View Full Version : Query to get all online users in vb3
DWard
05-20-2004, 06:16 PM
Does anybody know what query I can use to get all online users (members+guests) in vb3??
Cheers,
Dan
Xenon
05-20-2004, 08:59 PM
$datecut = TIMENOW - $vboptions['cookietimeout'];
$headerguests = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM session
WHERE userid = 0 AND lastactivity > $datecut
");
$headerusers = $DB_site->query_first("
SELECT COUNT(DISTINCT(userid)) AS count
FROM session
WHERE session.userid > 0 AND session.lastactivity > $datecut
");
$headerguests = $headerguests['count'];
$headerusers = $headerusers['count'];
$totalonline = $headerguests + $headerusers;
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.