Beispiel #1
0
 function import_settings($code)
 {
     if (preg_match("/var AdBrite_Title_Color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-title', $matches[1]);
         $code = str_replace("var AdBrite_Title_Color = '{$matches[1]}'", "var AdBrite_Title_Color = '{{color-title}}'", $code);
     }
     if (preg_match("/var AdBrite_Text_Color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-text', $matches[1]);
         $code = str_replace("var AdBrite_Text_Color = '{$matches[1]}'", "var AdBrite_Text_Color = '{{color-text}}'", $code);
     }
     if (preg_match("/var AdBrite_Background_Color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-bg', $matches[1]);
         $code = str_replace("var AdBrite_Background_Color = '{$matches[1]}'", "var AdBrite_Background_Color = '{{color-bg}}'", $code);
     }
     if (preg_match("/var AdBrite_Border_Color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-border', $matches[1]);
         $code = str_replace("var AdBrite_Border_Color = '{$matches[1]}'", "var AdBrite_Border_Color = '{{color-border}}'", $code);
     }
     if (preg_match("/var AdBrite_URL_Color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-link', $matches[1]);
         $code = str_replace("var AdBrite_URL_Color = '{$matches[1]}'", "var AdBrite_URL_Color = '{{color-link}}'", $code);
     }
     if (preg_match("/zs=(\\w*)/", $code, $matches) != 0) {
         $this->set_property('account-id', $matches[1]);
         $code = str_replace("zs={$matches[1]}", "zs={{account-id}}", $code);
     }
     if (preg_match("/sid=(\\w*)/", $code, $matches) != 0) {
         $this->set_property('slot', $matches[1]);
         $code = str_replace("sid={$matches[1]}", "sid={{slot}}", $code);
         $code = str_replace("opid={$matches[1]}", "sid={{slot}}", $code);
     }
     parent::import_settings($code);
 }
Beispiel #2
0
 function import_settings($code)
 {
     $width = '';
     $height = '';
     if (preg_match("/website=(\\w*)/", $code, $matches) != 0) {
         $this->set_property('account-id', $matches[1]);
         $code = str_replace("website={$matches[1]}", "website={{account-id}}'", $code);
     }
     if (preg_match("/width=(\\w*)/", $code, $matches) != 0) {
         $width = $matches[1];
         $code = str_replace("width={$matches[1]}", "width={{width}}'", $code);
     }
     if (preg_match("/height=(\\w*)/", $code, $matches) != 0) {
         $height = $matches[1];
         $code = str_replace("height={$matches[1]}", "height={{height}}'", $code);
     }
     if (preg_match("/style=\"width:(\\d*)px;height:(\\d*)px/", $code, $matches) != 0) {
         $code = str_replace("style=\"width:{$matches[1]}px;height:{$matches[2]}px", "style=\"width:{{xwidth}}px;height:{{xheight}}px", $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);
     }
     parent::import_settings($code);
 }
Beispiel #3
0
 function import_settings($code)
 {
     // Import parent settings first!
     parent::import_settings($code);
     // Slot ID
     if (preg_match('/sr_adspace_id( *)=( *)(\\d*);/', $code, $matches) != 0) {
         $this->set_property('slot', $matches[3]);
         $code = str_replace("sr_adspace_id{$matches[1]}={$matches[2]}{$matches[3]}", "sr_adspace_id{$matches[1]}={$matches[2]}{{slot}}", $code);
         $code = str_replace("azId={$matches[3]}", "azId={{slot}}", $code);
         $code = str_replace("ID #{$matches[3]}", "ID #{{slot}}", $code);
     }
     // Width / Height
     $width = '';
     $height = '';
     if (preg_match('/sr_adspace_width( *)=( *)(\\d*);/', $code, $matches) != 0) {
         $width = $matches[3];
         if ($width != '') {
             $this->set_property('width', $width);
         }
         $code = str_replace("sr_adspace_width{$matches[1]}={$matches[2]}{$width}", "sr_adspace_width{$matches[1]}={$matches[2]}{{width}}", $code);
     }
     if (preg_match('/sr_adspace_height( *)=( *)(\\d*);/', $code, $matches) != 0) {
         $height = $matches[3];
         if ($height != '') {
             $this->set_property('height', $height);
         }
         $code = str_replace("sr_adspace_height{$matches[1]}={$matches[2]}{$height}", "sr_adspace_height{$matches[1]}={$matches[2]}{{height}}", $code);
     }
     if ($width != '' && $height != '') {
         $adformats = $this->get_ad_formats();
         $adformat = in_array("{$width}x{$height}", $adformats['all']) ? "{$width}x{$height}" : 'custom';
         $this->set_property('adformat', $adformat);
     }
 }
Beispiel #4
0
 function import_settings($code)
 {
     if (preg_match('/(\\w*)\\.widgetbucks.com\\/script\\/(\\w*).js\\?uid=(\\w*)/', $code, $matches) != 0) {
         $this->set_property('slot', $matches[3]);
         $code = str_replace("{$matches[1]}.widgetbucks.com/script/{$matches[2]}.js?uid={$matches[3]}", "{$matches[1]}.widgetbucks.com/script/{$matches[2]}.js?uid={{slot}}", $code);
     }
     parent::import_settings($code);
 }
Beispiel #5
0
 function import_settings($code)
 {
     if (preg_match("/http:\\/\\/(\\w*).adroll.com\\/(\\w*)\\/(\\w*)\\/(\\w*)/", $code, $matches) != 0) {
         $this->set_property('account-id', $matches[3]);
         $this->set_property('slot', $matches[4]);
         $code = str_replace("http://{$matches[1]}.adroll.com/{$matches[2]}/{$matches[3]}/{$matches[4]}", "http://{$matches[1]}.adroll.com/{$matches[2]}/{{account-id}}/{{slot}}", $code);
     }
     parent::import_settings($code);
 }
Beispiel #6
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);
     }
     $code = str_replace('INSERT_RANDOM_NUMBER_HERE', '{{random}}', $code);
     parent::import_settings($code);
 }
Beispiel #7
0
 function import_settings($code)
 {
     if (preg_match('/ctxt_ad_partner( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('account-id', $matches[3]);
         $code = str_replace("ctxt_ad_partner{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_partner{$matches[1]}={$matches[2]}\"{{account-id}}\"", $code);
     }
     if (preg_match('/ctxt_ad_section( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('channel', $matches[3]);
         $code = str_replace("ctxt_ad_section{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_section{$matches[1]}={$matches[2]}\"{{channel}}\"", $code);
     }
     if (preg_match('/ctxt_ad_bc( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('color-border', $matches[3]);
         $code = str_replace("ctxt_ad_bc{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_bc{$matches[1]}={$matches[2]}\"{{color-border}}\"", $code);
     }
     if (preg_match('/ctxt_ad_cc( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('color-bg', $matches[3]);
         $code = str_replace("ctxt_ad_cc{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_cc{$matches[1]}={$matches[2]}\"{{color-bg}}\"", $code);
     }
     if (preg_match('/ctxt_ad_lc( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('color-title', $matches[3]);
         $code = str_replace("ctxt_ad_lc{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_lc{$matches[1]}={$matches[2]}\"{{color-title}}\"", $code);
     }
     if (preg_match('/ctxt_ad_tc( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('color-text', $matches[3]);
         $code = str_replace("ctxt_ad_tc{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_tc{$matches[1]}={$matches[2]}\"{{color-text}}\"", $code);
     }
     if (preg_match('/ctxt_ad_uc( *)=( *)"(.*)"/', $code, $matches)) {
         $this->set_property('color-link', $matches[3]);
         $code = str_replace("ctxt_ad_uc{$matches[1]}={$matches[2]}\"{$matches[3]}\"", "ctxt_ad_uc{$matches[1]}={$matches[2]}\"{{color-link}}\"", $code);
     }
     $width = '';
     $height = '';
     if (preg_match('/ctxt_ad_width( *)=( *)(\\d*)/', $code, $matches)) {
         $width = $matches[3];
         $code = str_replace("ctxt_ad_width{$matches[1]}={$matches[2]}{$matches[3]}", "ctxt_ad_width{$matches[1]}={$matches[2]}{{width}}", $code);
     }
     if (preg_match('/ctxt_ad_height( *)=( *)(\\d*)/', $code, $matches)) {
         $height = $matches[3];
         $code = str_replace("ctxt_ad_height{$matches[1]}={$matches[2]}{$matches[3]}", "ctxt_ad_height{$matches[1]}={$matches[2]}{{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
     }
     parent::import_settings($code);
 }
Beispiel #8
0
 function save_settings()
 {
     // Save settings to parent first!
     parent::save_settings();
     //Override adformat saving already
     switch ($this->get_property('adtype')) {
         case 'slot':
         case 'ad':
             $this->set_property('adformat', OX_Tools::sanitize($_POST['advman-adformat'], 'format'));
             break;
         case 'link':
             $this->set_property('adformat', OX_Tools::sanitize($_POST['advman-linkformat'], 'format'));
             break;
         case 'ref_image':
             $this->set_property('adformat', OX_Tools::sanitize($_POST['advman-referralformat'], 'format'));
             break;
         default:
             $this->set_property('adformat', '');
     }
     list($width, $height, $null) = split('[x]', $this->get_property('adformat'));
     $this->set_property('width', $width);
     $this->set_property('height', $height);
 }
Beispiel #9
0
 function import_settings($code)
 {
     if (preg_match("/www\\.adgridwork\\.com\\/\\?r=(\\d*)/", $code, $matches)) {
         $this->set_property('account-id', $matches[1]);
         $code = str_replace("www.adgridwork.com/?r={$matches[1]}", "www.adgridwork.com/?r={{account-id}}", $code);
     }
     if (preg_match('/var sid = \'(\\w*)\'/', $code, $matches)) {
         $this->set_property('slot', $matches[1]);
         $code = str_replace("var sid = '{$matches[1]}'", "var sid = '{{slot}}'", $code);
     }
     if (preg_match('/style=\\"color: #(\\w*);/', $code, $matches)) {
         $this->set_property('color-link', $matches[1]);
         $code = str_replace("style=\"color: #{$matches[1]};", "style=\"color: #{{color-link}};", $code);
     }
     if (preg_match("/var title_color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-title', $matches[1]);
         $code = str_replace("var title_color = '{$matches[1]}'", "var title_color = '{{color-title}}'", $code);
     }
     if (preg_match("/var description_color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-text', $matches[1]);
         $code = str_replace("var description_color = '{$matches[1]}'", "var description_color = '{{color-text}}'", $code);
     }
     if (preg_match("/var link_color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-url', $matches[1]);
         $code = str_replace("var link_color = '{$matches[1]}'", "var link_color = '{{color-link}}'", $code);
     }
     if (preg_match("/var background_color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-bg', $matches[1]);
         $code = str_replace("var background_color = '{$matches[1]}'", "var background_color = '{{color-bg}}'", $code);
     }
     if (preg_match("/var border_color = '(\\w*)'/", $code, $matches)) {
         $this->set_property('color-border', $matches[1]);
         $code = str_replace("var border_color = '{$matches[1]}'", "var border_color = '{{color-border}}'", $code);
     }
     parent::import_settings($code);
 }
Beispiel #10
0
 function import_settings($code)
 {
     // Import parent settings first!
     parent::import_settings($code);
     //Attempt to find html width/height strings
     $width = '';
     $height = '';
     if (preg_match('/width="(\\w*)"/', $code, $matches) != 0) {
         $width = $matches[1];
     }
     if (preg_match('/height="(\\w*)"/', $code, $matches) != 0) {
         $height = $matches[1];
     }
     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
     }
 }
Beispiel #11
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);
 }
Beispiel #12
0
 function import_settings($code)
 {
     if (preg_match("/shoppingads_ad_client(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('account-id', $matches[4]);
         $code = str_replace("shoppingads_ad_client{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_ad_client{$matches[1]}={$matches[2]}{$matches[3]}{{account-id}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_ad_campaign(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('campaign', $matches[4]);
         $code = str_replace("shoppingads_ad_campaign{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_ad_campaign{$matches[1]}={$matches[2]}{$matches[3]}{{campaign}}{$matches[5]}", $code);
     }
     //Process dimensions and fake adformat (to auto-select from list when editing) (NO CUSTOM OPTIONS)
     $width = '';
     $height = '';
     if (preg_match("/shoppingads_ad_height(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $height = $matches[4];
         $code = str_replace("shoppingads_ad_height{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_ad_height{$matches[1]}={$matches[2]}{$matches[3]}{{height}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_ad_width(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $width = $matches[4];
         $code = str_replace("shoppingads_ad_width{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_ad_width{$matches[1]}={$matches[2]}{$matches[3]}{{width}}{$matches[5]}", $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
     }
     if (preg_match("/shoppingads_ad_kw(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('keywords', $matches[4]);
         $code = str_replace("shoppingads_ad_kw{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_ad_kw{$matches[1]}={$matches[2]}{$matches[3]}{{keywords}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_color_border(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('color-border', $matches[4]);
         $code = str_replace("shoppingads_color_border{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_color_border{$matches[1]}={$matches[2]}{$matches[3]}{{color-border}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_color_bg(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('color-bg', $matches[4]);
         $code = str_replace("shoppingads_color_bg{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_color_bg{$matches[1]}={$matches[2]}{$matches[3]}{{color-bg}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_color_heading(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('color-title', $matches[4]);
         $code = str_replace("shoppingads_color_heading{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_color_heading{$matches[1]}={$matches[2]}{$matches[3]}{{color-title}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_color_text(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('color-text', $matches[4]);
         $code = str_replace("shoppingads_color_text{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_color_text{$matches[1]}={$matches[2]}{$matches[3]}{{color-text}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_color_link(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('color-link', $matches[4]);
         $code = str_replace("shoppingads_color_link{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_color_link{$matches[1]}={$matches[2]}{$matches[3]}{{color-link}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_attitude(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('attitude', $matches[4]);
         $code = str_replace("shoppingads_attitude{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_attitude{$matches[1]}={$matches[2]}{$matches[3]}{{attitude}}{$matches[5]}", $code);
     }
     if (preg_match("/shoppingads_options(\\s*)=(\\s*)([\\'\"]{1})(\\w*)([\\'\"]{1});/", $code, $matches) != 0) {
         $this->set_property('new-window', $matches[4] == 'n' ? 'yes' : 'no');
         $code = str_replace("shoppingads_options{$matches[1]}={$matches[2]}{$matches[3]}{$matches[4]}{$matches[5]}", "shoppingads_options{$matches[1]}={$matches[2]}{$matches[3]}{{new-window}}{$matches[5]}", $code);
     }
     parent::import_settings($code);
 }
Beispiel #13
0
 function import_settings($code)
 {
     if (preg_match('/http:\\/\\/([.\\w]*)\\/click-(\\d*)-(\\d*)/', $code, $matches) != 0) {
         $this->set_property('account-id', $matches[2]);
         $this->set_property('slot', $matches[3]);
         $code = str_replace("http://{$matches[1]}/click-{$matches[2]}-{$matches[3]}", "http://{{xdomain}}/click-{{account-id}}-{{slot}}", $code);
     }
     $a = $matches[2];
     $s = $matches[3];
     if (preg_match("/http:\\/\\/([.\\w]*)\\/image-{$a}-{$s}/", $code, $matches) != 0) {
         $code = str_replace("http://{$matches[1]}/image-{$a}-{$s}", "http://{{xdomain}}/image-{{account-id}}-{{slot}}", $code);
     }
     if (preg_match("/onmouseover=\"window.status='([^']*)';return true;\"/", $code, $matches)) {
         $this->set_property('status', $matches[1]);
         $code = str_replace("onmouseover=\"window.status='{$matches[1]}';return true;\"", "onmouseover=\"window.status='{{status}}';return true;\"", $code);
     }
     if (preg_match("/ alt=\"([^\"]*)\"/", $code, $matches)) {
         $this->set_property('alt-text', $matches[1]);
         $code = str_replace(" alt=\"{$matches[1]}\"", " alt=\"{{alt-text}}\"", $code);
     }
     if ($v = strpos($code, " target=\"_blank\"")) {
         $this->set_property('new-window', 'yes');
         $code = str_replace(" target=\"_blank\"", "{{new-window}}", $code);
     }
     $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
     }
     parent::import_settings($code);
 }
Beispiel #14
0
 function get_preview_url()
 {
     $url = parent::get_preview_url();
     return $url . '#chitikatest=mortgage';
 }