The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
checking usergroups
how do I check for a members usergroup, I want to make my ads only appear for certain usergroups
|
#2
|
||||
|
||||
the is_member_of function may help ya
|
#3
|
|||
|
|||
can I use that in a template?
like I want: if (!is_member_of("gold")) { // display ads } Is that right? |
#4
|
||||
|
||||
yes you should be able to use it in a template.
but instead of the 'gold' you have to use the usergroupid of the usergroup |
#5
|
|||
|
|||
hmmm well, this did not work, I wanted the ads to show for every usergroup except group10
<if condition="!is_member_of($post, 10)"> so then I tried to set an array for the if to affect all usergroups besides 1o, still didn't work <if condition="is_member_of($post, array(1, 2, 3, 9))"> how can I accomplish this? |
#6
|
||||
|
||||
Xenon, how to check usergroups in template conditions ?
|
#7
|
||||
|
||||
Code:
// ###################### Start is member of ####################### // returns true/false if a $userinfo belongs to $usergroupid // $userinfo must contain (userid, usergroupid, membergroupids) function is_member_of($userinfo, $usergroupid) |
#8
|
||||
|
||||
sorry for my bad but I still didn't understand how yet.
I actually want to check if usergroup id = 6 ( admin ), then it will display an image showing that user belong to admin group. Same for that to my Fan Club Group. |
#9
|
||||
|
||||
HTML Code:
<if condition="is_member_of($post, specific id here)"><img....</if> |
#10
|
||||
|
||||
kooool !
It worked ! Thank you so much Xenon ! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|