'ShoppingAds', 'shortname' => 'shops', 'www' => 'http://shoppingads.com/', 'www-create' => 'http://shoppingads.com/getcode/', 'www-signup' => 'http://www.shoppingads.com/refer_1ebff04bf5805f6da1b4', ); /* 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_ShoppingAds extends Ad_Generic { function Ad_ShoppingAds(){ $this->Ad_Generic(); } function render_ad(){ $code = ' ' . "\n"; return $code; } function save_settings_network() { $this->p['campaign']=strip_tags(stripslashes($_POST['adsensem-campaign'])); $this->p['keywords']=strip_tags(stripslashes($_POST['adsensem-keywords'])); $this->p['attitude']=strip_tags(stripslashes($_POST['adsensem-attitude'])); $this->p['new-window']=strip_tags(stripslashes($_POST['adsensem-new-window'])); //$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-link']=strip_tags(stripslashes($_POST['adsensem-color-link'])); } function reset_defaults_network() { global $_adsensem; $_adsensem['defaults'][$this->network()]+= array ( 'color-border'=> 'FFFFFF', 'color-bg' => 'FFFFFF', 'color-title' => '00A0E2', 'color-text' => '000000', 'color-link' => '008000', 'campaign' => '', 'keywords' => '', 'attitude' => 'cool', 'new-window' => 'no', 'adformat' => '250x250', ); } function import_detect_network($code){ return ( strpos($code,'shoppingads_ad_client')!==false ); } function import_settings($code){ /* shoppingads_ad_client = "1ebff04bf5805f6da1b4"; shoppingads_ad_campaign = "default"; shoppingads_ad_width = "300"; shoppingads_ad_height = "250"; shoppingads_ad_kw = "test"; */ if(preg_match('/shoppingads_ad_campaign(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-campaign'] = $matches[3]; } //Process dimensions and fake adformat (to auto-select from list when editing) (NO CUSTOM OPTIONS) if(preg_match('/shoppingads_ad_height(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-height'] = $matches[3]; } if(preg_match('/shoppingads_ad_width(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-width'] = $matches[3]; } $_POST['adsensem-adformat']=$_POST['adsensem-width'] . 'x' . $_POST['adsensem-height']; if(preg_match('/shoppingads_ad_kw(\s*)=(\s*)"([^"]*)"/', $code, $matches)!=0){ $_POST['adsensem-keywords'] = $matches[3]; } if(preg_match('/shoppingads_color_border(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-color-border'] = $matches[3]; } if(preg_match('/shoppingads_color_bg(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-color-bg'] = $matches[3]; } if(preg_match('/shoppingads_color_heading(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-color-title'] = $matches[3]; } if(preg_match('/shoppingads_color_text(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-color-text'] = $matches[3]; } if(preg_match('/shoppingads_color_link(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-color-link'] = $matches[3]; } if(preg_match('/shoppingads_attitude(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-attitude'] = $matches[3]; } if(preg_match('/shoppingads_options(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ ($matches[3]=='n')?$_POST['adsensem-new-window']='yes':$_POST['adsensem-new-window']='no'; } if(preg_match('/shoppingads_ad_client(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-account-id'] = $matches[3]; } $this->save_settings(); } function can_benice(){return true;} function render_benice(){ $this->set_account_id('X1ebff04bf5805f6da1b4'); //TEMPORARILY override the account id $this->p['campaign']='Xc8f5066b6a2f228b72a8ed3ae98ce017';; return $this->render_ad(); } function _form_settings_colors(){ $this->_form_settings_colors_generate(array('Border'=>'border','Description'=>'title','Background'=>'bg','Price'=>'text','Footer'=>'link')); } function _form_settings_colors_demo(){ ?>