Log in

View Full Version : Hiding certain link in the navbar from certain usergroups?


Radthekid
09-02-2010, 12:11 AM
I recently installed a plugin that showed a list of banned members and it is only for admin and mod to see and the are the only ones with permissions to see it, but the link for the list is in Quick Links so I was wondering, how do I hide this link from certain usergroups?

Lynne
09-02-2010, 12:41 AM
You would need to put a condition around the link. If it's in a template, then put this around it (change X, Y, Z to the usergroups you want to hide it from):
<if condition="!is_member_of($bbuserinfo, X, Y, Z)">
link to show if you aren't a member of usergroups X, Y, Z
</if>
If it's plugin code, you'll have to use php:
if (is_member_of($vbulletin->userinfo, X, Y, Z)) {
link to show if you aren't a member of usergroups X, Y, Z
}
If you don't know where the code it, the place to ask for help is in the modification thread since they are the ones who would know.

FASEOFMARS
09-02-2010, 12:07 PM
thanks for this lynne, made good use of it hiding all the sub-navtabs from guests..

as i force guests to register, i figure the only tab they should see is the forum one..

one thing though i believe the tags need to be </vb:if> and not </if>

Lynne
09-02-2010, 02:58 PM
one thing though i believe the tags need to be </vb:if> and not </if>
This is the vB3 forum, so it should be </if>

If you just want the condition for "guests" instead of having to write out the usergroupids, you can just use:
<if condition="$show['guest']">
stuff only to show non logged in users
</if>