Log in

View Full Version : Vbulletin <if> statement help.


jp2
04-07-2005, 08:47 AM
Vbulletin <if> statement help.

Here is what I am trying to do?

I want to add a link to my nav bar that?s only viewable by registered users prompting them to ?upgrade there account?.

I half know how <if> statements work in vbulletin but I am not sure on the exact code to make this work.

Something along the lines of?


<if condition="$bbuserinfo['userid'] == 2">
<td class="vbmenu_control"><a href="http://www.babeforums.net/imagehost/" target="_blank"><strong><font color="#000000">Test</font></strong></a></td>
<else />
</if>


This doesn?t seem to be working however.

Any help is greatly appreciated.
Jon

Deaths
04-07-2005, 08:54 AM
As I said on vb.com, the userid is the unique ID of a user, so if you set it to 2, the user with the ID 2 will see the link, and noone else ;)

Jenta
04-07-2005, 09:49 AM
yup, what he said

u have to use usergroup ids, your only if'ing one person there
use this instead <if condition="is_member_of($bbuserinfo, 2)"> this covers secondary groups
you can also use this if you dont have secondary groups <if condition="$bbuserinfo[usergroupid]==2">

either one will work in most cases

you also dont need the else statement

<if condition="is_member_of($bbuserinfo, 2)">
<td class="vbmenu_control"><a href="http://www.babeforums.net/imagehost/" target="_blank"><strong><font color="#000000">Test</font></strong></a></td>
</if>

Princeton
04-07-2005, 11:40 AM
for registerd users use...
<if condition="$show['member']">
link goes here
</if>

the 'is_member_of' will only check and show link if member belongs in the specific group that you are checking ...

so if a registered member is in group 6 ... link will not be shown 'cause you are only checking group 2

jp2
04-07-2005, 01:03 PM
Thanks for the replys. This has sorted it. :)

Cheers.