XF 2.1 Members Online separated by UserGroup

xSean

Member
Trying to have "Members Online" completely replace "Staff Online" and running into an issue.
While I can have it split up each row by group, what I now am trying to get it to do is label each row properly.

By default it lists all members as "Members" by using:
Code:
<h4 class="block-textHeader block-textHeader--scaled">
    {{ phrase('members') }}
</h4>

and so I then made a new phrase and placed it above the row that would display all administrators
Code:
<h4 class="block-textHeader block-textHeader--scaled onlineAdmin">
    {{ phrase('onlineAdmin') }}
</h4>

But I need to have that phrase ONLY display if there are Administrators online, similar to how the entire list only displays if "is="$online.users is not empty">".

So... how would I go about that?
I would also need to have this work for other usergroups (and not just admins / staff / moderators).


Side note:
Also trying to get it to say "Member" instead of "Members" and "Guest" instead of "Guests" when each value for online is 1.
 
Last edited:
Seems like I'm close to something....

Code:
<xf:foreach loop="$online.users" value="$users">
        <xf:if is="$users.user_group_id == 3">
DisplayText
    </xf:if>
</xf:foreach>

But main issue is that it would then show "DisplayText" for as many times as there are people online within that group ID.
 
Back
Top Bottom