1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Variable for registered group

Discussion in 'XenForo Questions and Support' started by najaru, Oct 9, 2010.

  1. najaru

    najaru Active Member

    i have see in sidebar_online_users that i can select staff only with:
    <xen:if is="{$user.is_moderator} OR {$user.is_admin}">

    how can i select only registred user and not staff and not guest?

    thanks

     
  2. borbole

    borbole Well-Known Member

    Try this

    Code:
    <xen:if is="{$visitor.user_id}">
    <!-- Your code for the logged in user -->
    </xen:if>
    
     
    Sumo likes this.
  3. najaru

    najaru Active Member

    no. with this i have also admin and mod.....
     
  4. borbole

    borbole Well-Known Member

    That is the var for the logged in users and not mods and/or any other groups. Can you tell us what is it exactly that you are trying to do?
     
  5. najaru

    najaru Active Member

    yes, i want to modify the sidebar_user_online, and display only NON staff user. and not admin and mod
     
  6. borbole

    borbole Well-Known Member

    In that case remove or comment the following code:

    Code:
    <xen:if hascontent="true">
        <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" />
                                    <a href="{xen:link members, $user}" class="username">{xen:helper richUserName, $user}</a>
                                    <div class="muted">{xen:helper userTitle, $user}</div>
                                </li>
                            </xen:if>
                        </xen:foreach>
                    </xen:contentcheck>
                </ul>
            </div>
        </div>
    </xen:if>
     
  7. najaru

    najaru Active Member

    no :)
    i want to leave this block of staff with avatar, but i dont want that the staff is visible in lower list.....
     
  8. borbole

    borbole Well-Known Member

    Change this code:

    Code:
    <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>
    to this:


    Code:
    <xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
                        <xen:if is="{$i} <= {$onlineUsers.limit}">
                            <li>
    <xen:if is="!{$user.is_moderator} OR !{$user.is_admin}">
                            <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>
                          </xen:if>
                            </li>
                        </xen:if>
                                         
                    </xen:foreach>
     
    najaru likes this.
  9. najaru

    najaru Active Member

    perfect thanks
     
  10. najaru

    najaru Active Member

  11. borbole

    borbole Well-Known Member

    You are welcome. Glad to have been of help.
     

Share This Page