function &current()
 {
     $temp = parent::current();
     if ($temp['invisible'] == 1) {
         Globals::setGlobal('num_online_invisible', Globals::getGlobal('num_online_invisible') + 1);
     }
     if ($temp['user_id'] != 0) {
         $group = get_user_max_group($temp, $this->groups);
         $temp['color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
         $temp['font_weight'] = @$group['min_perm'] > MEMBER ? 'bold' : 'normal';
     }
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
     }
     if ($temp['name'] != '' && (isset($temp['invisible']) && $temp['invisible'] == 0 || !isset($temp['invisible']))) {
         return $temp;
     }
 }
示例#2
0
 function current()
 {
     $temp = parent::current();
     // if there are more than one answers
     if ($temp['num_answers'] > 0) {
         $temp['sub_answers'] = $this->dba->executeQuery("SELECT * FROM " . K4FAQANSWERS . " WHERE category_id = " . intval($temp['category_id']) . " AND can_view <= " . intval($_SESSION['user']->get('perms')) . " ORDER BY row_order ASC");
     }
     // if there are more than one sub-categories
     if ($temp['num_categories'] > 0) {
         $temp['sub_categories'] = $this->dba->executeQuery("SELECT * FROM " . K4FAQCATEGORIES . " WHERE parent_id = " . intval($temp['category_id']) . " AND can_view <= " . intval($_SESSION['user']->get('perms')));
     }
     // custom url's
     $temp['U_FAQANSWER'] = K4Url::getGenUrl('faq', 'c=' . $temp['category_id'] . '#faq' . $temp['answer_id']);
     $temp['U_FAQCATEGORY'] = K4Url::getGenUrl('faq', 'c=' . $temp['category_id']);
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     if ($temp['invisible'] == 1) {
         Globals::setGlobal('num_online_invisible', Globals::getGlobal('num_online_invisible') + 1);
     }
     if ($temp['user_id'] >= 0) {
         $group = get_user_max_group($temp, $this->groups);
         $temp['color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
         $temp['font_weight'] = @$group['min_perm'] > MEMBER ? 'bold' : 'normal';
     }
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['user_id']);
     //if($temp['name'] != '') {
     //	if(((isset($temp['invisible']) && $temp['invisible'] == 0) || !isset($temp['invisible']))) {
     return $temp;
     //	}
     //}
 }
 function current()
 {
     $temp = parent::current();
     $temp['posticon'] = isset($temp['posticon']) && @$temp['posticon'] != '' ? iif(file_exists(BB_BASE_DIR . '/tmp/upload/posticons/' . @$temp['posticon']), @$temp['posticon'], 'clear.gif') : 'clear.gif';
     $temp['post_id'] = 'r' . $temp['post_id'];
     if ($temp['poster_id'] > 0) {
         if (!isset($this->users[$temp['poster_id']])) {
             $temp['post_display_user_ddmenu'] = 1;
             // display a ddmenu
             $user = $this->dba->getRow("SELECT " . $this->qp['user'] . $this->qp['userinfo'] . " FROM " . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id WHERE u.id=" . intval($temp['poster_id']));
             if (is_array($user) && !empty($user)) {
                 $group = get_user_max_group($user, $this->groups);
                 $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
                 $user['group_nicename'] = $group['nicename'];
                 $user['group_avatar'] = $group['avatar'];
                 $user['online'] = time() - ini_get('session.gc_maxlifetime') > $user['seen'] ? 'offline' : 'online';
                 $this->users[$user['id']] = $user;
             }
         } else {
             $temp['post_display_user_ddmenu'] = $this->result->hasPrev() ? 0 : 1;
             // use a different ddmenu
             $user = $this->users[$temp['poster_id']];
         }
         if (is_array($user) && !empty($user)) {
             if ($user['flag_level'] > 0 && $_SESSION['user']->get('perms') >= MODERATOR) {
                 $temp['post_user_background'] = 'background-color: #FFFF00;';
             }
             foreach ($user as $key => $val) {
                 $temp['post_user_' . $key] = $val;
             }
             $temp['profilefields'] = new FAArrayIterator(get_profile_fields($this->fields, $temp));
             $temp['post_user_title'] = $user['user_title'];
             $temp['post_user_user_title'] = get_user_title($user['user_title'], $user['num_posts']);
         }
         if (!isset($temp['post_user_online'])) {
             $temp['post_user_online'] = 'offline';
         }
     } else {
         $temp['post_user_id'] = 0;
         $temp['post_user_name'] = $temp['poster_name'];
     }
     /* do we have any attachments? */
     if (isset($temp['attachments']) && $temp['attachments'] > 0) {
         $temp['attachment_files'] = new K4AttachmentsIterator($this->dba, $this->user, $temp['post_id'], $temp['post_id']);
     }
     /* Deal with acronyms */
     replace_acronyms($temp['body_text']);
     /* word censors!! */
     replace_censors($temp['body_text']);
     replace_censors($temp['name']);
     /* Do any polls if they exist */
     do_post_polls($temp, $this->dba);
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#5
0
 function current()
 {
     $temp = parent::current();
     $group = get_user_max_group($temp, $this->groups);
     $temp['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
     $temp['group_nicename'] = $group['nicename'];
     $temp['group_avatar'] = $group['avatar'];
     $temp['font_weight'] = isset($group['min_perm']) && $group['min_perm'] > MEMBER ? 'bold' : 'normal';
     $temp['warn_color'] = get_warning_color($temp['warn_level']);
     // urls
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['user_id']);
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
 function &current()
 {
     $temp = parent::current();
     $temp['posticon'] = @$temp['posticon'] != '' ? iif(file_exists(FORUM_BASE_DIR . '/tmp/upload/posticons/' . @$temp['posticon']), @$temp['posticon'], 'clear.gif') : 'clear.gif';
     if ($temp['poster_id'] > 0) {
         if (!isset($this->users[$temp['poster_id']])) {
             $user = $this->dba->getRow("SELECT " . $this->qp['user'] . $this->qp['userinfo'] . " FROM " . USERS . " u LEFT JOIN " . USERINFO . " ui ON u.id=ui.user_id WHERE u.id=" . intval($temp['poster_id']));
             $group = get_user_max_group($user, $this->groups);
             $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
             $user['group_nicename'] = $group['nicename'];
             $user['group_avatar'] = $group['avatar'];
             $this->users[$user['id']] = $user;
         } else {
             $user = $this->users[$temp['poster_id']];
         }
         foreach ($user as $key => $val) {
             $temp['post_user_' . $key] = $val;
         }
     }
     $bbcode =& new BBCodex($this->user, $temp['body_text'], $temp['forum_id'], TRUE, TRUE, TRUE, TRUE);
     $temp['reverted_body_text'] = $bbcode->revert();
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
     }
     return $temp;
 }
示例#7
0
 function &current()
 {
     $temp = parent::current();
     $group = get_user_max_group($temp, $this->groups);
     $temp['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
     $temp['group_nicename'] = $group['nicename'];
     $temp['group_avatar'] = $group['avatar'];
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     $temp['posticon'] = isset($temp['posticon']) && $temp['posticon'] != '' ? file_exists(BB_BASE_DIR . '/tmp/upload/posticons/' . $temp['posticon']) ? $temp['posticon'] : 'clear.gif' : 'clear.gif';
     if ($temp['poster_id'] > 0) {
         if (!isset($this->users[$temp['poster_id']])) {
             $user = $this->dba->getRow("SELECT " . $this->qp['user'] . $this->qp['userinfo'] . " FROM " . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id WHERE u.id=" . intval($temp['poster_id']));
             $group = get_user_max_group($user, $this->groups);
             $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
             $user['group_nicename'] = $group['nicename'];
             $user['group_avatar'] = $group['avatar'];
             $this->users[$user['id']] = $user;
         } else {
             $user = $this->users[$temp['poster_id']];
         }
         foreach ($user as $key => $val) {
             $temp['post_user_' . $key] = $val;
         }
     }
     $temp['reverted_body_text'] = $this->bbcode->revert($temp['body_text']);
     if ($temp['is_poll'] == 1) {
         $temp['reverted_body_text'] = do_post_poll_urls($temp['reverted_body_text'], $this->dba, $this->url, $this->poll_text);
     }
     do_post_polls($temp, $this->dba, $this->url, $this->poll_text);
     return $temp;
 }
 function &current()
 {
     $temp = parent::current();
     if ($temp['row_right'] - $temp['row_left'] - 1 > 0) {
         $query_params = $this->query_params['info'] . $this->query_params['forum'];
         $temp['forums'] =& new ForumsIterator("SELECT {$query_params} FROM " . INFO . " i LEFT JOIN " . FORUMS . " f ON f.forum_id = i.id WHERE i.row_left > " . $temp['row_left'] . " AND i.row_right < " . $temp['row_right'] . " AND i.row_type = " . FORUM . " ORDER BY i.row_left, i.row_order ASC");
     }
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
     }
     return $temp;
 }
示例#10
0
 function current()
 {
     $temp = parent::current();
     $temp['title'] = isset($this->lang['L_' . strtoupper($temp['varname'])]) ? $this->lang['L_' . strtoupper($temp['varname'])] : '';
     $temp['description'] = isset($this->lang['L_HOWTO' . strtoupper($temp['varname'])]) ? $this->lang['L_HOWTO' . strtoupper($temp['varname'])] : '';
     /* Create the input fields */
     if ($temp['optioncode'] == 'yesno') {
         $temp['input'] = '<select name="' . $temp['varname'] . '" id="' . $temp['varname'] . '"><option value="1">YES</option><option value="0">NO</option></select><script type="text/javascript">d.setIndex(\'' . $temp['value'] . '\', \'' . $temp['varname'] . '\');</script>';
     } else {
         if ($temp['optioncode'] == 'textarea') {
             $temp['input'] = '<textarea class="inputbox" name="' . $temp['varname'] . '" rows="4" style="width:95%">' . $temp['value'] . '</textarea>';
         } else {
             $temp['input'] = '<input class="inputbox" type="text" name="' . $temp['varname'] . '" value="' . str_replace('"', '&quot;', $temp['value']) . '" />';
         }
     }
     return $temp;
 }
示例#11
0
 function current()
 {
     $temp = parent::current();
     /* Set the topic icons */
     //$temp['posticon']		= $temp['posticon'] != '' ? iif(file_exists(BB_BASE_DIR .'/tmp/upload/posticons/'. $temp['posticon']), $temp['posticon'], 'clear.gif') : 'clear.gif';
     //$temp['topicicon']		= topic_image($temp, $this->user, $this->img_dir, $last_seen);
     if ($temp['row_type'] == TOPIC) {
         $temp['topic_name'] = $temp['name'];
         $temp['url'] = 'viewtopic.php?id=' . $temp['post_id'];
         $this->topic_names[$temp['post_id']] = $temp['name'];
     } else {
         $temp['views'] = '--';
         $temp['url'] = 'findpost.php?id=' . $temp['post_id'];
         $temp['topic_name'] = !isset($this->topic_names[$temp['post_id']]) ? $this->dba->getValue("SELECT name FROM " . K4POSTS . " WHERE post_id = " . intval($temp['post_id'])) : $this->topic_names[$temp['post_id']];
         $this->topic_names[$temp['post_id']] = $temp['topic_name'];
     }
     if ($temp['poster_id'] > 0) {
         $user = !isset($this->users[$temp['poster_id']]) ? $this->dba->getRow("SELECT " . $this->qp['user'] . $this->qp['userinfo'] . " FROM " . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id WHERE u.id=" . intval($temp['poster_id'])) : $this->users[$temp['poster_id']];
         $group = get_user_max_group($user, $this->groups);
         $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
         $user['group_nicename'] = $group['nicename'];
         $user['group_avatar'] = $group['avatar'];
         $user['online'] = time() - ini_get('session.gc_maxlifetime') > $user['seen'] ? 'offline' : 'online';
         foreach ($user as $key => $val) {
             $temp['poster_' . $key] = $val;
         }
         $this->users[$temp['poster_id']] = $user;
     }
     $temp['body_text'] = preg_replace("~<!--(.+?)-->~is", "", $temp['body_text']);
     $temp['forum_name'] = isset($this->forums[$temp['forum_id']]['name']) ? $this->forums[$temp['forum_id']]['name'] : '--';
     $temp['number'] = $this->increment;
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     $this->increment++;
     return $temp;
 }
示例#12
0
 function &current()
 {
     $temp = parent::current();
     $num_children = @(($temp['row_right'] - $temp['row_left'] - 1) / 2);
     $temp['level'] = str_repeat('&nbsp;&nbsp;&nbsp;', $temp['row_level'] - $this->start_level);
     $temp['name'] = $temp['inherit'] == 1 ? '<span style="color: green;">' . $temp['name'] . '</span>' : '<span style="color: firebrick;">' . $temp['name'] . '</span>';
     //print_r($_COOKIE['mapsgui_menu']); exit;
     if (isset($_COOKIE['mapsgui_' . $temp['id']]) && $_COOKIE['mapsgui_' . $temp['id']] == 'yes' && $temp['row_level'] == 1) {
         $temp['expanded'] = 1;
         $temp['maps_children'] =& new MAPSIterator($this->dba->executeQuery("SELECT * FROM " . MAPS . " WHERE row_level > 1 AND row_left > " . $temp['row_left'] . " AND row_right < " . $temp['row_right'] . " ORDER BY row_left ASC"));
     } else {
         $temp['expanded'] = 0;
     }
     return $temp;
 }
示例#13
0
 function &current()
 {
     $temp = parent::current();
     /* Cache this forum in the session */
     cache_forum($temp);
     /* Set the forum's icon */
     $return = forum_icon($this, $temp);
     $temp['forum_icon'] = $return[0];
     /* Set a default cookie with the unread topic id in it */
     //if(ctype_digit($return[1])) {
     //	$this->forums[$temp['id']][$return[1]] = TRUE;
     //}
     /* Set a nice representation of what level we're on */
     $temp['level'] = @str_repeat('&nbsp;&nbsp;&nbsp;', $temp['row_level'] - 2);
     /* Should we query down to the next level of forums? */
     if ($this->do_recurse) {
         $query_params = $this->query_params['info'] . $this->query_params['forum'];
         if ($temp['subforums'] > 0 && $this->settings['showsubforums'] == 1) {
             $temp['subforums'] =& new ForumsIterator("SELECT {$query_params} FROM " . INFO . " i LEFT JOIN " . FORUMS . " f ON f.forum_id = i.id WHERE i.row_left > " . $temp['row_left'] . " AND i.row_right < " . $temp['row_right'] . " AND i.row_type = " . FORUM . " AND i.parent_id = " . $temp['id'] . " ORDER BY i.row_order ASC", FALSE);
         }
     }
     if ($temp['moderating_groups'] != '') {
         $groups = !unserialize($temp['moderating_groups']) ? array() : unserialize($temp['moderating_groups']);
         $temp['moderators'] = array();
         if (is_array($groups)) {
             foreach ($groups as $g) {
                 if (isset($this->usergroups[$g])) {
                     $temp['moderators'][] = $this->usergroups[$g];
                 }
             }
             $temp['moderators'] =& new FAArrayIterator($temp['moderators']);
         } else {
             $temp['moderating_groups'] = '';
         }
     }
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
         /* Set cookies for all of the topics */
         //	bb_settopic_cache_item('forums', serialize($this->forums), time() + 3600 * 25 * 5);
     }
     /* Return the formatted forum info */
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     $temp['user_ip'] = str_replace('\\.', '.', $temp['user_ip']);
     $temp['user_ip'] = str_replace('([0-9]+?)', '*', $temp['user_ip']);
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     $temp['file_icon'] = !file_exists($this->abs_path . $temp['file_type'] . '.gif') ? $this->img_dir . 'unknown.gif' : $this->img_dir . $temp['file_type'] . '.gif';
     $temp['file_name'] = k4_htmlentities($temp['file_name'], ENT_QUOTES);
     $temp['is_image'] = 0;
     if (in_array($temp['file_type'], $this->images)) {
         $temp['is_image'] = 1;
     }
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     /* Set the topic icons */
     $temp['posticon'] = $temp['posticon'] != '' ? iif(file_exists(BB_BASE_DIR . '/tmp/upload/posticons/' . $temp['posticon']), $temp['posticon'], 'clear.gif') : 'clear.gif';
     $new = $temp['member_has_read'] == 0 ? TRUE : FALSE;
     $temp['use_pager'] = 0;
     if ($this->repliesperpage < $temp['num_replies']) {
         /* Create a pager */
         $temp['use_pager'] = 1;
         $temp['num_pages'] = @ceil($temp['num_replies'] / $this->repliesperpage);
         $temp['pager'] = paginate($temp['num_replies'], '&laquo;', '&lt;', '', '&gt;', '&raquo;', $this->repliesperpage, $temp['pm_id']);
     }
     if ($temp['poster_id'] > 0) {
         if (in_array($temp['poster_id'], $this->flagged_users) && $_SESSION['user']->get('perms') >= MODERATOR) {
             $temp['post_user_background'] = 'background-color: #FFFF00;';
         }
     }
     if ($temp['is_draft'] == 1) {
         $temp['url'] = 'member.php?act=usercp&amp;view=pmnewmessage&amp;draft=' . $temp['pm_id'];
     } else {
         $temp['url'] = 'member.php?act=usercp&amp;view=pmsg&amp;pm=' . $temp['pm_id'];
     }
     if ($new) {
         $temp['is_new'] = 1;
     }
     /* Censor subjects if necessary */
     replace_censors($temp['name']);
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#17
0
 function current()
 {
     global $_QUERYPARAMS;
     $temp = parent::current();
     //$result					= $this->dba->getValue("SELECT * FROM ". K4POLLVOTES ." WHERE answer_id = ". intval($temp['id']));
     $result = $this->dba->executeQuery("SELECT " . $_QUERYPARAMS['user'] . ", u.id as user_id FROM " . K4POLLVOTES . " pv LEFT JOIN " . K4USERS . " u ON u.id=pv.user_id WHERE pv.answer_id = " . intval($temp['id']));
     $temp['users'] =& new UsersIterator($result);
     $temp['num_votes'] = intval($result->numRows());
     $temp['percent'] = @ceil($temp['num_votes'] / $this->num_votes * 100);
     return $temp;
 }
示例#18
0
 function current()
 {
     $temp = parent::current();
     /* Get this user's last seen time */
     //$last_seen				= is_a($this->session['user'], 'Member') ? iif($this->session['seen'] > $this->session['user']->info['last_seen'], $this->session['seen'], $this->session['user']->info['last_seen']) : $this->session['seen'];
     $last_seen = time();
     /* Set the topic icons */
     $temp['posticon'] = $temp['posticon'] != '' ? iif(file_exists(BB_BASE_DIR . '/tmp/upload/posticons/' . $temp['posticon']), $temp['posticon'], 'clear.gif') : 'clear.gif';
     $new = topic_icon($this->cookietopics, $temp, $this->img_dir);
     $temp['use_pager'] = 0;
     if ($this->forum['postsperpage'] < $temp['num_replies']) {
         $limit = $this->user->get('postsperpage') <= 0 ? $this->forum['postsperpage'] : $this->user->get('postsperpage');
         /* Create a pager */
         $temp['use_pager'] = 1;
         $temp['num_pages'] = @ceil($temp['num_replies'] / $limit);
         $temp['pager'] = paginate($temp['num_replies'], '&laquo;', '&lt;', '', '&gt;', '&raquo;', $limit, $temp['post_id']);
     }
     if ($temp['poster_id'] > 0) {
         if (in_array($temp['poster_id'], $this->flagged_users) && $_SESSION['user']->get('perms') >= MODERATOR) {
             $temp['post_user_background'] = 'background-color: #FFFF00;';
         }
     }
     /* Is this a sticky or an announcement and is it expired? */
     if ($temp['post_type'] > TOPIC_NORMAL && $temp['post_expire'] > 0) {
         if ($temp['created'] + 3600 * 24 * $temp['post_expire'] > time()) {
             $this->dba->executeUpdate("UPDATE " . K4POSTS . " SET post_expire=0,post_type=" . TOPIC_NORMAL . " WHERE post_id = " . intval($temp['id']));
         }
     }
     $temp['forum_name'] = $this->allforums[$temp['forum_id']]['name'];
     if ($new) {
         $temp['is_new'] = 1;
     }
     $temp['num_replies'] = number_format($temp['num_replies']);
     $temp['views'] = number_format($temp['views']);
     /* Censor the topic name if needed */
     replace_censors($temp['name']);
     $temp['number'] = $this->increment;
     // urls
     $temp['U_TOPICURL'] = K4Url::getTopicUrl($temp['post_id']);
     $temp['U_POSTURL'] = K4Url::getPostUrl($temp['post_id']);
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['lastpost_uid']);
     $this->increment++;
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     $forums =& new K4ForumsIterator($this->dba, "SELECT * FROM " . K4FORUMS . " WHERE category_id = " . $temp['category_id'] . " ORDER BY row_order ASC");
     if ($forums->hasNext()) {
         $temp['forums'] =& $forums;
     } else {
         $forums->free();
         unset($forums);
     }
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#20
0
 function current()
 {
     $temp = parent::current();
     //$this->bbcode->text		= $temp['body_text'];
     //$temp['body_text']		= $this->bbcode->revert();
     $temp['body_text'] = preg_replace("~<!--(.+?)-->~", "", $temp['body_text']);
     return $temp;
 }
示例#21
0
 function &current()
 {
     $temp = parent::current();
     /* Get this user's last seen time */
     //$last_seen				= is_a($this->session['user'], 'Member') ? iif($this->session['seen'] > $this->session['user']->info['last_seen'], $this->session['seen'], $this->session['user']->info['last_seen']) : $this->session['seen'];
     $last_seen = time();
     /* Set the topic icons */
     $temp['posticon'] = $temp['posticon'] != '' ? iif(file_exists(FORUM_BASE_DIR . '/tmp/upload/posticons/' . $temp['posticon']), $temp['posticon'], 'clear.gif') : 'clear.gif';
     $temp['topicicon'] = topic_image($temp, &$this->user, $this->img_dir, $last_seen);
     /* Set the number of replies */
     $temp['num_replies'] = @(($temp['row_right'] - $temp['row_left'] - 1) / 2);
     if ($this->forum['postsperpage'] < $temp['num_replies']) {
         /* Create a pager */
         $temp['pager'] = paginate($temp['num_replies'], '&laquo;', '&lt;', '', '&gt;', '&raquo;', $this->forum['postsperpage'], $temp['id']);
     }
     /* Check if this topic has been read or not */
     //if(($temp['created'] > $last_seen && $temp['poster_id'] != $this->session['user']->info['id'])
     //|| (isset($this->forums[$temp['forum_id']][$temp['id']]) && $this->forums[$temp['forum_id']][$temp['id']])
     //	) {
     //
     //	$this->forums[$temp['forum_id']][$temp['id']]	= TRUE;
     //
     //	$temp['name']									= '<strong>'. $temp['name'] .'</strong>';
     //}
     /* Is this a sticky or an announcement and is it expired? */
     if ($temp['topic_type'] > TOPIC_NORMAL && $temp['topic_expire'] > 0) {
         if ($temp['created'] + 3600 * 24 * $temp['topic_expire'] > time()) {
             $this->dba->executeUpdate("UPDATE " . TOPICS . " SET topic_expire=0,topic_type=" . TOPIC_NORMAL . " WHERE topic_id = " . intval($temp['id']));
         }
     }
     /* Should we free the result? */
     if ($this->row == $this->size - 1) {
         $this->result->freeResult();
         /* Reset the forums cookie if we're at the end of the iteration */
         //bb_settopic_cache_item('forums', serialize($this->forums), time() + 3600 * 25 * 5);
     }
     return $temp;
 }
示例#22
0
 function current()
 {
     $temp = parent::current();
     $temp['properties'] = trim(str_replace(';', ";\n", $temp['properties']), "\\s\n\r");
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#23
0
 function current()
 {
     $temp = parent::current();
     //		if($temp['post_id'] == 0) {
     $post = $this->dba->getRow("SELECT * FROM " . K4POSTS . " WHERE post_id = " . intval($temp['post_id']));
     if ($post['row_type'] & TOPIC) {
         $temp['topic_name'] = $post['name'];
         $temp['url'] = 'viewtopic.php?id=' . $topic['post_id'];
         $temp['topic_id'] = $post['post_id'];
         $this->topics[$temp['post_id']] = $post;
     } else {
         $temp['topic_name'] = !isset($this->topics[$post['parent_id']]) ? $this->dba->getValue("SELECT name FROM " . K4POSTS . " WHERE post_id = " . intval($post['parent_id'])) : $this->topics[$post['parent_id']]['name'];
         $this->topics[$post['parent_id']]['name'] = $temp['topic_name'];
         $temp['url'] = 'findpost.php?id=' . $post['post_id'];
         $temp['topic_id'] = $post['parent_id'];
     }
     $temp = array_merge($temp, $post);
     //		} else {
     //			$reply				= $this->dba->getRow("SELECT * FROM ". K4POSTS ." WHERE post_id = ". intval($temp['post_id']));
     //			$temp['post_id']	= $reply['post_id'];
     //			$temp['views']		= '--';
     //			$temp['url']		= 'findpost.php?id='. $reply['post_id'];
     //			$temp['topic_name'] = !isset($this->topics[$reply['post_id']]) ? $this->dba->getValue("SELECT name FROM ". K4POSTS ." WHERE post_id = ". intval($reply['post_id'])) : $this->topics[$reply['post_id']]['name'];
     //
     //			$temp				= array_merge($temp, $reply);
     //		}
     if ($temp['poster_id'] > 0) {
         $user = !isset($this->users[$temp['poster_id']]) ? $this->dba->getRow("SELECT " . $this->qp['user'] . $this->qp['userinfo'] . " FROM " . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id WHERE u.id=" . intval($temp['poster_id'])) : $this->users[$temp['poster_id']];
         $group = get_user_max_group($user, $this->groups);
         $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
         $user['group_nicename'] = $group['nicename'];
         $user['group_avatar'] = $group['avatar'];
         $user['online'] = time() - ini_get('session.gc_maxlifetime') > $user['seen'] ? 'offline' : 'online';
         foreach ($user as $key => $val) {
             $temp['poster_' . $key] = $val;
         }
         $this->users[$temp['poster_id']] = $user;
     }
     $temp['body_text'] = isset($temp['body_text']) ? preg_replace("~<!--(.+?)-->~is", "", $temp['body_text']) : '';
     $temp['forum_name'] = isset($this->forums['f' . $temp['forum_id']]) ? $this->forums['f' . $temp['forum_id']]['name'] : '';
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#24
0
 function current()
 {
     $temp = parent::current();
     $group = get_user_max_group($temp, $this->groups);
     $temp['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
     $temp['group_nicename'] = $group['nicename'];
     $temp['group_avatar'] = $group['avatar'];
     $temp['online'] = time() - ini_get('session.gc_maxlifetime') > $temp['seen'] ? 'offline' : 'online';
     // custom url's
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['user_id']);
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
 }
示例#25
0
 function current()
 {
     $temp = parent::current();
     /* Cache this forum in the session */
     cache_forum($temp);
     /**
      * Do the icon
      */
     switch ($temp['row_type']) {
         case FORUM:
             $temp['forum_icon'] = 'forum_off';
             forum_icon($temp, $temp['forum_icon']);
             break;
         case GALLERY:
             $temp['forum_icon'] = 'forum_gallery';
             break;
         case METAFORUM:
             $temp['forum_icon'] = 'forum_meta';
             break;
         case ARCHIVEFORUM:
             $temp['forum_icon'] = 'forum_archive';
             break;
     }
     /* Set a nice representation of what level we're on */
     $temp['level'] = @str_repeat('&nbsp;&nbsp;&nbsp;', $this->level);
     /* Should we query down to the next level of forums? */
     if ($temp['row_type'] & CATEGORY) {
         $temp['forums'] =& new K4ForumsIterator($this->dba, "SELECT * FROM " . K4FORUMS . " WHERE parent_id = " . $temp['forum_id'] . " ORDER BY row_order ASC", TRUE, $this->level + 1);
     }
     if ($this->do_recurse) {
         if ($temp['subforums'] > 0 && $this->settings['showsubforums'] == 1) {
             $it = new K4ForumsIterator($this->dba, "SELECT * FROM " . K4FORUMS . " WHERE parent_id = " . intval($temp['forum_id']) . " ORDER BY row_order ASC", FALSE, $this->level + 1);
             if ($it->hasNext()) {
                 // add the iterator
                 $temp['subforums_list'] = $it;
             } else {
                 // if this forum doesn't actually have subforums, fix it
                 $this->dba->executeUpdate("UPDATE " . K4FORUMS . " SET subforums=0 WHERE forum_id = " . intval($temp['forum_id']));
             }
         }
     }
     /**
      * Get the moderators
      */
     $temp['moderators'] = array();
     $temp['are_moderators'] = 0;
     if ($temp['moderating_groups'] != '') {
         $groups = explode('|', $temp['moderating_groups']);
         if (is_array($groups)) {
             foreach ($groups as $g) {
                 if (isset($this->usergroups[$g])) {
                     $temp['U_USERGROUPURL'] = K4Url::getUserGroupUrl($g);
                     $temp['moderators'][] = $this->usergroups[$g];
                 }
             }
             $temp['are_moderators'] = 1;
         }
     }
     if ($temp['moderating_users'] != '') {
         $users = force_unserialize($temp['moderating_users']);
         if (is_array($users) && !empty($users)) {
             foreach ($users as $user_id => $username) {
                 $temp['U_GMEMBERURL'] = K4Url::getMemberUrl($user_id);
                 $temp['moderators'][] = array('user_id' => $user_id, 'name' => $username);
             }
             $temp['are_moderators'] = 1;
         }
     }
     $temp['moderators'] =& new FAArrayIterator($temp['moderators']);
     /* Replace topic/post names with censors */
     replace_censors($temp['topic_name']);
     replace_censors($temp['post_name']);
     $temp['topics'] = number_format($temp['topics']);
     $temp['replies'] = number_format($temp['replies']);
     $temp['posts'] = number_format($temp['posts']);
     //		/* Set cookies for all of the topics */
     //		bb_settopic_cache_item('forums', serialize($this->forums), time() + 3600 * 25 * 5);
     $temp['safe_description'] = strip_tags($temp['description']);
     $temp['forum'] = $temp['row_type'] == CATEGORY ? 0 : 1;
     // custom url's
     $temp['U_FORUMURL'] = K4Url::getForumUrl($temp['forum_id']);
     $temp['U_TOPICURL'] = K4Url::getTopicUrl($temp['post_id']);
     $temp['U_POSTURL'] = K4Url::getPostUrl($temp['post_id']);
     $temp['U_FINDPOSTURL'] = K4Url::getPostUrl($temp['post_id']);
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['post_uid']);
     $temp['U_REDIRECTURL'] = K4Url::getRedirectUrl($temp['forum_id']);
     /* Return the formatted forum info */
     return $temp;
 }