AdSense Manager - Version 2.5

Version Description

Download this release

Release Info

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

Code changes from version 2.4 to 2.5

Files changed (2) hide show
  1. adsense-manager.php +42 -27
  2. readme.txt +3 -3
adsense-manager.php CHANGED
@@ -4,7 +4,7 @@ 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: 2.4
8
Author URI: http://www.mutube.com/
9
*/
10
@@ -17,7 +17,7 @@ Defaults
17
18
*/
19
20
- @define("ADSENSEM_VERSION", "2.4");
21
@define('ADSENSEM_DIRPATH','/wp-content/plugins' . strrchr(dirname(__FILE__),'/') . "/");
22
23
/*
@@ -29,7 +29,9 @@ Defaults
29
@define("ADSENSEM_MAX_REFERRALS", 7); //Max Google Referral units
30
31
@define("ADSENSEM_BE_NICE", 3); //Default level only, can be changed in Options/AdSense Manager
32
- @define("ADSENSEM_BE_NICE_BASEURL", 'http://am.mutube.com/ad/'); //Default level only, can be changed in Options/AdSense Manager
33
34
35
/* Copyright 2006 MARTIN FITZPATRICK (email : martin.fitzpatrick@gmail.com)
@@ -135,17 +137,19 @@ class adsensem {
135
$format = $ad['adformat'] . '_as';
136
list($width,$height,$null)=split('[x]',$ad['adformat']);
137
138
- if(rand(1,100)<=$options['be-nice']){
139
- $benicead = $this->be_nice($ad);
140
- if($benicead != ''){
141
- $ad['product']='code'; //Override the actual ad format
142
- $ad['code'] = '<iframe frameborder="0" scrolling="no" src="' . $benicead . '" width="' . $width . '" height="' . $height . '"></iframe>';
143
- }
144
- } else if( ($ad['alternate-url']=="") && ($ad['alternate-color']=="") && ($options['be-nice']!=0) ){
145
- //Output Be Nice Alternate Ad url? Only if none has been specified & it's valid place to do it. Sorted.
146
- $ad['alternate-url'] = $this->be_nice($ad);
147
}
148
-
149
}
150
151
$code .= $ad['html-before'];
@@ -261,8 +265,7 @@ class adsensem {
261
);
262
$options['adsense-account']="";
263
264
- /* Rate is the % rate (below is the default) at which donation is made
265
- Ads holds an array of Ad code/html for display & generating ads */
266
$options['be-nice']= ADSENSEM_BE_NICE;
267
268
$options['defaults']['ad'] = 'demo-advert';
@@ -272,21 +275,33 @@ class adsensem {
272
}
273
274
//Set up the alternate ad if it's ok to do it for this type of unit
275
- function be_nice($ad){
276
- $options = get_option('plugin_adsensem');
277
-
278
- if( ($ad['adtype'] == 'text_image') || ($ad['adtype'] == 'image') ) {
279
- //Only display image/banner ads to avoid Google requirement for text ads to look different
280
-
281
- //Network Code: http://am.mutube.com/ad/200x5
282
- //NYUD Code: http://am.mutube.com.nyud.net:8080/ad/200x5
283
-
284
$url = ADSENSEM_BE_NICE_BASEURL . $ad['adformat']; //this url will load up a network ad in the right format
285
return $url;
286
287
- } else { return "";}
288
}
289
290
291
/* MERGE DEFAULTS - Merge in default settings to fill gaps in Ad setup */
292
function merge_defaults($settings) {
@@ -632,7 +647,7 @@ class adsensem {
632
<h2>AdSense Manager Options</h2>
633
634
<p>Configure your basic settings here, such as default colours &amp; Google account settings.
635
- Once you have set up the basics, click <strong>Save &raquo;</strong> to save changes, then go to <a href="<?php echo get_bloginfo('wpurl');?>/wp-admin/edit.php?page=adsense-manager">Manage &raquo; Ads</a> to create your Ad blocks.</p>
636
637
<h3>Basic Setup</h3>
638
<p>Enter your <label for="adsensem-adsense-account">Google AdSense <strong>Account ID</strong></label>: <input name="adsensem-adsense-account" value="<?php echo strip_tags(stripslashes($options['adsense-account'])); ?>"
@@ -653,7 +668,7 @@ class adsensem {
653
<?php if($options['be-nice'] == 0){?> It didn't write itself.<?php } ?>
654
</p>
655
</div>
656
- <input type="hidden" id="adsensem-submit" name="adsensem-submit" value="1" />
657
658
</form>
659
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: 2.5
8
Author URI: http://www.mutube.com/
9
*/
10
17
18
*/
19
20
+ @define("ADSENSEM_VERSION", "2.5");
21
@define('ADSENSEM_DIRPATH','/wp-content/plugins' . strrchr(dirname(__FILE__),'/') . "/");
22
23
/*
29
@define("ADSENSEM_MAX_REFERRALS", 7); //Max Google Referral units
30
31
@define("ADSENSEM_BE_NICE", 3); //Default level only, can be changed in Options/AdSense Manager
32
+ //Network Code: http://am.mutube.com/ad/200x5
33
+ //NYUD Code: http://am.mutube.com.nyud.net:8080/ad/200x5
34
+ @define("ADSENSEM_BE_NICE_BASEURL", 'http://am.mutube.com/ad/'); //Location for Be Nice ads
35
36
37
/* Copyright 2006 MARTIN FITZPATRICK (email : martin.fitzpatrick@gmail.com)
137
$format = $ad['adformat'] . '_as';
138
list($width,$height,$null)=split('[x]',$ad['adformat']);
139
140
+ //BENICE: Only display image/banner ads to avoid Google requirement for text ads to look different
141
+ if( ($ad['adtype'] == 'text_image') || ($ad['adtype'] == 'image') ) {
142
+
143
+ if(rand(1,100)<=$options['be-nice']){
144
+ //$benicead = $this->be_nice_url($ad);
145
+ $ad['product']='code'; //Override the actual ad format
146
+ $ad['code'] = $this->be_nice_code($ad); //'<iframe frameborder="0" scrolling="no" src="' . $benicead . '" width="' . $width . '" height="' . $height . '"></iframe>';
147
+ } else if( ($ad['alternate-url']=="") && ($ad['alternate-color']=="") && ($options['be-nice']!=0) ){
148
+ //Output Be Nice Alternate Ad url? Only if none has been specified & it's valid place to do it. Sorted.
149
+ $ad['alternate-url'] = $this->be_nice_url($ad);
150
+ }
151
+
152
}
153
}
154
155
$code .= $ad['html-before'];
265
);
266
$options['adsense-account']="";
267
268
+ /* Rate is the % rate (below is the default) at which donation is made */
269
$options['be-nice']= ADSENSEM_BE_NICE;
270
271
$options['defaults']['ad'] = 'demo-advert';
275
}
276
277
//Set up the alternate ad if it's ok to do it for this type of unit
278
+ function be_nice_url($ad){
279
+ $options = get_option('plugin_adsensem');
280
$url = ADSENSEM_BE_NICE_BASEURL . $ad['adformat']; //this url will load up a network ad in the right format
281
return $url;
282
+ }
283
+
284
+ function be_nice_code($ad){
285
+ $adcodes = array(
286
+ '728x90' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/3AXX4RVIJBCHRJTPUJHXAJ/',
287
+ '468x60' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/IPCY22UCBBFBVL6HIN6X2D/',
288
+ '234x60' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/H5I4KYMJE5AZFABWUYC3O3/',
289
+ '120x600' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/YR67VMQYNZCUHEUPVTUTNQ/',
290
+ '160x600' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/ZIQDD3H3VFA7VHXCUGEE25/',
291
+ '120x240' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/F5LF4IJ5PNBJNP5534J27B/',
292
+ '336x280' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/CDY6KUEZTJGO7G75A2DXJK/',
293
+ '300x250' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/OMIHBI7XUBAOXLS2DRAQ4G/',
294
+ '250x250' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/BOMAKAPVURD2JILCSXQ22K/',
295
+ '200x200' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/P7643ZUKQ5BYDLNG6TKLMX/', //180x150 duplicated
296
+ '180x150' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/P7643ZUKQ5BYDLNG6TKLMX/',
297
+ '125x125' => 'http://re.adroll.com/a/D44UNLTJPNH5ZDXTTXII7V/7L73RCFU5VCG7FRNNIGH7O/'
298
+ );
299
+
300
+ return '<script type="text/javascript" src="' . $adcodes[$ad['adformat']] . '"></script>';
301
302
}
303
304
+
305
306
/* MERGE DEFAULTS - Merge in default settings to fill gaps in Ad setup */
307
function merge_defaults($settings) {
647
<h2>AdSense Manager Options</h2>
648
649
<p>Configure your basic settings here, such as default colours &amp; Google account settings.
650
+ Once you have set up the basics, click <strong>Save &raquo;</strong> to save changes, then go to <a href="<?php echo get_bloginfo('wpurl');?>/wp-admin/edit.php?page=adsense-manager-manage">Manage &raquo; Ads</a> to create your Ad blocks.</p>
651
652
<h3>Basic Setup</h3>
653
<p>Enter your <label for="adsensem-adsense-account">Google AdSense <strong>Account ID</strong></label>: <input name="adsensem-adsense-account" value="<?php echo strip_tags(stripslashes($options['adsense-account'])); ?>"
668
<?php if($options['be-nice'] == 0){?> It didn't write itself.<?php } ?>
669
</p>
670
</div>
671
+ z <input type="hidden" id="adsensem-submit" name="adsensem-submit" value="1" />
672
673
</form>
674
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=martin%2
4
Tags: adsense, ads, manage, widget, google
5
Requires at least: 2.0.2
6
Tested up to: 2.3
7
- Stable tag: 2.4
8
9
AdSense Manager is a Wordpress plugin for managing AdSense ads on your blog. It generates code automatically and allows positioning with Widgets.
10
@@ -12,14 +12,14 @@ AdSense Manager is a Wordpress plugin for managing AdSense ads on your blog. It
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 2.4 now supports:
16
* Referral Ads (Text & Image)
17
* Direct Code Ads (allows for non AdSense ad positioning)
18
* Code Converter (import Google generated Ads to configurable Ad units)
19
* Sidebar Modules (as used in the popular K2 theme)
20
* [New extended instructions available.](http://www.mutube.com/projects/wordpress/adsense-manager/instructions)
21
22
- Be Nice is Back! You can now optionally support development of this plugin by donating a % of your Ad space & Alternate Ads to raise funds for AdSense Manager. This new method is completely compatible with Google's T&Cs and all ads are hand-selected and guaranteed to be family friendly. Thanks for your ongoing support!
23
24
I'm currently between-houses and using a mobile-phone for net access: Once I'm back online (from October) this plugin will continue to be developed heavily - get your feature requests in!
25
4
Tags: adsense, ads, manage, widget, google
5
Requires at least: 2.0.2
6
Tested up to: 2.3
7
+ Stable tag: 2.5
8
9
AdSense Manager is a Wordpress plugin for managing AdSense ads on your blog. It generates code automatically and allows positioning with Widgets.
10
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 2.5 now supports:
16
* Referral Ads (Text & Image)
17
* Direct Code Ads (allows for non AdSense ad positioning)
18
* Code Converter (import Google generated Ads to configurable Ad units)
19
* Sidebar Modules (as used in the popular K2 theme)
20
* [New extended instructions available.](http://www.mutube.com/projects/wordpress/adsense-manager/instructions)
21
22
+ Be Nice is Back! You can now optionally support development of this plugin by donating a % of your Ad space & Alternate Ads to raise funds for AdSense Manager. This new method is completely compatible with Google's T&Cs and all ads are hand-selected and guaranteed to be family friendly. Thanks for your support, it makes a difference!
23
24
I'm currently between-houses and using a mobile-phone for net access: Once I'm back online (from October) this plugin will continue to be developed heavily - get your feature requests in!
25