From 5ff33e38fee9d6e651fc9a5ff283c357d29ef266 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 15 Apr 2001 14:21:19 +0000 Subject: [PATCH] Users online update git-svn-id: file:///svn/phpbb/trunk@144 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/functions/functions.php | 8 ++++++++ phpBB/index.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/functions/functions.php b/phpBB/functions/functions.php index 6345630813..bc2fd5b670 100644 --- a/phpBB/functions/functions.php +++ b/phpBB/functions/functions.php @@ -43,6 +43,10 @@ function get_db_stat($db, $mode) AND user_level != '. DELETED .' ORDER BY user_id DESC LIMIT 1'; break; + + case 'usersonline': + $sql = "SELECT COUNT(*) AS online FROM ".SESSIONS_TABLE; + break; } @@ -57,6 +61,10 @@ function get_db_stat($db, $mode) { return($row); } + else if($mode == "usersonline") + { + return ($row['online']); + } else { return($row['total']); diff --git a/phpBB/index.php b/phpBB/index.php index b8cea3e80c..79c0a9644b 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -41,7 +41,7 @@ $total_users = get_db_stat($db, 'usercount'); $newest_userdata = get_db_stat($db, 'newestuser'); $newest_user = $newest_userdata["username"]; $newest_uid = $newest_userdata["user_id"]; -$users_browsing = "4 Users"; +$users_browsing = get_db_stat($db, "usersonline") . " Users "; if(empty($viewcat)) {