Static global logged in userlist V2With this snippet you get a template variable, which shows a global logged in userlist everywhere as on IndexNormally the logged in userlist display is different in footer, if you go to forum, topic or wherever.
Credit: BNaScreen:Attachment:
on_2.png [ 462 Bytes | Viewed 1764 times ]
openincludes/functions.php
findCode:
$template->assign_vars(array(
before add Code:
$online_users_glob = obtain_users_online(0, $item);
$user_online_strings_glob = obtain_users_online_string($online_users_glob, 0, $item);
$online_userlist_glob = $user_online_strings_glob['online_userlist'];
findCode:
'LOGGED_IN_USER_LIST' => $online_userlist,
after addCode:
'LOGGED_IN_USER_LIST_GLOB' => (isset($online_userlist_glob)) ? $online_userlist_glob : false,
Now you can use
{LOGGED_IN_USER_LIST_GLOB}
in every template file
@ example:
openstyles/prosilver/template/overall_footer.html
findCode:
<div id="page-footer">
after addCode:
<!-- IF SCRIPT_NAME !== 'index' -->
<div class="navbar">
<div class="inner"><span class="corners-top"><span></span></span>
{LOGGED_IN_USER_LIST_GLOB}
<span class="corners-bottom"><span></span></span></div>
</div>
<div> </div>
<!-- ENDIF -->
Dont forget to clear all board- and browser-caches after each template change