[Snippet] Static global logged in userlist V2

Static global logged in userlist V2
With this snippet you get a template variable, which shows a global logged in userlist everywhere as on Index
Normally the logged in userlist display is different in footer, if you go to forum, topic or wherever.
Credit: BNa
Screen:
open
includes/functions.php
find
before add
find
after add
Now you can use
@ example:
open
styles/prosilver/template/overall_footer.html
find
after add
Dont forget to clear all board- and browser-caches after each template change
With this snippet you get a template variable, which shows a global logged in userlist everywhere as on Index
Normally the logged in userlist display is different in footer, if you go to forum, topic or wherever.
Credit: BNa
Screen:
open
includes/functions.php
find
- Code: Select all
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
before add
- Code: Select all
// Static global logged in userlist / BNa / 2012
$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'];
// Static global logged in userlist / BNa / 2012
find
- Code: Select all
'LOGGED_IN_USER_LIST' => $online_userlist,
after add
- Code: Select all
// Static global logged in userlist / BNa / 2012
'LOGGED_IN_USER_LIST_GLOB' => (isset($online_userlist_glob)) ? $online_userlist_glob : false,
// Static global logged in userlist / BNa / 2012
Now you can use
{LOGGED_IN_USER_LIST_GLOB}
in every template file@ example:
open
styles/prosilver/template/overall_footer.html
find
- Code: Select all
<div id="page-footer">
after add
- Code: Select all
<!-- 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