Ad Injection - Version 1.2.0.11

Version Description

  • Preserve HTML entities when saving - i.e. preserve special character sequences.
  • Add '400' as an option to the numbered drop downs.
Download this release

Release Info

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

Code changes from version 1.2.0.10 to 1.2.0.11

ad-injection-admin.php CHANGED
@@ -342,7 +342,7 @@ function adinj_top_message_box(){
342
 
343
  } else if (!isset($_GET['tab'])){
344
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
345
- echo "1st February 2012: Hopefully fix the unreliable cookie management code and fix any 'headers already sent' errors. Full filter support for template ads. Fix for category/tag filters with spaces them. With support for my new <a href='http://wordpress.org/extend/plugins/ad-logger/' target='_new'>Ad Logger</a> plugin's AdSense click blocking feature. 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>.';
346
  echo '</strong></p></div>';
347
  }
348
  }
342
 
343
  } else if (!isset($_GET['tab'])){
344
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
345
+ echo "7th April 2012: Preserve special HTML character sequences such as &amp;amp; and &amp;para. With support for my new <a href='http://wordpress.org/extend/plugins/ad-logger/' target='_new'>Ad Logger</a> plugin's AdSense click blocking feature. Please contact me ASAP if you spot any bugs, or odd behaviour via the <a href='http://wordpress.org/tags/ad-injection?forum_id=10'target='_new'>Ad Injection WordPress forum</a> or my ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>. If you like the plugin please consider making a donation using the PayPal box below :)';
346
  echo '</strong></p></div>';
347
  }
348
  }
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.10
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
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.11
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
adshow.php CHANGED
@@ -8,9 +8,7 @@ http://www.reviewmylife.co.uk/
8
 
9
  if (!defined('ADINJ_NO_CONFIG_FILE')){
10
  $adinj_dir = dirname(__FILE__);
11
- if (file_exists($adinj_dir.'/ad-injection-config.php')){
12
- include_once($adinj_dir.'/ad-injection-config.php');
13
- } else if (file_exists($adinj_dir.'/../../ad-injection-config.php')) {
14
  include_once($adinj_dir.'/../../ad-injection-config.php');
15
  } else {
16
  echo '<!--ADINJ DEBUG: ad-injection-config.php could not be found. Re-save your settings to re-generate it.-->';
8
 
9
  if (!defined('ADINJ_NO_CONFIG_FILE')){
10
  $adinj_dir = dirname(__FILE__);
11
+ if (file_exists($adinj_dir.'/../../ad-injection-config.php')) {
 
 
12
  include_once($adinj_dir.'/../../ad-injection-config.php');
13
  } else {
14
  echo '<!--ADINJ DEBUG: ad-injection-config.php could not be found. Re-save your settings to re-generate it.-->';
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.3.1
7
- Stable tag: 1.2.0.10
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
 
@@ -272,9 +272,9 @@ Ads will only appear if your front, home or archives page if you show the full p
272
 
273
  To stop ads appearing on the contact page (or any other post/page) you have many of options. Here are 4 to choose from:
274
 
275
- 1. Add the post/page id to the post/page id ad filtering box.
276
- 2. Add (copy and paste) &lt;!--NoAds--&gt; into the content of the post/page with the contact form. Just edit the contact page and paste this in - it will be invisible to the reader.
277
- 3. Add a disable_adverts custom field to the post/page containing the contact form and set the value to 1 (the number one as a single digit). If you can't see the custom fields click on 'Screen Options' at the top right on the post/page editing screen, and tick 'Custom Fields.
278
  4. Add a tag to the page to mean that it shouldn't have adverts, and then add that tag to the tag filtering condition in the global settings area of the plugin configuration page.
279
 
280
  = How can I put ads on category (or other archive pages)? =
@@ -497,7 +497,7 @@ Solution: Follow the below advice for the 'theme conflicts'.
497
 
498
  Ad Injection (when injecting random ads) works by looking for the end paragraph tags (&lt;p&gt;&lt;/p&gt;). Some themes override the wpautop filter and set it to run after the plugins. This means that Ad Injection can't find the end paragraph tags, and so can't inject any random ads. If this happens try changing the the_content filter priority from the Advanced tab in the Ad Injection UI. Try values of 100, and if that doesn't work 200.
499
 
500
- Themes which I know have this issue include 'Avenue', 'TheTravelTheme', 'Exciter Magazine', and 'Vectors'.
501
 
502
  = Will Ad Injection work with the multi-blog version of WordPress? =
503
 
@@ -607,6 +607,10 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
607
 
608
  == Changelog ==
609
 
 
 
 
 
610
  = 1.2.0.10 =
611
  * Fix to allow categories/tags/author names which contain spaces.
612
  * Add category/tag/id/author filters for template ads.
@@ -843,6 +847,10 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
843
 
844
  == Upgrade Notice ==
845
 
 
 
 
 
846
  = 1.2.0.10 =
847
  * Fix to allow categories/tags/author names which contain spaces.
848
  * Add category/tag/id/author filters for template ads.
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.3.1
7
+ Stable tag: 1.2.0.11
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
 
272
 
273
  To stop ads appearing on the contact page (or any other post/page) you have many of options. Here are 4 to choose from:
274
 
275
+ 1. Add a disable_adverts custom field to the post/page containing the contact form and set the value to 1 (the number one as a single digit). If you can't see the custom fields click on 'Screen Options' at the top right on the post/page editing screen, and tick 'Custom Fields.
276
+ 2. Add the post/page id to the post/page id ad filtering box.
277
+ 3. Add (copy and paste) &lt;!--NoAds--&gt; into the content of the post/page with the contact form. Just edit the contact page and paste this in - it will be invisible to the reader.
278
  4. Add a tag to the page to mean that it shouldn't have adverts, and then add that tag to the tag filtering condition in the global settings area of the plugin configuration page.
279
 
280
  = How can I put ads on category (or other archive pages)? =
497
 
498
  Ad Injection (when injecting random ads) works by looking for the end paragraph tags (&lt;p&gt;&lt;/p&gt;). Some themes override the wpautop filter and set it to run after the plugins. This means that Ad Injection can't find the end paragraph tags, and so can't inject any random ads. If this happens try changing the the_content filter priority from the Advanced tab in the Ad Injection UI. Try values of 100, and if that doesn't work 200.
499
 
500
+ Themes which I know have this issue include 'Avenue', 'TheTravelTheme', 'Exciter Magazine', 'Vectors', and 'Canvas' from Woothemes.
501
 
502
  = Will Ad Injection work with the multi-blog version of WordPress? =
503
 
607
 
608
  == Changelog ==
609
 
610
+ = 1.2.0.11 =
611
+ * Preserve HTML entities when saving - i.e. preserve special character sequences.
612
+ * Add '400' as an option to the numbered drop downs.
613
+
614
  = 1.2.0.10 =
615
  * Fix to allow categories/tags/author names which contain spaces.
616
  * Add category/tag/id/author filters for template ads.
847
 
848
  == Upgrade Notice ==
849
 
850
+ = 1.2.0.11 =
851
+ * Preserve HTML entities when saving - i.e. preserve special character sequences.
852
+ * Add '400' as an option to the numbered drop downs.
853
+
854
  = 1.2.0.10 =
855
  * Fix to allow categories/tags/author names which contain spaces.
856
  * Add category/tag/id/author filters for template ads.
ui-tab-adrotation.php CHANGED
@@ -106,8 +106,9 @@ echo <<<EOT
106
  <textarea name="$name" rows="8" cols="
107
  EOT;
108
  adinj_table_width('rotation');
 
109
  echo <<<EOT
110
- ">$ops[$name]</textarea>
111
  </td><td>
112
  <input name="$namesplit" size="7" value="$ops[$namesplit]" />
113
  <br />
106
  <textarea name="$name" rows="8" cols="
107
  EOT;
108
  adinj_table_width('rotation');
109
+ echo '">'.htmlentities($ops[$name]);
110
  echo <<<EOT
111
+ </textarea>
112
  </td><td>
113
  <input name="$namesplit" size="7" value="$ops[$namesplit]" />
114
  <br />
ui-tab-main.php CHANGED
@@ -52,7 +52,7 @@ function adinj_placement_settings_box($ops){
52
  <tr><td>Only show on posts longer than:</td><td>
53
  <?php
54
  $unit = adinj_counting_unit_description();
55
- $ad_if_longer_settings = array('d',100,200,300,500,750,1000,1500,2000,2500,3000,5000,10000,15000,20000);
56
  adinj_selection_box("top_ad_if_longer_than", $ad_if_longer_settings, $unit);
57
  echo '</td><td><div class="adinj_home">';
58
  adinj_selection_box("home_top_ad_if_longer_than", $ad_if_longer_settings, $unit);
@@ -83,7 +83,7 @@ function adinj_placement_settings_box($ops){
83
  </td>
84
  <td>
85
  <?php
86
- adinj_selection_box("top_ad_position", array(0,1,2,3,4,5,100,200,300,500,750,1000,1500,2000,3000), " ");
87
  ?>
88
  </td></tr>
89
  </table>
@@ -197,7 +197,7 @@ JQUERYOPACITY;
197
  </td><td>
198
  <div class="random_ads_start_unit">
199
  <?php
200
- adinj_selection_box("random_ads_start_at", array(1,2,3,4,5,100,200,300,500,750,1000,1500,2000,3000,4000,5000,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), " ");
201
  ?>
202
  </div>
203
  </td>
@@ -244,7 +244,7 @@ JQUERYOPACITY;
244
  </td><td>
245
  <div class="random_ads_end_unit">
246
  <?php
247
- adinj_selection_box("random_ads_end_at", array(1,2,3,4,5,100,200,300,500,750,1000,1500,2000,3000,4000,5000,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), " ");
248
  ?>
249
  </div>
250
  </td>
@@ -355,7 +355,7 @@ JQUERYOPACITY;
355
  </td>
356
  <td>
357
  <?php
358
- adinj_selection_box("bottom_ad_position", array(0,1,2,3,4,5,100,200,300,500,750,1000,1500,2000,3000), " ");
359
  ?>
360
  </td>
361
  <td>
@@ -390,7 +390,7 @@ function adinj_adverts_box($ops){
390
  <h3><a name="topadcode"></a>Top ad (below post title - this is not a 'header' ad) [<a href="#topadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_top'>pool</a>]--></h3>
391
  <table border="0" class="adinjtable" width="98%">
392
  <tr><td>
393
- <textarea name="ad_code_top_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo $ops['ad_code_top_1']; ?></textarea>
394
  <br />
395
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x15">468x15</a> or <a href="#336x280">336x280</a> advert.</span></p>
396
  </td><td>
@@ -405,7 +405,7 @@ function adinj_adverts_box($ops){
405
  <h3><a name="randomadcode"></a>Random ad (inserted randomly between paragraphs) [<a href="#randomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_random'>pool</a>]--></h3>
406
  <table border="0" class="adinjtable" width="98%">
407
  <tr><td>
408
- <textarea name="ad_code_random_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo $ops['ad_code_random_1']; ?></textarea>
409
  <br />
410
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x60">468x60</a> or <a href="#728x90">728x90</a> banner.</span></p>
411
  </td><td>
@@ -419,7 +419,7 @@ function adinj_adverts_box($ops){
419
  <h3><a name="bottomadcode"></a>Bottom ad (below the post content) [<a href="#bottomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_bottom'>pool</a>]--></h3>
420
  <table border="0" class="adinjtable" width="98%">
421
  <tr><td>
422
- <textarea name="ad_code_bottom_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo $ops['ad_code_bottom_1']; ?></textarea>
423
  <br />
424
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#336x280">336x280</a> advert.</span></p>
425
  </td><td>
@@ -434,7 +434,7 @@ function adinj_adverts_box($ops){
434
  <h3><a name="footeradcode"></a>Footer ad (put into 'the_footer' hook - not supported by all themes) [<a href="#footeradplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_footer'>pool</a>]--></h3>
435
  <table border="0" class="adinjtable" width="98%">
436
  <tr><td>
437
- <textarea name="ad_code_footer_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo $ops['ad_code_footer_1']; ?></textarea>
438
  <br />
439
  Docs: footer ad information and troubleshooting
440
  <?php adinj_add_show_hide_section('footer_docs_'.uniqid(''), 'ui_footer_docs_show', 'ui_footer_docs_show', $ops); ?>
@@ -698,7 +698,7 @@ function adinj_random_ad_limit_table(){
698
  <?php
699
  $prefixes = array("", "home", "archive");
700
  $unit = adinj_counting_unit_description();
701
- $ad_limit_settings = array('d',100,200,300,500,750,1000,1500,2000,2500,3000,5000,10000,15000,20000);
702
 
703
  foreach ($prefixes as $prefix){
704
  echo '<td><div class="adinj_'.$prefix.'">';
52
  <tr><td>Only show on posts longer than:</td><td>
53
  <?php
54
  $unit = adinj_counting_unit_description();
55
+ $ad_if_longer_settings = array('d',100,200,300,400,500,750,1000,1500,2000,2500,3000,5000,10000,15000,20000);
56
  adinj_selection_box("top_ad_if_longer_than", $ad_if_longer_settings, $unit);
57
  echo '</td><td><div class="adinj_home">';
58
  adinj_selection_box("home_top_ad_if_longer_than", $ad_if_longer_settings, $unit);
83
  </td>
84
  <td>
85
  <?php
86
+ adinj_selection_box("top_ad_position", array(0,1,2,3,4,5,100,200,300,400,500,750,1000,1500,2000,3000), " ");
87
  ?>
88
  </td></tr>
89
  </table>
197
  </td><td>
198
  <div class="random_ads_start_unit">
199
  <?php
200
+ adinj_selection_box("random_ads_start_at", array(1,2,3,4,5,100,200,300,400,500,750,1000,1500,2000,3000,4000,5000,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), " ");
201
  ?>
202
  </div>
203
  </td>
244
  </td><td>
245
  <div class="random_ads_end_unit">
246
  <?php
247
+ adinj_selection_box("random_ads_end_at", array(1,2,3,4,5,100,200,300,400,500,750,1000,1500,2000,3000,4000,5000,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20), " ");
248
  ?>
249
  </div>
250
  </td>
355
  </td>
356
  <td>
357
  <?php
358
+ adinj_selection_box("bottom_ad_position", array(0,1,2,3,4,5,100,200,300,400,500,750,1000,1500,2000,3000), " ");
359
  ?>
360
  </td>
361
  <td>
390
  <h3><a name="topadcode"></a>Top ad (below post title - this is not a 'header' ad) [<a href="#topadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_top'>pool</a>]--></h3>
391
  <table border="0" class="adinjtable" width="98%">
392
  <tr><td>
393
+ <textarea name="ad_code_top_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_top_1']); ?></textarea>
394
  <br />
395
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x15">468x15</a> or <a href="#336x280">336x280</a> advert.</span></p>
396
  </td><td>
405
  <h3><a name="randomadcode"></a>Random ad (inserted randomly between paragraphs) [<a href="#randomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_random'>pool</a>]--></h3>
406
  <table border="0" class="adinjtable" width="98%">
407
  <tr><td>
408
+ <textarea name="ad_code_random_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_random_1']); ?></textarea>
409
  <br />
410
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#468x60">468x60</a> or <a href="#728x90">728x90</a> banner.</span></p>
411
  </td><td>
419
  <h3><a name="bottomadcode"></a>Bottom ad (below the post content) [<a href="#bottomadplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_bottom'>pool</a>]--></h3>
420
  <table border="0" class="adinjtable" width="98%">
421
  <tr><td>
422
+ <textarea name="ad_code_bottom_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_bottom_1']); ?></textarea>
423
  <br />
424
  <p><span style="font-size:10px;"><b>Docs:</b> Try a <a href="#336x280">336x280</a> advert.</span></p>
425
  </td><td>
434
  <h3><a name="footeradcode"></a>Footer ad (put into 'the_footer' hook - not supported by all themes) [<a href="#footeradplacement">placement</a>] <!--[<a href='?page=ad-injection&amp;tab=adrotation#multiple_footer'>pool</a>]--></h3>
435
  <table border="0" class="adinjtable" width="98%">
436
  <tr><td>
437
+ <textarea name="ad_code_footer_1" rows="10" cols="<?php adinj_table_width('ad'); ?>"><?php echo htmlentities($ops['ad_code_footer_1']); ?></textarea>
438
  <br />
439
  Docs: footer ad information and troubleshooting
440
  <?php adinj_add_show_hide_section('footer_docs_'.uniqid(''), 'ui_footer_docs_show', 'ui_footer_docs_show', $ops); ?>
698
  <?php
699
  $prefixes = array("", "home", "archive");
700
  $unit = adinj_counting_unit_description();
701
+ $ad_limit_settings = array('d',100,200,300,400,500,750,1000,1500,2000,2500,3000,5000,10000,15000,20000);
702
 
703
  foreach ($prefixes as $prefix){
704
  echo '<td><div class="adinj_'.$prefix.'">';