1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

alternate sidebar: members online now

Discussion in 'Template Modifications [Archive]' started by dieketzer, Dec 22, 2010.

  1. dieketzer

    dieketzer Well-Known Member

    this sidebar will load avatars for your online members rather than the default text link. i thought the members would like being able to see at a glance whos online, rather than see a list of text. member feedback has been positive.

    what makes this sidebar different than the other available avatar sidebars is the following:
    • the smallest avatars are loaded.
    • admins and moderators will not reappear in 'members' (they already show in 'staff online').
    • people you follow will not reappear in 'members' (they already show in 'people you follow').
    • tooltip on mouseover with the members name.
    • 'invisible' members' show to admin/mods as semi-transperent
    those worried about this bloating out the page:
    • the avs are an average of 5KiB in size.
    • the avs are cached by your regulars.
    • the number of avs listed is configurable via the acp.
    online2.png
    (1.01) in template sidebar_online_users:

    replace all code with:
    Code:
    <xen:edithint template="sidebar.css" />
    
    <xen:if hascontent="true">
        <!-- block: sidebar_online_staff -->
        <div class="section staffOnline avatarList">
            <div class="secondaryContent">
                <h3>{xen:phrase staff_online_now}</h3>
                <ul>
                    <xen:contentcheck>
                        <xen:foreach loop="$onlineUsers.records" value="$user">
                            <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                                <li>
                                    <xen:avatar user="$user" size="s" img="true" class="{xen:if '!{$user.visible}', 'dKinvisible'}" />
                                    <xen:username user="$user" rich="true" />
                                    <div class="userTitle">{xen:helper userTitle, $user}</div>
                                </li>
                            </xen:if>
                        </xen:foreach>
                    </xen:contentcheck>
                </ul>
            </div>
        </div>
        <!-- end block: sidebar_online_staff -->
    </xen:if>
    
    <!-- block: sidebar_online_users -->
    <div class="section membersOnline userList">
        <div class="secondaryContent">
            <h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase members_online_now}</a></h3>
            <xen:if is="{$onlineUsers.records}">
                <xen:if is="{$visitor.user_id}">
                    <xen:if hascontent="true">
                    <h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
                    <ul class="followedOnline">
                        <xen:contentcheck>
                            <xen:foreach loop="$onlineUsers.records" value="$user">
                                <xen:if is="{$user.followed}">
                                    <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage{xen:if '!{$user.visible}', ' dKinvisible'}" /></li>
                                </xen:if>
                            </xen:foreach>
                        </xen:contentcheck>
                    </ul>
                    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
                    </xen:if>
                </xen:if>
    
                <ol class="followedOnline">
                    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
    
                      <xen:if is="!{$user.followed} && !{$user.is_moderator} && !{$user.is_admin}">
                                <xen:if is="{$user.user_id}">
                      <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage{xen:if '!{$user.visible}', ' dKinvisible'}" /></li>
                    <xen:else />
                                    {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                                </xen:if>
                  </xen:if>
    
                        </xen:if>
                    </xen:foreach>
                    <xen:if is="{$onlineUsers.recordsUnseen}">
                        <li class="moreLink">... <a href="{xen:link online}" title="{xen:phrase see_all_visitors}">{xen:phrase and_x_more, 'count={xen:number $onlineUsers.recordsUnseen}'}</a></li>
                    </xen:if>
                </ol>
            </xen:if>
    
            <div class="footnote">
                {xen:phrase online_now_x_members_y_guests_z, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}'}
            </div>
        </div>
    </div>
    <!-- end block: sidebar_online_users -->
    the semi-transparent state of invisible members is set by .dKinvisible. you can change this css to suit your own purposes.
    add to template EXTRA.css
    Code:
    /* alternate members online */
    .dKinvisible
    {
            opacity:0.6;
    }
    changelog:
    1.may.11
    -fixed an issue that caused some staff members to appear twice
    -invisible users now display admins/mods a semi-transparent avatar
     
    oVR, LukeJB, Corey and 18 others like this.
  2. dieketzer

    dieketzer Well-Known Member

    if you are using jaxels portal you will want to also edit his module template.
    note: newer portal releases do not require a template change.

    if you are using xfrocks' widget framework you will want to edit his widget templates:

    in template wf_widget_online_users:
    replace the entire template with:
    Code:
            <xen:if is="{$onlineUsers.records}">
                <xen:if is="{$visitor.user_id}">
                    <xen:if hascontent="true">
                    <h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
                    <ul class="followedOnline">
                        <xen:contentcheck>
                            <xen:foreach loop="$onlineUsers.records" value="$user">
                                <xen:if is="{$user.followed}">
                                    <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
                                </xen:if>
                            </xen:foreach>
                        </xen:contentcheck>
                    </ul>
                    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
                    </xen:if>
                </xen:if>
    
                <ol class="followedOnline">
                    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
    
                      <xen:if is="!{$user.followed} && !{$user.is_moderator} && !{$user.is_admin}">
                                <xen:if is="{$user.user_id}">
                      <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage{xen:if '!{$user.visible}', ' dKinvisible'}" /></li>
                    <xen:else />
                                    {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                                </xen:if>
                  </xen:if>
    
                        </xen:if>
                    </xen:foreach>
                    <xen:if is="{$onlineUsers.recordsUnseen}">
                        <li class="moreLink">... <a href="{xen:link online}" title="{xen:phrase see_all_visitors}">{xen:phrase and_x_more, 'count={xen:number $onlineUsers.recordsUnseen}'}</a></li>
                    </xen:if>
                </ol>
            </xen:if>
    
            <div class="footnote">
                <a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase online_now_x_members_y_guests_z, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}'}</a>
            </div>
    in template wf_widget_online_staff:

    replace the entire template with:
    Code:
    <xen:if hascontent="true">
    
    <div class="avatarList">
    
        <ul>
    
            <xen:contentcheck>
    
                <xen:foreach loop="$onlineUsers.records" value="$user">
    
                    <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
    
                        <li>
    
                            <xen:avatar user="$user" size="s" img="true" class="{xen:if '!{$user.visible}', ' dKinvisible'}" />
    
                            <xen:username user="$user" rich="true" />
    
                            <div class="userTitle">{xen:helper userTitle, $user}</div>
    
                        </li>
    
                    </xen:if>
    
                </xen:foreach>
    
            </xen:contentcheck>
    
        </ul>
    
    </div>
    
    </xen:if>
     
    Fuhrmann and CFodder like this.
  3. ddmmh

    ddmmh Well-Known Member

    Hi Mate

    Great mod, I REALLY want to use this. I replaced all code in template online_sidebar_users with all the code in your first post. I dont get any errors but nothing changes, just lists usernames as text as per normal. I am running beta 5 with original template, any ideas? cheers
     
  4. dieketzer

    dieketzer Well-Known Member

    the code in the first post is for template sidebar_online_users (forum side block)
    the code in the second post is for template EWRporta_Block_OnlineUsers (portal side block)
    they are not interchangeable
     
  5. ddmmh

    ddmmh Well-Known Member

    Yep I did exactly as your first post states. I also use the portal but I havent even tried the portal code yet as I cant get the mod to work in the sidebar. I went in my ACP, went to templates. Opened up sidebar_online_users template, removed all the code from there and replaced it with the code in your first post, this is correct yeh? It didnt work for me
     
  6. ddmmh

    ddmmh Well-Known Member

    If you would like to see for yourself my site is www.mmazone.com.au

    currently my template has your code in it but as you can see its not showing pictures, just text as usual.
     
  7. dieketzer

    dieketzer Well-Known Member

    this suggests you may have edited a template that is not being used in your active theme. it is not possible for the text usernames to be appearing because all the template code for that has been removed.
     
  8. ddmmh

    ddmmh Well-Known Member

    Thats a little strange considering im using the default template isnt it? I havent made too many mods, most are through XML files, i barley edited any templates and if i did its usually one liners. I dont recall editing this template in particular so I dont know whats going on?? But 100% as of now the template is showing your code in the first page... not sure what else I can do? I really want to use this cool mod
     
  9. dieketzer

    dieketzer Well-Known Member

    if you pm me an admin account i will have a look.
     
  10. dieketzer

    dieketzer Well-Known Member

    im not sure what you feel the problem is. what is it you are expecting to see?

    mmaz.png
     
  11. ddmmh

    ddmmh Well-Known Member

    Im an idiot! I didnt realise that using my admin account i would only see me in the staff online! Sorry long night, thanks mate
     
    dieketzer likes this.
  12. dieketzer

    dieketzer Well-Known Member

    updated to include xfrocks' widget framework.
     
  13. Mutt

    Mutt Well-Known Member

    how does this handle invisible users for staff? right now admins can see invisible users faded out. are the avs faded? just curious
     
  14. dieketzer

    dieketzer Well-Known Member

    one caveat of using the avatars rather than the default text is that invisible users will not give any hint that they are invisible. their avatars will show to the admin as 'visible'. so be careful!
    i plan to redo this once xf goes gold. i will load invisibles' avatars at 60% opacity or whatnot.
     
  15. lms

    lms Well-Known Member

    Thanks. Great mod.

    Salud2
     
  16. BlackMuddler

    BlackMuddler Active Member

    Does the replace code works with RC3? Anyone to confirm..
     
  17. lms

    lms Well-Known Member

    Yes

    Salud2
     
  18. discoian

    discoian Active Member

    Ok I replaced the code on my RC3 install and the online users shows nothing at all now, not even a text link. I have reverted the changes.

    Any ideas?
     
  19. lms

    lms Well-Known Member

    My template sidebar_online_users

    PHP:
    <xen:edithint template="sidebar.css" />

    <
    xen:if hascontent="true">
     <!-- 
    blocksidebar_online_staff -->
     <
    div class="section staffOnline avatarList">
     <
    div class="secondaryContent">
     <
    h3>{xen:phrase staff_online_now}</h3>
     <
    ul>
     <
    xen:contentcheck>
     <
    xen:foreach loop="$onlineUsers.records" value="$user">
     <
    xen:if is="{$user.is_moderator} OR {$user.is_admin}">
     <
    li>
     <
    xen:avatar user="$usersize="s" img="true" />
     <
    xen:username user="$userrich="true" />
     <
    div class="userrank_lms">{xen:helper userTitle$user}</div>
     </
    li>
     </
    xen:if>
     </
    xen:foreach>
     </
    xen:contentcheck>
     </
    ul>
     </
    div>
     </
    div>
     <!-- 
    end blocksidebar_online_staff -->
    </
    xen:if>

    <!-- 
    blocksidebar_online_users -->
    <
    div class="section membersOnline userList">
     <
    div class="secondaryContent">
     <
    h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase members_online_now}</a></h3>
     <
    xen:if is="{$onlineUsers.records}">
     <
    xen:if is="{$visitor.user_id}">
     <
    xen:if hascontent="true">
     <
    h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
     <
    ul class="followedOnline">
     <
    xen:contentcheck>
     <
    xen:foreach loop="$onlineUsers.records" value="$user">
     <
    xen:if is="{$user.followed}">
     <
    li title="{$user.username}class="Tooltip"><xen:avatar user="$usersize="s" img="true" class="_plainImage" /></li>
     </
    xen:if>
     </
    xen:foreach>
     </
    xen:contentcheck>
     </
    ul>
     <
    h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
     </
    xen:if>
     </
    xen:if>

     <
    ol class="followedOnline">
     <
    xen:foreach loop="$onlineUsers.records" value="$useri="$i">
     <
    xen:if is="{$i} <= {$onlineUsers.limit}">
     <
    xen:if is="!{$user.is_moderator} OR !{$user.is_admin}">
     <
    xen:if is="!{$user.followed}">
     <
    xen:if is="{$user.user_id}">
     <
    li title="{$user.username}class="Tooltip"><xen:avatar user="$usersize="s" img="true" class="_plainImage" /></li>
     <
    xen:else />
     {
    xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
     </
    xen:if>
     </
    xen:if>
     </
    xen:if>
     </
    xen:if>
     </
    xen:foreach>
     <
    xen:if is="{$onlineUsers.recordsUnseen}">
     <
    li class="moreLink">... <a href="{xen:link online}" title="{xen:phrase see_all_visitors}">{xen:phrase and_x_more'count={xen:number $onlineUsers.recordsUnseen}'}</a></li>
     </
    xen:if>
     </
    ol>
     </
    xen:if>

     <
    div class="footnote">
     {
    xen:phrase online_now_x_members_y_guests_z'total={xen:number $onlineUsers.total}''members={xen:number $onlineUsers.members}''guests={xen:number $onlineUsers.guests}'}
     </
    div>
     </
    div>
    </
    div>
    <!-- 
    end blocksidebar_online_users -->
    Looks like


    1.png


    Salud2​
     
  20. dieketzer

    dieketzer Well-Known Member

    i am guessing you are having the same issue ddmmh had. he was looking at a blank members online thinking it was a problem without taking into account there were no members other than himself online. remember, the admin account already shows in 'staff online', so you will not show in members online as well. log in with an alt account and you will see your icon in members online.
     

Share This Page