vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Combine conditionals (https://vborg.vbsupport.ru/showthread.php?t=247564)

Xtrigit 07-29-2010 11:32 PM

Combine conditionals
 
I would like to combine these two conditionals:

PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,3,8)">show this to usergroups 138</vb:if> 

PHP Code:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1and 3</vb:if> 

I tried:

PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND in_array($forum['forumid'], array(1,2,3))">show this to usergroups in forums</vb:if> 

and it didn't work.

Thanks

Boofo 07-29-2010 11:59 PM

Code:

<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND (in_array($forum['forumid'], array(1,2,3)))">show this to usergroups in forums</vb:if>

Xtrigit 07-30-2010 01:43 AM

Thanks but that does not work.

Boofo 07-30-2010 01:59 AM

Where are you using this?

--------------- Added [DATE]1280458795[/DATE] at [TIME]1280458795[/TIME] ---------------

Code:

<vb:if condition="is_member_of($bbuserinfo, 1,3,8) AND in_array($foruminfo['forumid'], array(1,2,3))">show this to usergroups in forums</vb:if>

Xtrigit 07-30-2010 03:59 AM

SHOWTHREAD template inside the head tag <head> </head>.

Boofo 07-30-2010 08:16 AM

Why don't you use one of the showthread hooks for this? What are you want to show if the condition is met?

Xtrigit 07-30-2010 01:27 PM

I'm trying to show an ad that covers the whole screen but this ad should only be shown to guests and unconfirmed members in all forums but two.

At the moment
PHP Code:

<vb:if condition="is_member_of($bbuserinfo, 1,3,8)">show this to usergroups 138</vb:if> 

works for guests and unconfirmed members.

I had it working with 3.8.4 but I just upgraded like a day ago to vb 4.0.5.

Boofo 07-30-2010 03:06 PM

What was the exact code for 3.8.4?

Eric 07-30-2010 03:26 PM

hmm, give this a try:

Quote:

<vb:if condition="is_member_of($bbuserinfo, 1, 3, 8) AND in_array($threadinfo['forumid'], array(1, 2, 3))">
show this to usergroups in forums
</vb:if>

Xtrigit 07-31-2010 03:45 AM

Thank you guys!

SecondV, that worked :D


All times are GMT. The time now is 03:55 PM.

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.01232 seconds
  • Memory Usage 1,735KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete