Version Description
Fix for disappearing top / bottom ad.
Download this release
Release Info
Developer | reviewmylife |
Plugin | Ad Injection |
Version | 0.9.7.1 |
Comparing to | |
See all releases |
Code changes from version 0.9.7 to 0.9.7.1
- ad-injection-admin.php +1 -1
- ad-injection.php +14 -6
- readme.txt +6 -3
ad-injection-admin.php
CHANGED
@@ -331,7 +331,7 @@ function adinj_top_message_box(){
|
|
331 |
|
332 |
} else {
|
333 |
echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
|
334 |
-
echo "28th February 2011: Archives and home ads now fully supported - you can add top/random/bottom ads to them. Big UI updates to support this. And fixes for when/where widget ads appear. I'd recommend you re-check that your ads appear where you expect them to. Please contact me ASAP if you spot any bugs, or odd behaviour via the ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>.';
|
335 |
echo '</strong></p></div>';
|
336 |
}
|
337 |
}
|
331 |
|
332 |
} else {
|
333 |
echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
|
334 |
+
echo "28th February 2011: Fix for disappearing top/bottom ad - I'm sorry if you were affected by that! Archives and home ads now fully supported - you can add top/random/bottom ads to them. Big UI updates to support this. And fixes for when/where widget ads appear. I'd recommend you re-check that your ads appear where you expect them to. Please contact me ASAP if you spot any bugs, or odd behaviour via the ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>.';
|
335 |
echo '</strong></p></div>';
|
336 |
}
|
337 |
}
|
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: 0.9.7
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
@@ -769,9 +769,12 @@ function adinj_num_top_ads_to_insert($content_length){
|
|
769 |
global $adinj_total_top_ads_used;
|
770 |
$ops = adinj_options();
|
771 |
$prefix = adinj_get_current_page_type_prefix();
|
772 |
-
|
773 |
-
|
774 |
-
|
|
|
|
|
|
|
775 |
if (!adinj_allowed_in_category('top', $ops)) return "NOADS: top ad blocked from category";
|
776 |
if (!adinj_allowed_in_tag('top', $ops)) return "NOADS: top ad blocked from tag";
|
777 |
if (!adinj_allowed_in_author('top', $ops)) return "NOADS: top ad blocked from author";
|
@@ -786,8 +789,12 @@ function adinj_num_bottom_ads_to_insert($content_length){
|
|
786 |
global $adinj_total_bottom_ads_used;
|
787 |
$ops = adinj_options();
|
788 |
$prefix = adinj_get_current_page_type_prefix();
|
789 |
-
|
790 |
-
|
|
|
|
|
|
|
|
|
791 |
|
792 |
if (!adinj_allowed_in_category('bottom', $ops)) return "NOADS: bottom ad blocked from category";
|
793 |
if (!adinj_allowed_in_tag('bottom', $ops)) return "NOADS: bottom ad blocked from tag";
|
@@ -870,6 +877,7 @@ function adinj_upgrade_db_if_necessary(){
|
|
870 |
$cached_options = adinj_options();
|
871 |
if(empty($cached_options)){
|
872 |
// 1st Install.
|
|
|
873 |
adinj_install_db();
|
874 |
return;
|
875 |
}
|
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: 0.9.7.1
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
769 |
global $adinj_total_top_ads_used;
|
770 |
$ops = adinj_options();
|
771 |
$prefix = adinj_get_current_page_type_prefix();
|
772 |
+
if (is_single() || is_page()){
|
773 |
+
$max_num_ads_to_insert = 1 - $adinj_total_top_ads_used;
|
774 |
+
} else {
|
775 |
+
$max_num_ads_to_insert = $ops[$prefix.'max_num_top_ads_per_page'] - $adinj_total_top_ads_used;
|
776 |
+
}
|
777 |
+
if ($max_num_ads_to_insert <= 0) return 0;
|
778 |
if (!adinj_allowed_in_category('top', $ops)) return "NOADS: top ad blocked from category";
|
779 |
if (!adinj_allowed_in_tag('top', $ops)) return "NOADS: top ad blocked from tag";
|
780 |
if (!adinj_allowed_in_author('top', $ops)) return "NOADS: top ad blocked from author";
|
789 |
global $adinj_total_bottom_ads_used;
|
790 |
$ops = adinj_options();
|
791 |
$prefix = adinj_get_current_page_type_prefix();
|
792 |
+
if (is_single() || is_page()){
|
793 |
+
$max_num_ads_to_insert = 1 - $adinj_total_bottom_ads_used;;
|
794 |
+
} else {
|
795 |
+
$max_num_ads_to_insert = $ops[$prefix.'max_num_bottom_ads_per_page'] - $adinj_total_bottom_ads_used;
|
796 |
+
}
|
797 |
+
if ($max_num_ads_to_insert <= 0) return 0;
|
798 |
|
799 |
if (!adinj_allowed_in_category('bottom', $ops)) return "NOADS: bottom ad blocked from category";
|
800 |
if (!adinj_allowed_in_tag('bottom', $ops)) return "NOADS: bottom ad blocked from tag";
|
877 |
$cached_options = adinj_options();
|
878 |
if(empty($cached_options)){
|
879 |
// 1st Install.
|
880 |
+
require_once(ADINJ_PATH . '/ad-injection-admin.php');
|
881 |
adinj_install_db();
|
882 |
return;
|
883 |
}
|
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.1
|
7 |
-
Stable tag: 0.9.7
|
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 |
|
@@ -372,6 +372,9 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
|
|
372 |
|
373 |
== Changelog ==
|
374 |
|
|
|
|
|
|
|
375 |
= 0.9.7 =
|
376 |
* Archive and home page ads now fully supported with the same controls as ads for single posts/pages.
|
377 |
* Category, tag and author restrictions for top, random and bottom ads.
|
@@ -501,8 +504,8 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
|
|
501 |
|
502 |
== Upgrade Notice ==
|
503 |
|
504 |
-
= 0.9.7 =
|
505 |
-
|
506 |
|
507 |
= 0.8.3 =
|
508 |
First public release.
|
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.1
|
7 |
+
Stable tag: 0.9.7.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 |
|
372 |
|
373 |
== Changelog ==
|
374 |
|
375 |
+
= 0.9.7.1 =
|
376 |
+
Fix for disappearing top / bottom ad.
|
377 |
+
|
378 |
= 0.9.7 =
|
379 |
* Archive and home page ads now fully supported with the same controls as ads for single posts/pages.
|
380 |
* Category, tag and author restrictions for top, random and bottom ads.
|
504 |
|
505 |
== Upgrade Notice ==
|
506 |
|
507 |
+
= 0.9.7.1 =
|
508 |
+
Fix for disappearing top/bottom ad.
|
509 |
|
510 |
= 0.8.3 =
|
511 |
First public release.
|