vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   exclude forum in ad code (https://vborg.vbsupport.ru/showthread.php?t=320671)

NarutoFTW 10-31-2015 05:49 PM

exclude forum in ad code
 
Can someone help me edit the code below to allow me to exclude certain forums? Like exclude forum id: 301.

Code:

<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">

<script type="text/javascript">
    google_ad_client = "ca-pub-6546546546546";
    google_ad_slot = "6401555550";
    google_ad_width = 728;
    google_ad_height = 90;
</script>
<!-- 728x90, created 8/7/09 -->
<script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</li>
</vb:if>

Thanks a lot guys.

TheLastSuperman 10-31-2015 06:25 PM

Code:

<vb:if condition="$forum[forumid] != x">Show this if forum id is not x</vb:if>
If excluding from more than one forum then use an array:
Code:

<vb:if condition="!in_array($forum['forumid'], array(1,2,3))">Show this to all forums except forum 1, 2 and 3</vb:if>

TheLastSuperman 10-31-2015 07:00 PM

Also here is the list of conditionals for vB4:
https://vborg.vbsupport.ru/showthread.php?t=231525

Then I noticed you're doing something with advertising in posts? You can also look at the template conditionals listed in post #2 here:
https://vborg.vbsupport.ru/showpost....59&postcount=2

^ There are more conditional examples in the mod's thread where I help some others out previously, even if you don't use my mod specifically (I need to update it regardless to be more modern etc) the template conditionals posted will give you better ideas on how to use them and hide/show/other code based on tons of conditionals that many don't even know you can use ;).

Edit: This is a link from vbulletin.com as well with slightly older 3.x <if> conditionals, simply apply the new <vb:if> instead and they should work fine as well, basically the same thing you're trying to achieve was outline here long ago: http://www.vbulletin.com/forum/forum...google-adsense


All times are GMT. The time now is 08:48 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.01565 seconds
  • Memory Usage 1,716KB
  • 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
  • (3)bbcode_code_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