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.

Add Staff Online into Members Online

Discussion in 'Template Modifications [Archive]' started by Russ, Nov 25, 2010.

Thread Status:
Not open for further replies.
  1. Russ

    Russ Well-Known Member

    End Result:
    jamie.png

    Open sidebar_online_users:

    Replace entire code with:

    Code:
    <xen:edithint template="sidebar.css" />
    
    <!-- block: sidebar_online_staff -->
    <!-- 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 hascontent="true">
                    <h4 class="minorHeading">{xen:phrase staff_online_now}</h4>
                <ul class="staffonlinelist">
                    <xen:contentcheck>
                        <xen:foreach loop="$onlineUsers.records" value="$user">
                            <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                                <li title="{$user.username}" class="Tooltip">
                                    <xen:avatar user="$user" size="s" img="true" />
                                </li>
                            </xen:if>
                        </xen:foreach>
                    </xen:contentcheck>
                </ul>
    <div style="clear:both;"></div>
    </xen:if>
    
            <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>
                    </xen:if>
                </xen:if>
                    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
                <ol class="listInline">
                    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
                            <li>
                            <xen:if is="{$user.user_id}">
                                <a href="{xen:link members, $user}"
                                    class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                            <xen:else />
                                {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                            </xen:if>
                            </li>
                        </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_staff -->
    <!-- end block: sidebar_online_users -->
    
    Final step - in extra.css add->

    Code:
    .staffonlinelist li {
    float: left;
    margin-top: 3px;
    }
    .staffonlinelist img {
    height: 32px;
    width: 32px;
    margin-right:5px;
    padding: 2px;
    }
    
    NOTE*** If you made edits to your sidebar_online_users already take caution when using this modification as this redoes the entire bit of code in it. If customizations you'd have to go back and re-do them using this method above.
     
    Warning, Moddis, Archet and 20 others like this.
  2. ArnyVee

    ArnyVee Well-Known Member

    Very nice consolidation. May have to go this route :)
     
  3. iTuN3r

    iTuN3r Well-Known Member

    Nice work :)
     
  4. kkm323

    kkm323 Well-Known Member

    great little code
    very useful
    installed=liked
     
  5. Mutt

    Mutt Well-Known Member

  6. iXanon

    iXanon Active Member

    Much, much better IMHO. Should be default behavior.. (y)
     
  7. Daniel Hood

    Daniel Hood Well-Known Member

    where is the first file you mentioned? Like what's the full path?
     
  8. Russ

    Russ Well-Known Member

    In the appearance tab, templates then under:

    sidebar_online_users:

    Also... rather than adding that snippit of code to:

    Final step - in xenforo.css add->

    Add it to extra.css, i've updated the original post.
     
  9. Daniel Hood

    Daniel Hood Well-Known Member

    The template files aren't hard coded?
     
  10. Vincent

    Vincent Well-Known Member

    Why should they be?
    Else we couldn't edit things in our installation.
     
  11. Daniel Hood

    Daniel Hood Well-Known Member

    I mean.. all of it? Like it's all saved in databases editable through admin cp only?
     
  12. dieketzer

    dieketzer Well-Known Member

    wow! its like you came straight from scriptkeeper ;)
    yes, they are editable through the acp.
     
  13. Daniel Hood

    Daniel Hood Well-Known Member

    wow! its like I don't typically use premade software. ;)
    okay, nice to know. Also didn't help that I couldn't access the admin page for some strange reason.
    Thanks.
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    For future reference, only avatars and attachments are stored in the file system.
     
  15. Daniel Hood

    Daniel Hood Well-Known Member

    Now that I have full access to an admin cp, it all makes sense. Thanks.
     
    Vincent likes this.
  16. iXanon

    iXanon Active Member

    Suggestion: Re-add the template "block" comments for "sidebar_online_users", some addons with automatic template edits search for them.
     
    bambua likes this.
  17. spiderman

    spiderman Member

    Hi have installed your template modification, however, nothing changed

    show pic
     

    Attached Files:

  18. Russ

    Russ Well-Known Member

    Replaced sidebar_online_users with the updated code in my first post, apologies :). I've added those little block comments back in.
     
  19. karoshio

    karoshio Active Member

    How would i go about changing it so that no avatars are shown and it just lists the staff and doesn't show people you follow at all?
     
  20. Russ

    Russ Well-Known Member

    Replace entire code with:

    HTML:
    <xen:edithint template="sidebar.css" />
    
    <!-- block: sidebar_online_staff -->
    <!-- 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 hascontent="true">
                    <h4 class="minorHeading">{xen:phrase staff_online_now}</h4>
                <ul class="staffonlinelist">
                    <xen:contentcheck>
                        <xen:foreach loop="$onlineUsers.records" value="$user">
                            <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
                                <li title="{$user.username}">
                                    <a href="{xen:link members, $user}">{$user.username}</a>
                                </li>
                            </xen:if>
                        </xen:foreach>
                    </xen:contentcheck>
                </ul>
    <div style="clear:both;"></div>
    </xen:if>
    
            <xen:if is="{$onlineUsers.records}">
                    <h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
                <ol class="listInline">
                    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
                            <li>
                            <xen:if is="{$user.user_id}">
                                <a href="{xen:link members, $user}"
                                    class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                            <xen:else />
                                {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                            </xen:if>
                            </li>
                        </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_staff -->
    <!-- end block: sidebar_online_users -->
    
     
Thread Status:
Not open for further replies.

Share This Page