Resource icon

Add usergroups to Staff online now

Rost35

Member
Rost35 submitted a new resource:

Add usergroups to Staff online now (version 1.0) - add usergroups to staff online now, without extra permissions

It is my first official XenForo-Code modification, it is really easy. But maybe you have to use it, I do not know ;).

Have fun and enjoy it!

Description:
You can add usergroups to the "staff online now"-sidebar without giving them moderative or administrative permissions.


Direction:

  1. Open the template "sidebar_online_users"
  2. Find
    Code:
    <xen:if is="{$user.is_moderator} OR {$user.is_admin}">
  3. You have to add at the end e.g.:
    Code:
     OR...

Read more about this resource...
 
Code:
<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">

Don't work for me... :(
 
Code:
<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">

Don't work for me... :(
Only user groups does work with that code. If you want to put some Users, you have to you an other code.

Can you send me an URL to your forum?

To find the right user group ID:

  1. Go to the ACP
  2. -> Users (http://www.yourdomain.com/admin.php?users/)
  3. -> User groups (http://www.yourdomain.com/admin.php?user-groups/)
  4. hover your user group, than you can see an ID and fill in the code (e.g.):
screen.webp
 
Only user groups does work with that code. If you want to put some Users, you have to you an other code.

Can you send me an URL to your forum?

To find the right user group ID:

  1. Go to the ACP
  2. -> Users (http://www.yourdomain.com/admin.php?users/)
  3. -> User groups (http://www.yourdomain.com/admin.php?user-groups/)
  4. hover your user group, than you can see an ID and fill in the code (e.g.):
But this is a user group nor a single user...
http://www.immobilio.it/admin.php?user-groups/membri-dello-staff.37/edit
 
This is the code...

Code:
        <!-- block: forum_stats -->
        <div class="section membersOnline userList">
            <div class="secondaryContent statsList" id="boardStats">
                <div id="totalforumstatscontainer">
                    <div class="totalforumstats">
                        <div style="float:left;padding-right: 10px;">
                            <div class="utenti48"></div>
                        </div>   
                        <div style="float:right;">
                            <p class="forumstatsnumber">{xen:number $boardTotals.users}</p>
                            <p class="forumstatsname">{xen:phrase members_count}</p>
                        </div>
                    </div>
               
                    <div class="totalforumstats">
                        <div style="float:left;padding-right: 10px;">
                            <div class="forum48"></div>
                        </div>
                        <div style="float:right;">
                            <p class="forumstatsnumber">{xen:number $boardTotals.discussions}</p>
                            <p class="forumstatsname">{xen:phrase discussions}</p>
                        </div>
                    </div>
                   
                    <div class="totalforumstats">
                        <div style="float:left;padding-right: 10px;">
                            <div class="statistiche44"></div>
                        </div>   
                        <div style="float:right;">
                            <p class="forumstatsnumber">{xen:number $boardTotals.messages}</p>
                            <p class="forumstatsname">{xen:phrase messages}</p>
                        </div>
                    </div>
                <div>
            </div>
        </div>
       
<!-- Inserire qui gli utenti iscritti del giorno -->
 
<!-- <xen:include template="borbole_today_registrations" /> -->
 
        <!-- <div style="text-align: center;">Diamo il Benvenuto a <i><xen:username user="$boardTotals.latestUser" /></i>, il nostro ultimo iscritto!</div> -->   
<!-- Questi sono i due div del precedente template -->
    </div>
</div>
<!-- / -->
 
<!-- end block: forum_stats -->
 
<!-- block: sidebar_online_users -->
        <div class="section membersOnline userList">       
            <div class="secondaryContent">
                <xen:if is="{$onlineUsers.records}">
               
                    <xen:if is="{$visitor.user_id}">
                        <xen:if hascontent="true">
                            <p style="font-size:14px;padding-bottom:5px;"><a href="{xen:link account/following}">Utenti Online che stai seguendo:</a></p>
                            <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>
                   
<!-- block: Staff online now -->                   
                    <xen:if hascontent="true">
                        <p style="font-size:14px;padding-bottom:5px;">{xen:phrase staff_online_now}:</p>
                        <ul class="staffonlinelist">
                            <xen:contentcheck>
                                <xen:foreach loop="$onlineUsers.records" value="$user">
                                    <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">
                                        <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>
<!-- End block: Staff online now -->
                   
                    <h2 class="minorHeading" style="padding: 10px 0 10px 0;font-size:16px;"><a href="{xen:link online}">
                    {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></h2>   
                   
                    <xen:comment>           
                          <ol class="listInline" style="font-size:11px;">
                            <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:comment>
                </xen:if>
<!-- end block: sidebar_online_users -->
 
<!-- Inizio Who has visited -->
    </div>
<xen:if is="{$XenTrCom_WhoHasVisited}">
 
    <xen:if hascontent="true">
        <div class="section WhoHasVisited userList">
            <div class="secondaryContent">
                <xen:if is="{$xenOptions.xentrcom_whohasvisited_set} == 1">
                    <h2 class="minorHeading" style="padding: 10px 0 10px 0;font-size:16px;">Da ieri a quest'ora hanno visitato la Community {$XWhoHasVisited.count} Utenti Registrati </h2>
                <xen:else />
                    <h2 class="minorHeading" style="padding: 10px 0 10px 0;font-size:16px;">{xen:phrase xen_tr_com_who_has_visited_today}: {$XWhoHasVisited.count}</h2>
                </xen:if>
              <!--
<ol class="listInline" style="font-size:11px;">
                    <xen:contentcheck>
                        <xen:foreach loop="$XenTrCom_WhoHasVisited" value="$XWhoHasVisited" i="$limit">
                            <xen:if is="{$limit} <= {$xenOptions.xentrcom_whohasvisited_limit}">
                                <li>
                                    <xen:username user="$XWhoHasVisited.user" rich="true" class="Tooltip" title="{xen:date {$XWhoHasVisited.user.last_activity}, 'H:i'}" /><xen:if is="{$limit} < {$xenOptions.xentrcom_whohasvisited_limit} AND {$limit} < {$XWhoHasVisited.count}">,</xen:if>
                                </li>
                            </xen:if>
                        </xen:foreach>
                    </xen:contentcheck>
                    <xen:if is="{$limit} > {$xenOptions.xentrcom_whohasvisited_limit}">
                        <li class="moreLink">... <a href="{xen:link WhoHasVisited}" title="{xen:phrase xen_tr_com_who_has_visited_seeall}">{xen:phrase xen_tr_com_who_has_visited_morelink, 'number={xen:number $XWhoHasVisited.more}'}</a></li>
                    </xen:if>
                </ol>
-->
            </div>
        </div>
    </xen:if>
</xen:if>
</div>
<!-- Fine Who has visited -->
 
Your code:
Code:
<xen:contentcheck>
                                <xen:foreach loop="$onlineUsers.records" value="$user">
                                    <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">
                                        <li title="{$user.username}" class="Tooltip">
                                        <xen:avatar user="$user" size="s" img="true" />
                                        </li>
                                        </xen:if>
                                </xen:foreach>
                                </xen:contentcheck>

Try to use my code, please:
Code:
<xen:contentcheck>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">
                            <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>


_______
And did you edited all of your designs (=template "sidebar_online_users")?
 
Your code:
Code:
<xen:contentcheck>
                                <xen:foreach loop="$onlineUsers.records" value="$user">
                                    <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">
                                        <li title="{$user.username}" class="Tooltip">
                                        <xen:avatar user="$user" size="s" img="true" />
                                        </li>
                                        </xen:if>
                                </xen:foreach>
                                </xen:contentcheck>

Try to use my code, please:
Code:
<xen:contentcheck>
                    <xen:foreach loop="$onlineUsers.records" value="$user">
                        <xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 37">
                            <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>


_______
And did you edited all of your designs (=template "sidebar_online_users")?

Don't work... :(
 
You know that they have to be online?

Is it possible to get me an account - I will have a look in your template
 
Back
Top Bottom