View Full Version : Any conditionals experts out there? I need assistance...
Sal Collaziano
10-28-2005, 08:37 PM
I'd like to display information at the very top of my forum - different for guests, registered members and supporting members. Am I on the right track with the code I've typed below? It doesn't work for me so would somebody mind helping me out?
Thanks in advance...
<if condition="$bbuserinfo['userid'] == 1">
<p>guest</p>
<else />
<if condition="$bbuserinfo['userid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Guests get "not guest or registered".
I'm in my own usergroup and I get "guest".
Any help would be appreciated...
peterska2
10-28-2005, 08:51 PM
Try
<if condition="$show[registerbutton]">
<p>Guest</p>
<else />
<if condition="$bbuserinfo['usergroupid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Note: This only works in the navbar. Elsewhere it may have to be tweaked.
Sal Collaziano
10-30-2005, 12:54 PM
Thank you.. Well.. I'm actually trying to get this information to display at the very top of the page.. At the very beginning of the header.. Would anyone happen to know the trick for that?
Thank you...
Paul M
10-30-2005, 01:02 PM
I'd like to display information at the very top of my forum - different for guests, registered members and supporting members. Am I on the right track with the code I've typed below? It doesn't work for me so would somebody mind helping me out?
Thanks in advance...
<if condition="$bbuserinfo['userid'] == 1">
<p>guest</p>
<else />
<if condition="$bbuserinfo['userid'] == 2">
<p>registered</p>
<else />
<p>not guest or registered</p>
</if>
</if>
Guests get "not guest or registered".
I'm in my own usergroup and I get "guest".
Any help would be appreciated...
You appear to be using "userid" in your tests instead of "usergroupid".
akanevsky
10-30-2005, 01:10 PM
<if condition="!$bbuserinfo['userid']">
<p>guest</p>
<else />
<p>registered</p>
</if>
Sal Collaziano
10-30-2005, 01:29 PM
Thank you.. Is it supposed to say "userid" with the actual usergroup "number" in there somewhere? Like 'userid=1'?
Paul M
10-30-2005, 02:24 PM
For different user groups, the easiest method is ;
<if condition="$bbuserinfo['usergroupid'] == 1">
<p>Group 1 message (Guests)</p>
</if>
<if condition="$bbuserinfo['usergroupid'] == 2">
<p>Group 2 message (Normal registered users)</p>
</if>
<if condition="$bbuserinfo['usergroupid'] == 9">
<p>Group 9 message</p>
</if>
Sal Collaziano
11-03-2005, 04:55 PM
Thank you.. That's exactly what I needed. :)
Okay. Just one more request... If I want to give the same message to several usergroups, would it be done like this?:
<if condition="$bbuserinfo['usergroupid'] == 1,2,3,4,5">
<p>Message here</p>
</if>
TyleR
11-03-2005, 05:13 PM
Thank you.. That's exactly what I needed. :)
Okay. Just one more request... If I want to give the same message to several usergroups, would it be done like this?:
<if condition="$bbuserinfo['usergroupid'] == 1,2,3,4,5">
<p>Message here</p>
</if>
Nope, would be like this:
<if condition="is_member_of($bbuserinfo[usergroupid], array(1,2,3,4,5))">
<p>Message here</p>
</if>
Sal Collaziano
11-03-2005, 05:28 PM
Nope, would be like this:
<if condition="is_member_of($bbuserinfo[usergroupid], array(1,2,3,4,5))">
<p>Message here</p>
</if>
I couldn't get this one to work for some reason... Of course, I replaced the array numbers with my own usergroups...
TyleR
11-03-2005, 05:38 PM
I couldn't get this one to work for some reason... Of course, I replaced the array numbers with my own usergroups...
Hmm, should work since i just tested it on my own forum before replying.
Sal Collaziano
11-03-2005, 07:13 PM
It must be me then. I'll try again as soon as I can.. I'm in "swamped" mode right now...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.