diff options
Diffstat (limited to 'phpBB/viewonline.php')
-rw-r--r-- | phpBB/viewonline.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 6b26a3f5d6..ef8bfb888b 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -39,6 +39,8 @@ if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) login_box('', $user->lang['LOGIN_EXPLAIN_VIEWONLINE']); } +$pagination = $phpbb_container->get('pagination'); + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']); $sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page'); @@ -139,9 +141,12 @@ $sql_ary = array( * @event core.viewonline_modify_sql * @var array sql_ary The SQL array * @var bool show_guests Do we display guests in the list +* @var int guest_counter Number of guests displayed +* @var array forum_data Array with forum data * @since 3.1-A1 +* @change 3.1.0-a2 Added vars guest_counter and forum_data */ -$vars = array('sql_ary', 'show_guests'); +$vars = array('sql_ary', 'show_guests', 'guest_counter', 'forum_data'); extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars))); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); @@ -345,9 +350,11 @@ while ($row = $db->sql_fetchrow($result)) * @var array row Array with the users sql row * @var string location Page name to displayed in the list * @var string location_url Page url to displayed in the list + * @var array forum_data Array with forum data * @since 3.1-A1 + * @change 3.1.0-a2 Added var forum_data */ - $vars = array('on_page', 'row', 'location', 'location_url'); + $vars = array('on_page', 'row', 'location', 'location_url', 'forum_data'); extract($phpbb_dispatcher->trigger_event('core.viewonline_overwrite_location', compact($vars))); $template->assign_block_vars('user_row', array( @@ -414,15 +421,16 @@ $db->sql_freeresult($result); // Refreshing the page every 60 seconds... meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start")); +$start = $pagination->validate_start($start, $config['topics_per_page'], $counter); $base_url = append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"); -phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start); +$pagination->generate_template_pagination($base_url, 'pagination', 'start', $counter, $config['topics_per_page'], $start); // Send data to template $template->assign_vars(array( 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)), 'TOTAL_GUEST_USERS_ONLINE' => $user->lang('GUEST_USERS_ONLINE', (int) $guest_counter), 'LEGEND' => $legend, - 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $counter, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => $pagination->on_page($base_url, $counter, $config['topics_per_page'], $start), 'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)), |