if ($poster_id == ANONYMOUS) { $on_off_hidden = ''; } else { $on_off_hidden = '<img src="' . $images['icon_offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />'; } } } //Online/Offline // Start Smilies Invasion Mod if ($board_config['allow_smilies']) { $post_subject = smilies_pass($post_subject); } // End Smilies Invasion Mod $message = AddClicksCounter($message); $template->assign_block_vars('postrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'ADR_TOPIC_BOX' => $adr_topic_box, 'RABBITOSHI_LINK' => $rabbitoshi_link, 'POSTER_NAME' => $poster_id == ANONYMOUS ? $postrow[$i]['post_username'] != '' ? $postrow[$i]['post_username'] : $lang['Guest'] : $rcs->get_colors($postrow[$i], $postrow[$i]['username']), 'PAGERANK' => $PageRank, 'POSTER_RANK' => $poster_rank, 'POSTER_GENDER' => $gender_image, 'RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => $poster_joined, 'POSTER_POSTS' => $poster_posts, 'POSTER_FROM' => $poster_from, 'POSTER_AVATAR' => $poster_avatar, 'POSTER_ONLINE' => $on_off_hidden, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'POST_NUMBER' => $post_number, 'POST_ID' => $post_id, 'SIGNATURE' => $user_sig, 'EDITED_MESSAGE' => $l_edited_by, 'S_NUM_ROW' => $num_row, 'S_NAV_BUTTONS' => $nav_buttons, 'I_MINITIME' => $images['icon_minitime'], 'MINI_POST_IMG' => $mini_post_img, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'MINI_PROFILE_IMG' => $mini_profile_img, 'MINI_PROFILE' => $mini_profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'EDIT_IMG' => $edit_img, 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'I_QP_QUOTE' => $qp_quote_img, 'L_GENDER' => $lang['Gender'], 'POINTS' => $user_points, 'DONATE_POINTS' => $donate_points, 'USER_WARNINGS' => $user_warnings, 'CARD_IMG' => $card_img, 'CARD_HIDDEN_FIELDS' => $card_hidden, 'CARD_EXTRA_SPACE' => $r_card_img || $y_card_img || $g_card_img || $b_card_img ? ' ' : '', 'L_MINI_POST_ALT' => $mini_post_alt, 'KEEP_UNREAD_IMG' => $keep_unread_img, 'L_POST' => $lang['Post'], 'U_MINI_POST' => $mini_post_url, 'U_G_CARD' => $g_card_img, 'U_Y_CARD' => $y_card_img, 'U_R_CARD' => $r_card_img, 'U_B_CARD' => $b_card_img, 'S_CARD' => append_sid("card." . $phpEx), 'U_VIEW_POSTER_PROFILE' => $userdata['user_level'] != ADMIN ? append_sid("profile.{$phpEx}?mode=viewprofile&" . POST_USERS_URL . "=" . $poster_id) : append_sid("admin/admin_users.{$phpEx}?mode=edit&" . POST_USERS_URL . "=" . $poster_id . "&sid=" . $userdata['session_id']), 'POSTER_STYLE' => $poster_style_color, 'U_POST_ID' => $postrow[$i]['post_id'])); display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']); //-- mod : birthday ------------------------------------------------------------ $birthday->display_details($poster_birthday, $poster_zodiac, false, 'postrow'); //-- mod : flags --------------------------------------------------------------- display_flag($poster_flag, false, 'postrow'); //-- mod : post description ---------------------------------------------------- display_sub_title('postrow', $post_sub_title, $board_config['sub_title_length']); //-- mod : topics enhanced ----------------------------------------------------- if ($i != $total_posts - 1) { $template->assign_block_vars('postrow.spacing', array()); } } include $phpbb_root_path . 'includes/functions_related.' . $phpEx; get_related_topics($topic_id); $template->pparse('body'); include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
public function __construct() { global $template, $db, $get, $rcs, $lang; $time_period = 300 * floor(time() / 300); // reset "who's online" list every 5 minutes $cachename = 'show_online_' . $time_period; if (!isset($_SESSION['is_in_viewonline'])) { // V: it's our first time viewing the viewonline, so we need to be extract careful // and make sure we appear $_SESSION['is_in_viewonline'] = true; $db->clear_cache($cachename); } $logged_visible_online = 0; $logged_hidden_online = 0; $bot_count = 0; $guests_online = $this->countGuests($time_period); $online_userlist = ''; $l_online_users = ''; $gender_image = ''; $online_botlist = ''; $userlist_ary = array(); $userlist_visible = array(); $prev_user_id = 0; $prev_user_ip = $prev_session_ip = ''; $sql = $this->getFetchSql($time_period); if (!($result = $db->sql_query($sql, false, $cachename))) { message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $agent = strtolower($row['session_agent']); $browser = $this->getBrowserIcon($agent); // Skip multiple sessions for one user if ($row['user_id'] != $prev_user_id) { $style_color = $rcs->get_colors($row); if ($row['user_allow_viewonline']) { $user_online_link = '<a href="' . $get->url('userlist', array('mode' => 'viewprofile', POST_USERS_URL => $row['user_id']), true) . '"' . $style_color . '>' . $row['username'] . '</a>' . $browser . ''; $logged_visible_online++; if ($dta_flag = display_flag($row['user_flag'], true)) { $i_online_flag = ' <img class="gensmall" src="' . $dta_flag['img'] . '" alt="' . $dta_flag['name'] . '" title="' . $dta_flag['name'] . '" style="vertical-align:text-bottom; border:0;" />'; $user_online_link = $user_online_link . $i_online_flag; } } else { $user_online_link = '<a href="' . $get->url('userlist', array('mode' => 'viewprofile', POST_USERS_URL => $row['user_id']), true) . '"' . $style_color . '><i>' . $row['username'] . '</i></a>' . $browser . ''; $logged_hidden_online++; } if ($row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN) { $online_userlist .= $online_userlist != '' ? ', ' . $user_online_link : $user_online_link; switch ($row['user_gender']) { case 1: $online_userlist .= " <img src=\"" . $images['icon_minigender_male'] . "\" alt=\"" . $lang['Gender'] . ":" . $lang['Male'] . "\" title=\"" . $lang['Gender'] . ":" . $lang['Male'] . "\" border=\"0\" />"; break; case 2: $online_userlist .= " <img src=\"" . $images['icon_minigender_female'] . "\" alt=\"" . $lang['Gender'] . ":" . $lang['Female'] . "\" title=\"" . $lang['Gender'] . ":" . $lang['Female'] . "\" border=\"0\" />"; break; } } } $prev_user_id = $row['user_id']; $prev_session_ip = $row['session_ip']; } $db->sql_freeresult($result); // www.phpBB-SEO.com SEO TOOLKIT BEGIN if (!empty($bots_online)) { foreach ($bots_online as $bot => $bot_num) { $bot_cnt = $bot_num > 1 ? "({$bot_num})" : ''; $online_botlist .= ($online_botlist != '' ? ', ' : '') . "<span " . $bot_style[$bot] . ">{$bot} {$bot_cnt}</span>"; } } // www.phpBB-SEO.com SEO TOOLKIT END if (empty($online_userlist)) { $online_userlist = $lang['None']; } $online_userlist = (isset($forum_id) ? $lang['Browsing_forum'] : $lang['Registered_users']) . ' ' . $online_userlist; $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; // www.phpBB-SEO.com SEO TOOLKIT BEGIN $total_online_users += $bot_count; // www.phpBB-SEO.com SEO TOOLKIT END $this->tryUpdateBest($total_online_users); if ($total_online_users == 0) { $l_t_user_s = $lang['Online_users_zero_total']; } else { if ($total_online_users == 1) { $l_t_user_s = $lang['Online_user_total']; } else { $l_t_user_s = $lang['Online_users_total']; } } if ($logged_visible_online == 0) { $l_r_user_s = $lang['Reg_users_zero_total']; } else { if ($logged_visible_online == 1) { $l_r_user_s = $lang['Reg_user_total']; } else { $l_r_user_s = $lang['Reg_users_total']; } } if ($logged_hidden_online == 0) { $l_h_user_s = $lang['Hidden_users_zero_total']; } else { if ($logged_hidden_online == 1) { $l_h_user_s = $lang['Hidden_user_total']; } else { $l_h_user_s = $lang['Hidden_users_total']; } } if ($guests_online == 0) { $l_g_user_s = $lang['Guest_users_zero_total']; } else { if ($guests_online == 1) { $l_g_user_s = $lang['Guest_user_total']; } else { $l_g_user_s = $lang['Guest_users_total']; } } if ($bot_count == 0) { $l_bot = $lang['Bot_nul']; } else { if ($bot_count == 1) { $l_bot = $lang['Bot_one']; } else { $l_bot = $lang['Bot_total']; } } $l_online_users = sprintf($l_t_user_s, $total_online_users); $l_online_users .= sprintf($l_r_user_s, $logged_visible_online); $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); $l_online_users .= sprintf($l_g_user_s, $guests_online); $l_online_users .= sprintf($l_bot, $bot_count); $template->assign_vars(array('TOTAL_USERS_ONLINE' => $l_online_users, 'LOGGED_IN_USER_LIST' => $online_userlist, 'BOT_LIST' => $bot_count ? $lang['Bot_online'] . ($online_botlist != '' ? $online_botlist : $lang['None']) : '')); }
$row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2']; //Online/Offline if ($row['user_session_time'] >= time() - 300 && $row['user_allow_viewonline']) { $on_off_hidden = '<img src="' . $images['icon_online'] . '" alt="' . $lang['Online'] . '" title="' . $lang['Online'] . '" border="0" />'; } else { if ($row['user_allow_viewonline'] == 0) { $on_off_hidden = '<img src="' . $images['icon_hidden'] . '" alt="' . $lang['Hidden'] . '" title="' . $lang['Hidden'] . '" border="0" />'; } else { $on_off_hidden = '<img src="' . $images['icon_offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />'; } } //Online/Offline $template->assign_block_vars('memberrow', array('ROW_NUMBER' => $i + ($start + 1), 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'STYLE' => $rcs->get_colors($row), 'USERNAME' => $username, 'FROM' => $from, 'JOINED' => $joined, 'POSTS' => $posts, 'AVATAR_IMG' => $poster_avatar, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'USERADMIN_IMG' => $useradmin_img, 'PERMCONTROL_IMG' => $permcontrol_img, 'USER_ONLINE' => $on_off_hidden, 'POINTS' => $user_points, 'U_VIEWPROFILE' => append_sid("profile.{$phpEx}?mode=viewprofile&" . POST_USERS_URL . "={$user_id}"))); //-- mod : flags --------------------------------------------------------------- //-- add display_flag($row['user_flag'], false, 'memberrow'); //-- fin mod : flags ----------------------------------------------------------- $i++; } while ($row = $db->sql_fetchrow($result)); $db->sql_freeresult($result); } if ($mode != 'topten' || $board_config['topics_per_page'] < 10) { $sql = "SELECT count(*) AS total\r\n\t\tFROM " . USERS_TABLE . "\r\n\t\tWHERE user_id <> " . ANONYMOUS . $letter_sql; if (!($result = $db->sql_query($sql, false, 'usercount'))) { message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql); } if ($total = $db->sql_fetchrow($result)) { $total_members = $total['total']; $pagination = generate_pagination("memberlist.{$phpEx}?mode={$mode}&order={$sort_order}&letter={$by_letter}", $total_members, $board_config['topics_per_page'], $start) . ' '; } $db->sql_freeresult($result);