diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 14:21:19 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 14:21:19 +0000 |
commit | 5ff33e38fee9d6e651fc9a5ff283c357d29ef266 (patch) | |
tree | 6fdb7a00ea9639259dd2d7b779eca04e042ede38 /phpBB | |
parent | 7791a3126090aef74a00e0b85f3d7779819e75c3 (diff) | |
download | forums-5ff33e38fee9d6e651fc9a5ff283c357d29ef266.tar forums-5ff33e38fee9d6e651fc9a5ff283c357d29ef266.tar.gz forums-5ff33e38fee9d6e651fc9a5ff283c357d29ef266.tar.bz2 forums-5ff33e38fee9d6e651fc9a5ff283c357d29ef266.tar.xz forums-5ff33e38fee9d6e651fc9a5ff283c357d29ef266.zip |
Users online update
git-svn-id: file:///svn/phpbb/trunk@144 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/functions/functions.php | 8 | ||||
-rw-r--r-- | phpBB/index.php | 2 |
2 files changed, 9 insertions, 1 deletions
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)) { |