PDA

View Full Version : Condition Question


AlexisMedia
12-25-2010, 01:28 AM
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:

<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:

<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 1293303855 at 1293303855 ---------------

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
<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...