The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Online in the Header
Hi all
I am lookign for updated code to display online info in the header. Prior to uprgading to 3.5, I had this code in phpinclude_start: Code:
$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]; $headeronline=$headerguests+$headerusers; Can anyone point me to the correct implementation now the code base has changed. My users are missing this... Thanks Cheers Figured it out... Created a plugin using the global_start hook and out this in the plugin code: Code:
$hdr_datecut = TIMENOW - $vbulletin->options['cookietimeout']; $hdr_guestsarry = $db->query_first("SELECT COUNT(host) AS sessions FROM " . TABLE_PREFIX . "session WHERE userid = 0 AND lastactivity > $hdr_datecut"); $hdr_membersarry = $db->query_read("SELECT DISTINCT userid FROM " . TABLE_PREFIX . "session WHERE userid <> 0 AND lastactivity > $hdr_datecut"); $hdr_guests = intval($hdr_guestsarry['sessions']); $hdr_members = intval($db->num_rows($hdr_membersarry)); $hdr_online = ($hdr_guests + $hdr_members); Cheers Bruce Edit: What's this "auto merge" thing? I replied to my own post, why was it merged? For some reason the "auto merge" thingie called it a double up |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|