Ok, I have gotten my forum to display one set of ads for the main page, and a different set of ads for each forum, forum specific.
I am using VB3.0.3 and PHPADSNEW.
- Using keywords in phpadsnew, assign a keyword to each banner that you want displayed in a specific forum. The keyword is the same as the forum title that you want it displayed in. (eg: forum1, forum2, etc)
- Assign a different keyword to the index page banners (eg: "mainpage")
Note: For whatever reason, this application only worked with javascript banner invocation. I am not a programmer, and it is beyond my capabilities to figure out how to put the php code in here, but perhaps someone else would want to. For me, the javascript invocation worked, and that is good enough for me right now.
In the header, or wherever, the code is as follows:
<if condition="!$forumid">
**insert javascript invocation code generated by phpadsnew here for the main page banners, using the keyword 'mainpage' **
</if>
<if condition="$forumid >= 1">
**insert javascript invocation code generated by phpadsnew here for the individual forum banners using the keyword $foruminfo[title] **
</if>
This method matches the name of the forum with the keyword assigned to an individual banner, and displays it.
Here is the code in it's entirety taken from my VB header template for your reference:
<if condition="!$forumid">
<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.mysite.com/ads/adjs.php?n=" + phpAds_random);
document.write ("&what=mainpage&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.mysite.com/ads/adclick.php?n=ac58295b' target='_blank'><img src='http://www.mysite.com/ads/adview.php?what=mainpage&n=ac58295b' border='0' alt=''></a></noscript>
</if>
<if condition="$forumid >= 1">
<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.mysite.com/ads/adjs.php?n=" + phpAds_random);
document.write ("&what=$foruminfo[title]&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.mysite.com/ads/adclick.php?n=a14c4e55' target='_blank'><img src='http://www.mysite.com/ads/adview.php?what=$foruminfo[title]&n=a14c4e55' border='0' alt=''></a></noscript>
</if>
I hope this helps someone. I have gleaned a lot of information off of support forums like this, and I only hope that this helps someone looking for a similar application.
Thank you to Jake and Conqsoft and The Music Man for your help today.
I am using VB3.0.3 and PHPADSNEW.
- Using keywords in phpadsnew, assign a keyword to each banner that you want displayed in a specific forum. The keyword is the same as the forum title that you want it displayed in. (eg: forum1, forum2, etc)
- Assign a different keyword to the index page banners (eg: "mainpage")
Note: For whatever reason, this application only worked with javascript banner invocation. I am not a programmer, and it is beyond my capabilities to figure out how to put the php code in here, but perhaps someone else would want to. For me, the javascript invocation worked, and that is good enough for me right now.
In the header, or wherever, the code is as follows:
<if condition="!$forumid">
**insert javascript invocation code generated by phpadsnew here for the main page banners, using the keyword 'mainpage' **
</if>
<if condition="$forumid >= 1">
**insert javascript invocation code generated by phpadsnew here for the individual forum banners using the keyword $foruminfo[title] **
</if>
This method matches the name of the forum with the keyword assigned to an individual banner, and displays it.
Here is the code in it's entirety taken from my VB header template for your reference:
<if condition="!$forumid">
<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.mysite.com/ads/adjs.php?n=" + phpAds_random);
document.write ("&what=mainpage&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.mysite.com/ads/adclick.php?n=ac58295b' target='_blank'><img src='http://www.mysite.com/ads/adview.php?what=mainpage&n=ac58295b' border='0' alt=''></a></noscript>
</if>
<if condition="$forumid >= 1">
<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.mysite.com/ads/adjs.php?n=" + phpAds_random);
document.write ("&what=$foruminfo[title]&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.mysite.com/ads/adclick.php?n=a14c4e55' target='_blank'><img src='http://www.mysite.com/ads/adview.php?what=$foruminfo[title]&n=a14c4e55' border='0' alt=''></a></noscript>
</if>
I hope this helps someone. I have gleaned a lot of information off of support forums like this, and I only hope that this helps someone looking for a similar application.
Thank you to Jake and Conqsoft and The Music Man for your help today.
Comment