aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-03-01 16:48:13 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-03-01 16:48:13 +0000
commitcbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb (patch)
tree0b4851516183b6a75504330497b785ec2f3d99b7 /phpBB
parent19c55abb19e5889eb41ed765d1ee75b7caa44b89 (diff)
downloadforums-cbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb.tar
forums-cbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb.tar.gz
forums-cbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb.tar.bz2
forums-cbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb.tar.xz
forums-cbf63d31c4ca876ff9cc74851d3bfc9e0707c6bb.zip
Ignore duplicate IP's for guest counts ... keep in mind this swings 100% the other way from keeping them all, you'll not count some users.
git-svn-id: file:///svn/phpbb/trunk@2238 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/page_header.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index 1eb6ef5158..93dc6f8852 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -98,7 +98,7 @@ $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.s
AND ( s.session_time >= ".( time() - 300 ) . "
OR u.user_session_time >= " . ( time() - 300 ) . " )
$user_forum_sql
- ORDER BY u.username ASC";
+ ORDER BY u.username ASC, s.session_ip ASC";
$result = $db->sql_query($sql);
if(!$result)
{
@@ -114,6 +114,7 @@ $guests_online = 0;
$online_userlist = "";
$prev_user_id = 0;
+$prev_user_ip = '';
while( $row = $db->sql_fetchrow($result) )
{
@@ -154,9 +155,14 @@ while( $row = $db->sql_fetchrow($result) )
}
else
{
- $guests_online++;
+ // Skip multiple sessions for one user
+ if( $row['session_ip'] != $prev_session_ip )
+ {
+ $guests_online++;
+ }
}
+ $prev_session_ip = $row['session_ip'];
$prev_user_id = $row['user_id'];
}
@@ -475,4 +481,4 @@ header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$template->pparse("overall_header");
-?>
+?> \ No newline at end of file