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.

Make Staff Online with no name or title

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

  1. Russ

    Russ Well-Known Member

    End Result"
    staff2.png

    In sidebar_online_users

    Find:

    Code:
    <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" />
                                    <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>
    
    Replace with:

    Code:
    <xen:if hascontent="true">
        <!-- block: sidebar_online_staff -->
        <div class="section staffOnline avatarList">
            <div class="secondaryContent">
                <h3>{xen:phrase staff_online_now}</h3>
                <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>
            </div>
        </div>
        <!-- end block: sidebar_online_staff -->
    </xen:if>
    


    Final step in xenforo.css

    Add:

    Code:
    .staffonlinelist li {
    float: left;
    }
    .staffonlinelist img {
    height: 32px;
    width: 32px;
    margin-right:5px;
    padding: 2px;
    }
    
    Any further questions feel free to ask!
     
  2. Vincent

    Vincent Well-Known Member

    For some strange reason this doesn't work with my beta 4 :(
     
  3. Russ

    Russ Well-Known Member

    Updated for beta 4, try those edits and tell me how it goes. Tested on IE and FF for the new code.
     
  4. Vincent

    Vincent Well-Known Member


    It works, but can I make the images a little bit bigger? Like the normal size of how they were :D
     
  5. Russ

    Russ Well-Known Member


    No size adjustments we're made in my edits but you can adjust the avatar size through style properties.

    Style Properties -> Sidebar -> Avatar List Avatar -> Miscellaneous
     
  6. bogus

    bogus Guest

    Nice one. Thanks.
    How can i get groups displayed, i added myself, e.g.: supporter, helper?
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Try changing: <xen:if is="{$user.is_moderator} OR {$user.is_admin}">

    To: <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 4">

    Where 4 is the usergroup ID.
     
  8. bogus

    bogus Guest

    Thanks for your help all time. Appreciated

    But its not working
    Code:
    <xen:if  is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id}  == 13"> OR {$user.user_group_id} == 12">

    Where 12 is supporter
    and the display is

    Staff online now
    OR 3 == 12">
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Remove the > after the 13"
     
  10. bogus

    bogus Guest

    Upps, did not saw that ;)
    Thanks
    Hmm. Its not displaying an avatar....
    Group Supporter and Helper are first Usergroups

    Just recognized that, if u test Userrights, it wont be displayed. The User has to be really online ;)
     
  11. Michael Dance

    Michael Dance Active Member

    Ok, i loved this idea, but i wanted it for the Members online instead of the username.
    So i used this code. You can just replace the old:

    Replace:
    Code:
    <!-- 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" /></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="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'}">{xen:helper richUserName, $user}</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_users -->
    With:
    Code:
    <!-- 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" /></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="listInline">
                    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
                            <li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></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_users -->
    Wasn't sure if you like it.
    [​IMG]
     

Share This Page