The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Need a <if> conditional
Hello I'm looking for a conditional where say I just want to show ads to registered users(doesn't make sense ), and not anyone else, what would the <if> conditional be for this?
Also say I want to show ads to just admins, moderators, and registered users, what is the conditional for this? Thanks in advance |
#2
|
||||
|
||||
The conditional to show it to your registered users is this:
HTML Code:
<if condition="$show['member']"> </if> |
#3
|
||||
|
||||
Thanks, would this only show it to "registered users" and no one else?
As well how would I show it to both registered users and admins? Thanks so much |
#4
|
||||
|
||||
Code:
<if condition="$bbuserinfo['usergroupid']==2"> CODE FOR REGISTERED USERS </if> Code:
<if condition="$bbuserinfo['usergroupid']==2"> Show if usergroup id is 2 <else /> Show if usergroup id is not 2 </if> |
#5
|
||||
|
||||
Thanks Attilitus, so with the first code, say I want to display to both registered users and admins,
for the usergroupid, could i put ==2, 6"> ? to show to both admin/registered user? and does this only show the add to the admin/registered user and no one else? Thanks alot |
#6
|
||||
|
||||
That would be correct.
|
#7
|
||||
|
||||
actually thats completely wrong :-p
what you want is... HTML Code:
<if condition="is_member_of($vbulletin->userinfo, X)"> members of that group only see this... </if> is_member_of($vbulletin->userinfo, X, Y, Z..) dont use the dots, but basically add more usergroup ids with commas |
#8
|
||||
|
||||
You can actually use either one, just the one you posted Darkwaltz4, also checks the secondary usergroup of the users
|
#9
|
||||
|
||||
no what i meant by what is wrong, is what you said was right, this:
==2, 6"> is bad php :-p, and doesnt check multiple usergroups. at the very least it would need PHP Code:
PHP Code:
|
#10
|
||||
|
||||
Thanks guys, this is very useful!, now I have ads that I do not want to show to one usergroup, what would the conditional be to not show ads to this one usergroup?
Thanks so much |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|