View Full Version : Show conditional on usergroup
Goatpod
06-27-2007, 12:53 PM
Hi, hopefully this is an easy one :)
When someone subscribes to my forum they're given a little red medal in their postbit. Currently I have to manually input the file name into a field in their profile via the admincp for the medal to show.
I'm sure I should be able to automate the process using an <if> </if> statement in the process but I'm unsure as to the exact syntax to use.
As usual, any help for this bear of little brain would be greatly appreciated.
Thanks
Dave
dyna88
06-27-2007, 01:10 PM
You want the medal to show if they are a registered member then???
How about...
<if condition="$show['member']">
medal code here
</if>
Goatpod
06-27-2007, 01:19 PM
You want the medal to show if they are a registered member then???
How about...
<if condition="$show['member']">
medal code here
</if>
Thanks Dyna88 :) The medal should only show if they're a member of the Subsciber usergroup (sorry, I should have mentioned they move usergroup automatically when they sign up to a subscription).
So would....
<if condition="$show['subscriber']">
medal code here
</if>
do it if 'subscriber' is the name of the user group?
Cheers
Dave
dyna88
06-27-2007, 01:24 PM
<if condition="$show['member']">
medal code here
</if>
Will show for everyone except guests
If you want it to show just for one usergroup you would use
<if condition="is_member_of($bbuserinfo, X)">
medal code here
</if>
Replace the X with the usergroup ID number
Goatpod
06-27-2007, 01:33 PM
Many thanks for your quick responses Dyna88, you're a star :)
Will run off and try it now.
Cheers
Dave
I used:
<if condition="is_member_of($bbuserinfo, 31)">
<img src="submed.gif">
</if>
31 is the number of the Subscriber usergroup, but the code just gave medals to all the members!
Can anyone spot what I've done wrong?
Thanks
Dave
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.