OX_Ad($aAd);
}
/**
* This function is called statically from the ad engine. Use this function to put any hooks in the ad engine that you want to use.
*/
function register_plugin(&$engine)
{
$engine->addAction('ad_network', get_class($this));
}
function get_network_property_defaults()
{
$properties = array(
'identifier' => '',
'slot' => '',
);
return $properties + parent::get_network_property_defaults();
}
function get_ad_formats()
{
return array('all' => array('custom', '728x90', '468x60', '234x60', '150x50', '120x90', '120x60', '83x31', '120x600', '160x600', '240x400', '120x240', '336x280', '300x250', '250x250', '200x200', '180x150', '125x125'));
}
function get_ad_colors()
{
return array('border', 'title', 'bg', 'text');
}
function import_detect_network($code)
{
return ( preg_match('/http:\/\/www.crispads.com\/spinner\//', $code, $matches) !==0);
}
function import_settings($code)
{
if (preg_match("/zoneid=(\w*)/", $code, $matches) !=0) {
$this->set_property('slot', $matches[1]);
$code = str_replace("zoneid={$matches[1]}", "zoneid={{slot}}", $code);
}
if (preg_match("/n=(\w*)/", $code, $matches)!=0) {
$this->set_property('identifier', $matches[1]);
$code = str_replace("n={$matches[1]}", "n={{identifier}}", $code);
$code = str_replace("id=\"{$matches[1]}\"", "id=\"{{identifier}}\"", $code);
$code = str_replace("name=\"{$matches[1]}\"", "name=\"{{identifier}}\"", $code);
}
//Only available on IFRAME ads
$width = '';
$height = '';
if (preg_match('/width="(\w*)"/', $code, $matches) != 0) {
$width = $matches[1];
$code = str_replace("width=\"{$width}\"", "width=\"{{width}}\"", $code);
}
if (preg_match('/height="(\w*)"/', $code, $matches) != 0) {
$height = $matches[1];
$code = str_replace("height=\"{$height}\"", "height=\"{{height}}\"", $code);
}
if ($width != '') {
$this->set_property('width', $width);
}
if ($height != '') {
$this->set_property('height', $height);
}
if (($width != '') && ($height != '')) {
$this->set_property('adformat', $width . 'x' . $height); //Only set if both width and height present
}
$code = str_replace('INSERT_RANDOM_NUMBER_HERE', '{{random}}', $code);
parent::import_settings($code);
}
}
/*
// JAVASCRIPT
//IFRAME
*/
?>