vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to combine two <if> conditionals (https://vborg.vbsupport.ru/showthread.php?t=277460)

viper357 01-24-2012 09:18 AM

How to combine two <if> conditionals
 
Hi all. I've googled and tried but I can't anymore, lol.

Can anyone help me how to combine these two conditionals please.

<if condition="in_array($forumid, array(X,Y,Z))">
and
<if condition="$thread['postuserid'] == $post['userid']">

I've tried everything on google and vb.org and vb.com but I just can't get it right.

This code is being placed into the postbit_legacy template and what I want it to do is, if in a certain forum then an image/link will be displayed but only on the original thread starters posts.

If the conditionals are used separately then they work fine, but as soon as I try to use both they seem to cancel each other out somehow. I've tried so many different ways of combing them but I'm not a coder.

Thanks. :)

kh99 01-24-2012 10:26 AM

You can do this:

Code:

<if condition="in_array($forumid, array(X,Y,Z)) AND $thread['postuserid'] == $post['userid']">
// Image code here
</if>


but doing this should also have worked:
Code:

<if condition="in_array($forumid, array(X,Y,Z))">
  <if condition="$thread['postuserid'] == $post['userid']">
// Image code here
  </if>
</if>


viper357 01-24-2012 12:06 PM

Thank you.


All times are GMT. The time now is 11:52 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.01080 seconds
  • Memory Usage 1,709KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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