vb.org Archive

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

AlexisMedia 12-25-2010 01:28 AM

Condition Question
 
I'm trying to do my first condition and I'm not sure if I got the code correct as it's not working. I'm thinking maybe my forum id is wrong but I don't know... This is for ad placements. The pre-loader is placed in the head (forumdisplay) like this:

Code:

<vb:if condition="$forum[forumid] == 26"><!-- AdSpeed.com Serving Code 7.9.4 for 3 zones [Any Dimension] --> 
<script type="text/javascript" src="http://g.adspeed.net/ad.php?do=js&zids=26302x9&wd=-1&ht=-1&target=_top"></script> 
<!-- AdSpeed.com End --></vb:if>

Then the ad's divs are placed in the proper part of the FORUM DISPLAY template like this:

Code:

<vb:if condition="$forum[forumid] == 26">
<div id="banner-column-container">

<div class="banner-ads-long">
<script type="text/javascript"> 
AdSpeed_display(26302,0); // first ad 
</script>
</div><!--banner-ads-long-->

<div class="banner-ads-long">
<script type="text/javascript"> 
AdSpeed_display(26302,1); // 2nd ad 
</script>
</div><!--banner-ads-long-->

ETC...

</div><!--banner-column-container-->

</vb:if>

My url was this ending: forums/forumdisplay.php/26-Pro so I figured either 26 or 26-Pro would be the forum id. Neither seemed to work and show up in the source code though so maybe I'm doing the forum id wrong? You would think if it was completely wrong then the code would be showing up in the source code. I know positively I'm putting them in the right templates as I've tested with bogus words in the header etc and that showed up in the source code.

Thanks!

Lynne 12-25-2010 03:33 AM

You said this is in the FORUMDISPLAY template, so take a look at that template. When you do, you'll see the variable $forum is not used there, but instead the variable is called $foruminfo. So, use that variable instead.

Digital Jedi 12-25-2010 04:12 AM

And also, 26 was correct. You don't use the SEO'd forum name. Just the ID number.

AlexisMedia 12-25-2010 06:07 AM

Awesome, thanks for the help everybody. Works : )

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

I can't find this condition. Is there such? I've found everything but it seems...

"Show in every forum but these: (multiple forums)"

Lynne 12-25-2010 06:01 PM

HTML Code:

<vb:if condition="!in_array($foruminfo['forumid'], array(x, y, z))">stuff</vb:if>

AlexisMedia 12-25-2010 06:04 PM

that was a no-go for me...

Digital Jedi 12-25-2010 06:15 PM

Same or different template?

AlexisMedia 12-25-2010 07:47 PM

Same

Lynne 12-25-2010 08:50 PM

Exactly what do you have entered and exactly where in the FORUMDISPLAY template is it entered (show us the code from three lines before to three lines after the beginning if and ending if). And, what is the result?

AlexisMedia 12-26-2010 12:08 AM

Sorry Lynne. Your code looked just like mine from the other thread so I thought you just changed the "foruminfo" part. Upon closer inspection I found a few little 's and )'s that were different.

All works fine now. These preset conditionals are actually pretty bad @$$. Just gotta keep learning them I guess...


All times are GMT. The time now is 01:13 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.01032 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_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