aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewonline.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
committerDavid M <davidmj@users.sourceforge.net>2008-01-04 18:35:49 +0000
commitaf738dbc2a48713f59779410955282aa5760b741 (patch)
tree35053fbc840e81689dada401b978ae8dfb181d33 /phpBB/viewonline.php
parentedd6c34eda14fbef5bd1e6502735c45d038d6575 (diff)
downloadforums-af738dbc2a48713f59779410955282aa5760b741.tar
forums-af738dbc2a48713f59779410955282aa5760b741.tar.gz
forums-af738dbc2a48713f59779410955282aa5760b741.tar.bz2
forums-af738dbc2a48713f59779410955282aa5760b741.tar.xz
forums-af738dbc2a48713f59779410955282aa5760b741.zip
Ch-ch-ch-changes
- Made us more DB independent by making many queries capability based instead of DB specific - Finished PHP5ifying of the acm_file class, now with some (hopefully) enhancements to its performance - Sped up viewforum considerably (also goes towards mcp_forum) I really hope I didn't explode CVS... git-svn-id: file:///svn/phpbb/trunk@8301 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewonline.php')
-rw-r--r--phpBB/viewonline.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index ea29e09660..c27788c4c8 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -97,23 +97,21 @@ $guest_counter = 0;
// Get number of online guests (if we do not display them)
if (!$show_guests)
{
- switch ($db->sql_layer)
+ if ($db->count_distinct)
{
- case 'sqlite':
- $sql = 'SELECT COUNT(session_ip) as num_guests
- FROM (
- SELECT DISTINCT session_ip
- FROM ' . SESSIONS_TABLE . '
- WHERE session_user_id = ' . ANONYMOUS . '
- AND session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
- ')';
- break;
-
- default:
- $sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests
+ $sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . ANONYMOUS . '
AND session_time >= ' . (time() - ($config['load_online_time'] * 60));
+ else
+ {
+ $sql = 'SELECT COUNT(session_ip) as num_guests
+ FROM (
+ SELECT DISTINCT session_ip
+ FROM ' . SESSIONS_TABLE . '
+ WHERE session_user_id = ' . ANONYMOUS . '
+ AND session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
+ ')';
break;
}
$result = $db->sql_query($sql);