The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditionals
Hi all. I'm new to this vB skinning thing and I have a question. Is it possible to limit if something (like ad sections) are shown based on a usergroup?
I.e.: If a user pays for a subscription to my forum, I'd like to remove the ads; however, they should be visible to everyone else that's not in the "subscriber" group. Is this possible? And if so, how? |
#2
|
||||
|
||||
In the template, put this code around the ad:
HTML Code:
<if condition="!is_member_of($bbuserinfo, x)"> Ad for users not in in usergroupid x </else> Stuff for users in all other usergroups </if> HTML Code:
<if condition="!is_member_of($bbuserinfo, x)"> Ad for users not in in usergroupid x </if> |
#3
|
|||
|
|||
Thanks for your help. I figured it would be something as easy as that.
Is the "X" the usergroup ID? |
#4
|
||||
|
||||
Whoops, yes, the x is the usergroup id.
|
#5
|
|||
|
|||
If this doesn't work, another way would be:
Code:
<if condition="$bbuserinfo[usergroup] = X"> |
#6
|
|||
|
|||
What about multiple conditions? I.e. can I use the typical php operator "||" and "&&" to make:
<if condition="!is_member_of($bbuserinfo, 26) || !is_member_of($bbuserinfo, 6)"> <!-- Ad Code --> </if> I.e. If they're not a member of "subscriptions" or "admin" then show the ads. |
#7
|
||||
|
||||
<if condition="!is_member_of($vbulletin->userinfo, 6,26)">
|
#8
|
|||
|
|||
Well that was easy!
|
#9
|
||||
|
||||
It usually is.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|