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

Conditionals not working for specific usergroup

Discussion in 'Troubleshooting and Problems' started by Ingenious, Feb 18, 2012.

  1. Ingenious

    Ingenious Well-Known Member

    I have added an additional "Staff online" sidebar, but called "Sponsors online" which I only want to list members online who are in usergroup 6.

    I am using this code:

    Code:
    <!-- block: sidebar_online_sponsors -->
    <xen:if hascontent="true">
        <div class="section staffOnline avatarList">
            <div class="secondaryContent">
                <h3>Sponsors Online Now</h3>
                <ul>
                    <xen:contentcheck>
                        <xen:foreach loop="$onlineUsers.records" value="$user">
                            <xen:if is="{xen:helper ismemberof, $visitor, 6}">
                                <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>
    </xen:if>
    <!-- end block: sidebar_online_sponsors -->
    
    But ALL on-line members are showing there, even if they are not members of usergroup 6.

    What have I done wrong here please?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
                            <xen:if is="{xen:helper ismemberof, $visitor, 6}">
    
    Use $user instead of $visitor.
     
    Ingenious likes this.
  3. Ingenious

    Ingenious Well-Known Member

    Thanks Jake, works :)
     

Share This Page