Ad Injection - Version 1.2.0.2

Version Description

  • Fix: Problem with repeating bottom ads and ID filters not being properly applied to archives.
Download this release

Release Info

Developer reviewmylife
Plugin Icon wp plugin Ad Injection
Version 1.2.0.2
Comparing to
See all releases

Code changes from version 1.2.0.1 to 1.2.0.2

Files changed (2) hide show
  1. ad-injection.php +4 -16
  2. readme.txt +8 -2
ad-injection.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ad Injection
4
  Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
5
  Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
6
- Version: 1.2.0.1
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
@@ -159,9 +159,7 @@ function adinj_get_ad_code($adtype, $ads_db){
159
  $formatting = NULL;
160
  if (adinj_mfunc_mode()){
161
  adinj_live_ads_array($adtype, $ads_db, $ads_live, $ads_split, 'string');
162
- if (adinj_db_version($ads_db) >= 2){
163
- adinj_live_ads_array($adtype.'_alt', $ads_db, $alt_live, $alt_split, 'string');
164
- }
165
  $formatting = adinj_formatting_options($adtype, $ads_db, 'string');
166
  } else {
167
  $ads_live = array();
@@ -169,9 +167,7 @@ function adinj_get_ad_code($adtype, $ads_db){
169
  $alt_live = array();
170
  $alt_split = array();
171
  adinj_live_ads_array($adtype, $ads_db, $ads_live, $ads_split, 'array');
172
- if (adinj_db_version($ads_db) >= 2){
173
- adinj_live_ads_array($adtype.'_alt', $ads_db, $alt_live, $alt_split, 'array');
174
- }
175
  $formatting = adinj_formatting_options($adtype, $ads_db, 'array');
176
  }
177
  if (empty($ads_live) && empty($alt_live)){
@@ -612,10 +608,6 @@ function adinj_allowed_in_id($scope, $ops){
612
  $conditions = adinj_split_comma_list($ops[$scope.'_id_condition_entries']);
613
  if (empty($conditions)) return true;
614
 
615
- if (!is_single() && !is_page()){
616
- return true;
617
- }
618
-
619
  $postid = -1;
620
  if (in_the_loop()){
621
  global $post;
@@ -790,11 +782,7 @@ function adinj_content_hook($content){
790
  $content = $topad.$content;
791
  ++$adinj_total_top_ads_used;
792
  }
793
- if ($ops['bottom_ad_position'] == 0){ // default is special case
794
- $content = $content.$bottomad;
795
- ++$adinj_total_bottom_ads_used;
796
- }
797
- if ($bottom_ad_paragraph !== -1 && $adinj_total_bottom_ads_used == 0){
798
  $content = $content.$bottomad;
799
  ++$adinj_total_bottom_ads_used;
800
  }
3
  Plugin Name: Ad Injection
4
  Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
5
  Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
6
+ Version: 1.2.0.2
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
159
  $formatting = NULL;
160
  if (adinj_mfunc_mode()){
161
  adinj_live_ads_array($adtype, $ads_db, $ads_live, $ads_split, 'string');
162
+ adinj_live_ads_array($adtype.'_alt', $ads_db, $alt_live, $alt_split, 'string');
 
 
163
  $formatting = adinj_formatting_options($adtype, $ads_db, 'string');
164
  } else {
165
  $ads_live = array();
167
  $alt_live = array();
168
  $alt_split = array();
169
  adinj_live_ads_array($adtype, $ads_db, $ads_live, $ads_split, 'array');
170
+ adinj_live_ads_array($adtype.'_alt', $ads_db, $alt_live, $alt_split, 'array');
 
 
171
  $formatting = adinj_formatting_options($adtype, $ads_db, 'array');
172
  }
173
  if (empty($ads_live) && empty($alt_live)){
608
  $conditions = adinj_split_comma_list($ops[$scope.'_id_condition_entries']);
609
  if (empty($conditions)) return true;
610
 
 
 
 
 
611
  $postid = -1;
612
  if (in_the_loop()){
613
  global $post;
782
  $content = $topad.$content;
783
  ++$adinj_total_top_ads_used;
784
  }
785
+ if ($bottom_ad_paragraph !== -1 && $ops['bottom_ad_position'] == 0){ // default is special case as themes can't be trusted to close the final paragraph
 
 
 
 
786
  $content = $content.$bottomad;
787
  ++$adinj_total_bottom_ads_used;
788
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-w
4
  Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
5
  Requires at least: 2.8.6
6
  Tested up to: 3.2.1
7
- Stable tag: 1.2.0.1
8
 
9
  Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
10
 
@@ -329,7 +329,7 @@ You can do the same for tags using has_tag. See http://codex.wordpress.org/Funct
329
 
330
  Note - this will only work in direct insertion mode.
331
 
332
- == I want a different advert for each category. How can I do this? ==
333
 
334
  1. In your plugins directory create a sub-directory called 'ad-injection-ads'. e.g. /wordpress/wp-content/plugins/ad-injection-ads/
335
 
@@ -579,6 +579,9 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
579
 
580
  == Changelog ==
581
 
 
 
 
582
  = 1.2.0.1 =
583
  * Fix: Bottom ad moved can potentially move up a paragraph if theme doesn't put closing paragraph at end of post.
584
 
@@ -786,6 +789,9 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
786
 
787
  == Upgrade Notice ==
788
 
 
 
 
789
  = 1.2.0.1 =
790
  * Fix: Bottom ad moved can potentially move up a paragraph if theme doesn't put closing paragraph at end of post.
791
 
4
  Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
5
  Requires at least: 2.8.6
6
  Tested up to: 3.2.1
7
+ Stable tag: 1.2.0.2
8
 
9
  Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
10
 
329
 
330
  Note - this will only work in direct insertion mode.
331
 
332
+ = I want a different advert for each category. How can I do this? =
333
 
334
  1. In your plugins directory create a sub-directory called 'ad-injection-ads'. e.g. /wordpress/wp-content/plugins/ad-injection-ads/
335
 
579
 
580
  == Changelog ==
581
 
582
+ = 1.2.0.2 =
583
+ * Fix: Problem with repeating bottom ads and ID filters not being properly applied to archives.
584
+
585
  = 1.2.0.1 =
586
  * Fix: Bottom ad moved can potentially move up a paragraph if theme doesn't put closing paragraph at end of post.
587
 
789
 
790
  == Upgrade Notice ==
791
 
792
+ = 1.2.0.2 =
793
+ * Fix: Problem with repeating bottom ads and ID filters not being properly applied to archives.
794
+
795
  = 1.2.0.1 =
796
  * Fix: Bottom ad moved can potentially move up a paragraph if theme doesn't put closing paragraph at end of post.
797