vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Conditional statement question (https://vborg.vbsupport.ru/showthread.php?t=64579)

VodkaFish 04-30-2004 04:22 PM

Conditional statement question
 
In my header I have something I want displayed for everyone except one usergroup. What would be the code needed within the header template to wrap that stuff in a "if not this userid then display" sort of statement?

Zachery 04-30-2004 04:57 PM

Quote:

Originally Posted by VodkaFish
In my header I have something I want displayed for everyone except one usergroup. What would be the code needed within the header template to wrap that stuff in a "if not this userid then display" sort of statement?

<if condition="$bbuserinfo[usergroupid] != X"> Show Stuff here r</if>

Change x to the group you dont want it to see :)

VodkaFish 04-30-2004 05:46 PM

Thank you, I assumed that was the syntax; but wasn't positive.

my guess would have been:
<if condition="$bbuserinfo['usergroupid'] != X"> Show Stuff here r</if>

But I like the assurance :)

btw - you don't need the single quotes around the usergroupid?

also is this proper?:

<if condition="($bbuserinfo[usergroupid] != X) or ($bbuserinfo[usergroupid] != Y)"> Show Stuff here r</if>"> Show Stuff here r</if>

Zachery 04-30-2004 05:47 PM

No, you NEVER use single quotes inside conditionals

VodkaFish 04-30-2004 05:48 PM

Wow, you got me before my edit. Thanks for the reply again :)

VodkaFish 05-02-2004 09:46 PM

I forgot I will be using this as a secondary usergroup. membergroupids is the variable, correct? But in an array. Is it possible to use a single conditional to do this? An "if not member of X"?

Zachery 05-02-2004 10:12 PM

youll need to use !is_member_of($bbuserinfo, X) instead of what i have above

SVTBlackLight01 05-02-2004 10:15 PM

Quote:

Originally Posted by Zachery
No, you NEVER use single quotes inside conditionals

I'm confused. Here are some examples from the vb manual and they are using single quotes. :confused:

http://www.vbulletin.com/docs/html/m...e_conditionals

VodkaFish 05-02-2004 10:32 PM

I attempted to use this:

<if condition="!is_member_of($bbuserinfo[membergroupids], 12)">

However, whatever is in-between the <if></if> still shows for members in the secondary group id of 12. I then took away the other secondary usergroups that the member belonged to as a test, but it still shows.

Zachery 05-02-2004 10:34 PM

Quote:

Originally Posted by VodkaFish
I attempted to use this:

<if condition="!is_member_of($bbuserinfo[membergroupids], 12)">

However, whatever is in-between the <if></if> still shows for members in the secondary group id of 12. I then took away the other secondary usergroups that the member belonged to as a test, but it still shows.

No, as i posted it


!is_member_of($bbuserinfo, 12)

Is what you are going to use.


All times are GMT. The time now is 09:29 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.01047 seconds
  • Memory Usage 1,729KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete