firefly, i installed your hack today. i was thinking of an interesting mod... to show the actual numbers of users viewing the thread in forumdisplay. here it is what i did...
in forumdisplay.php find:
Code:
updateuserforum($forumid);
replace it with:
Code:
updateuserforum($forumid,$threadid);
find:
Code:
ORDER BY sticky DESC, $sortfield $sqlsortorder
");
BELOW this add::
Code:
// users browsing each thread
$getthreadbrowsers = $DB_site->query("SELECT COUNT(*) AS count,inthread
FROM user
WHERE lastactivity>".($ourtimenow - $cookietimeout)."
AND lastvisit<>lastactivity
GROUP BY inthread");
$threadbrowsers = array();
while ($threadbrowser = $DB_site->fetch_array($getthreadbrowsers)) {
$threadbrowsers[$threadbrowser['inthread']] = $threadbrowser['count'];
}
find:
Code:
$thread[votenum] = '0';
} else {
BELOW this, add:
Code:
global $threadbrowsers;
$activebrowsers = $threadbrowsers[$forum['forumid']];
if (intval($activebrowsers)<1) {
$activebrowsers = 0;
}
now.. there is something i miss, because it will not update the number of users viewing the thread. i also tried this...
find:
Code:
getforumrules($foruminfo,$getperms);
BELOW this, add:
Code:
updateuserforum($thread['forumid'], $thread['threadid']);
i think there is an unset somewhere that stop it from counting. can you let me know if the basic idea is ok and what steps i missed? thanks.