PDA

View Full Version : IF Conditions


utahraves
12-30-2009, 07:38 PM
I've tried using a IF Condition in my version 4 to block something out to unregistered users.
I use:

<vb:if condition="$post['usergroupid'] != 1">
BLOCKEDOUTINFOHERE
</vb:if>Can not get this for the life of me to work... :( I was looking for a vb4 updated list of if conditions

Should I be using...

<vb:if condition="$is_member_of($bbuserinfo,1)">

<vb:else />
BLOCKEDOUTINFOHERE
</vb:if>


I'm at a complete loss of what to do here... I seem to be blanking out what should be done. Thanks in advance for any help.

Lynne
12-30-2009, 08:06 PM
The conditions for vb4 are the same as for vb3 except that you put "vb:" before the line... so <vb:if and </vb:if and <vb:else etc. The actual condition itself though should be the same.

You also didn't tell us what template you are modifying. That is usually essential information when helping out.

utahraves
12-30-2009, 08:09 PM
I'm editing the footer. I have a java script thing that runs at the bottom of the window but I don't want it displaying for unregistered people.

Thanks for that - I will look up a list of the conditions so I can try and figure out what my deal is...

Lynne
12-30-2009, 08:14 PM
The $post variable is not available in the footer. Not only that, but $post['usergroupid'] is the usergroupid of the person making the post, so it makes no sense to use it in the footer. You want $bbuserinfo and yes, you should use is_member_of.

utahraves
12-30-2009, 08:21 PM
Thanks!

For people that use this thread in the future, I used:

<vb:if condition="!is_member_of($bbuserinfo, 1)">
blahblah
</vb:if>