From 4c05450291d939f0d6bf4ea3ba538719cf3b43ba Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 19 Apr 2001 14:46:11 +0000 Subject: Replaced previously removed anon and non-logged-in user templating info git-svn-id: file:///svn/phpbb/trunk@188 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewonline.php | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'phpBB/viewonline.php') diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index b074909e15..5f3eebab2e 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -91,17 +91,29 @@ if($online_count) $row_color = "#DDDDDD"; } - if($onlinerow[$i]['user_id'] != ANONYMOUS && $onlinerow[$i]['user_id'] != DELETED && $onlinerow[$i]['session_logged_in']) + if($onlinerow[$i]['user_id'] != ANONYMOUS && $onlinerow[$i]['user_id'] != DELETED) { - $username = $onlinerow[$i]['username']; - $active_users++; + if($onlinerow[$i]['session_logged_in']) + { + $username = $onlinerow[$i]['username']; + $logged_on = TRUE; + $active_users++; + } + else + { + $username = $onlinerow[$i]['username']; + $logged_on = FALSE; + $guest_users++; + } } else { + $username = $l_anonymous; + $logged_on = FALSE; $guest_users++; } - if($onlinerow[$i]['forum_name'] == "" && $onlinerow[$i]['session_logged_in']) + if($onlinerow[$i]['forum_name'] == "") { switch($onlinerow[$i]['session_page']) { @@ -152,12 +164,21 @@ if($online_count) $location = $onlinerow[$i]['forum_name']; } - if($onlinerow[$i]['session_logged_in']) + // + // What would be nice here is to let + // the template designer decide whether + // to display all users, registered users + // or just logged in users ... but we need + // if... constructs in the templating system + // for that ... + // + if($logged_on) { $template->assign_block_vars("userrow", array("ROW_COLOR" => $row_color, "USER_ID" => $onlinerow[$i]['user_id'], "USERNAME" => $username, + "LOGGED_ON" => $logged_on, "LASTUPDATE" => create_date($date_format, $onlinerow[$i]['session_time'], $sys_timezone), "LOCATION" => $location, "LOCATION_URL" => $location_url -- cgit v1.2.1