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-16-2007 04:30 AM

You only need one set of them, not two. So just use this:
Code:

<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:<if condition="$foruminfo['forumid'] == 11">7<else />3</if>&amp;n=a6409d73' border='0' alt=''></a></noscript>


ski diva 06-19-2007 04:21 PM

Thanks for all your help, but this is not working at all.

So I thought I'd just try to keep the ads from feeding in to one specific forum entirely, but I haven't had any luck with that, either. Any suggestions?

Dismounted 06-20-2007 07:02 AM

Code:

<script language='JavaScript' type='text/javascript' src='http://www.XXXXXXX.com/openads/adx.js'></script>
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.XXXXXXX.com/openads/adjs.php?n=" + phpAds_random);
document.write ("&amp;what=zone:<if condition="$forum['forumid'] == 11">7<else />3</if>");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.XXXXXXX.com/openads/adclick.php?n=a6409d73' target='_blank'><img src='http://www.XXXXXXX.com/openads/adview.php?what=zone:<if condition="$forum['forumid'] == 11">7<else />3</if>&amp;n=a6409d73' border='0' alt=''></a></noscript>

Try that. It is still the zone changing thing.

ski diva 06-20-2007 04:59 PM

I know it sounds nuts, and I really appreciate your help, but this doesn't work, either.

Boy, this is frustrating!!!!!!

Dismounted 06-21-2007 05:45 AM

What happens? Have you replaced the XXXXXXX.com's?

TheMilkCarton 06-21-2007 07:32 AM

Are you using "forums" as a general word, ski diva?

If you're trying to get this to show up in individual threads shouldn't "$thread[forumid]" be used then?

Also, I've never even used "$foruminfo['forumid']" either.. I've only used "$forumid" or "$forum[forumid]".. I'm not saying "$foruminfo[forumid]" is wrong, but is there any actual benefit in using it over the shorthand, Dismounted?

I also don't understand why single quotations are required in the code? (e.g. $foruminfo['forumid']). Also, speaking of the single quotations, I've noticed in the code ski diva has posted there are extra spaces in the conditional code ($foruminfo[SPACE'forumid'SPACE]). Not sure if this matters.

Well, anyway.. I was just trying to offer up some possible reasons why the code isn't working. Also, if you were getting double ads on each page, I'd say you were copying the code twice? I don't think even vBulletin misunderstanding the conditional code could cause double ads in this situation.

Although.. Dismounted is wayyyyyyyy smarter than me, so probably everything I've suggested is wrong. :)

Anyway.. You haven't been very descriptive about where you're trying to use this code, so maybe just try $forumid == 11 or $thread[forumid] ==11 instead.

Dismounted 06-21-2007 07:39 AM

Quote:

Originally Posted by TheMilkCarton (Post 1273045)
Also, I've never even used "$foruminfo['forumid']" either.. I've only used "$forumid" or "$forum[forumid]".. I'm not saying "$foruminfo[forumid]" is wrong, but is there any actual benefit in using it over the shorthand, Dismounted?

I've mostly used $foruminfo because that's what I've learned to do from coding plugins.
Quote:

Originally Posted by TheMilkCarton (Post 1273045)
I also don't understand why single quotations are required in the code? (e.g. $foruminfo['forumid']).

When you don't use single quotations (or even double), PHP searches for a constant with that name, then it accesses that string of the array. It will emit an E_NOTICE error if it doesn't find a constant (although you won't see this error on most servers). It is also slower.

TheMilkCarton 06-21-2007 09:50 AM

Quote:

Originally Posted by Dismounted (Post 1273047)
I've mostly used $foruminfo because that's what I've learned to do from coding plugins.

When you don't use single quotations (or even double), PHP searches for a constant with that name, then it accesses that string of the array. It will emit an E_NOTICE error if it doesn't find a constant (although you won't see this error on most servers). It is also slower.

Thanks! You're so informative!

Now if the OP would respond so we (meaning you :p) can figure out what's going wrong. :D

ski diva 06-21-2007 11:39 AM

Okay, I'm here.

What I'm getting now is the ads that are linked to the second zone in the code are appearing in all cases -- that is, across all forums. This applies to the forum that I want to get its own ad, too without the others appearing (this is the first zone in the code). The ad that I want delivered to that zone specifically is not appearing at all.

Weird, huh?

BTW, Dismounted, I took your advice and only put in the block of code you gave me once; I guess I misunderstood when you said I needed multiple zones. I thought that meant I had to put in the code in for all the multiple zones.

nanaimobar 06-21-2007 10:05 PM

I use an iframe tag and invocation code to display ads on my word search puzzle pages.

First off, I'm not a coder by any stretch of the imagination and I don't know if what I did will work in your instance but it worked for me to rotate ads.

I simply created a new html page, place the invocation code in it (generated by openads for javascript) and set a metatag refresh time in it.

The ads are displayed in a page using an html iframe tag in that page to call the invocation code html page.

The html page with the invocation code:
1)create new html page
2)place metatag for refresh near top.
3)place invocation code from openads below metatag for refreshing ads in iframe.
4)save it as: WhateverYouWantToNameYourFile.html

Invocation code was the code generated by openads 2.0 for javascript. I simply copied that into a new HTML page and named it something. Above the invocation code I placed the metatag for refresh the invocation code and set a time in it.

The metatag is: <META HTTP-EQUIV="refresh" CONTENT="60">
The 60 simply is the time in seconds.

Also in the page with the invocation code, at the very top, I have:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
which works for me.

Iframe tag:
<iframe height="140" width="760" scrolling="no"frame frameborder="0" border="0px" src="WhateverYouWantToNameYourFile.html"></iframe>
Be sure to include the quotes in this example.

Above code for iframe to be placed in whatever page you want the adds to refresh or rotate.

I added the height and width because I don't know how to have an iframe automatically fit an ad. I set scrolling to no to eliminate the scroll bars which appear in the iframe. The frameborder numbers are set to 0 so no border appears.

You can see it in action here.

All my word search puzzle pages have the iframe code I mentioned above so if you want to see other examples just choose one of the puzzles. The ads will refresh in 60 seconds without changing the puzzle.

For the majority of ads on my forum board I use vb admanagement with openads. It works fairly straightforward.


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