View Full Version : Only show for X usergroup
Osterling
09-23-2007, 05:43 PM
In the template system, if I want only the Register group to see something, how can I do that?
Lynne
09-23-2007, 06:27 PM
<if condition="is_member_of($bbuserinfo, 2)">
SEE THIS IF REGISTERED
</if>
However, that will only show it for Registered Users, not Super Mods or Admins (assuming you put SMs and Admin as primary users in the SM or Admin group). So, you may want to go:
<if condition="in_array($bbuserinfo[usergroupid], array(2,5,6,7))">
SHOW TO REGISTERED USERS, MODERATORS, SUPER-MODS, AND ADMINS
</if>
Opserty
09-23-2007, 06:44 PM
You can still use the is_member_of() function for multiple usergroups
E.g.
<if condition="is_member_of($bbuserinfo, 2, 5, 6, 7)">
SHOW TO REGISTERED USERS, MODERATORS, SUPER-MODS, AND ADMINS
</if>
P.s. the is a closing double quote missing before the '>' on the first line of Lynee's first piece of code.
Brandon Sheley
09-23-2007, 06:46 PM
Here is a nice list of vBulletin Template Conditionals List (http://forum.vbulletinsetup.com/f66/vbulletin-template-conditionals-list-2185.html) that a user had posted.
Osterling
09-23-2007, 06:50 PM
Thank you.
Lynne
09-23-2007, 07:05 PM
You can still use the is_member_of() function for multiple usergroups
P.s. the is a closing double quote missing before the '>' on the first line of Lynee's first piece of code.
Good to know about the is_member_of() and thanks for pointing out the missing quote. :up:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.