Ok, so I am not well versed with javascript and do everything with php. But this one calls for a bit of js manipulation.
For someone who knows JS this should be a five minute job.
So, we are using openx for ad management. The problem is that placing the openx javacode all over the page is simply too annoying.
so we had created a single php function called disp_ads where it would be fed the ad_zone and another variable and then it would display the ad.
this is one it looks like:
function ad_disp_raw ($ad_zone, $ad_n) {
?>
<script type=’text/javascript’><!–//<![CDATA[
var m3_u = (location.protocol=='https:'?'/cp/adserver/www/delivery/ajs.php':'/cp/adserver/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=<?=$ad_zone; ?>");
document.write ('&amp;cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
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=’/cp/adserver/www/delivery/ck.php?n=<?=$ad_n; ?>&amp;cb=INSERT_RANDOM_NUMBER_HERE’ target=’_blank’><img src=’/cp/adserver/www/delivery/avw.php?zoneid=<?=$ad_zone; ?>&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=<?=$ad_n; ?>’ border=’0′ alt=” /></a></noscript>
<?
}
// function ad_disp is a generic add display module from phpads
function ad_disp ($ad_zone, $ad_n) {
?>
<fieldset class=ads>
<legend>ADVERTISEMENT</legend>
<? ad_disp_raw ($ad_zone, $ad_n); ?>
</fieldset><?
}
———
So as you can see, sometimes we call the ad_disp function which displays a little fieldset around the ad or we can call the ad_disp_raw function directly if we don’t want the fieldset around the ad.
—-> the job:
we need the same methodology done but ALL is java. So, no php function but a java function PLUS the call.
So, really all one needs to do is write two js functions where one calls the other (see above php functions) and their call syntax – where all we do is call the function with the two variables.
right now the function calls look like this:
<? ad_disp{12, 1233s32); ?>
so we want a call that is as simple as this!
—> this needs to be done rightaway. so if you can’t do this in less than an hour don’t bid please.