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;
 }
 function current()
 {
     $temp = parent::current();
     $temp['posticon'] = @$temp['posticon'] != '' ? file_exists(BB_BASE_DIR . '/tmp/upload/posticons/' . @$temp['posticon']) ? @$temp['posticon'] : 'clear.gif' : 'clear.gif';
     $temp['post_id'] = 't' . $temp['post_id'];
     if ($temp['poster_id'] > 0) {
         $temp['post_display_user_ddmenu'] = 1;
         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']));
             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'] = isset($group['nicename']) ? $group['nicename'] : '';
                 $user['group_avatar'] = isset($group['avatar']) ? $group['avatar'] : '';
                 $user['online'] = time() - ini_get('session.gc_maxlifetime') > $user['seen'] ? 'offline' : 'online';
                 $this->users[$user['id']] = $user;
             }
         } else {
             $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';
         }
         /* This array holds all of the userinfo for users that post to this topic */
         $this->users[$user['id']] = $user;
     } else {
         $temp['post_user_id'] = 0;
         $temp['post_user_name'] = $temp['poster_name'];
     }
     /* 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);
     /* do we have any attachments? */
     if (isset($temp['attachments']) && $temp['attachments'] > 0) {
         $temp['attachment_files'] = new K4AttachmentsIterator($this->dba, $this->user, $temp['post_id'], 0);
     }
     // url's
     $temp['U_TOPICURL'] = K4Url::getTopicUrl($temp['post_id']);
     $temp['U_POSTURL'] = K4Url::getPostUrl($temp['post_id']);
     $temp['U_MEMBERURL'] = K4Url::getMemberUrl($temp['poster_id']);
     if ($this->sr && $temp['num_replies'] > 0) {
         $this->result = $this->dba->executeQuery("SELECT * FROM " . K4POSTS . " WHERE parent_id = " . intval($temp['post_id']) . " AND row_type=" . REPLY . " " . ($this->post_id ? "AND post_id = " . $this->post_id : "") . " AND created >= " . 3600 * 24 * intval($temp['daysprune']) . " ORDER BY " . $temp['sortedby'] . " " . $temp['sortorder'] . " LIMIT " . intval($temp['start']) . "," . intval($temp['postsperpage']));
         $temp['replies'] = new RepliesIterator($this->user, $this->dba, $this->result, $this->qp, $this->users, $this->groups, $this->fields);
     }
     return $temp;
 }
 function current()
 {
     $temp = parent::current();
     //if( ($temp['folder_id'] == PM_SENTITEMS && $temp['member_id'] != $this->user->get('id')) || ($temp['member_id'] == $this->user->get('id')) ) {
     $temp['posticon'] = isset($temp['posticon']) && @$temp['posticon'] != '' ? iif(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']));
             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 {
             $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));
         }
         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']);
     //		}
     if ($temp['member_has_read'] == 0) {
         $this->dba->executeUpdate("UPDATE " . K4USERS . " SET new_pms=new_pms-1 WHERE id = " . intval($_SESSION['user']->get('id')));
         $this->dba->executeUpdate("UPDATE " . K4PRIVMESSAGES . " SET member_has_read = 1 WHERE pm_id = " . intval($temp['pm_id']));
     }
     /* Deal with acronyms */
     replace_acronyms($temp['body_text']);
     /* word censors!! */
     replace_censors($temp['body_text']);
     replace_censors($temp['name']);
     /* Should we free the result? */
     if (!$this->hasNext()) {
         $this->result->free();
     }
     return $temp;
     //}
 }