I am using OpenX to serve bannerads to our Drupal 5.x site.

Until now I have used the javascript type of invocation codes to place banners. It has worked fine, except all the javascript is slowing down the site. To increase the speed of the site, I would like to replace the javascript invocation codes with XML-RPC invocation codes.

I can get this swap to work where the invocation codes is placed in the page templates. But where the invocation codes have been placed in blocks replacing javascript with xml-rpc does not work. I am left puzzled as to why this is.

The same snippets of XML-RPC invocation codes which works fine when placed directly in the page templates - ads show up correctly - won't work when transplanted into a block

---

This is an example: (The number 12 refers to the specific zone id and particular ad format)

This piece of code is placed in the page template header:

//ini_set('include_path', '.:/usr/local/lib/php/');
require 'files/openads-xmlrpc.inc.php';

    if (!isset($OA_context)) $OA_context = array();
    $oaXmlRpc = new OA_XmlRpc('x-ray-mag.com', '/openads/www/delivery/axmlrpc.php', 0, false, 15);

    $adArray[12] = $oaXmlRpc->view('zone:12', 0, '', '', 0, $OA_context);
    $OA_context[] = array('!=' => 'bannerid:'.$adArray[12]['bannerid']);

This stump of code is then placed where I want the bannerad to show up:
echo $adArray[12]['html'];

---

Just copying in that same last line into a block doesn't work - nothing shows up. (I did remember to set the input format options for the block to php. The block itself is also ok, as anything else i.e. the title and amended texts will show up ok in the right place).

I having a nagging suspicion that it some sort of path issue I am missing - it seems the block doesn't make the connection with the statements in the header.

Can anyone direct me to what I need to include in the block or tweak to make it work?

Best regards

Peter S.