mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 04:48:54 +00:00
viewonline updates
git-svn-id: file:///svn/phpbb/trunk@155 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
830535cdca
commit
17edd92527
2 changed files with 30 additions and 6 deletions
|
@ -126,6 +126,24 @@ switch($pagetype)
|
||||||
"TOPIC_TITLE" => $topic_title));
|
"TOPIC_TITLE" => $topic_title));
|
||||||
$template->pparse("header");
|
$template->pparse("header");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'viewonline':
|
||||||
|
$template->set_filenames(array("header" => "viewonline_header.tpl",
|
||||||
|
"body" => "viewonline_body.tpl",
|
||||||
|
"jumpbox" => "jumpbox.tpl",
|
||||||
|
"footer" => "viewonline_footer.tpl"));
|
||||||
|
$jumpbox = make_jumpbox($db);
|
||||||
|
$template->assign_vars(array("TOTAL_POSTS" => $total_posts,
|
||||||
|
"TOTAL_USERS" => $total_users,
|
||||||
|
"NEWEST_USER" => $newest_user,
|
||||||
|
"NEWEST_UID" => $newest_uid,
|
||||||
|
"JUMPBOX_LIST" => $jumpbox,
|
||||||
|
"JUMPBOX_ACTION" => "viewforum.".$phpEx,
|
||||||
|
"SELECT_NAME" => POST_FORUM_URL));
|
||||||
|
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
||||||
|
$template->pparse("header");
|
||||||
|
break;
|
||||||
|
|
||||||
case 'newtopic':
|
case 'newtopic':
|
||||||
$template->set_filenames(array("header" => "newtopic_header.tpl",
|
$template->set_filenames(array("header" => "newtopic_header.tpl",
|
||||||
"body" => "posting_body.tpl"));
|
"body" => "posting_body.tpl"));
|
||||||
|
|
|
@ -44,10 +44,11 @@ $newest_uid = $newest_userdata["user_id"];
|
||||||
|
|
||||||
include('includes/page_header.'.$phpEx);
|
include('includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
$sql = "SELECT u.username, u.user_id, f.forum_name, f.forum_id, s.session_page, s.session_logged_in
|
$sql = "SELECT u.username, u.user_id, f.forum_name, f.forum_id, s.session_page, s.session_logged_in, s.session_time
|
||||||
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
||||||
LEFT JOIN ".FORUMS_TABLE." f ON f.forum_id = s.session_page
|
LEFT JOIN ".FORUMS_TABLE." f ON f.forum_id = s.session_page
|
||||||
WHERE u.user_id = s.session_user_id";
|
WHERE u.user_id = s.session_user_id
|
||||||
|
ORDER BY s.session_time DESC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
if(!$result)
|
if(!$result)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +66,9 @@ $template->assign_vars(array(
|
||||||
"POST_USER_URL" => POST_USERS_URL,
|
"POST_USER_URL" => POST_USERS_URL,
|
||||||
"L_WHOSONLINE" => $l_whosonline,
|
"L_WHOSONLINE" => $l_whosonline,
|
||||||
"L_USERNAME" => $l_username,
|
"L_USERNAME" => $l_username,
|
||||||
"L_LOCATION" => $l_location
|
"L_LOCATION" => $l_location,
|
||||||
|
"L_LAST_UPDATE" => "Last Updated",
|
||||||
|
"L_LOGGED_ON" => "Logged On"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -84,21 +87,22 @@ if($online_count)
|
||||||
$row_color = "#DDDDDD";
|
$row_color = "#DDDDDD";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!stristr($onlinerow[$i]['username'], "Anonymous"))
|
if($onlinerow[$i]['user_id'] != ANONYMOUS && $onlinerow[$i]['user_id'] != DELETED)
|
||||||
{
|
{
|
||||||
$username = $onlinerow[$i]['username'];
|
$username = $onlinerow[$i]['username'];
|
||||||
if($onlinerow[$i]['session_logged_in'])
|
if($onlinerow[$i]['session_logged_in'])
|
||||||
{
|
{
|
||||||
$username .= " [ Logged In ]";
|
$loggedon = " $l_yes ";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$username .= " [ Logged Out ]";
|
$loggedon = " $l_no ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$username = "$l_anonymous";
|
$username = "$l_anonymous";
|
||||||
|
$loggedon = " - ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($onlinerow[$i]['forum_name'] == "")
|
if($onlinerow[$i]['forum_name'] == "")
|
||||||
|
@ -147,6 +151,8 @@ if($online_count)
|
||||||
array("ROW_COLOR" => $row_color,
|
array("ROW_COLOR" => $row_color,
|
||||||
"USER_ID" => $onlinerow[$i]['user_id'],
|
"USER_ID" => $onlinerow[$i]['user_id'],
|
||||||
"USERNAME" => $username,
|
"USERNAME" => $username,
|
||||||
|
"LOGGEDON" => $loggedon,
|
||||||
|
"LASTUPDATE" => create_date($default_dateformat, $onlinerow[$i]['session_time'], $sys_timezone),
|
||||||
"LOCATION" => $location,
|
"LOCATION" => $location,
|
||||||
"LOCATION_URL" => $location_url
|
"LOCATION_URL" => $location_url
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue