The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I have a strange issue here.
I'm using this active plugin with global_start hook location for both desktop and mobile templates. It works fine in mobile (navbar), but not in desktop (header template) Same exact code in plugin, same code in templates: Code:
// get online users
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$guestsarry = $db->query_first("SELECT COUNT(host) AS sessions FROM " . TABLE_PREFIX . "session WHERE userid = 0 AND lastactivity > $datecut");
$membersarry = $db->query_read("SELECT DISTINCT userid FROM " . TABLE_PREFIX . "session WHERE userid <> 0 AND lastactivity > $datecut");
$msxguests = intval($guestsarry['sessions']);
$msxmembers = intval($db->num_rows($membersarry));
$msxtotal = $msxmembers + $msxguests;
vB_Template::preRegister('navbar_link',array('msxtotal' => $msxtotal, 'msxmembers' => $msxmembers, 'msxguests' => $msxguests));
// get online users
Code:
<div style="background-color: #fff; text-align: center; padding: 10px; float: right">
<span style="font-size: 16px; color: #777">there are <span style="color: #43A6DF; font-weight: bold">{vb:raw $msxtotal}</span> people online</span>
</div>
I have the code in the header template in desktop version and navbar template in mobile. |
|
#2
|
||||
|
||||
|
You'll have to register the variable also to the header template then. Try this code
PHP Code:
|
| 3 благодарности(ей) от: | ||
| Chadi, gsmlover4u, Lynne | ||
|
#3
|
||||
|
||||
|
Perfect that works! Thanks
|
|
#4
|
||||
|
||||
|
You're welcome
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|