View Full Version : condition
Speysider
12-02-2009, 02:08 PM
I want a link in the navbar to only appear if a user is in a usergroup called Banned Users, allowing them to appeal their ban.
What's the <if condition> statement for this? <if condition=???> Fill in the ???
ChopSuey
12-02-2009, 02:19 PM
<if condition="is_member_of($vbulletin->userinfo, 8)"></if>
Lynne
12-02-2009, 02:23 PM
<if condition="is_member_of($bbuserinfo, x)">
link
</if>
I thin that should work. Change x to the banned usergroup id.
Speysider
12-02-2009, 02:25 PM
Thanks Lynne and ChopSuey =)
--------------- Added 1259771256 at 1259771256 ---------------
If I want other usergroups to see the link, do I put a comma after the last usergroup id?
eg 22,6,8 ?
ChopSuey
12-02-2009, 02:30 PM
Add a comma and a space. Like
<if condition="is_member_of($vbulletin->userinfo, 8, 6, 2)"></if>
Speysider
12-02-2009, 02:39 PM
thanks. You don't need to put a space.
Lynne
12-02-2009, 03:29 PM
No, you don't *nned* to put a space, however it is good practice to do so. See the manual - Use of Spaces (http://www.vbulletin.com/docs/html/codestandards_spaces):
Function arguments should have a space after each comma.
Speysider
01-14-2010, 12:07 PM
Okay, thanks guys.
Another question using the condition statement: how would I go about setting up a conditional or a piece of code that hides the forums that moderators moderate if that user isn't in that usergroup (registered users)? I want the entire list of forums to appear to anyone else, but not the registered users (there's a setup that allows members to go into hogwarts houses.)
Lynne
01-14-2010, 02:09 PM
What do you mean that "hide the forums that moderators moderate"? You would use Forum Permissions to not show forums to other usergroups.
Speysider
01-14-2010, 03:16 PM
What do you mean that "hide the forums that moderators moderate"? You would use Forum Permissions to not show forums to other usergroups.
Sorry, I didn't say it properly.
How would I go about setting up a conditional or a piece of code that hides the forums that moderators moderate if that user isn't in that usergroup (registered users) on the Show Groups page? I want the entire list of forums to appear to anyone else, but not the registered users (there's a setup that allows members to go into hogwarts houses) on the Show Groups page.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.