vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Conditional For <if script =="script"> (https://vborg.vbsupport.ru/showthread.php?t=142583)

Xplorer4x4 03-20-2007 10:02 AM

Conditional For <if script =="script">
 
Ok can some one show me the if conditional for showing something only on showthread.php and forumdisplay.php

<if this_script == showthread.php AND forumdisplay.php>code</if>

That didn't look write but looked close, if some one could show me the correct version it would be very helpful. :)

Dismounted 03-20-2007 10:11 AM

THIS_SCRIPT == 'showthread'
THIS_SCRIPT == 'forumdisplay'

TheMilkCarton 03-20-2007 10:12 AM

Code:

<if condition="THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread'">
AND won't work. I think that's right.. not too much of a coder. :)

nvm... I think AND is what you want if you're excluding all pages but those scripts. I think??

Xplorer4x4 03-20-2007 10:25 AM

Quote:

Originally Posted by Dismounted (Post 1207979)
THIS_SCRIPT == 'showthread'
THIS_SCRIPT == 'forumdisplay'

your on a role today for helping me! Thanks alot both of you.

Kirk Y 03-21-2007 04:09 AM

Quote:

Originally Posted by TheMilkCarton (Post 1207980)
Code:

<if condition="THIS_SCRIPT == 'forumdisplay' OR THIS_SCRIPT == 'showthread'">
AND won't work. I think that's right.. not too much of a coder. :)

nvm... I think AND is what you want if you're excluding all pages but those scripts. I think??

It'd be impossible to have two different values for THIS_SCRIPT -- it would be contradictory - and would always return false. (If this animal is a Fish and Ferret; return.) The correct operator would be OR. :p

Code:

<if condition="THIS_SCRIPT == 'forumdisplay'">
Only Show this if we're looking at Forumdisplay.</if>

Code:

<if condition="THIS_SCRIPT != 'forumdisplay'">
Only Show this if we're not looking at Forumdisplay.</if>


TheMilkCarton 03-21-2007 06:36 AM

Yeah, sorry.. I was right the first time I guess. :) But I thought you could use "AND" if you also used "!==" such as
Code:

<if condition="THIS_SCRIPT !== 'forumdisplay' AND THIS_SCRIPT !== 'showthread'">
Wouldn't that show code in everything but forumdisplay and showthread? Or is it still "OR"?

Dismounted 03-21-2007 06:49 AM

Quote:

Originally Posted by TheMilkCarton (Post 1208583)
Yeah, sorry.. I was right the first time I guess. :) But I thought you could use "AND" if you also used "!==" such as
Code:

<if condition="THIS_SCRIPT !== 'forumdisplay' AND THIS_SCRIPT !== 'showthread'">
Wouldn't that show code in everything but forumdisplay and showthread? Or is it still "OR"?

That would shown everywhere execpt forumdisplay and showthead. Also, !== (or ===) is only used when comparing types. != (or ==) should be used in any other case.

Kirk Y 03-21-2007 03:31 PM

What Dismounted said. :p


All times are GMT. The time now is 07:55 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.00997 seconds
  • Memory Usage 1,726KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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