• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Staff Online - Show More Than "Admins" and "Mods"

subtato

Active member
Instead of having just "Administrative" and "Moderating" as the two groups on the forum home, how about adding another usergroup?

It's rather easy. It requires one template edit, and finding the user_group_id of another group. :)
or if we push hard enough, we should be able to get it... :p

First:
Find the usergroup id.
Go to your Admin CP > Users Tab > List User groups.
Select the group you want, as if you were going to edit the usergroup.
Now, in the url, you'll see something like this:
yourdomain.org/admin.php?user-groups/administrative.3/edit
You need to be looking at: /administrative.3/
3 is your usergroup id for that group.
Once you've figured that out, you can move onto step two.

Second (and finally):
Go to your Templates Editor (under the Appearance tab) and find "sidebar_online_users"
Find:
HTML:
<xen:if is="{$user.is_moderator} OR {$user.is_admin}">
After the last } add:
PHP:
OR {$user.user_group_id} == YOUR_USERGROUP_ID_HERE
so, I would put 5 in my template, because the usergroup id of my "trusted members/moderators" is 5. Yours will most likely differ.

Once you are done, you should have the output as such:
Screenshot.webp

Enjoy :)
 
Hi

this is really nice work.

I've got one question:

Does this term:
PHP:
OR {$user.user_group_id} == YOUR_USERGROUP_ID_HERE

work for both primary and secondary group? I tried this and for me I think this work only for primary group-members. Thank for help!

Benny
 
Primary usergroup only.

See:
Note that user_group_id only stores the primary usergroup id of a user; so you are only comparing the primary usergroup in the code above. Secondary usergroup id's are stored as a comma separated list in the secondary_group_ids field; but I haven't come across any native template helper that we can use here.
 
hmm, I can't get this to work. I'm trying to add my mods to the staff online box, who are 'secret mods' ie. not 'made a moderator' but given moderating as primary usergroup. The number for the moderating usergroup is 4.

So this is what I've put into the template:

<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.4}">

what am I doing wrong?
 
It needs to be like this Jo:

<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 4">
 
  • Like
Reactions: Jo.
This is fantastic, I actually used this the other way around. I didn't want to show as staff so removed this " OR {$user.is_admin}" and all is fine now. :)
 
It needs to be like this Jo:

<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 4">
Ciao Brogan, non riesco a far funzionare la MOD con la versione RC5.
Se elimino MOD o Admin funziona, ma se aggiungo un ID non succede niente.....
E' cambiato qualcosa?

Google Translate
HelloBrogan, I can notrun themodwith theRC5version.
If I deleteMOD orAdminworks, butif I addan IDnothing happens.....
And'anything changed?
HTML:
<xen:if is="{$user.is_moderator} OR {$user.is_admin} OR {$user.user_group_id} == 17">
 
Top Bottom