aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewonline.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-03-31 00:06:34 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-03-31 00:06:34 +0000
commite1f7400b8da1088ebabd351fe9b6e1f246c34531 (patch)
treef5271ef99c1d83076002f1cb9d43e8728e40398e /phpBB/viewonline.php
parentf74fa81851cb9b03cd84400e9a4817f216b09a5b (diff)
downloadforums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar
forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.gz
forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.bz2
forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.tar.xz
forums-e1f7400b8da1088ebabd351fe9b6e1f246c34531.zip
pre-freeze on main templates, various bug fixes (highlighting search results, various search related issues, blah blah). These updates need _thorough_ checking, quickly
git-svn-id: file:///svn/phpbb/trunk@2448 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewonline.php')
-rw-r--r--phpBB/viewonline.php79
1 files changed, 32 insertions, 47 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index dd1f68f21a..29df6c4341 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -21,7 +21,7 @@
***************************************************************************/
define('IN_PHPBB', true);
-$phpbb_root_path = "./";
+$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
@@ -35,37 +35,22 @@ init_userprefs($userdata);
//
//
-// Output page header and load
-// viewonline template
+// Output page header and load viewonline template
//
$page_title = $lang['Who_is_online'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
- "body" => "viewonline_body.tpl",
- "jumpbox" => "jumpbox.tpl")
+ 'body' => 'viewonline_body.tpl')
);
+make_jumpbox('viewforum.'.$phpEx);
-$jumpbox = make_jumpbox();
$template->assign_vars(array(
- "L_GO" => $lang['Go'],
- "L_JUMP_TO" => $lang['Jump_to'],
- "L_SELECT_FORUM" => $lang['Select_forum'],
-
- "S_JUMPBOX_LIST" => $jumpbox,
- "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
-);
-$template->assign_var_from_handle("JUMPBOX", "jumpbox");
-//
-// End header
-//
-
-$template->assign_vars(array(
- "L_WHOSONLINE" => $lang['Who_is_online'],
- "L_ONLINE_EXPLAIN" => $lang['Online_explain'],
- "L_USERNAME" => $lang['Username'],
- "L_FORUM_LOCATION" => $lang['Forum_Location'],
- "L_LAST_UPDATE" => $lang['Last_updated'])
+ 'L_WHOSONLINE' => $lang['Who_is_online'],
+ 'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
+ 'L_USERNAME' => $lang['Username'],
+ 'L_FORUM_LOCATION' => $lang['Forum_Location'],
+ 'L_LAST_UPDATE' => $lang['Last_updated'])
);
//
@@ -82,7 +67,7 @@ if( $result = $db->sql_query($sql) )
}
else
{
- message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}
//
@@ -94,15 +79,15 @@ $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
//
// Get user list
//
-$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip
- FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s
- WHERE u.user_id = s.session_user_id
- AND ( u.user_session_time >= " . ( time() - 300 ) . "
- OR s.session_time >= " . ( time() - 300 ) . " )
- ORDER BY u.username ASC, s.session_ip";
+$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip
+ FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
+ WHERE u.user_id = s.session_user_id
+ AND ( s.session_time >= ".( time() - 300 ) . "
+ OR u.user_session_time >= " . ( time() - 300 ) . " )
+ ORDER BY u.username ASC, s.session_ip ASC";
if ( !($result = $db->sql_query($sql)) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql);
}
if( $row = $db->sql_fetchrow($result) )
@@ -128,7 +113,7 @@ if( $row = $db->sql_fetchrow($result) )
{
$username = $row['username'];
- $style_color = "";
+ $style_color = '';
if ( $row['user_level'] == ADMIN )
{
$username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>';
@@ -226,7 +211,7 @@ if( $row = $db->sql_fetchrow($result) )
}
else
{
- $location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $user_page);
+ $location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $user_page);
$location = $forum_data[$user_page];
}
@@ -234,14 +219,14 @@ if( $row = $db->sql_fetchrow($result) )
$row_class = ( $$which_counter % 2 ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars("$which_row", array(
- "ROW_COLOR" => "#" . $row_color,
- "ROW_CLASS" => $row_class,
- "USERNAME" => $username,
- "LASTUPDATE" => create_date($board_config['default_dateformat'], $last_update, $board_config['board_timezone']),
- "FORUM_LOCATION" => $location,
-
- "U_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $user_id),
- "U_FORUM_LOCATION" => append_sid($location_url))
+ 'ROW_COLOR' => '#' . $row_color,
+ 'ROW_CLASS' => $row_class,
+ 'USERNAME' => $username,
+ 'LASTUPDATE' => create_date($board_config['default_dateformat'], $last_update, $board_config['board_timezone']),
+ 'FORUM_LOCATION' => $location,
+
+ 'U_USER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $user_id),
+ 'U_FORUM_LOCATION' => append_sid($location_url))
);
$$which_counter++;
@@ -289,26 +274,26 @@ if( $row = $db->sql_fetchrow($result) )
}
$template->assign_vars(array(
- "TOTAL_REGISTERED_USERS_ONLINE" => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users),
- "TOTAL_GUEST_USERS_ONLINE" => sprintf($l_g_user_s, $guest_users))
+ 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users),
+ 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users))
);
if ( $registered_users + $hidden_users == 0 )
{
$template->assign_vars(array(
- "L_NO_REGISTERED_USERS_BROWSING" => $lang['No_users_browsing'])
+ 'L_NO_REGISTERED_USERS_BROWSING' => $lang['No_users_browsing'])
);
}
if ( $guest_users == 0 )
{
$template->assign_vars(array(
- "L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
+ 'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing'])
);
}
}
-$template->pparse("body");
+$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);