'AdGridWork', 'shortname' => 'adgrid', 'www' => 'http://www.adgridwork.com/', //'www-create' => 'http://www.adbrite.com/zones/commerce/purchase.php?product_id_array=22', 'www-signup' => 'http://www.adgridwork.com/?r=18501', ); /* INITIALISATION All functions in here called at startup (after other plugins have loaded, in case we need to wait for the widget-plugin). */ class Ad_AdGridWork extends Ad_Generic { function Ad_AdGridWork(){ $this->Ad_Generic(); } function render_ad(){ $code ='Free Advertising'; $code.=''; return $code; } function render_benice(){ $this->set_account_id('18501'); //TEMPORARILY override the account id return $this->render_ad(); } function can_benice(){return true;} function save_settings_network() { $this->p['slot']=strip_tags(stripslashes($_POST['adsensem-slot'])); $this->p['code']=stripslashes($_POST['adsensem-code']); $this->p['color-border']=strip_tags(stripslashes($_POST['adsensem-color-border'])); $this->p['color-title']=strip_tags(stripslashes($_POST['adsensem-color-title'])); $this->p['color-bg']=strip_tags(stripslashes($_POST['adsensem-color-bg'])); $this->p['color-text']=strip_tags(stripslashes($_POST['adsensem-color-text'])); $this->p['color-url']=strip_tags(stripslashes($_POST['adsensem-color-url'])); } function reset_defaults_network() { global $_adsensem; $_adsensem['defaults'][$this->network()]+= array ( 'color-border'=> '646360', 'color-title' => '000000', 'color-bg' => 'FFFFFF', 'color-text' => '646360', 'color-url' => '7FBE00', ); } function import_detect_network($code){ return ( (strpos($code,'www.adgridwork.com')!==false) || (strpos($code,'www.mediagridwork.com/mx.js')!==false) ); } function import_settings($code){ if(preg_match('/var sid = \'(\w*)\'/', $code, $matches)!=0){ $_POST['adsensem-account-id'] = $matches[1]; } if(preg_match("/var title_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-title'] = $matches[1]; } if(preg_match("/var description_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-text'] = $matches[1]; } if(preg_match("/var link_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-url'] = $matches[1]; } if(preg_match("/var background_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-bg'] = $matches[1]; } if(preg_match("/var border_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-border'] = $matches[1]; } $this->save_settings(); } function _form_settings_ad_unit(){ adsensem_admin::_field_input('Name','name',$this->name,15,'Name for this Ad Unit'); ?>