aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-10-15 19:22:25 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-10-15 19:22:25 +0000
commitc7f9d94b75f6749ab50fc4c2825eb0c282c35178 (patch)
treece3188b60e60ca13048b03ff0546f3a0604773ba /phpBB/includes/functions.php
parentdd5a27dc6f02cd6db1e2ff43cb2e8b9ab8098ec8 (diff)
downloadforums-c7f9d94b75f6749ab50fc4c2825eb0c282c35178.tar
forums-c7f9d94b75f6749ab50fc4c2825eb0c282c35178.tar.gz
forums-c7f9d94b75f6749ab50fc4c2825eb0c282c35178.tar.bz2
forums-c7f9d94b75f6749ab50fc4c2825eb0c282c35178.tar.xz
forums-c7f9d94b75f6749ab50fc4c2825eb0c282c35178.zip
looks like nobody ever found this bug :D
git-svn-id: file:///svn/phpbb/trunk@6503 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php24
1 files changed, 19 insertions, 5 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 40225a363b..0965a585b8 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3005,11 +3005,25 @@ function page_header($page_title = '', $display_online_list = true)
// Get number of online guests
if (!$config['load_online_guests'])
{
- $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests
- FROM ' . SESSIONS_TABLE . ' s
- WHERE s.session_user_id = ' . ANONYMOUS . '
- AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
- $reading_sql;
+ if ($db->sql_layer === 'sqlite')
+ {
+ $sql = 'SELECT COUNT(session_ip) as num_guests
+ FROM (
+ SELECT DISTINCT s.session_ip
+ FROM ' . SESSIONS_TABLE . ' s
+ WHERE s.session_user_id = ' . ANONYMOUS . '
+ AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
+ $reading_sql .
+ ')';
+ }
+ else
+ {
+ $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests
+ FROM ' . SESSIONS_TABLE . ' s
+ WHERE s.session_user_id = ' . ANONYMOUS . '
+ AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
+ $reading_sql;
+ }
$result = $db->sql_query($sql);
$guests_online = (int) $db->sql_fetchfield('num_guests');
$db->sql_freeresult($result);