XF 2.1 Members Online separated by UserGroup


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:
<h4 class="block-textHeader block-textHeader--scaled">
    {{ phrase('members') }}

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

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....

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

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