CrumbDown |
12-04-2012 02:49 PM |
I've been looking but only see these:
PHP Code:
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('footer'); $templater->register_page_templates(); $templater->register('activemembers', $activemembers); $templater->register('activeusers', $activeusers); $templater->register('forumbits', $forumbits); $templater->register('newuserinfo', $newuserinfo); $templater->register('numberguest', $numberguest); $templater->register('numbermembers', $numbermembers); $templater->register('numberregistered', $numberregistered); $templater->register('totalonline', $totalonline); $templater->register('totalposts', $totalposts); $templater->register('totalthreads', $totalthreads);
print_output($templater->render());
Should I be using this layout?:
PHP Code:
$templater->register('totalonline', $totalonline);
--------------- Added [DATE]1354636855[/DATE] at [TIME]1354636855[/TIME] ---------------
Found the other part:
PHP Code:
// ### LOGGED IN USERS ################################################# if (($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 2 OR ($vbulletin->options['displayloggedin'] > 2 AND $vbulletin->userinfo['userid'])) AND !$show['search_engine']) { $datecut = TIMENOW - $vbulletin->options['cookietimeout']; $numbervisible = 0; $numberregistered = 0; $numberguest = 0;
$hook_query_fields = $hook_query_joins = $hook_query_where = ''; ($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser_query')) ? eval($hook) : false;
$forumusers = $db->query_read_slave(" SELECT user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, user.lastvisit, session.userid, session.inforum, session.lastactivity, session.badlocation, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid $hook_query_fields FROM " . TABLE_PREFIX . "session AS session LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid) $hook_query_joins WHERE session.lastactivity > $datecut $hook_query_where " . iif($vbulletin->options['displayloggedin'] == 1 OR $vbulletin->options['displayloggedin'] == 3, "ORDER BY username ASC") . " ");
if ($vbulletin->userinfo['userid']) { // fakes the user being online $vbulletin->userinfo['joingroupid'] = iif($vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['displaygroupid'], $vbulletin->userinfo['usergroupid']); $userinfos = array ( $vbulletin->userinfo['userid'] => array ( 'userid' =>& $vbulletin->userinfo['userid'], 'username' =>& $vbulletin->userinfo['username'], 'invisible' =>& $vbulletin->userinfo['invisible'], 'inforum' => 0, 'lastactivity' => TIMENOW, 'lastvisit' =>& $vbulletin->userinfo['lastvisit'], 'usergroupid' =>& $vbulletin->userinfo['usergroupid'], 'displaygroupid' =>& $vbulletin->userinfo['displaygroupid'], 'infractiongroupid' =>& $vbulletin->userinfo['infractiongroupid'], ) ); } else { $userinfos = array(); }
$inforum = array(); while ($loggedin = $db->fetch_array($forumusers)) { $userid = $loggedin['userid']; if (!$userid) { // Guest $numberguest++; if (!isset($inforum["$loggedin[inforum]"])) { $inforum["$loggedin[inforum]"] = 0; } if (!$loggedin['badlocation']) { $inforum["$loggedin[inforum]"]++; } } else if (empty($userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity'])) { $userinfos["$userid"] = $loggedin; } }
// We are a guest and somehow got missed by the query. if (!$vbulletin->userinfo['userid'] AND !$numberguest) { $numberguest++; }
$activeusers = array(); /* VBIV-12365 Users who are moderated or awaiting e-mail confirmation were being counted as guests. This was causing online count discrepancies between this and online.php, removed code */ foreach ($userinfos AS $userid => $loggedin) { $numberregistered++; if ($userid != $vbulletin->userinfo['userid'] AND !$loggedin['badlocation']) { if (!isset($inforum["$loggedin[inforum]"])) { $inforum["$loggedin[inforum]"] = 0; } $inforum["$loggedin[inforum]"]++; }
fetch_musername($loggedin); $loggedin['comma'] = $vbphrase['comma_space']; ($hook = vBulletinHook::fetch_hook('forumhome_loggedinuser')) ? eval($hook) : false;
if (fetch_online_status($loggedin)) { $numbervisible++; $activeusers[$numbervisible] = $loggedin; } }
// Last element if ($numbervisible) { $activeusers[$numbervisible]['comma'] = ''; }
// memory saving unset($userinfos, $loggedin);
$db->free_result($forumusers);
$totalonline = $numberregistered + $numberguest; $numberinvisible = $numberregistered - $numbervisible;
// ### MAX LOGGEDIN USERS ################################ if (intval($vbulletin->maxloggedin['maxonline']) <= $totalonline) { $vbulletin->maxloggedin['maxonline'] = $totalonline; $vbulletin->maxloggedin['maxonlinedate'] = TIMENOW; build_datastore('maxloggedin', serialize($vbulletin->maxloggedin), 1); }
$recordusers = vb_number_format($vbulletin->maxloggedin['maxonline']); $recorddate = vbdate($vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxonlinedate'], true); $recordtime = vbdate($vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxonlinedate']);
$show['loggedinusers'] = true; } else { $show['loggedinusers'] = false; }
But gives me an error: Fatal error:
Call to a member function query_read_slave() on a non-object in includes/class_bootstrap.php(430) : eval()'d code on line 17
|