AdSense Manager - Version 3.1.0

Version Description

Download this release

Release Info

Developer mutube
Plugin Icon wp plugin AdSense Manager
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0 to 3.1.0

adsense-manager.css CHANGED
@@ -101,12 +101,15 @@ th {border-bottom:2px solid #000;font-size:smaller;}
101
 
102
  .network_header a {border-bottom:none;text-decoration:underline;}
103
 
104
- .Ad_AdBrite {padding-left: 25px; background: transparent url(http://files.adbrite.com/mb/images/favicon.ico) no-repeat center left; }
105
- .Ad_AdRoll {padding-left:25px;background:url(http://www.adroll.com/i/favicon.ico) left no-repeat;}
106
- .Ad_AdSense {padding-left:25px;background:url(http://www.google.com/favicon.ico) left no-repeat;}
107
- .Ad_AdSense_Classic {padding-left:25px;background:url(http://www.google.com/favicon.ico) left no-repeat;}
108
- .Ad_CJ {padding-left:25px;background:url(http://www.cj.com/favicon.ico) left no-repeat;}
109
- .Ad_Code {padding-left:25px;background:url(./code.png) left no-repeat;}
110
- .Ad_WidgetBucks {padding-left:25px;background:url(http://www.widgetbucks.com/favicon.ico) left no-repeat;}
111
- .Ad_ShoppingAds {padding-left:25px;background:url(./shoppingads.png) left no-repeat;}
112
- .Ad_Adpinion {padding-left:25px;background:url(http://www.adpinion.com/static/images/logo_small.gif) left no-repeat;}
 
 
 
101
 
102
  .network_header a {border-bottom:none;text-decoration:underline;}
103
 
104
+ .ad_adbrite {padding-left: 25px; background: transparent url(http://files.adbrite.com/mb/images/favicon.ico) no-repeat center left; }
105
+ .ad_adgridwork {padding-left: 25px; background: transparent url(http://www.adgridwork.com/favicon.ico) no-repeat center left; }
106
+ .ad_adpinion {padding-left:25px;background:url(http://www.adpinion.com/static/images/logo_small.gif) left no-repeat;}
107
+ .ad_adroll {padding-left:25px;background:url(http://www.adroll.com/i/favicon.ico) left no-repeat;}
108
+ .ad_adsense {padding-left:25px;background:url(http://www.google.com/favicon.ico) left no-repeat;}
109
+ .ad_adsense_classic {padding-left:25px;background:url(http://www.google.com/favicon.ico) left no-repeat;}
110
+ .ad_cj {padding-left:25px;background:url(http://www.cj.com/favicon.ico) left no-repeat;}
111
+ .ad_code {padding-left:25px;background:url(./code.png) left no-repeat;}
112
+ .ad_crispads {padding-left:25px;background:url(http://www.crispads.com/favicon.ico) left no-repeat;}
113
+ .ad_widgetbucks {padding-left:25px;background:url(http://www.widgetbucks.com/favicon.ico) left no-repeat;}
114
+ .ad_shoppingads {padding-left:25px;background:url(./shoppingads.png) left no-repeat;}
115
+ .ad_ypn {padding-left:25px;background:url(http://www.yahoo.com/favicon.ico) left no-repeat;}
adsense-manager.php CHANGED
@@ -4,20 +4,19 @@ Plugin Name: AdSense Manager
4
  PLugin URI: http://wordpress.org/extend/plugins/adsense-manager/
5
  Description: Control and arrange your AdSense & Referral blocks on your Wordpress blog. With Widget and inline post support, configurable colours.
6
  Author: Martin Fitzpatrick
7
- Version: 3.0
8
  Author URI: http://www.mutube.com/
9
  */
 
10
 
11
  /*
12
  TODO:
13
 
14
  Defaults
15
  * highlight the fields for which there are default settings
16
- * is this making code overcomplicated? rearrange into functions/etc.
17
-
18
  */
19
 
20
- @define("ADSENSEM_VERSION", "3.0");
21
  @define('ADSENSEM_DIRPATH','/wp-content/plugins' . strrchr(dirname(__FILE__),'/') . "/");
22
 
23
  /*
@@ -52,25 +51,24 @@ Defaults
52
  require_once('class-generic.php');
53
 
54
  require_once('class-adsense.php'); //Adsense (using Slots, etc.)
 
55
 
56
- require_once('class-adsense-classic.php'); //AdSense units pre-slot style
57
- require_once('class-adsense-ad.php'); //AdSense Ad units pre-slot style
58
- require_once('class-adsense-link.php'); //AdSense Link units pre-slot style
59
- require_once('class-adsense-referral.php'); //AdSense Referral units pre-slot style
60
-
61
  require_once('class-adpinion.php'); //Adpinion
62
  require_once('class-adroll.php'); //AdRoll
63
- require_once('class-adbrite.php'); //AdBrite
64
  require_once('class-cj.php'); //Commission Junction
65
- //require('class-ypn.php'); //Yahoo! Publisher Network - not yet supported
66
  require_once('class-code.php'); //HTML Code
 
67
  require_once('class-shoppingads.php'); //ShoppingAds
 
68
  require_once('class-widgetbucks.php'); //Widgetbucks
69
 
70
  if(is_admin()){ require_once('class-admin.php'); } //Admin interface functions (keep out while browsing main site
71
 
72
  $_adsensem = get_option('plugin_adsensem');
73
  $_adsensem_notices = array();
 
74
 
75
 
76
  /*
@@ -90,7 +88,11 @@ if(!function_exists('adsensem_ad')) {
90
  {$ad=$_adsensem['ads'][$_adsensem['default-ad']];}
91
  else
92
  {$ad=$_adsensem['ads'][$name];}
93
- echo adsensem::get_ad($ad,$name);
 
 
 
 
94
  }
95
  }
96
 
@@ -138,44 +140,59 @@ class adsensem {
138
  global $_adsensem;
139
  /* SITE SECTION: WIDGET DISPLAY CODE
140
  /* Add the blocks to the Widget panel for positioning WP2.2+*/
141
- $args = array('n' => $name, 'height' => 80, 'width' => 300);
142
 
143
- if (function_exists('wp_register_sidebar_widget') )
144
  {
 
 
 
 
 
145
  /* Loop through available ads and generate widget one at a time */
146
  if(is_array($_adsensem['ads'])){
147
  foreach($_adsensem['ads'] as $name => $ad){
148
- $args = array('n' => $name, 'height' => 80, 'width' => 300);
149
  //$id, $name, $output_callback, $_adsensem = array()
150
- wp_register_sidebar_widget('adsensem-' . $name,'Ad #' . $name, array('adsensem','widget'), $args, $name);
151
- wp_register_widget_control('adsensem-' . $name,'Ad #' . $name, array('adsensem','widget_control'), $args, $name);
152
  }
153
  }
154
-
155
- }
156
-
157
  }
158
 
159
-
 
 
 
 
 
 
 
 
 
 
 
 
160
  // This is the function that outputs adsensem widget.
161
- function widget($args, $n=0) {
162
- // $args is an array of strings that help widgets to conform to
163
- // the active theme: before_widget, before_title, after_widget,
164
- // and after_title are the array keys. Default tags: li and h2.
165
- extract($args);
166
- global $_adsensem;
167
 
168
- // Each widget can store its own options. We keep strings here.
169
- $ad = $_adsensem['ads'][$n];
170
 
171
- // These lines generate our output. Widgets can be very complex
172
- // but as you can see here, they can also be very, very simple.
173
- echo $before_widget;
174
- if($ad->title!=''){ echo $before_title . $ad->title . $after_title; }
175
- echo $ad->get_ad(); //Output the selected ad
176
- echo $after_widget;
177
- }
178
-
 
 
179
  /* Widget admin block for each Ad element on the page, allows
180
  movement of them around the sidebar */
181
  function widget_control($name)
@@ -207,27 +224,51 @@ class adsensem {
207
  }
208
 
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
 
211
  /* This filter parses post content and replaces markup with the correct ad,
212
  <!--adsense#name--> for named ad or <!--adsense--> for default */
213
  function filter_ads($content) {
214
  global $_adsensem;
215
-
216
  if(is_object($_adsensem['ads'][$_adsensem['default-ad']])){
217
- //Insert default ad first
218
- $content=str_replace(array("<!--adsense-->","<!--am-->"),$_adsensem['ads'][$_adsensem['default-ad']]->get_ad(),$content);
219
-
220
- foreach($_adsensem['ads'] as $name=>$ad)
221
- { $content = str_replace(array("<!--adsense#" . $name . "-->","<!--am#" . $name . "-->"), $ad->get_ad(), $content); }
222
  }
223
-
224
- return $content;
225
  }
226
 
227
  }
228
 
229
 
230
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  /* SHOW ALTERNATE AD UNITS */
232
  if ($_REQUEST['adsensem-show-ad']){
233
  ?><html><body><?php
@@ -247,7 +288,14 @@ if ($_REQUEST['adsensem-benice']){
247
  /* END BENICE UNITS */
248
 
249
 
250
-
 
 
 
 
 
 
 
251
 
252
 
253
  /* PRE-OUTPUT PROCESSING - e.g. NOTICEs (upgrade-adsense-deluxe) */
@@ -269,7 +317,22 @@ switch ($_POST['adsensem-mode'].':'.$_POST['adsensem-action']){
269
 
270
 
271
 
 
 
 
 
 
 
 
 
 
 
272
  add_action('plugins_loaded', array('adsensem','init'), 1);
273
  add_action('widgets_init', array('adsensem','init_widgets'), 1);
274
 
 
 
 
 
 
275
  ?>
4
  PLugin URI: http://wordpress.org/extend/plugins/adsense-manager/
5
  Description: Control and arrange your AdSense & Referral blocks on your Wordpress blog. With Widget and inline post support, configurable colours.
6
  Author: Martin Fitzpatrick
7
+ Version: 3.1.0
8
  Author URI: http://www.mutube.com/
9
  */
10
+ @define("ADSENSEM_VERSION", "3.1.0");
11
 
12
  /*
13
  TODO:
14
 
15
  Defaults
16
  * highlight the fields for which there are default settings
 
 
17
  */
18
 
19
+
20
  @define('ADSENSEM_DIRPATH','/wp-content/plugins' . strrchr(dirname(__FILE__),'/') . "/");
21
 
22
  /*
51
  require_once('class-generic.php');
52
 
53
  require_once('class-adsense.php'); //Adsense (using Slots, etc.)
54
+ require_once('class-adsense-classic.php'); //AdSense units pre-slot style
55
 
56
+ require_once('class-adbrite.php'); //AdBrite
57
+ require_once('class-adgridwork.php'); //AdGridWork
 
 
 
58
  require_once('class-adpinion.php'); //Adpinion
59
  require_once('class-adroll.php'); //AdRoll
 
60
  require_once('class-cj.php'); //Commission Junction
 
61
  require_once('class-code.php'); //HTML Code
62
+ require_once('class-crispads.php'); //Crisp Ads
63
  require_once('class-shoppingads.php'); //ShoppingAds
64
+ require_once('class-ypn.php'); //Yahoo! Publisher Network - not yet supported
65
  require_once('class-widgetbucks.php'); //Widgetbucks
66
 
67
  if(is_admin()){ require_once('class-admin.php'); } //Admin interface functions (keep out while browsing main site
68
 
69
  $_adsensem = get_option('plugin_adsensem');
70
  $_adsensem_notices = array();
71
+ $_adsensem_counters = array();
72
 
73
 
74
  /*
88
  {$ad=$_adsensem['ads'][$_adsensem['default-ad']];}
89
  else
90
  {$ad=$_adsensem['ads'][$name];}
91
+
92
+ if($ad->show_ad_here()){
93
+ echo $ad->get_ad();
94
+ $ad->counter_click();
95
+ }
96
  }
97
  }
98
 
140
  global $_adsensem;
141
  /* SITE SECTION: WIDGET DISPLAY CODE
142
  /* Add the blocks to the Widget panel for positioning WP2.2+*/
 
143
 
144
+ if (function_exists('wp_register_sidebar_widget') || function_exists('register_sidebar_module') )
145
  {
146
+
147
+ /* Create Ad Unit for the 'Default Ad' */
148
+ //$args = array('name' => 'default-ad', 'height' => 80, 'width' => 300);
149
+ //adsensem::register_widget('default-ad',$args);
150
+
151
  /* Loop through available ads and generate widget one at a time */
152
  if(is_array($_adsensem['ads'])){
153
  foreach($_adsensem['ads'] as $name => $ad){
154
+ $args = array('name' => $name, 'height' => 80, 'width' => 300);
155
  //$id, $name, $output_callback, $_adsensem = array()
156
+ adsensem::register_widget($name,$args);
 
157
  }
158
  }
159
+ }
 
 
160
  }
161
 
162
+
163
+ function register_widget($name,$args){
164
+
165
+ if(function_exists('wp_register_sidebar_widget')){
166
+ wp_register_sidebar_widget('adsensem-' . $name,'Ad #' . $name, array('adsensem','widget'), $args, $name);
167
+ wp_register_widget_control('adsensem-' . $name,'Ad #' . $name, array('adsensem','widget_control'), $args, $name);
168
+ } else if (function_exists('register_sidebar_module') ){
169
+ register_sidebar_module('Ad #' . $name, 'adsensem_sbm_widget', 'adsensem-' . $name, $args );
170
+ register_sidebar_module_control('Ad #' . $name, array('adsensem','widget_control'), 'adsensem-' . $name);
171
+ }
172
+ }
173
+
174
+
175
  // This is the function that outputs adsensem widget.
176
+ function widget($args,$n) {
177
+ // $args is an array of strings that help widgets to conform to
178
+ // the active theme: before_widget, before_title, after_widget,
179
+ // and after_title are the array keys. Default tags: li and h2.
180
+ extract($args); //nb. $name comes out of this, hence the use of $n
181
+ global $_adsensem;
182
 
183
+ // Each widget can store its own options. We keep strings here.
184
+ if($n){$ad = $_adsensem['ads'][$n];} else {$ad = $_adsensem['ads'][$_adsensem['default-ad']];}
185
 
186
+ if($ad->show_ad_here()){
187
+ $ad->counter_click();
188
+
189
+ echo $before_widget;
190
+ if($ad->title!=''){ echo $before_title . $ad->title . $after_title; }
191
+ echo $ad->get_ad(); //Output the selected ad
192
+
193
+ echo $after_widget;
194
+ }
195
+ }
196
  /* Widget admin block for each Ad element on the page, allows
197
  movement of them around the sidebar */
198
  function widget_control($name)
224
  }
225
 
226
 
227
+ function filter_ad_callback($matches){
228
+ global $_adsensem;
229
+
230
+ if($matches[1]==''){ /* default ad */ $matches[1]=$_adsensem['default-ad']; }
231
+
232
+ if(isset($_adsensem['ads'][$matches[1]])){
233
+ $ad=$_adsensem['ads'][$matches[1]];
234
+ if($ad->show_ad_here()){
235
+ $ad->counter_click();
236
+ return $ad->get_ad();
237
+ }
238
+ }
239
+ return '';
240
+ }
241
+
242
 
243
  /* This filter parses post content and replaces markup with the correct ad,
244
  <!--adsense#name--> for named ad or <!--adsense--> for default */
245
  function filter_ads($content) {
246
  global $_adsensem;
247
+
248
  if(is_object($_adsensem['ads'][$_adsensem['default-ad']])){
249
+ $content=preg_replace_callback(array("/<!--adsense-->/","/<!--am-->/"),array('adsensem','filter_ad_callback'),$content);
250
+ $content=preg_replace_callback(array("/<!--adsense#(.*)-->/","/<!--am#(.*)-->/"),array('adsensem','filter_ad_callback'),$content);
 
 
 
251
  }
252
+
253
+ return $content;
254
  }
255
 
256
  }
257
 
258
 
259
 
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
  /* SHOW ALTERNATE AD UNITS */
273
  if ($_REQUEST['adsensem-show-ad']){
274
  ?><html><body><?php
288
  /* END BENICE UNITS */
289
 
290
 
291
+ /* REVERT TO PREVIOUS BACKUP OF AD DATABASE */
292
+ if ($_REQUEST['adsensem-revert-db']){
293
+ $backup=get_option('plugin_adsensem_backup');
294
+ $_adsensem=$backup[$_REQUEST['adsensem-revert-db']];
295
+ update_option('plugin_adsensem',$_adsensem);
296
+ if($_REQUEST['adsensem-block-upgrade']){die();}
297
+ }
298
+ /* END REVERT TO PREVIOUS BACKUP OF AD DATABASE */
299
 
300
 
301
  /* PRE-OUTPUT PROCESSING - e.g. NOTICEs (upgrade-adsense-deluxe) */
317
 
318
 
319
 
320
+
321
+ /* SIDEBAR MODULES COMPATIBILITY FUNCTION */
322
+ function adsensem_sbm_widget($args){
323
+ global $k2sbm_current_module;
324
+ adsensem::widget($args,$k2sbm_current_module->options['name']);
325
+ }
326
+ /* SIDEBAR MODULES COMPATIBILITY FUNCTION */
327
+
328
+
329
+
330
  add_action('plugins_loaded', array('adsensem','init'), 1);
331
  add_action('widgets_init', array('adsensem','init_widgets'), 1);
332
 
333
+ function kda_mce_callback(){
334
+ // echo " handle_event_callback : \"scheduleScan\",\n";
335
+ }
336
+ add_action('mce_options', 'kda_mce_callback');
337
+
338
  ?>
class-adbrite.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdBrite'] = array(
6
  'name' => 'AdBrite',
7
  'shortname' => 'adbrite',
8
  'www' => 'http://www.adbrite.com/',
@@ -44,8 +44,8 @@ class Ad_AdBrite extends Ad_Generic {
44
  $code .= "var AdBrite_Background_Color = '" . $this->pd('color-bg') . "'\n";
45
  $code .= "var AdBrite_Border_Color = '" . $this->pd('color-border') . "'\n";
46
  $code .= '</script>' . "\n";
47
- $code .= '<script src="http://ads.adbrite.com/mb/text_group.php?sid=' . $this->account_id() . '&zs=' . $this->pd('slot') . '" type="text/javascript"></script>';
48
- $code .= '<div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=' . $this->account_id() . '&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>';
49
  $code .= '<!-- End: AdBrite -->';
50
 
51
  return $code;
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adbrite'] = array(
6
  'name' => 'AdBrite',
7
  'shortname' => 'adbrite',
8
  'www' => 'http://www.adbrite.com/',
44
  $code .= "var AdBrite_Background_Color = '" . $this->pd('color-bg') . "'\n";
45
  $code .= "var AdBrite_Border_Color = '" . $this->pd('color-border') . "'\n";
46
  $code .= '</script>' . "\n";
47
+ $code .= '<script src="http://ads.adbrite.com/mb/text_group.php?sid=' . $this->pd('slot') . '&zs=' . $this->account_id() . '" type="text/javascript"></script>';
48
+ $code .= '<div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=' . $this->pd('slot') . '&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>';
49
  $code .= '<!-- End: AdBrite -->';
50
 
51
  return $code;
class-adgridwork.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!ADSENSEM_VERSION){die();}
4
+
5
+ $_adsensem_networks['ad_adgridwork'] = array(
6
+ 'name' => 'AdGridWork',
7
+ 'shortname' => 'adgrid',
8
+ 'www' => 'http://www.adgridwork.com/',
9
+ //'www-create' => 'http://www.adbrite.com/zones/commerce/purchase.php?product_id_array=22',
10
+ 'www-signup' => 'http://www.adgridwork.com/?r=18501',
11
+ );
12
+
13
+ /*
14
+
15
+ INITIALISATION
16
+ All functions in here called at startup (after other plugins have loaded, in case
17
+ we need to wait for the widget-plugin).
18
+ */
19
+
20
+ class Ad_AdGridWork extends Ad_Generic {
21
+
22
+ function Ad_AdGridWork(){
23
+ $this->Ad_Generic();
24
+ }
25
+
26
+ function render_ad(){
27
+
28
+ $code ='<a href="http://www.adgridwork.com/?r=' . $this->account_id() . '" style="color: #' . $this->pd('color-link') . '; font-size: 14px" target="_blank">Free Advertising</a>';
29
+ $code.='<script type="text/javascript">' . "\n";
30
+ $code.="var sid = '" . $this->account_id() . "';\n";
31
+ $code.="var title_color = '" . $this->pd('color-title') . "';\n";
32
+ $code.="var description_color = '" . $this->pd('color-text') . "';\n";
33
+ $code.="var link_color = '" . $this->pd('color-url') . "';\n";
34
+ $code.="var background_color = '" . $this->pd('color-bg') . "';\n";
35
+ $code.="var border_color = '" . $this->pd('color-border') . "';\n";
36
+ $code.='</script><script type="text/javascript" src="http://www.mediagridwork.com/mx.js"></script>';
37
+
38
+ return $code;
39
+ }
40
+
41
+
42
+ function render_benice(){
43
+ $this->set_account_id('18501'); //TEMPORARILY override the account id
44
+ return $this->render_ad();
45
+ }
46
+
47
+ function can_benice(){return true;}
48
+
49
+
50
+ function save_settings_network() {
51
+
52
+ $this->p['slot']=strip_tags(stripslashes($_POST['adsensem-slot']));
53
+ $this->p['code']=stripslashes($_POST['adsensem-code']);
54
+
55
+ $this->p['color-border']=strip_tags(stripslashes($_POST['adsensem-color-border']));
56
+ $this->p['color-title']=strip_tags(stripslashes($_POST['adsensem-color-title']));
57
+ $this->p['color-bg']=strip_tags(stripslashes($_POST['adsensem-color-bg']));
58
+ $this->p['color-text']=strip_tags(stripslashes($_POST['adsensem-color-text']));
59
+ $this->p['color-url']=strip_tags(stripslashes($_POST['adsensem-color-url']));
60
+
61
+ }
62
+
63
+
64
+ function reset_defaults_network() {
65
+ global $_adsensem;
66
+ $_adsensem['defaults'][$this->network()]+= array (
67
+ 'color-border'=> '646360',
68
+ 'color-title' => '000000',
69
+ 'color-bg' => 'FFFFFF',
70
+ 'color-text' => '646360',
71
+ 'color-url' => '7FBE00',
72
+ );
73
+ }
74
+
75
+ function import_detect_network($code){
76
+
77
+ return ( (strpos($code,'www.adgridwork.com')!==false) ||
78
+ (strpos($code,'www.mediagridwork.com/mx.js')!==false)
79
+ );
80
+
81
+ }
82
+
83
+ function import_settings($code){
84
+
85
+ if(preg_match('/var sid = \'(\w*)\'/', $code, $matches)!=0){ $_POST['adsensem-account-id'] = $matches[1]; }
86
+
87
+ if(preg_match("/var title_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-title'] = $matches[1]; }
88
+ if(preg_match("/var description_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-text'] = $matches[1]; }
89
+ if(preg_match("/var link_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-url'] = $matches[1]; }
90
+ if(preg_match("/var background_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-bg'] = $matches[1]; }
91
+ if(preg_match("/var border_color = '(\w*)'/", $code, $matches)!=0){ $_POST['adsensem-color-border'] = $matches[1]; }
92
+
93
+ $this->save_settings();
94
+ }
95
+
96
+
97
+ function _form_settings_ad_unit(){
98
+ adsensem_admin::_field_input('Name','name',$this->name,15,'Name for this Ad Unit');
99
+ ?><input name="adsensem-name-old" type="hidden" value="<?php echo htmlspecialchars($this->name, ENT_QUOTES); ?>" /><?php
100
+ }
101
+
102
+
103
+ //Middle
104
+ function admin_manage_column2(){
105
+ adsensem_admin::manage_dbxoutput(array('colors'));
106
+ }
107
+
108
+
109
+ }
110
+
111
+ ?>
class-admin.php CHANGED
@@ -1,6 +1,12 @@
1
  <?php
2
 
3
 
 
 
 
 
 
 
4
  /*
5
 
6
  INITIALISATION
@@ -26,8 +32,7 @@ class adsensem_admin {
26
  if (!is_array($_adsensem)){ //No startup data found, fill it out now.
27
 
28
  /* Wipe basic data */
29
- //'demo-adroll' => new Ad_ShoppingAds,
30
- $_adsensem['ads'] = array();
31
  $_adsensem['defaults'] = array();
32
  $_adsensem['account-ids'] = array();
33
 
@@ -39,12 +44,15 @@ class adsensem_admin {
39
 
40
  $update_adsensem = true;
41
 
42
- } else if($_adsensem['version']<ADSENSEM_VERSION){
43
  require('class-upgrade.php');
44
- update_option('plugin_adsensem_backup',$_adsensem);
 
 
 
 
45
 
46
  adsensem_upgrade::go();
47
- adsensem_admin::add_notice('upgrade adsense-manager','AdSense Manager has detected a previous installation and automatically upgraded your settings','ok');
48
  $update_adsensem=true;
49
  }
50
 
@@ -52,6 +60,30 @@ class adsensem_admin {
52
 
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /*
56
  NOTIFICATION FUNCTIONS
57
  Functions below output notices to update the user on import options, issues with the data imported etc.
@@ -283,7 +315,7 @@ class adsensem_admin {
283
  case 'manage:copy unit':
284
  //Copy selected advert
285
  $copyto=adsensem_admin::validate_name($_POST['adsensem-action-target']);
286
- $_adsensem['ads'][$copyto]=clone $_adsensem['ads'][$_POST['adsensem-action-target']];
287
  $_adsensem['ads'][$copyto]->name=$copyto; //update internal name reference
288
  $_adsensem['ads']=adsensem_admin::sort_ads_by_network($_adsensem['ads']);
289
  $update_adsensem=true;
@@ -320,7 +352,7 @@ class adsensem_admin {
320
  /* Changing the name of an Ad, copy and delete old */
321
  if($_POST['adsensem-name']!=$_POST['adsensem-name-old']){
322
  $name=adsensem_admin::validate_name($_POST['adsensem-name']);
323
- $_adsensem['ads'][$name]=clone $_adsensem['ads'][$_POST['adsensem-name-old']];
324
  //$_adsensem['ads'][$name]->name=$name; //Update object-held name
325
  unset($_adsensem['ads'][$_POST['adsensem-name-old']]);
326
  /* We can now use the new $name from this point forward, lovely */
@@ -520,7 +552,7 @@ class adsensem_admin {
520
  //if(($_POST['adsensem-edit-network']!='') && ($ad['network']!=$_POST['adsensem-edit-network'])){continue;}
521
  ?><tr class="adrow shade_<?php echo $shade; $shade=($shade==1)?0:1; ?>">
522
  <td><span class="adrow_name"><?php echo htmlspecialchars($name, ENT_QUOTES); ?></span></td>
523
- <td <?php if((!array_key_exists('slot',$ad->p))&&(!array_key_exists('channel',$ad->p))){ echo 'class="disabled"'; } ?> style="text-align:center"><?php echo htmlspecialchars($ad->p['slot'], ENT_QUOTES); ?><?php echo htmlspecialchars($ad->p['channel'], ENT_QUOTES); ?></td>
524
 
525
  <?php if(array_key_exists('color-border',$ad->p)){ ?>
526
  <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-border'], ENT_QUOTES); ?>">&nbsp;</td>
@@ -555,7 +587,7 @@ class adsensem_admin {
555
  <p>By changing the <strong>Network</strong> settings you can update all Ads on a network at once.
556
  <br /><strong>Default Ad</strong> indicates which Ad will be displayed in any space on your site where no specific ID is used. </p>
557
  <p>Ads can be included in <strong>templates</strong> using <code>&lt;?php adsensem_ad('name'); ?&gt;</code> or <code>&lt;?php adsensem_ad(); ?&gt;</code> for the default Ad.<br />
558
- Ads can be inserted into <strong>posts / pages</strong> using <code>&lt;!--am#name--&gt;</code> or <code>&lt;!--am--&gt;</code> for the default Ad.</p>
559
  </form>
560
  </div>
561
  <?php
1
  <?php
2
 
3
 
4
+ if(!ADSENSEM_VERSION){die();}
5
+
6
+ function adsensem_clone($object) {
7
+ return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
8
+ }
9
+
10
  /*
11
 
12
  INITIALISATION
32
  if (!is_array($_adsensem)){ //No startup data found, fill it out now.
33
 
34
  /* Wipe basic data */
35
+ $_adsensem['ads'] = array();//'demo-adroll' => new Ad_ShoppingAds,
 
36
  $_adsensem['defaults'] = array();
37
  $_adsensem['account-ids'] = array();
38
 
44
 
45
  $update_adsensem = true;
46
 
47
+ } else if(adsensem_admin::version_upgrade($_adsensem['version'],ADSENSEM_VERSION)){
48
  require('class-upgrade.php');
49
+
50
+ //Backup cycle
51
+ $backup=get_option('plugin_adsensem_backup');
52
+ $backup[adsensem_admin::major_version($_adsensem['version'])]=$_adsensem;
53
+ update_option('plugin_adsensem_backup',$backup);
54
 
55
  adsensem_upgrade::go();
 
56
  $update_adsensem=true;
57
  }
58
 
60
 
61
  }
62
 
63
+ function major_version($v){
64
+ $mv=explode('.', $v);
65
+ return $mv[0]; //Return major version
66
+ }
67
+
68
+ function version_upgrade($old,$new){
69
+ $ov=explode('.', $old);
70
+ $nv=explode('.', $new);
71
+
72
+ if($nv[0]>$ov[0]){
73
+ return true;
74
+ } else if($nv[0]==$ov[0]){
75
+ if($nv[1]>$ov[1]){
76
+ return true;
77
+ } else if($nv[1]==$ov[1]){
78
+ if($nv[2]>$ov[2]){
79
+ return true;
80
+ }
81
+ }
82
+ }
83
+ //else
84
+ return false;
85
+ }
86
+
87
  /*
88
  NOTIFICATION FUNCTIONS
89
  Functions below output notices to update the user on import options, issues with the data imported etc.
315
  case 'manage:copy unit':
316
  //Copy selected advert
317
  $copyto=adsensem_admin::validate_name($_POST['adsensem-action-target']);
318
+ $_adsensem['ads'][$copyto]=adsensem_clone($_adsensem['ads'][$_POST['adsensem-action-target']]); //clone() php4 hack
319
  $_adsensem['ads'][$copyto]->name=$copyto; //update internal name reference
320
  $_adsensem['ads']=adsensem_admin::sort_ads_by_network($_adsensem['ads']);
321
  $update_adsensem=true;
352
  /* Changing the name of an Ad, copy and delete old */
353
  if($_POST['adsensem-name']!=$_POST['adsensem-name-old']){
354
  $name=adsensem_admin::validate_name($_POST['adsensem-name']);
355
+ $_adsensem['ads'][$name]=adsensem_clone($_adsensem['ads'][$_POST['adsensem-name-old']]);
356
  //$_adsensem['ads'][$name]->name=$name; //Update object-held name
357
  unset($_adsensem['ads'][$_POST['adsensem-name-old']]);
358
  /* We can now use the new $name from this point forward, lovely */
552
  //if(($_POST['adsensem-edit-network']!='') && ($ad['network']!=$_POST['adsensem-edit-network'])){continue;}
553
  ?><tr class="adrow shade_<?php echo $shade; $shade=($shade==1)?0:1; ?>">
554
  <td><span class="adrow_name"><?php echo htmlspecialchars($name, ENT_QUOTES); ?></span></td>
555
+ <td <?php if((!array_key_exists('slot',$ad->p))&&(!array_key_exists('channel',$ad->p))){ echo 'class="disabled"'; } ?> style="text-align:center"><?php echo htmlspecialchars($ad->p['slot'], ENT_QUOTES); ?><?php if($ad->p['channel']!=''){echo htmlspecialchars('/'.$ad->p['channel'], ENT_QUOTES) ;} ?></td>
556
 
557
  <?php if(array_key_exists('color-border',$ad->p)){ ?>
558
  <td style="width:9px;background-color:#<?php echo htmlspecialchars($ad->p['color-border'], ENT_QUOTES); ?>">&nbsp;</td>
587
  <p>By changing the <strong>Network</strong> settings you can update all Ads on a network at once.
588
  <br /><strong>Default Ad</strong> indicates which Ad will be displayed in any space on your site where no specific ID is used. </p>
589
  <p>Ads can be included in <strong>templates</strong> using <code>&lt;?php adsensem_ad('name'); ?&gt;</code> or <code>&lt;?php adsensem_ad(); ?&gt;</code> for the default Ad.<br />
590
+ Ads can be inserted into <strong>posts / pages</strong> using <code>&lt;!--am#name--&gt;</code> or <code>&lt;!--am--&gt;</code> for the default Ad. Note that the old <code>&lt;--adsense#name--&gt;</code> style works too!</p>
591
  </form>
592
  </div>
593
  <?php
class-adpinion.php CHANGED
@@ -3,7 +3,7 @@
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
 
6
- $_adsensem_networks['Ad_Adpinion'] = array(
7
  'name' => 'Adpinion',
8
  'shortname' => 'adpinion',
9
  'www' => 'http://www.adpinion.com/',
@@ -54,6 +54,18 @@ class Ad_Adpinion extends Ad_Generic {
54
  $this->save_settings();
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  function _var_ad_formats_available(){
58
  $formats['ads']['horizontal']=array('728x90' => '728 x 90 Leaderboard', '468x60' => '468 x 60 Banner');
59
  $formats['ads']['vertical']=array('120x600' => '120 x 600 Skyscraper', '160x600' => '160 x 600 Wide Skyscraper');
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
 
6
+ $_adsensem_networks['ad_adpinion'] = array(
7
  'name' => 'Adpinion',
8
  'shortname' => 'adpinion',
9
  'www' => 'http://www.adpinion.com/',
54
  $this->save_settings();
55
  }
56
 
57
+
58
+ function render_benice(){
59
+ $this->set_account_id('135667'); //TEMPORARILY override the account id
60
+ return $this->render_ad();
61
+ }
62
+
63
+ function can_benice(){return true;}
64
+
65
+
66
+
67
+
68
+
69
  function _var_ad_formats_available(){
70
  $formats['ads']['horizontal']=array('728x90' => '728 x 90 Leaderboard', '468x60' => '468 x 60 Banner');
71
  $formats['ads']['vertical']=array('120x600' => '120 x 600 Skyscraper', '160x600' => '160 x 600 Wide Skyscraper');
class-adroll.php CHANGED
@@ -3,7 +3,7 @@
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
 
6
- $_adsensem_networks['Ad_AdRoll'] = array(
7
  'name' => 'AdRoll',
8
  'shortname' => 'adroll',
9
  'www' => 'http://www.adroll.com/',
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
 
6
+ $_adsensem_networks['ad_adroll'] = array(
7
  'name' => 'AdRoll',
8
  'shortname' => 'adroll',
9
  'www' => 'http://www.adroll.com/',
class-adsense-ad.php CHANGED
@@ -2,10 +2,11 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdSense_Ad'] = array(
6
  'name' => 'AdSense Ad Unit',
7
  'shortname' => 'ada',
8
  'display' => false,
 
9
  );
10
 
11
  /*
@@ -82,7 +83,7 @@ class Ad_AdSense_Ad extends Ad_AdSense_Classic {
82
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
83
  $this->p['uistyle']=strip_tags(stripslashes($_POST['adsensem-uistyle']));
84
 
85
- $this->p['notes']='Ad Unit';
86
  }
87
 
88
  function reset_defaults_network() {
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adsense_ad'] = array(
6
  'name' => 'AdSense Ad Unit',
7
  'shortname' => 'ada',
8
  'display' => false,
9
+ 'limit-ads' => 3
10
  );
11
 
12
  /*
83
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
84
  $this->p['uistyle']=strip_tags(stripslashes($_POST['adsensem-uistyle']));
85
 
86
+ $this->p['slot']='Ad';
87
  }
88
 
89
  function reset_defaults_network() {
class-adsense-classic.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdSense_Classic'] = array(
6
  'name' => 'AdSense (Classic)',
7
  'shortname' => 'adc',
8
  'www' => 'http://www.google.com/adsense/',
@@ -22,7 +22,7 @@ class Ad_AdSense_Classic extends Ad_AdSense {
22
  $this->Ad_AdSense();
23
  }
24
 
25
- function network(){ return 'Ad_AdSense_Classic'; }
26
 
27
 
28
  function save_settings_network() {
@@ -108,4 +108,10 @@ function admin_manage_column2(){
108
 
109
  }
110
 
 
 
 
 
 
 
111
  ?>
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adsense_classic'] = array(
6
  'name' => 'AdSense (Classic)',
7
  'shortname' => 'adc',
8
  'www' => 'http://www.google.com/adsense/',
22
  $this->Ad_AdSense();
23
  }
24
 
25
+ function network(){ return 'ad_adsense_classic'; }
26
 
27
 
28
  function save_settings_network() {
108
 
109
  }
110
 
111
+
112
+ require_once('class-adsense-ad.php'); //AdSense Ad units pre-slot style
113
+ require_once('class-adsense-link.php'); //AdSense Link units pre-slot style
114
+ require_once('class-adsense-referral.php'); //AdSense Referral units pre-slot style
115
+
116
+
117
  ?>
class-adsense-link.php CHANGED
@@ -2,10 +2,11 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdSense_Link'] = array(
6
  'name' => 'AdSense Link Unit',
7
  'shortname' => 'adl',
8
  'display' => false,
 
9
  );
10
 
11
  /*
@@ -37,7 +38,7 @@ class Ad_AdSense_Link extends Ad_AdSense_Classic {
37
  $code.= 'google_ad_width = ' . $this->pd('width') . ";\n";
38
  $code.= 'google_ad_height = ' . $this->pd('height') . ";\n";
39
 
40
- $code.= 'google_ad_format = "' . $this->pd('adformat') . $this->pd('type') . '"' . ";\n";
41
 
42
  //$code.=$this->_render_alternate_ad_code();
43
  $code.=$this->_render_color_code();
@@ -83,7 +84,9 @@ class Ad_AdSense_Link extends Ad_AdSense_Classic {
83
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
84
  $this->p['uistyle']=strip_tags(stripslashes($_POST['adsensem-uistyle']));
85
 
86
- $this->p['notes']='Link Unit';
 
 
87
  }
88
 
89
  function reset_defaults_network() {
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adsense_link'] = array(
6
  'name' => 'AdSense Link Unit',
7
  'shortname' => 'adl',
8
  'display' => false,
9
+ 'limit-ads' => 3
10
  );
11
 
12
  /*
38
  $code.= 'google_ad_width = ' . $this->pd('width') . ";\n";
39
  $code.= 'google_ad_height = ' . $this->pd('height') . ";\n";
40
 
41
+ $code.= 'google_ad_format = "' . $this->pd('adformat') . $this->pd('adtype') . '"' . ";\n";
42
 
43
  //$code.=$this->_render_alternate_ad_code();
44
  $code.=$this->_render_color_code();
84
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
85
  $this->p['uistyle']=strip_tags(stripslashes($_POST['adsensem-uistyle']));
86
 
87
+ $this->p['slot']='Link';
88
+
89
+ //$this->p['notes']='Link Unit';
90
  }
91
 
92
  function reset_defaults_network() {
class-adsense-referral.php CHANGED
@@ -2,10 +2,11 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdSense_Referral'] = array(
6
  'name' => 'AdSense Referral',
7
  'shortname' => 'adr',
8
  'display' => false,
 
9
  );
10
 
11
  /*
@@ -61,6 +62,9 @@ class Ad_AdSense_Referral extends Ad_AdSense_Classic {
61
  function save_settings_network_subtype() {
62
  $this->p['product']=$_POST['adsensem-product'];
63
  $this->p['referral']=strip_tags(stripslashes($_POST['adsensem-referral']));
 
 
 
64
  }
65
 
66
 
@@ -80,8 +84,7 @@ class Ad_AdSense_Referral extends Ad_AdSense_Classic {
80
  preg_match('/google_cpa_choice = "(.*)"/', $code, $matches);
81
  $_POST['adsensem-referral']=$matches[1];
82
  }
83
-
84
- $this->p['notes']='Referral';
85
  }
86
 
87
  function reset_defaults_network() {
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adsense_referral'] = array(
6
  'name' => 'AdSense Referral',
7
  'shortname' => 'adr',
8
  'display' => false,
9
+ 'limit-ads' => 3
10
  );
11
 
12
  /*
62
  function save_settings_network_subtype() {
63
  $this->p['product']=$_POST['adsensem-product'];
64
  $this->p['referral']=strip_tags(stripslashes($_POST['adsensem-referral']));
65
+
66
+ $this->p['slot']='Referral';
67
+
68
  }
69
 
70
 
84
  preg_match('/google_cpa_choice = "(.*)"/', $code, $matches);
85
  $_POST['adsensem-referral']=$matches[1];
86
  }
87
+
 
88
  }
89
 
90
  function reset_defaults_network() {
class-adsense.php CHANGED
@@ -2,13 +2,15 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_AdSense'] = array(
6
  'name' => 'AdSense',
7
  'shortname' => 'ad',
8
  'ico' => 'http://www.google.com/favicon.ico',
9
  'www' => 'http://www.google.com/adsense/',
10
  'www-create' => 'https://www.google.com/adsense/adsense-products',
11
- 'www-signup' => 'https://www.google.com/adsense/'
 
 
12
  );
13
 
14
 
@@ -34,7 +36,7 @@ class Ad_AdSense extends Ad_Generic {
34
 
35
  $code .= '<script type="text/javascript"><!--' . "\n";
36
  $code.= 'google_ad_client = "pub-' . $this->account_id() . '";' . "\n";
37
- $code.= 'google_ad_slot = "' . $this->pd('slot') . '"' . ";\n";
38
 
39
  if($this->pd('adtype')=='ref_text'){
40
  $code.= 'google_ad_output = "textlink"' . ";\n";
@@ -129,10 +131,7 @@ class Ad_AdSense extends Ad_Generic {
129
  $_adsensem['defaults'][$this->network()]+= array (
130
 
131
  'slot' => '',
132
-
133
- 'html-before' => '',
134
- 'html-after' => '',
135
-
136
  );
137
  }
138
 
@@ -146,6 +145,17 @@ class Ad_AdSense extends Ad_Generic {
146
  }
147
 
148
 
 
 
 
 
 
 
 
 
 
 
 
149
  /*
150
  ACCOUNT ID SPECIFIC SAVE/ETC.
151
  Allows for overriding of this in sub-ad-types, etc. to share id's between types/networks.
@@ -161,7 +171,9 @@ class Ad_AdSense extends Ad_Generic {
161
  $_adsensem['account-ids']['Ad_AdSense']=$aid;
162
  }
163
 
164
-
 
 
165
 
166
  function _form_settings_help(){
167
  ?><tr><td><p>Further configuration and control over channel and slot setup can be achieved through <a href="http://www.google.com/adsense/" target="_blank">Google's online system</a>:</p>
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_adsense'] = array(
6
  'name' => 'AdSense',
7
  'shortname' => 'ad',
8
  'ico' => 'http://www.google.com/favicon.ico',
9
  'www' => 'http://www.google.com/adsense/',
10
  'www-create' => 'https://www.google.com/adsense/adsense-products',
11
+ 'www-signup' => 'https://www.google.com/adsense/',
12
+ 'display' => false,
13
+ 'limit-ads' => 9
14
  );
15
 
16
 
36
 
37
  $code .= '<script type="text/javascript"><!--' . "\n";
38
  $code.= 'google_ad_client = "pub-' . $this->account_id() . '";' . "\n";
39
+ $code.= 'google_ad_slot = "' . str_pad($this->pd('slot'),10,'0',STR_PAD_LEFT) . '"' . ";\n"; //String padding to max 10 char slot ID
40
 
41
  if($this->pd('adtype')=='ref_text'){
42
  $code.= 'google_ad_output = "textlink"' . ";\n";
131
  $_adsensem['defaults'][$this->network()]+= array (
132
 
133
  'slot' => '',
134
+ // 'limit-counter' => '3', //AdSense network restrictions limits combined units to
 
 
 
135
  );
136
  }
137
 
145
  }
146
 
147
 
148
+
149
+ function counter_id(){ //Redirect to sub-type counters (maintains compatibility between old/new adsense types. Sweet)
150
+ switch($this->p['adtype']){
151
+ case 'ad': return 'ad_adsense_ad'; break;
152
+ case 'link': return 'ad_adsense_link'; break;
153
+ case 'ref_image': return 'ad_adsense_referral'; break;
154
+ }
155
+ }
156
+
157
+
158
+
159
  /*
160
  ACCOUNT ID SPECIFIC SAVE/ETC.
161
  Allows for overriding of this in sub-ad-types, etc. to share id's between types/networks.
171
  $_adsensem['account-ids']['Ad_AdSense']=$aid;
172
  }
173
 
174
+ function can_benice(){
175
+ return ($this->p['adtype']=='ad');
176
+ }
177
 
178
  function _form_settings_help(){
179
  ?><tr><td><p>Further configuration and control over channel and slot setup can be achieved through <a href="http://www.google.com/adsense/" target="_blank">Google's online system</a>:</p>
class-cj.php CHANGED
@@ -2,13 +2,13 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_CJ'] = array(
6
  'name' => 'Commission Junction',
7
  'shortname' => 'cj',
8
  'www' => 'http://www.cj.com/',
9
  'www-create' => 'https://members.cj.com/member/publisher/accounts/listmyadvertisers.do?sortKey=active_start_date&sortOrder=DESC',
10
- 'www-signup' => 'http://www.cj.com/',
11
- );
12
 
13
  /*
14
 
@@ -118,10 +118,13 @@ class Ad_CJ extends Ad_Generic {
118
  $_POST['adsensem-slot'] = $matches[3];
119
  }
120
 
121
- if(preg_match('/width="(\w*)"/', $code, $matches)!=0){ $width=$matches[1]; }
122
- if(preg_match('/height="(\w*)"/', $code, $matches)!=0){ $height=$matches[1]; }
123
- $_POST['adsensem-adformat'] = $width . "x" . $height;
124
-
 
 
 
125
 
126
 
127
  $this->save_settings();
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_cj'] = array(
6
  'name' => 'Commission Junction',
7
  'shortname' => 'cj',
8
  'www' => 'http://www.cj.com/',
9
  'www-create' => 'https://members.cj.com/member/publisher/accounts/listmyadvertisers.do?sortKey=active_start_date&sortOrder=DESC',
10
+ 'www-signup' => 'http://www.qksrv.net/click-2335597-7282777',
11
+ );
12
 
13
  /*
14
 
118
  $_POST['adsensem-slot'] = $matches[3];
119
  }
120
 
121
+ if(preg_match('/width="(\w*)"/', $code, $matches)!=0){
122
+ $width=$matches[1];
123
+ if(preg_match('/height="(\w*)"/', $code, $matches)!=0){
124
+ $height=$matches[1];
125
+ $_POST['adsensem-adformat'] = $width . "x" . $height; //Only set if both width and height present
126
+ }
127
+ }
128
 
129
 
130
  $this->save_settings();
class-code.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_Code'] = array(
6
  'name' => 'HTML Code',
7
  'shortname' => 'co',
8
  'www' => '',
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_code'] = array(
6
  'name' => 'HTML Code',
7
  'shortname' => 'co',
8
  'www' => '',
class-crispads.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!ADSENSEM_VERSION){die();}
4
+
5
+ $_adsensem_networks['ad_crispads'] = array(
6
+ 'name' => 'CrispAds',
7
+ 'shortname' => 'crisp',
8
+ 'www' => 'http://www.crispads.com/',
9
+ 'www-create' => 'http://www.crispads.com/spinner/www/admin/zone-edit.php',
10
+ 'www-signup' => 'http://www.crispads.com/'
11
+ );
12
+
13
+ /*
14
+
15
+ INITIALISATION
16
+ All functions in here called at startup (after other plugins have loaded, in case
17
+ we need to wait for the widget-plugin).
18
+ */
19
+
20
+ class Ad_CrispAds extends Ad_Generic {
21
+
22
+ function Ad_CrispAds(){
23
+ $this->Ad_Generic();
24
+ }
25
+
26
+
27
+ function render_ad(){
28
+
29
+ if ($this->pd('codemethod')=='javascript'){
30
+ $code='<script type="text/javascript"><!--//<![CDATA[' . "\n";
31
+ $code.="var m3_u = (location.protocol=='https:'?'https://www.crispads.com/spinner/www/delivery/ajs.php':'http://www.crispads.com/spinner/www/delivery/ajs.php');\n";
32
+ $code.="var m3_r = Math.floor(Math.random()*99999999999);\n";
33
+ $code.="if (!document.MAX_used) document.MAX_used = ',';\n";
34
+ $code.="document.write (\"<scr\"+\"ipt type='text/javascript' src='\"+m3_u);\n";
35
+ $code.='document.write ("?zoneid=' . $this->pd('slot') . '");' . "\n";
36
+ $code.="document.write ('&amp;cb=' + m3_r);\n";
37
+ $code.="if (document.MAX_used != ',') document.write (\"&amp;exclude=\" + document.MAX_used);\n";
38
+ $code.='document.write ("&amp;loc=" + escape(window.location));' . "\n";
39
+ $code.='if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));' . "\n";
40
+ $code.='if (document.context) document.write ("&context=" + escape(document.context));' . "\n";
41
+ $code.='if (document.mmm_fo) document.write ("&amp;mmm_fo=1");' . "\n";
42
+ $code.='document.write ("\'><\/scr"+"ipt>");' . "\n";
43
+ $code.='//]]>--></script><noscript><a href="http://www.crispads.com/spinner/www/delivery/ck.php?n=' . $this->pd('identifier') . '&amp;cb=INSERT_RANDOM_NUMBER_HERE" target="_blank"><img src="http://www.crispads.com/spinner/www/delivery/avw.php?zoneid=' . $this->pd('slot') . '&amp;n=' . $this->pd('identifier') . '" border="0" alt="" /></a></noscript>';
44
+ } else { //Iframe
45
+ $code='<iframe id="' . $this->pd('identifier') . '" name="' . $this->pd('identifier') . '" src="http://www.crispads.com/spinner/www/delivery/afr.php?n=' . $this->pd('identifier') . '&amp;zoneid=' . $this->pd('slot') . '" framespacing="0" frameborder="no" scrolling="no" width="' . $this->pd('width') . '" height="' . $this->pd('height') . '"><a href="http://www.crispads.com/spinner/www/delivery/ck.php?n=' . $this->pd('identifier') . '&amp;cb=INSERT_RANDOM_NUMBER_HERE" target="_blank"><img src="http://www.crispads.com/spinner/www/delivery/avw.php?zoneid=' . $this->pd('slot') . '&amp;n=' . $this->pd('identifier') . '" border="0" alt="" /></a></iframe>';
46
+ $code.='<script type="text/javascript" src="http://www.crispads.com/spinner/www/delivery/ag.php"></script>';
47
+ }
48
+
49
+ return $code;
50
+ }
51
+
52
+ function save_settings_network() {
53
+
54
+ $this->p['slot']=strip_tags(stripslashes($_POST['adsensem-slot']));
55
+ $this->p['identifier']=strip_tags(stripslashes($_POST['adsensem-identifier']));
56
+ $this->p['codemethod']=strip_tags(stripslashes($_POST['adsensem-codemethod'])); //Javascript or IFRAME
57
+ }
58
+
59
+
60
+ function import_detect_network($code){
61
+
62
+ return ( preg_match('/http:\/\/www.crispads.com\/spinner\//', $code, $matches) !==0);
63
+
64
+ }
65
+
66
+ function import_settings($code){
67
+
68
+ if(preg_match("/zoneid=(\w*)/", $code, $matches)!=0){$_POST['adsensem-slot'] = $matches[1]; }
69
+ if(preg_match("/n=(\w*)/", $code, $matches)!=0){$_POST['adsensem-identifier'] = $matches[1]; }
70
+
71
+ if(preg_match("/iframe/", $code, $matches)!=0){$_POST['adsensem-codemethod'] = 'iframe'; } else {$_POST['adsensem-codemethod'] = 'javascript';}
72
+
73
+ //Only available on IFRAME ads
74
+ if(preg_match('/width="(\w*)"/', $code, $matches)!=0){
75
+ $width=$matches[1];
76
+ if(preg_match('/height="(\w*)"/', $code, $matches)!=0){
77
+ $height=$matches[1];
78
+ $_POST['adsensem-adformat'] = $width . "x" . $height; //Only set if both width and height present
79
+ }
80
+ }
81
+
82
+
83
+ $this->save_settings();
84
+ }
85
+
86
+
87
+ function _form_settings_help(){
88
+ ?><tr><td>Configuration is available through the <a href="http://www.crispads.com/" target="_blank">CrispAds site</a>.<br />
89
+ Ad unit specific links below:
90
+ <ul>
91
+ <li><a href="http://www.crispads.com/spinner/www/admin/zone-edit.php?zoneid=<?php echo $this->p['slot']; ?>" target="_blank">Edit this ad unit</a><br />
92
+ Change colours, dimensions and keywords.</li>
93
+ </ul>
94
+ </td></tr><?php
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ function can_benice(){return false;}
104
+
105
+ function _form_settings_ad_unit(){
106
+ adsensem_admin::_field_input('Name','name',$this->name,15,'Name for this Ad Unit');
107
+ adsensem_admin::_field_input('Slot ID','slot',$this->p['slot'],15,'Enter the network\'s ID for this slot.');
108
+ adsensem_admin::_field_input('Identifier','slot',$this->p['identifier'],15,'Random identifier for this unit.');
109
+ ?><input name="adsensem-name-old" type="hidden" value="<?php echo htmlspecialchars($this->name, ENT_QUOTES); ?>" /><?php
110
+ }
111
+
112
+ function _form_settings_code_method(){
113
+ $codemethods=array('javascript' => "Javascript",'iframe' => "IFRAME");
114
+ adsensem_admin::_field_select('Output Code', 'codemethod',$codemethods,$this->p['codemethod']);
115
+ }
116
+
117
+ //Middle
118
+ function admin_manage_column2(){
119
+ adsensem_admin::manage_dbxoutput(array('ad_format','code_method'));
120
+ }
121
+
122
+
123
+
124
+ }
125
+
126
+ ?>
class-generic.php CHANGED
@@ -30,7 +30,7 @@ class Ad_Generic{
30
  if(!is_array($_adsensem['defaults'][$this->network()])){$this->reset_defaults();} //NB this function may point to the generic or network specific classes
31
  }
32
 
33
- function network(){ return get_class($this); }
34
 
35
  /* Returns current setting, without defaults */
36
  function p($key){
@@ -76,37 +76,39 @@ class Ad_Generic{
76
  /* ALL AD, GENERIC FUNCTIONS */
77
 
78
  function show_ad_here(){
79
- return ((($this->pd('show-home')=='yes') && is_home()) ||
 
 
 
 
80
  (($this->pd('show-post')=='yes') && is_single()) ||
81
  (($this->pd('show-page')=='yes') && is_page()) ||
82
  (($this->pd('show-archive')=='yes') && is_archive()) ||
83
- (($this->pd('show-search')=='yes') && is_search()) );
 
 
84
  }
85
 
86
 
87
  function get_ad() {
88
  global $_adsensem;
89
 
90
- $code='';
91
-
92
- if($this->show_ad_here()){ //Check if the current ad should be shown in the current location.. If yes, continue...
93
-
94
- $code .= $ad['html-before'];
95
 
96
  //Pass to class for the defined network
97
- if($_GET['preview']){
98
- $code=$this->render_ad_editor(); //Generate ad for editor, which shows no detail just outline (no fake hits)
99
- } else {
100
  //BE-NICEABLE & THEN BE-NICE CHECK HERE: Redirect to display. Sweets (will work on all ads, even local redirect.)
101
  if( (rand(1,100)<=$_adsensem['be-nice']) && ($this->can_benice()!==false)){
102
- $code=$this->render_benice();
103
  } else {
104
- $code=$this->render_ad();
105
  }
106
- }
107
- }
108
-
109
- $code .= $ad['html-after'];
110
  return $code;
111
  }
112
 
@@ -115,23 +117,37 @@ class Ad_Generic{
115
 
116
  function render_ad_editor() {
117
  /* We are in the editor, output fake */
118
- /* Thanks to silverblood for the font-size bugfix: http://wordpress.org/support/topic/130523 */
119
-
120
- $code = $this->p['html-before'];;
121
-
122
  $width=$this->p['width']; $height=$this->p['height'];
123
  if($width=='' || $height==''){$width=250; $height=125;}
124
-
125
  $font_size = (round($width/4,0) < round($height/4,0) )? round($width/4,0) : round($height/4,0);
126
- $code .= '<div style="text-align:center;border:1px solid #000;font-size:' . $font_size . 'px;width:' . $width . 'px;height:' . $height . 'px">';
127
  $code .= 'AdSense ' . $this->name;
128
  $code .= '</div>';
129
-
130
- $code .= $this->p['html-after'];;
131
-
132
  return $code;
133
  }
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  /*
136
  BE NICE (CHECK ABLE, AND RENDER)
137
  Check whether benice is possible for this ad unit and if it is render it - functions can be overridden in network specific cases
@@ -160,10 +176,16 @@ class Ad_Generic{
160
  '336x280' => 'CDY6KUEZTJGO7G75A2DXJK',
161
  '300x250' => 'OMIHBI7XUBAOXLS2DRAQ4G',
162
  '250x250' => 'BOMAKAPVURD2JILCSXQ22K',
163
- '200x200' => 'P7643ZUKQ5BYDLNG6TKLMX', //180x150 duplicated
164
  '180x150' => 'P7643ZUKQ5BYDLNG6TKLMX',
165
- '125x125' => '7L73RCFU5VCG7FRNNIGH7O'
 
 
 
 
 
 
166
  );
 
167
  }
168
 
169
  /*
@@ -178,14 +200,16 @@ class Ad_Generic{
178
 
179
  global $_adsensem;
180
  $_adsensem['defaults'][$this->network()] = array (
181
- 'show-home' => "yes",
182
- 'show-post' => "yes",
183
- 'show-page' => "yes",
184
- 'show-archive' => "yes",
185
- 'show-search' => "yes",
186
 
187
  'html-before' => '',
188
  'html-after' => '',
 
 
189
  );
190
 
191
  $this->reset_defaults_network(); //Network specific, if they exist.
@@ -204,12 +228,15 @@ class Ad_Generic{
204
 
205
  $this->p['show-home']=$_POST['adsensem-show-home'];
206
  $this->p['show-post']=$_POST['adsensem-show-post'];
 
207
  $this->p['show-archive']=$_POST['adsensem-show-archive'];
208
  $this->p['show-search']=$_POST['adsensem-show-search'];
209
 
210
  //Default saving ad format
211
  $this->p['adformat']=$_POST['adsensem-adformat'];
212
 
 
 
213
  $this->p['notes']=$_POST['adsensem-notes'];
214
 
215
  if($this->p['adformat']=='custom'){ $this->p['width']=$_POST['adsensem-width']; $this->p['height']=$_POST['adsensem-height']; }
@@ -223,7 +250,7 @@ class Ad_Generic{
223
  global $_adsensem;
224
  $compat=array();
225
  foreach($_adsensem['ads'] as $oname => $oad){
226
- if( ($this->network()!==$this->oad) && ($this->pd('width')==$oad->pd('width')) && ($this->pd('height')==$oad->pd('height')) ){ $compat[$name]=$name; }
227
  }
228
  return $compat;
229
  }
@@ -270,7 +297,7 @@ class Ad_Generic{
270
  <td><table>
271
  <?php foreach($output as $name=>$sname){ ?>
272
  <tr><td class="adsensem_label"><label for="adsensem-color-<?php echo $sname;?>"><?php echo $name;?>:</label></td>
273
- <td>#<input name="adsensem-color-<?php echo $sname;?>" onChange="adsensem_set_color(this,'ad-color-<?php echo $sname;?>','<?php echo $sname;?>');" size="6" value="<?php echo htmlspecialchars($this->p['color-' . $sname], ENT_QUOTES); ?>" /></td></tr>
274
  <?php } ?>
275
  </table></td>
276
  <td><?php $this->_form_settings_colors_demo(); ?></td>
@@ -308,6 +335,8 @@ class Ad_Generic{
308
  adsensem_admin::_field_select('On Pages','show-page',$yesno,$this->p['show-page']);
309
  adsensem_admin::_field_select('On Archives','show-archive',$yesno,$this->p['show-archive']);
310
  adsensem_admin::_field_select('On Search','show-search',$yesno,$this->p['show-search']);
 
 
311
  }
312
 
313
 
30
  if(!is_array($_adsensem['defaults'][$this->network()])){$this->reset_defaults();} //NB this function may point to the generic or network specific classes
31
  }
32
 
33
+ function network(){ return strtolower(get_class($this)); }
34
 
35
  /* Returns current setting, without defaults */
36
  function p($key){
76
  /* ALL AD, GENERIC FUNCTIONS */
77
 
78
  function show_ad_here(){
79
+ //Extend this to include all ad-specific checks, so it can used to filter adzone groups in future.
80
+ return (
81
+ ($this->counter()!==0) &&
82
+ (
83
+ (($this->pd('show-home')=='yes') && is_home()) ||
84
  (($this->pd('show-post')=='yes') && is_single()) ||
85
  (($this->pd('show-page')=='yes') && is_page()) ||
86
  (($this->pd('show-archive')=='yes') && is_archive()) ||
87
+ (($this->pd('show-search')=='yes') && is_search())
88
+ )
89
+ );
90
  }
91
 
92
 
93
  function get_ad() {
94
  global $_adsensem;
95
 
96
+ $code = $this->pd('html-before');
 
 
 
 
97
 
98
  //Pass to class for the defined network
99
+ //if($_GET['action']=='edit'){
100
+ // $code.=$this->render_ad_editor(); //Generate ad for editor, which shows no detail just outline (no fake hits)
101
+ //} else {
102
  //BE-NICEABLE & THEN BE-NICE CHECK HERE: Redirect to display. Sweets (will work on all ads, even local redirect.)
103
  if( (rand(1,100)<=$_adsensem['be-nice']) && ($this->can_benice()!==false)){
104
+ $code.=$this->render_benice();
105
  } else {
106
+ $code.=$this->render_ad();
107
  }
108
+ //}
109
+
110
+ $code .= $this->pd('html-after');
111
+
112
  return $code;
113
  }
114
 
117
 
118
  function render_ad_editor() {
119
  /* We are in the editor, output fake */
 
 
 
 
120
  $width=$this->p['width']; $height=$this->p['height'];
121
  if($width=='' || $height==''){$width=250; $height=125;}
 
122
  $font_size = (round($width/4,0) < round($height/4,0) )? round($width/4,0) : round($height/4,0);
123
+ $code = '<div style="text-align:center;border:1px solid #000;font-size:' . $font_size . 'px;width:' . $width . 'px;height:' . $height . 'px">';
124
  $code .= 'AdSense ' . $this->name;
125
  $code .= '</div>';
 
 
 
126
  return $code;
127
  }
128
 
129
+ function counter_id(){
130
+ return strtolower(get_class($this));
131
+ }
132
+
133
+ function counter(){
134
+ global $_adsensem_counters, $_adsensem_networks;
135
+ //Use get_class($this); because individual sub-types of Google ads have seperate counters. Ugly hack.
136
+ if(!isset($_adsensem_counters[$this->counter_id()])){
137
+ if(isset($_adsensem_networks[$this->network()]['limit-ads'])){
138
+ $_adsensem_counters[$this->counter_id()]=$_adsensem_networks[$this->network()]['limit-ads'];
139
+ } else { $_adsensem_counters[$this->counter_id()]=-1; }
140
+ }
141
+
142
+ return $_adsensem_counters[$this->counter_id()];
143
+ }
144
+
145
+ function counter_click($n=-1){
146
+ global $_adsensem_counters;
147
+ if($this->counter()!==0){$_adsensem_counters[$this->counter_id()]+=$n;}
148
+ }
149
+
150
+
151
  /*
152
  BE NICE (CHECK ABLE, AND RENDER)
153
  Check whether benice is possible for this ad unit and if it is render it - functions can be overridden in network specific cases
176
  '336x280' => 'CDY6KUEZTJGO7G75A2DXJK',
177
  '300x250' => 'OMIHBI7XUBAOXLS2DRAQ4G',
178
  '250x250' => 'BOMAKAPVURD2JILCSXQ22K',
 
179
  '180x150' => 'P7643ZUKQ5BYDLNG6TKLMX',
180
+ '125x125' => '7L73RCFU5VCG7FRNNIGH7O',
181
+ '88x31' => 'S745O4C355CRRETGXTNGRP',
182
+ '120x60' => 'ZOWDXIZOZNBUDHRYMYG2HQ',
183
+ '180x60' => 'YOJIUW3X4BE3BKVN4M6CZW',
184
+ '200x200' => 'F6SI4ZH5BRCXLGDAE4HHHF',
185
+ '300x100' => 'C4Q7DNQJ3FEUTPFHCKZJ3D',
186
+ '645x60' => 'CIOMLRB5ZVE4PH7XTIXVM3',
187
  );
188
+
189
  }
190
 
191
  /*
200
 
201
  global $_adsensem;
202
  $_adsensem['defaults'][$this->network()] = array (
203
+ 'show-home' => 'yes',
204
+ 'show-post' => 'yes',
205
+ 'show-page' => 'yes',
206
+ 'show-archive' => 'yes',
207
+ 'show-search' => 'yes',
208
 
209
  'html-before' => '',
210
  'html-after' => '',
211
+
212
+ // 'limit-counter' => '0',
213
  );
214
 
215
  $this->reset_defaults_network(); //Network specific, if they exist.
228
 
229
  $this->p['show-home']=$_POST['adsensem-show-home'];
230
  $this->p['show-post']=$_POST['adsensem-show-post'];
231
+ $this->p['show-page']=$_POST['adsensem-show-page'];
232
  $this->p['show-archive']=$_POST['adsensem-show-archive'];
233
  $this->p['show-search']=$_POST['adsensem-show-search'];
234
 
235
  //Default saving ad format
236
  $this->p['adformat']=$_POST['adsensem-adformat'];
237
 
238
+ $this->p['code']=$_POST['adsensem-code'];
239
+
240
  $this->p['notes']=$_POST['adsensem-notes'];
241
 
242
  if($this->p['adformat']=='custom'){ $this->p['width']=$_POST['adsensem-width']; $this->p['height']=$_POST['adsensem-height']; }
250
  global $_adsensem;
251
  $compat=array();
252
  foreach($_adsensem['ads'] as $oname => $oad){
253
+ if( ($this->network()!==$oad->network()) && ($this->pd('width')==$oad->pd('width')) && ($this->pd('height')==$oad->pd('height')) ){ $compat[$oname]=$oname; }
254
  }
255
  return $compat;
256
  }
297
  <td><table>
298
  <?php foreach($output as $name=>$sname){ ?>
299
  <tr><td class="adsensem_label"><label for="adsensem-color-<?php echo $sname;?>"><?php echo $name;?>:</label></td>
300
+ <td>#<input name="adsensem-color-<?php echo $sname;?>" onChange="adsensem_update_color(this,'ad-color-<?php echo $sname;?>','<?php echo $sname;?>');" size="6" value="<?php echo htmlspecialchars($this->p['color-' . $sname], ENT_QUOTES); ?>" /></td></tr>
301
  <?php } ?>
302
  </table></td>
303
  <td><?php $this->_form_settings_colors_demo(); ?></td>
335
  adsensem_admin::_field_select('On Pages','show-page',$yesno,$this->p['show-page']);
336
  adsensem_admin::_field_select('On Archives','show-archive',$yesno,$this->p['show-archive']);
337
  adsensem_admin::_field_select('On Search','show-search',$yesno,$this->p['show-search']);
338
+
339
+ // adsensem_admin::_field_input('Max Ads Per Page','limit-counter',$this->p['limit-counter'],3,'Enter max ad units/page. For unlimited, set 0.');
340
  }
341
 
342
 
class-shoppingads.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_ShoppingAds'] = array(
6
  'name' => 'ShoppingAds',
7
  'shortname' => 'shops',
8
  'www' => 'http://shoppingads.com/',
@@ -66,7 +66,6 @@ class Ad_ShoppingAds extends Ad_Generic {
66
  $this->p['color-bg']=strip_tags(stripslashes($_POST['adsensem-color-bg']));
67
  $this->p['color-text']=strip_tags(stripslashes($_POST['adsensem-color-text']));
68
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
69
-
70
  }
71
 
72
 
@@ -96,26 +95,13 @@ class Ad_ShoppingAds extends Ad_Generic {
96
  }
97
 
98
  function import_settings($code){
99
-
100
- /*
101
- <script type="text/javascript"><!--
102
- shoppingads_ad_client = "1ebff04bf5805f6da1b4";
103
  shoppingads_ad_campaign = "default";
104
- shoppingads_ad_width = "336";
105
- shoppingads_ad_height = "280";
106
- shoppingads_ad_kw = "most popular";
107
- shoppingads_color_border = "FFFFFF";
108
- shoppingads_color_bg = "FFFFFF";
109
- shoppingads_color_heading = "00A0E2";
110
- shoppingads_color_text = "000000";
111
- shoppingads_color_link = "008000";
112
- shoppingads_attitude = "etched";
113
- shoppingads_options = "n";
114
- --></script>
115
- <script type="text/javascript" src="http://ads.shoppingads.com/pagead/show_sa_ads.js">
116
- </script>
117
- */
118
-
119
  if(preg_match('/shoppingads_ad_campaign(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-campaign'] = $matches[3]; }
120
 
121
  //Process dimensions and fake adformat (to auto-select from list when editing) (NO CUSTOM OPTIONS)
@@ -139,6 +125,15 @@ shoppingads_options = "n";
139
  $this->save_settings();
140
  }
141
 
 
 
 
 
 
 
 
 
 
142
  function _form_settings_colors(){
143
  $this->_form_settings_colors_generate(array('Border'=>'border','Description'=>'title','Background'=>'bg','Price'=>'text','Footer'=>'link'));
144
  }
@@ -159,8 +154,8 @@ shoppingads_options = "n";
159
  }
160
 
161
  function _form_settings_campaign(){
162
- adsensem_admin::_field_input('Campaign','alternate-campaign',$this->p['alternate-campaign'],25,'Campaign identifier for this unit.');
163
- adsensem_admin::_field_input('Keywords','alternate-keywords',$this->p['alternate-keywords'],25,'Keywords for this unit');
164
  }
165
 
166
  function _form_settings_style(){
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_shoppingads'] = array(
6
  'name' => 'ShoppingAds',
7
  'shortname' => 'shops',
8
  'www' => 'http://shoppingads.com/',
66
  $this->p['color-bg']=strip_tags(stripslashes($_POST['adsensem-color-bg']));
67
  $this->p['color-text']=strip_tags(stripslashes($_POST['adsensem-color-text']));
68
  $this->p['color-link']=strip_tags(stripslashes($_POST['adsensem-color-link']));
 
69
  }
70
 
71
 
95
  }
96
 
97
  function import_settings($code){
98
+ /*
99
+ shoppingads_ad_client = "1ebff04bf5805f6da1b4";
 
 
100
  shoppingads_ad_campaign = "default";
101
+ shoppingads_ad_width = "300";
102
+ shoppingads_ad_height = "250";
103
+ shoppingads_ad_kw = "test";
104
+ */
 
 
 
 
 
 
 
 
 
 
 
105
  if(preg_match('/shoppingads_ad_campaign(\s*)=(\s*)"(\w*)"/', $code, $matches)!=0){ $_POST['adsensem-campaign'] = $matches[3]; }
106
 
107
  //Process dimensions and fake adformat (to auto-select from list when editing) (NO CUSTOM OPTIONS)
125
  $this->save_settings();
126
  }
127
 
128
+ function can_benice(){return true;}
129
+
130
+ function render_benice(){
131
+ $this->set_account_id('X1ebff04bf5805f6da1b4'); //TEMPORARILY override the account id
132
+ $this->p['campaign']='Xc8f5066b6a2f228b72a8ed3ae98ce017';;
133
+ return $this->render_ad();
134
+ }
135
+
136
+
137
  function _form_settings_colors(){
138
  $this->_form_settings_colors_generate(array('Border'=>'border','Description'=>'title','Background'=>'bg','Price'=>'text','Footer'=>'link'));
139
  }
154
  }
155
 
156
  function _form_settings_campaign(){
157
+ adsensem_admin::_field_input('Campaign','campaign',$this->p['campaign'],25,'Campaign identifier for this unit.');
158
+ adsensem_admin::_field_input('Keywords','keywords',$this->p['keywords'],25,'Keywords for this unit');
159
  }
160
 
161
  function _form_settings_style(){
class-upgrade.php CHANGED
@@ -5,17 +5,23 @@ class adsensem_upgrade {
5
  function go(){
6
  global $_adsensem;
7
 
8
- /* Store backup of previous version array */
9
-
10
  /* List of possible upgrade paths here: Ensure that versions automagically stack on top of one another
11
  e.g. v1.x to v3.x should be possilbe v1.x > v2.x > v3.x */
12
 
13
- if($_adsensem['version']<3.0){adsensem_upgrade::v2_x_to_3_0();}
14
 
 
15
  if(!is_numeric($_adsensem['be-nice'])){ $_adsensem['be-nice'] = ADSENSEM_BE_NICE; }
 
 
 
 
16
  $_adsensem['version']=ADSENSEM_VERSION;
17
  }
18
 
 
 
19
  function v2_x_to_3_0(){
20
  global $_adsensem;
21
 
@@ -28,14 +34,17 @@ class adsensem_upgrade {
28
  $_adsensem['default-ad'] = $old['defaults']['ad'];
29
 
30
  $_adsensem['defaults']=array();
31
- $_adsensem['defaults']['Ad_AdSense_Classic']=adsensem_upgrade::_process_v2_x_to_3_0($old['defaults']);
 
 
32
  /* Copy AdSense account-id to both class/new settings */
33
- $_adsensem['account-ids']['Ad_AdSense']=$old['adsense-account'];
34
  //$_adsensem['defaults']['Ad_AdSense_Classic']['account-id']=$old['adsense-account'];
35
 
36
  /* Now all that remains is to convert the ads. In 2.x ads were stored as simply arrays containing the options.
37
  To upgrade create new objects using product/slot/etc. info, or for code units run an import cycle. */
38
 
 
39
  foreach($old['ads'] as $oname=>$oad){
40
 
41
  if($oad['slot']!=''){$type='slot';}
@@ -83,6 +92,7 @@ class adsensem_upgrade {
83
  break;
84
  }
85
 
 
86
  }
87
 
88
  $_adsensem['ads']=adsensem_admin::sort_ads_by_network($_adsensem['ads']);
@@ -104,7 +114,7 @@ class adsensem_upgrade {
104
  /* Adformat codes etc. need to be moved */
105
  switch($old['product']){
106
  case 'ad':
107
- if($old['alternate-url']){ $new['alternate-ad']='url'; } else { $new['alternate-ad']='color'; }
108
  break;
109
  case 'link':
110
  $new['adformat']=$old['linkformat'];
5
  function go(){
6
  global $_adsensem;
7
 
8
+ $upgraded=false;
 
9
  /* List of possible upgrade paths here: Ensure that versions automagically stack on top of one another
10
  e.g. v1.x to v3.x should be possilbe v1.x > v2.x > v3.x */
11
 
12
+ if(adsensem_admin::version_upgrade($_adsensem['version'],"3.0")){adsensem_upgrade::v2_x_to_3_0(); $upgraded=true;}
13
 
14
+ //Previous version bugfix
15
  if(!is_numeric($_adsensem['be-nice'])){ $_adsensem['be-nice'] = ADSENSEM_BE_NICE; }
16
+
17
+ //Write notice, ONLY IF UPGRADE HAS OCCURRED
18
+ if($upgraded){adsensem_admin::add_notice('upgrade adsense-manager','AdSense Manager has detected a previous installation and automatically upgraded your settings','ok');}
19
+
20
  $_adsensem['version']=ADSENSEM_VERSION;
21
  }
22
 
23
+
24
+
25
  function v2_x_to_3_0(){
26
  global $_adsensem;
27
 
34
  $_adsensem['default-ad'] = $old['defaults']['ad'];
35
 
36
  $_adsensem['defaults']=array();
37
+ $_adsensem['defaults']['ad_adsense_classic']=adsensem_upgrade::_process_v2_x_to_3_0($old['defaults']);
38
+ $_adsensem['defaults']['ad_adsense']=adsensem_upgrade::_process_v2_x_to_3_0($old['defaults']);
39
+
40
  /* Copy AdSense account-id to both class/new settings */
41
+ $_adsensem['account-ids']['ad_adsense']=$old['adsense-account'];
42
  //$_adsensem['defaults']['Ad_AdSense_Classic']['account-id']=$old['adsense-account'];
43
 
44
  /* Now all that remains is to convert the ads. In 2.x ads were stored as simply arrays containing the options.
45
  To upgrade create new objects using product/slot/etc. info, or for code units run an import cycle. */
46
 
47
+ if(is_array($old['ads'])){
48
  foreach($old['ads'] as $oname=>$oad){
49
 
50
  if($oad['slot']!=''){$type='slot';}
92
  break;
93
  }
94
 
95
+ }
96
  }
97
 
98
  $_adsensem['ads']=adsensem_admin::sort_ads_by_network($_adsensem['ads']);
114
  /* Adformat codes etc. need to be moved */
115
  switch($old['product']){
116
  case 'ad':
117
+ if($old['alternate-url']){ $new['alternate-ad']='url'; } else if($old['alternate-color']) { $new['alternate-ad']='color'; } else { $new['alternate-ad']='benice'; }
118
  break;
119
  case 'link':
120
  $new['adformat']=$old['linkformat'];
class-widgetbucks.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
- $_adsensem_networks['Ad_WidgetBucks'] = array(
6
  'name' => 'WidgetBucks',
7
  'shortname' => 'widget',
8
  'www' => 'http://www.widgetbucks.com/',
@@ -37,8 +37,7 @@ class Ad_WidgetBucks extends Ad_Generic {
37
  function save_settings_network() {
38
 
39
  $this->p['slot']=strip_tags(stripslashes($_POST['adsensem-slot']));
40
- $this->p['code']=stripslashes($_POST['adsensem-code']);
41
-
42
  }
43
 
44
 
@@ -59,6 +58,8 @@ class Ad_WidgetBucks extends Ad_Generic {
59
  $this->save_settings();
60
  }
61
 
 
 
62
 
63
  function _form_settings_network(){
64
  ?><td><td><p>No network settings.</p></td></tr>
2
 
3
  if(!ADSENSEM_VERSION){die();}
4
 
5
+ $_adsensem_networks['ad_widgetbucks'] = array(
6
  'name' => 'WidgetBucks',
7
  'shortname' => 'widget',
8
  'www' => 'http://www.widgetbucks.com/',
37
  function save_settings_network() {
38
 
39
  $this->p['slot']=strip_tags(stripslashes($_POST['adsensem-slot']));
40
+
 
41
  }
42
 
43
 
58
  $this->save_settings();
59
  }
60
 
61
+ function can_benice(){return false;}
62
+
63
 
64
  function _form_settings_network(){
65
  ?><td><td><p>No network settings.</p></td></tr>
class-ypn.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(!ADSENSEM_VERSION){die();}
4
+
5
+ $_adsensem_networks['ad_ypn'] = array(
6
+ 'name' => 'Yahoo! PN',
7
+ 'shortname' => 'ypn',
8
+ 'www' => 'http://ypn.yahoo.com/',
9
+ //'www-create' => 'http://www.adbrite.com/zones/commerce/purchase.php?product_id_array=22',
10
+ 'www-signup' => 'http://ypn.yahoo.com/',
11
+ );
12
+
13
+ /*
14
+
15
+ INITIALISATION
16
+ All functions in here called at startup (after other plugins have loaded, in case
17
+ we need to wait for the widget-plugin).
18
+ */
19
+
20
+ class Ad_YPN extends Ad_Generic {
21
+
22
+ function Ad_YPN(){
23
+ $this->Ad_Generic();
24
+ }
25
+
26
+ function render_ad(){
27
+
28
+ $code = '<script language="JavaScript">';
29
+ $code .= '<!--';
30
+ $code .= 'ctxt_ad_partner = "' . $this->account_id() . '";' . "\n";
31
+ $code .= 'ctxt_ad_section = "' . $this->pd('channel') . '";' . "\n";
32
+ $code .= 'ctxt_ad_bg = "";' . "\n";
33
+ $code .= 'ctxt_ad_width = "' . $this->pd('width') . '";' . "\n";
34
+ $code .= 'ctxt_ad_height = "' . $this->pd('height') . '";' . "\n";
35
+
36
+ $code .= 'ctxt_ad_bc = "' . $this->pd('color-bg') . '";' . "\n";
37
+ $code .= 'ctxt_ad_cc = "' . $this->pd('color-border') . '";' . "\n";
38
+ $code .= 'ctxt_ad_lc = "' . $this->pd('color-title') . '";' . "\n";
39
+ $code .= 'ctxt_ad_tc = "' . $this->pd('color-text') . '";' . "\n";
40
+ $code .= 'ctxt_ad_uc = "' . $this->pd('color-url') . '";' . "\n";
41
+
42
+ $code .= '// -->';
43
+ $code .= '</script>';
44
+ $code .= '<script language="JavaScript" src="http://ypn-js.overture.com/partner/js/ypn.js">';
45
+ $code .= '</script>';
46
+
47
+ return $code;
48
+ }
49
+
50
+
51
+ function save_settings_network() {
52
+
53
+ $this->p['channel']=strip_tags(stripslashes($_POST['adsensem-channel']));
54
+
55
+ $this->p['color-border']=strip_tags(stripslashes($_POST['adsensem-color-border']));
56
+ $this->p['color-title']=strip_tags(stripslashes($_POST['adsensem-color-title']));
57
+ $this->p['color-bg']=strip_tags(stripslashes($_POST['adsensem-color-bg']));
58
+ $this->p['color-text']=strip_tags(stripslashes($_POST['adsensem-color-text']));
59
+ $this->p['color-url']=strip_tags(stripslashes($_POST['adsensem-color-url']));
60
+
61
+ }
62
+
63
+
64
+ function reset_defaults_network() {
65
+ global $_adsensem;
66
+ $_adsensem['defaults'][$this->network()]+= array (
67
+ 'color-border'=> 'FFFFFF',
68
+ 'color-title' => '0000FF',
69
+ 'color-bg' => 'FFFFFF',
70
+ 'color-text' => '000000',
71
+ 'color-url' => '0000FF',
72
+
73
+ 'url' => '',
74
+
75
+ 'adformat' => '250x250',
76
+ );
77
+ }
78
+
79
+
80
+ function import_detect_network($code){
81
+
82
+ return ( (strpos($code,'ypn-js.overture.com')!==false) );
83
+
84
+ }
85
+
86
+ function import_settings($code){
87
+
88
+ if(preg_match('/ctxt_ad_section = "(.*)"/', $code, $matches)!=0){$_POST['adsensem-channel'] = $matches[1]; }
89
+
90
+ if(preg_match('/ctxt_ad_bc = "(.*)"/', $code, $matches)!=0){ $_POST['adsensem-color-bg'] = $matches[1]; }
91
+ if(preg_match('/ctxt_ad_cc = "(.*)"/', $code, $matches)!=0){ $_POST['adsensem-color-border'] = $matches[1]; }
92
+ if(preg_match('/ctxt_ad_lc = "(.*)"/', $code, $matches)!=0){ $_POST['adsensem-color-title'] = $matches[1]; }
93
+ if(preg_match('/ctxt_ad_tc = "(.*)"/', $code, $matches)!=0){ $_POST['adsensem-color-text'] = $matches[1]; }
94
+ if(preg_match('/ctxt_ad_uc = "(.*)"/', $code, $matches)!=0){ $_POST['adsensem-color-url'] = $matches[1]; }
95
+
96
+ if(preg_match('/ctxt_ad_width = (\w*)/', $code, $matches)!=0){ $width = $matches[1]; }
97
+ if(preg_match('/ctxt_ad_height = (\w*)/', $code, $matches)!=0){ $height = $matches[1]; }
98
+ $_POST['adsensem-adformat'] = $width . "x" . $height;
99
+
100
+ if(preg_match('/ctxt_ad_partner = "(\w*)"/', $code, $matches)!=0){$_POST['adsensem-account-id'] = $matches[1]; }
101
+
102
+
103
+ $this->save_settings();
104
+ }
105
+
106
+
107
+ function _form_settings_ad_unit(){
108
+ adsensem_admin::_field_input('Name','name',$this->name,15,'Name for this Ad Unit');
109
+ ?><input name="adsensem-name-old" type="hidden" value="<?php echo htmlspecialchars($this->name, ENT_QUOTES); ?>" /><?php
110
+ }
111
+
112
+ function _form_settings_colors(){
113
+ $this->_form_settings_colors_generate(array('Border'=>'border','Title'=>'title','Background'=>'bg','Text'=>'text','URL'=>'url'));
114
+ }
115
+
116
+ function _form_settings_ad_format(){
117
+ $default=array('' => 'Use Default');
118
+ $formats=$this->_var_ad_formats_available(); //Get permitted formats for the current network
119
+ adsensem_admin::_field_select('Format','adformat',$formats,$this->p['adformat']);
120
+ adsensem_admin::_field_input('Channel','channel',$this->p['channel'],20,'Enter multiple Channels separated by + signs.');
121
+ }
122
+
123
+
124
+ }
125
+
126
+ ?>
readme.txt CHANGED
@@ -1,24 +1,27 @@
1
  === AdSense Manager ===
2
  Contributors: mutube
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2efitzpatrick%40gmail%2ecom&item_name=Donation%20to%20mutube%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
4
- Tags: adsense, ad, link, referral, manage, widget, google, adbrite, cj, adpinion, shoppingads, widgetbucks
5
  Requires at least: 2.3.3
6
- Tested up to: 2.3.3
7
- Stable tag: 3.0
8
 
9
- AdSense Manager is a Wordpress plugin for managing AdSense and other networks on your blog. It generates code automatically and allows position with widgets, code or inline tags.
10
 
11
  == Description ==
12
 
13
  AdSense Manager is a Wordpress plugin for managing AdSense ads on your blog. It generates code automatically and allows positioning with Widgets.
14
 
15
- Version 3.0 now supports:
16
- [AdSense](http://www.google.com/adsense), [Adpinion](http://www.adpinion.com/), [AdBrite](http://www.adbrite.com/mb/landing_both.php?spid=51549&afb=120x60-1-blue), [Adroll](http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/7L73RCFU5VCG7FRNNIGH7O/d6ca1e265e654df2010a2153d5c42ed4.re), [Commission Junction](http://www.cj.com/), [ShoppingAds](http://www.shoppingads.com/refer_1ebff04bf5805f6da1b4) and [WidgetBucks](http://www.widgetbucks.com/home.page?referrer=468034).
17
  Automatic Ad Code Importer for all supported networks.
18
  Widgets & Sidebar Modules compatible (as used in the popular K2 theme).
 
 
19
  [Extended instructions are available here...](http://www.mutube.com/mu/getting-started-with-adsense-manager-3x).
20
 
21
- You optionally support development of this plugin by donating a % of your Ad space & Alternate Ads to raise funds for AdSense Manager. All ads are hand-selected and guaranteed to be family friendly. Thanks for your support, it makes a difference!
 
 
22
 
23
  == Installation ==
24
 
@@ -39,7 +42,9 @@ Be Nice is a way for you to support development of this plugin without donating
39
 
40
  = What if I'm Not Nice? =
41
 
42
- Nothing. It's entirely up to you: the plugin will function identically whether you donate ad space or not. If you are able [please consider making a PayPal donation instead](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2efitzpatrick%40gmail%2ecom&item_name=Donation%20to%20mutube%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8).
 
 
43
 
44
  = What do you spend the money on? =
45
 
@@ -51,14 +56,22 @@ For some ad networks (e.g. WidgetBucks, Adroll, etc.) the dimensions of ads are
51
 
52
  = Do I still need AdSense Manager now I can manage ads through Google's system? =
53
 
54
- Yes and no. While the original purpose of being able to modify colours etc. without digging into code is now gone (although still supported) there are other advantages to AdSense Manager. For example: positioning. Additionally there are some plans afoot to provide intelligent ad placing methods to make all this work even better.
 
 
 
 
 
 
 
 
55
 
56
  = What else do you have planned? =
57
 
58
  1. Ad Zones to allow grouping of ads at a particular location, and switching depending on the visitors language, country, etc.
59
  1. Auto-inserting of ads into posts based on configurable rules (i.e. All Posts, 2nd Paragraph)
60
  1. Localisation: multi-language support
61
- 1. Support for Amazon Affiliates, Yahoo! Publisher Network, and any other networks I hear about.
62
 
63
  = Where can I get more information? =
64
 
@@ -68,5 +81,6 @@ Yes and no. While the original purpose of being able to modify colours etc. with
68
 
69
  == Screenshots ==
70
 
71
- 1. Setting up default Ads settings
72
- 2. The Ad management panel
 
1
  === AdSense Manager ===
2
  Contributors: mutube
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2efitzpatrick%40gmail%2ecom&item_name=Donation%20to%20mutube%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
4
+ Tags: adsense, ad, link, referral, manage, widget, google, adbrite, cj, adpinion, shoppingads, ypn, widgetbucks
5
  Requires at least: 2.3.3
6
+ Stable tag: 3.1.0
 
7
 
8
+ AdSense Manager is a Wordpress plugin for managing AdSense and any other ad network on your blog. It generates code automatically and allows position with widgets, code or inline tags.
9
 
10
  == Description ==
11
 
12
  AdSense Manager is a Wordpress plugin for managing AdSense ads on your blog. It generates code automatically and allows positioning with Widgets.
13
 
14
+ Version 3.1.x now supports:
15
+ [AdSense](http://www.google.com/adsense), [AdBrite](http://www.adbrite.com/mb/landing_both.php?spid=51549&afb=120x60-1-blue), [AdGridWork](http://www.adgridwork.com/?r=18501), [Adpinion](http://www.adpinion.com/), [Adroll](http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/7L73RCFU5VCG7FRNNIGH7O/d6ca1e265e654df2010a2153d5c42ed4.re), [Commission Junction](http://www.cj.com/), [CrispAds](http://www.crispads.com/), [ShoppingAds](http://www.shoppingads.com/refer_1ebff04bf5805f6da1b4), [Yahoo!PN](http://ypn.yahoo.com/) and [WidgetBucks](http://www.widgetbucks.com/home.page?referrer=468034).
16
  Automatic Ad Code Importer for all supported networks.
17
  Widgets & Sidebar Modules compatible (as used in the popular K2 theme).
18
+ Automatic limiting of Ads to meet network T&Cs (Google 3 units/page)
19
+
20
  [Extended instructions are available here...](http://www.mutube.com/mu/getting-started-with-adsense-manager-3x).
21
 
22
+ You may opt to support development of this plugin by donating a % of your Ad space to raise funds for AdSense Manager. All ads are hand-selected and guaranteed to be family friendly. Thanks for your support, it makes a difference!
23
+
24
+ This plugin is under active development: if you experience problems, please first make sure you have the latest version installed. Feature requests, bug reports and comments can be submitted [here](http://www.mutube.com/mu/getting-started-with-adsense-manager-3x/).
25
 
26
  == Installation ==
27
 
42
 
43
  = What if I'm Not Nice? =
44
 
45
+ Nothing. It's entirely up to you: the plugin will function identically whether you donate ad space or not.
46
+
47
+ If you are able [please consider making a PayPal donation instead](https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2efitzpatrick%40gmail%2ecom&item_name=Donation%20to%20mutube%2ecom&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8).
48
 
49
  = What do you spend the money on? =
50
 
56
 
57
  = Do I still need AdSense Manager now I can manage ads through Google's system? =
58
 
59
+ No, and Yes. While the original purpose of being able to modify colours etc. without digging into code is now gone (although still supported) there are other advantages to AdSense Manager. For example: positioning. Additionally there are some plans afoot to provide intelligent ad placing methods to make all this work even better.
60
+
61
+ = Upgrading has gone a bit wrong... What can I do? =
62
+
63
+ To revert to an old copy of your Ad database, go to your Dashboard and add ?adsensem-revert-db=X to your URL. Replace X with the major version that you want to revert to.
64
+
65
+ If the latest version to work was 2.1, enter: ?adsensem-revert-db=2
66
+
67
+ Load the page and AdSense Manager will revert to that version of the database and re-attempt the upgrade.
68
 
69
  = What else do you have planned? =
70
 
71
  1. Ad Zones to allow grouping of ads at a particular location, and switching depending on the visitors language, country, etc.
72
  1. Auto-inserting of ads into posts based on configurable rules (i.e. All Posts, 2nd Paragraph)
73
  1. Localisation: multi-language support
74
+ 1. Support for Amazon Affiliates and any other networks I hear about.
75
 
76
  = Where can I get more information? =
77
 
81
 
82
  == Screenshots ==
83
 
84
+ 1. Create/import ad units
85
+ 2. The ad management panel
86
+ 2. Editing ad settings
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png ADDED
Binary file