vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   multiple id's for if condition="$bbuserinfo (https://vborg.vbsupport.ru/showthread.php?t=79629)

TheRayden 04-08-2005 07:52 PM

multiple id's for if condition="$bbuserinfo
 
I have set a conditional for a private menu section on my vbadvanced site using this code:

Code:

<if condition="$bbuserinfo[usergroupid]==6">
Now, I wish to add multiple usergroups here but whatever method I try results in an error.

So if I try 6,14 I get this error:

Code:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected ',' in /home/archimed/public_html/redpill/includes/adminfunctions_template.php(3096) : eval()'d code on line 8

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

The same goes for ; or : or a space, etc etc

I'm obviously missing something small here, but I can't seem to find it.

amykhar 04-08-2005 07:56 PM

There is a hack that will let you use a list of usergroups. It takes a minute to install and is a joy to have.

https://vborg.vbsupport.ru/showthrea...t=is_member_of

Zachery 04-08-2005 07:59 PM

You can always make use of arrays :) and in_array

amykhar 04-08-2005 08:04 PM

Quote:

Originally Posted by Zachery
You can always make use of arrays :) and in_array

even in templates?

TheRayden 04-08-2005 08:09 PM

Quote:

Originally Posted by amykhar
There is a hack that will let you use a list of usergroups. It takes a minute to install and is a joy to have.

https://vborg.vbsupport.ru/showthrea...t=is_member_of

Worked like a charm. Thank you. ;)

Zachery 04-08-2005 08:19 PM

Quote:

Originally Posted by amykhar
even in templates?

<if condition="in_array($bbuserinfo[usergroupid], array(X,Y,Z))"> test </if>

works fine :)

amykhar 04-08-2005 11:05 PM

Quote:

Originally Posted by Zachery
<if condition="in_array($bbuserinfo[usergroupid], array(X,Y,Z))"> test </if>

works fine :)

Cool. Learn something new every day. The thing about my suggestion though is that it gets member groups and not just primary groups.


All times are GMT. The time now is 07:02 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.01002 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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