PDA

View Full Version : What's wrong with this conditional?


trafficbrokers
06-03-2010, 08:31 PM
I'm new to VB and having a hard time figuring out what should be a simple conditional. Basically what I'm trying to do is hide the "Post New Thread" button for regular members in 1 specific forum that they can't post in.

Here's the conditional I figured would work, but it doesn't. My logic is simply that if the forum ID is 11 and the user is not an admin, the button shouldn't be displayed. But it doesn't work, so I assume that one or both of those variables is not available in the FORUMDISPLAY template for some reason. Can anyone help??

<vb:if condition="$forum[forumid] == 11 AND $bbuserinfo['usergroupid'] != 6">
*nothing*
<vb:else />
*code to show button*
</vb:if>

I also tried this and it doesn't work either ...

<vb:if condition="$forum[forumid] == 11 AND !is_member_of($bbuserinfo,6)">

Boofo
06-03-2010, 08:54 PM
<vb:if condition="$foruminfo['forumid'] == 11 AND $vbulletin->userinfo['usergroupid'] != 6">
*nothing*
<vb:else />
*code to show button*
</vb:if>

trafficbrokers
06-03-2010, 08:59 PM
You're the best, thanks!

Boofo
06-03-2010, 09:19 PM
Just a little hint for the next time. Looking at the forumdisplay.php file will give you a lot of clues as to how it handle variables. The same goes with the other files for the other areas as well. ;)