vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   What's wrong with this conditional? (https://vborg.vbsupport.ru/showthread.php?t=243891)

trafficbrokers 06-03-2010 08:31 PM

What's wrong with this conditional?
 
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

Code:

<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. ;)


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01545 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete