vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I target ads to specific forums? (https://vborg.vbsupport.ru/showthread.php?t=149225)

Dismounted 06-22-2007 06:00 AM

You do know the use of iFrames are highly not recommended, it's bad coding style. Also, he's not trying to rotate ads, he's trying to get DIFFERENT ads in different forums.

ski diva 06-22-2007 11:10 AM

Dismounted, you got that exactly right! Rotating ads IS NOT the problem.

There HAS to be a way to solve this, though, wouldn't you think? :confused:

shunx91 09-18-2007 10:25 PM

Quote:

Originally Posted by Dismounted (Post 1265229)
Replace the two instances of "zone:3" with:
Code:

zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else />3</if>
To do this with multiple forums:
Code:

zone:<if condition="$foruminfo['forumid'] == FORUMID">ZONENUMBER<else /><if condition="$foruminfo['forumid'] == FORUMID2">ZONENUMBER2<else />3</if></if>

Hi Dismounted;

I tried what you posted but it doesn't work.

Code:

<!--/* Openads Javascript Tag v2.3.39-beta */-->

<!--/*
  * The backup image section of this tag has been generated for use on a
  * non-SSL page. If this tag is to be placed on an SSL page, change the
  *  'http://www.clubwrx.net/openads/www/delivery/...'
  * to
  *  'https://www.clubwrx.net/openads/www/delivery/...'
  *
  * This noscript section of this tag only shows image banners. There
  * is no width or height in these banners, so if you want these tags to
  * allocate space for the ad before it shows, you will need to add this
  * information to the <img> tag.
  *
  * If you do not want to deal with the intricities of the noscript
  * section, delete the tag (from <noscript>... to </noscript>). On
  * average, the noscript tag is called from less than 1% of internet
  * users.
  */-->

<script type='text/javascript'><!--//<![CDATA[
  var m3_u = (location.protocol=='https:'?'https://www.xxxxx.net/openads/www/delivery/ajs.php':'http://www.clubwrx.net/openads/www/delivery/ajs.php');
  var m3_r = Math.floor(Math.random()*99999999999);
  if (!document.MAX_used) document.MAX_used = ',';
  document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
  document.write ("?zoneid=4");
  document.write ('&amp;cb=' + m3_r);
  if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
  document.write ("&amp;loc=" + escape(window.location));
  if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
  if (document.context) document.write ("&context=" + escape(document.context));
  if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
  document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://www.clubwrx.net/openads/www/delivery/ck.php?n=a4f64f41&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://www.clubwrx.net/openads/www/delivery/avw.php?zoneid=4&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a4f64f41' border='0' alt='' /></a></noscript>


It seems like the key variable lies in the phrase document.write ("?zoneid=4");

Is there any way to use if and else statements before and after this entire line?

Here's the pseudo code:

If (forumid == x)
document.write ("?zoneid=4");
else if (forumid == y)
document.write ("?zoneid=5");
else
document.write("?zoneid=6");

Can you tell me how to write the if and else statement in the java script provided by openads?

Dismounted 09-19-2007 05:10 AM

You'll have to tell me the forum IDs...

shunx91 09-19-2007 06:27 AM

for exmaple if the forum ids are 12 and 22, what would the code look like? Thanks ahead for your help btw.

Dismounted 09-19-2007 08:06 AM

Find:
Code:

document.write ("?zoneid=4");
Replace With:
Code:

document.write ("?zoneid=<if condition="$foruminfo['forumid'] == 12">4<else /><if condition="$foruminfo['forumid'] == 22">5<else />6</if></if>");

doug97gxe 10-17-2007 05:40 PM

code turned out a little different for me.. but Dismounted gave the general road map

Code:

document.write ("&amp;<if condition="$foruminfo['forumid'] == 45">what=zone:1</if>");


All times are GMT. The time now is 04:47 PM.

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.01034 seconds
  • Memory Usage 1,738KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete