Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-25-2010, 01:28 AM
AlexisMedia AlexisMedia is offline
 
Join Date: Dec 2010
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 12-25-2010, 03:33 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-25-2010, 04:12 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And also, 26 was correct. You don't use the SEO'd forum name. Just the ID number.
Reply With Quote
  #4  
Old 12-25-2010, 06:07 AM
AlexisMedia AlexisMedia is offline
 
Join Date: Dec 2010
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)"
Reply With Quote
  #5  
Old 12-25-2010, 06:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<vb:if condition="!in_array($foruminfo['forumid'], array(x, y, z))">stuff</vb:if>
Reply With Quote
  #6  
Old 12-25-2010, 06:04 PM
AlexisMedia AlexisMedia is offline
 
Join Date: Dec 2010
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that was a no-go for me...
Reply With Quote
  #7  
Old 12-25-2010, 06:15 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same or different template?
Reply With Quote
  #8  
Old 12-25-2010, 07:47 PM
AlexisMedia AlexisMedia is offline
 
Join Date: Dec 2010
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same
Reply With Quote
  #9  
Old 12-25-2010, 08:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 12-26-2010, 12:08 AM
AlexisMedia AlexisMedia is offline
 
Join Date: Dec 2010
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:58 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.04618 seconds
  • Memory Usage 2,249KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete