OX_Network(); $this->name = 'OpenX'; $this->short_name = 'openx'; } /** * 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->add_action('ad_network', get_class()); } function get_default_properties() { $properties = array( 'slot' => '', ); return $properties + parent::get_default_properties(); } function get_ad_colors() { return array('border', 'title', 'bg', 'text'); } function import($code) { $ad = false; if ((strpos($code, 'd1.openx.org') !== false) || (strpos($code, 'MAX_used') !== false)) { $ad = OX_Ad::to_object(); $ad->network_type = get_class(); if (preg_match("/zoneid=(\w*)/", $code, $matches) !=0) { $ad->set_property('slot', $matches[1]); $code = str_replace('zoneid=' . $matches[1], 'zoneid={{slot}}', $code); } $code = str_replace('INSERT_RANDOM_NUMBER_HERE', '{{random}}', $code); $ad->set_property('code', $code); } return $ad; } } /* */ ?>