Log in

View Full Version : <IF CONDITION= not working


SLR722
07-14-2008, 07:54 PM
Hey

I am trying to make a modification for vB.org and for my client. I am trying to declare a function and some HTML through vB's template conditions and its not working. In basic, I could not find a developer documentation for the following conditions, but none of them are working with else, and if else combinations.

<if condition="in_array($bbuserinfo['usergroupid'], array(1,3,4))">
stuff here
<else />
other stuff here
</if>


And
<if condition="in_array($bbuserinfo['usergroupid'], array(1))">
stuff here
<else />
other stuff here
</if>


And

<if condition="$show['guest']">

<if condition="$show['member']">



Anyone have an idea to achieve this.

IF user->guest SHOW
Hey guest
ELSE
Welcome back
END IF

veenuisthebest
07-14-2008, 08:13 PM
For usergroup:-

<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3)">

</if>

For guest:-

<if condition="$show['guest']">

</if>

SLR722
07-14-2008, 08:32 PM
Still not working

Dismounted
07-15-2008, 09:40 AM
They will work - if you are implementing them properly.

SLR722
07-15-2008, 06:36 PM
Hey

I am doing a Welcome Panel. And have done it in the ForumHome template. It displays when the user is logged in only, and not for the guest.

The code is being called in the FORUMHOME_WELCOMEPANEL

Opserty
07-15-2008, 07:40 PM
<a href="http://www.vbulletin.com/docs/html/main/template_conditionals" target="_blank">Template Conditionals</a> See if maybe you can get something from there that works. Also use <else /> instead of two seperate <if>s

SLR722
07-15-2008, 08:41 PM
Its working. I managed to place the guest information in the navigation bar and its fixed it!