Code optimization (?) suggest:
forumhome_complete
PHP Code:
// ############### Paul M - Who has visited today v3.31 #################
$vbulletin->templatecache['forumhome_loggedinuser'] = str_replace('href=', 'title=\"$wrdate\" href=', $vbulletin->templatecache['forumhome_loggedinuser']);
$tnow = date('YmdHis',TIMENOW - $vbulletin->options['hourdiff']);
$cutoff = TIMENOW - (substr($tnow,8,2)*3600 + substr($tnow,10,2)*60 + substr($tnow,12,2));
//$cutoff = TIMENOW - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $vbulletin->db->query_read("
SELECT userid, usergroupid, membergroupids, lastactivity, options, username FROM " . TABLE_PREFIX . "user
WHERE lastactivity > $cutoff ORDER BY username
");
$totaltoday = 0;
while ($loggedin = $vbulletin->db->fetch_array($todaysusers))
{
$totaltoday++;
if (fetch_online_status($loggedin))
{
$loggedin['musername'] = fetch_musername($loggedin);
$wrdate = vbdate($vbulletin->options['timeformat'], $loggedin['lastactivity']);
eval('$whotoday .= ", ' . fetch_template('forumhome_loggedinuser') . '";');
}
}
unset($loggedin);
$whotoday = substr($whotoday, 2);
$db->free_result($todayusers);
// ############# End of Who has visited today ###############