hi ,
i'm wondering why vbulletin didn't added the condition for fetching who's viewing the thread/forum right now by adding the condition (inthread/inforum) instead of fetching all the logged in users and do a php process ?
old code in showthread.php for instance :
as it should be as i guess like this :
from the comments i see "Don't put the inthread value in the WHERE clause as it might not be the newest location!" but in the bootstrapper i think the value will be changed according for the current location .
i think i will boost the pages .
i'm wondering why vbulletin didn't added the condition for fetching who's viewing the thread/forum right now by adding the condition (inthread/inforum) instead of fetching all the logged in users and do a php process ?
old code in showthread.php for instance :
PHP Code:
// Don't put the inthread value in the WHERE clause as it might not be the newest location!
$threadusers = $db->query_read_slave(" SELECT user.username, user.usergroupid, user.membergroupids, session.userid, session.inthread, session.lastactivity, session.badlocation, IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) WHERE session.lastactivity > $datecut ORDER BY " . iif($vbulletin->options['showthreadusers'] == 1 OR $vbulletin->options['showthreadusers'] == 3, " username ASC,") . " lastactivity DESC
PHP Code:
SELECT user.username, user.usergroupid, user.membergroupids, session.userid, session.inthread, session.lastactivity, session.badlocation, IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) WHERE session.lastactivity > $datecut and inforum = ".$threadinfo['threadid']." ORDER BY " . iif($vbulletin->options['showthreadusers'] == 1 OR $vbulletin->options['showthreadusers'] == 3, " username ASC,") . " lastactivity DESC
from the comments i see "Don't put the inthread value in the WHERE clause as it might not be the newest location!" but in the bootstrapper i think the value will be changed according for the current location .
i think i will boost the pages .
Comment