Home > PHP, Programming > Fix Openx Direct Selection

Fix Openx Direct Selection

September 25th, 2009

I have a server that uses OpenX to display ads. All my zone selections are working, but direct selections are not.
At the top of the page, I have:

<?php
// The MAX_PATH below should point to the base of your OpenX installation
define(‘MAX_PATH’, ‘/home/traderef/public_html/miningreference/phpAdsNew’);
if (include_once(MAX_PATH . ‘/www/delivery/alocal.php’)) {
if (!isset($phpAds_context)) {
$phpAds_context = array();
}
// function view_local($what, $zoneid=0, $campaignid=0, $bannerid=0, $target=”, $source=”, $withtext=”, $context=”, $charset=”)
$phpAds_inc_ok = TRUE; // variable that tells all the ads that the include worked
}
?>

At each zone selection ad place, I have:

<?php
if ($phpAds_inc_ok) {
$phpAds_raw = view_local(”, 12, 0, 0, ”, ”, ’0′, $phpAds_context, ”);
$phpAds_context[] = array(‘!=’ => ‘bannerid:’.$phpAds_raw['bannerid']);
}
echo $phpAds_raw['html'];
?>

This is working.

For Direct Selection, I have:
<?php
if ($phpAds_inc_ok) {
$phpAds_raw = view_local(”, 10, 0, 0, ”, ”, ’0′, $phpAds_context, ”);
$phpAds_context[] = array(‘!=’ => ‘bannerid:’.$phpAds_raw['bannerid']);
}
echo $phpAds_raw['html'];
?>
</div>

This is NOT working.

I need someone to help me get sorted out ASAP.


Fix Openx Direct Selection

Comments are closed.
Bear