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

Staff online , "Group name" online?

Discussion in 'XenForo Questions and Support' started by Yiit, Jun 10, 2012.

  1. Yiit

    Yiit Member

    Hello , i was trying today to add a new block to my sidebar below the "Staff Online" block. The new block would be just like "Staff Online" , however, it would show if any members of a custom group is online. We have assistant ranks in our forum and i want to create a seperate block to allow users to see if any assistants are online at that time.

    I've tried to create a template called "assist_on" which includes these codes:

        <div class="section assistOnline avatarList">
            <div class="secondaryContent">
                <h3>{xen:phrase assist_online_now}</h3>
                        <xen:foreach loop="$onlineUsers.records" value="$user">
                                                    <xen:if is="{xen:helper ismemberof, $user, 9}">
                                    <xen:avatar user="$user" size="s" img="true" />
                                    <xen:username user="$user" rich="true" />
                                    <div class="userTitle">{xen:helper userTitle, $user}</div>
    The 9 in the line " <xen:if is="{xen:helper ismemberof, $user, 9}">" is the group ID of the assistants group.

    Then in PAGE_CONTAINER i've added this line under sidebar:

    <xen:include template="assist_on" />
    In the end it did show a block much like the "Staff_Online" block. However it just doesn't show when an assistant is online. Any idea how i could fix this? Thanks! :]
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add it to the sidebar in the forum_list template instead of PAGE_CONTAINER. That is where the online records are available.

Share This Page