Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 15:34

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 1 post ] 
Author Message
PostPosted: 22 Apr 2012, 14:24 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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:
Attachment:
on_2.png
on_2.png [ 462 Bytes | Viewed 1764 times ]

open

includes/functions.php

find

Code:
    // The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array(


before add

Code:
        // 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:
        'LOGGED_IN_USER_LIST'            => $online_userlist


after add

Code:
        // 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:
<div id="page-footer">


after add

Code:
<!-- 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>&nbsp;</div>
<!-- ENDIF --> 


Dont forget to clear all board- and browser-caches after each template change

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.012s | 23 Queries | GZIP : Off ]