View Full Version : Conditional statement question
VodkaFish
04-30-2004, 04:22 PM
In my header I have something I want displayed for everyone except one usergroup. What would be the code needed within the header template to wrap that stuff in a "if not this userid then display" sort of statement?
Zachery
04-30-2004, 04:57 PM
In my header I have something I want displayed for everyone except one usergroup. What would be the code needed within the header template to wrap that stuff in a "if not this userid then display" sort of statement?
<if condition="$bbuserinfo[usergroupid] != X"> Show Stuff here r</if>
Change x to the group you dont want it to see :)
VodkaFish
04-30-2004, 05:46 PM
Thank you, I assumed that was the syntax; but wasn't positive.
my guess would have been:
<if condition="$bbuserinfo['usergroupid'] != X"> Show Stuff here r</if>
But I like the assurance :)
btw - you don't need the single quotes around the usergroupid?
also is this proper?:
<if condition="($bbuserinfo[usergroupid] != X) or ($bbuserinfo[usergroupid] != Y)"> Show Stuff here r</if>"> Show Stuff here r</if>
Zachery
04-30-2004, 05:47 PM
No, you NEVER use single quotes inside conditionals
VodkaFish
04-30-2004, 05:48 PM
Wow, you got me before my edit. Thanks for the reply again :)
VodkaFish
05-02-2004, 09:46 PM
I forgot I will be using this as a secondary usergroup. membergroupids is the variable, correct? But in an array. Is it possible to use a single conditional to do this? An "if not member of X"?
Zachery
05-02-2004, 10:12 PM
youll need to use !is_member_of($bbuserinfo, X) instead of what i have above
SVTBlackLight01
05-02-2004, 10:15 PM
No, you NEVER use single quotes inside conditionals
I'm confused. Here are some examples from the vb manual and they are using single quotes. :confused:
http://www.vbulletin.com/docs/html/main/template_conditionals
VodkaFish
05-02-2004, 10:32 PM
I attempted to use this:
<if condition="!is_member_of($bbuserinfo[membergroupids], 12)">
However, whatever is in-between the <if></if> still shows for members in the secondary group id of 12. I then took away the other secondary usergroups that the member belonged to as a test, but it still shows.
Zachery
05-02-2004, 10:34 PM
I attempted to use this:
<if condition="!is_member_of($bbuserinfo[membergroupids], 12)">
However, whatever is in-between the <if></if> still shows for members in the secondary group id of 12. I then took away the other secondary usergroups that the member belonged to as a test, but it still shows.
No, as i posted it
!is_member_of($bbuserinfo, 12)
Is what you are going to use.
T3MEDIA
01-23-2005, 10:38 PM
No, as i posted it
!is_member_of($bbuserinfo, 12)
Is what you are going to use.
Slightly off topic... how would you do it if you wanted secondary uergroups to see it only?
say usergroup from 10-15. I HAVE NO idea how to do this. been seraching and this is the closest I have found.
VodkaFish
01-23-2005, 10:49 PM
Slightly off topic... how would you do it if you wanted secondary uergroups to see it only?
say usergroup from 10-15. I HAVE NO idea how to do this. been seraching and this is the closest I have found.
It works the same way, is_member_of checks all usergroups, not just primary.
T3MEDIA
01-25-2005, 12:33 AM
It works the same way, is_member_of checks all usergroups, not just primary.
On forum home is there a way to target each user in that array?
What I want to do is to put a pic for each user that has something in their profile field.
mild bump if anyone else knows.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.