'http://www.crispads.com/spinner/www/admin/zone-edit.php',
'www-signup' => 'http://www.crispads.com/'
);
class OX_Adnet_Crispads extends OX_Adnet
{
/**
* The short name for any ad of this type, used when generating a unique name for the ad, or creating class files
*/
var $shortName = 'Crispads';
/**
* The URL for the home page of the ad network site
*/
var $url = 'http://www.crispads.com';
/**
* The name of the network. Used when displaying ads by network.
*/
var $networkName = 'Crisp Ads';
function OX_Adnet_Crispads()
{
$this->OX_Adnet();
}
function get_default_properties()
{
$properties = array(
'identifier' => '',
'slot' => '',
);
return $properties + parent::get_default_properties();
}
function import_detect_network($code)
{
return ( preg_match('/http:\/\/www.crispads.com\/spinner\//', $code, $matches) !==0);
}
function import_settings($code)
{
// Import parent settings first!
parent::import_settings($code);
if (preg_match("/zoneid=(\w*)/", $code, $matches) !=0) {
$this->set('slot', $matches[1]);
$code = str_replace("zoneid={$matches[1]}", "zoneid={{slot}}", $code);
}
if (preg_match("/n=(\w*)/", $code, $matches)!=0) {
$this->set('identifier', $matches[1]);
$code = str_replace("n={$matches[1]}", "n={{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('width', $width);
}
if ($height != '') {
$this->set('height', $height);
}
if (($width != '') && ($height != '')) {
$this->set('adformat', $width . 'x' . $height); //Only set if both width and height present
}
$code = str_replace('INSERT_RANDOM_NUMBER_HERE', '{{random}}', $code);
$this->set('code', $code);
}
}
/*
// JAVASCRIPT
//IFRAME
*/
?>