vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   if condition.. (https://vborg.vbsupport.ru/showthread.php?t=232637)

Trasion 01-09-2010 04:06 PM

if condition..
 
I want to do a if condition, where...

Code:

<td class="alt2 smallfont"><img src="images/misc/controller.png"></td>
I want it so that if:

Forum ID is larger than (>) 1, then it adds a:

Code:

style="border-bottom:1px solid #4E4E4E;"
In the code for the td. And if it's equal to 1, it doesn't show it. How can I do this? I'm good with doing if conditions with the equal sign, but I'm wondering how to do the larger than.

JamesC70 01-10-2010 02:06 AM

Negate the equals sign with a not ("!"):

PHP Code:

<td class="alt2 smallfont" &nbsp;
<if 
condition="$foruminfo['forumid'] != 0">
  {  
style="border-bottom:1px solid #4E4E4E;"
  
}
</if>
><
img src="images/misc/controller.png"></td

The nbsp; code is to keep the style statement from crashing into the class statement. If the style statement isn't sent to the user, then the user's browser will ignore it.

Though, I wonder why you specify a forum number > 1, when there's no such "0 forum" in vBulletin. :confused:

Maybe you just want this to display in forums numbered, say, 25 and higher?
PHP Code:

<if condition="in_array($forum['forumid'], array(25,26,27,28))"



Code is off the top of my head, it may need tweaking.


All times are GMT. The time now is 08:28 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.01902 seconds
  • Memory Usage 1,714KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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