vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   <if> statement based on forum ID? (https://vborg.vbsupport.ru/showthread.php?t=191777)

Rukas 09-24-2008 03:59 PM

<if> statement based on forum ID?
 
Is it possible to do an if statement based on forum ID?

I want to add an image to postbit dependent on the forum the thread was posted in.

So basically Id like it to be

IF thread is in Forum 1
Use 1.gif
IF thread is in Forum 2
Use 2.jpg
Else use 3.gif

Can anyone help me out?

Thanks.

Lynne 09-24-2008 04:10 PM

HTML Code:

<if condition="$forumid==1">
Use 1.gif
<else />
<if condition="$forumid==2">
Use 2.jpg
<else />
use 3.gif
</if>
</if>

I think that should do it. If $forumid doesn't work, try one of these instead:

$forum[forumid]
$foruminfo[forumid]
$thread[forumid]
$threadinfo[forumid]
$GLOBAL[forumid]

theOZer 09-24-2008 04:11 PM

Display Information On a Per Forum Basis
--------------------------------------------------
This conditional allows you to display information on a per forum basis. This can be helpful if you wish to display different advertisements depending on what forum that the user is in. You would simply replace X with the forum id that you wish the information to appear in.
HTML Code:
<if condition="$forum[forumid] == X"></if>
and on the other hand you can use the ! to do the opposite and display the information in every forum but the id you list
HTML Code:
<if condition="$forum[forumid] != X"></if>
or if you have multiple forums you wish to include something with you can use an array such as this
HTML Code:
<if condition="in_array($forum['forumid'], array(1,2,3,6))"></if>

I found this information on vBulletinSetup, thread:
http://forum.vbulletinsetup.com/f18/...list-2185.html

~OZ


All times are GMT. The time now is 01:54 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.01100 seconds
  • Memory Usage 1,713KB
  • 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
  • (1)bbcode_html_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