Ad Injection - Version 1.2.0.16

Version Description

  • New options to exclude ads from table tags.
Download this release

Release Info

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

Code changes from version 1.2.0.15 to 1.2.0.16

ad-injection-admin.php CHANGED
@@ -343,7 +343,7 @@ function adinj_top_message_box(){
343
 
344
  } else if (!isset($_GET['tab'])){
345
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
346
- echo "25th June 2012: New options to exclude ads from div, form, ol and ul tags. Fix relating to post length restrictions. 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 :)'."<br/>And finally I've just released my first iPhone game called <a href='http://itunes.apple.com/us/app/solar-balls/id521551813?ls=1&mt=8' target='_new'>Solar Balls</a> - please have a go if you have time :)";
347
  echo '</strong></p></div>';
348
  }
349
  }
@@ -1420,6 +1420,7 @@ function adinj_default_options(){
1420
  'exclude_ads_from_div_tags' => 'off',
1421
  'exclude_ads_from_list_tags' => 'off',
1422
  'exclude_ads_from_form_tags' => 'off',
 
1423
  // random ad start/end position
1424
  'random_ads_start_mode' => 'anywhere',
1425
  'random_ads_start_unit' => 'paragraph',
343
 
344
  } else if (!isset($_GET['tab'])){
345
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
346
+ echo "11th August 2012: Add table exclusion option. Remove old advert - the space is now available. 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 :)'."<br/>And finally I've just released an app to help you try Facebook Likes, Twitter Tweets and Google +1s on your website. It is called <a href='http://www.reviewmylife.co.uk/blog/2012/07/14/web-social-stats-for-seo/' target='_new'>Web Social Stats for SEO</a>.";
347
  echo '</strong></p></div>';
348
  }
349
  }
1420
  'exclude_ads_from_div_tags' => 'off',
1421
  'exclude_ads_from_list_tags' => 'off',
1422
  'exclude_ads_from_form_tags' => 'off',
1423
+ 'exclude_ads_from_table_tags' => 'off',
1424
  // random ad start/end position
1425
  'random_ads_start_mode' => 'anywhere',
1426
  'random_ads_start_unit' => 'paragraph',
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.15
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
@@ -38,7 +38,8 @@ define('ADINJ_NO_CONFIG_FILE', 1);
38
  // 21 = 1.2.0.8 Template conditions
39
  // 22 = 1.2.0.13 exclude_ads_from_block_tags option
40
  // 23 = 1.2.0.15 exclude_ads_from_[div/list/form]_tags option
41
- define('ADINJ_DB_VERSION', 23);
 
42
 
43
  // Files
44
  // TODO will these paths work on windows?
@@ -753,6 +754,14 @@ function adinj_content_hook($content){
753
  if (!$valid) continue;
754
  }
755
 
 
 
 
 
 
 
 
 
756
  if($valid){
757
  $next_exclude_open = adinj_stripos($content, '<!--adinj_exclude_start-->', $prevpos);
758
  $next_exclude_close = adinj_stripos($content, '<!--adinj_exclude_end-->', $prevpos);
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.16
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
38
  // 21 = 1.2.0.8 Template conditions
39
  // 22 = 1.2.0.13 exclude_ads_from_block_tags option
40
  // 23 = 1.2.0.15 exclude_ads_from_[div/list/form]_tags option
41
+ // 24 = 1.2.0.16 exclude_ads_from_table_tags option
42
+ define('ADINJ_DB_VERSION', 24);
43
 
44
  // Files
45
  // TODO will these paths work on windows?
754
  if (!$valid) continue;
755
  }
756
 
757
+ if (adinj_ticked('exclude_ads_from_table_tags')){
758
+ $next_open = adinj_stripos($content, '<table', $prevpos);
759
+ $next_close = adinj_stripos($content, '</table>', $prevpos);
760
+ $valid = (($next_open == $next_close) ||
761
+ ($next_open > $prevpos && $next_open <= $next_close));
762
+ if (!$valid) continue;
763
+ }
764
+
765
  if($valid){
766
  $next_exclude_open = adinj_stripos($content, '<!--adinj_exclude_start-->', $prevpos);
767
  $next_exclude_close = adinj_stripos($content, '<!--adinj_exclude_end-->', $prevpos);
advert-1_placeholder.png ADDED
Binary file
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: reviewmylife
3
  Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
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.2
7
- Stable tag: 1.2.0.15
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
 
@@ -306,7 +306,7 @@ Check your style sheet to see if either the text or headings have the 'clear' at
306
 
307
  This is because you have inserted adverts that are too wide for your site's layout. The browser can no longer fit all the parts of your layout side-by-side. Try using ads that are less wide.
308
 
309
- = How do I add left/right margins to the ads
310
 
311
  There aren't any options to do this in the UI, but you can just put the layout tags into the ad box around your advert. e.g.
312
 
@@ -624,6 +624,9 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
624
 
625
  == Changelog ==
626
 
 
 
 
627
  = 1.2.0.15 =
628
  * New options to exclude ads from div, form, ol and ul tags.
629
  * Fix relating to post length restrictions.
@@ -878,6 +881,9 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
878
 
879
  == Upgrade Notice ==
880
 
 
 
 
881
  = 1.2.0.15 =
882
  * New options to exclude ads from div, form, ol and ul tags.
883
  * Fix relating to post length restrictions.
3
  Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
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.4.1
7
+ Stable tag: 1.2.0.16
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
 
306
 
307
  This is because you have inserted adverts that are too wide for your site's layout. The browser can no longer fit all the parts of your layout side-by-side. Try using ads that are less wide.
308
 
309
+ = How do I add left/right margins to the ads =
310
 
311
  There aren't any options to do this in the UI, but you can just put the layout tags into the ad box around your advert. e.g.
312
 
624
 
625
  == Changelog ==
626
 
627
+ = 1.2.0.16 =
628
+ * New options to exclude ads from table tags.
629
+
630
  = 1.2.0.15 =
631
  * New options to exclude ads from div, form, ol and ul tags.
632
  * Fix relating to post length restrictions.
881
 
882
  == Upgrade Notice ==
883
 
884
+ = 1.2.0.16 =
885
+ * New options to exclude ads from table tags.
886
+
887
  = 1.2.0.15 =
888
  * New options to exclude ads from div, form, ol and ul tags.
889
  * Fix relating to post length restrictions.
themefuse.jpg DELETED
Binary file
ui-tab-main.php CHANGED
@@ -406,6 +406,13 @@ JQUERYOPACITY;
406
  adinj_add_checkbox('exclude_ads_from_form_tags');
407
  ?>
408
  </td></tr>
 
 
 
 
 
 
 
409
  <tr><td colspan="4"><p><span style="font-size:10px;">Ad Injection also supports &lt;!--adinj_exclude_start--&gt;&lt;!--adinj_exclude_end--&gt; tags. You don't need to tick the box for these to be enabled.</span></p></td></tr>
410
 
411
  </table>
@@ -851,7 +858,7 @@ function adinj_side_advert_box(){
851
  }
852
 
853
  function adinj_get_advert_1(){
854
- return '<a href="http://themefuse.com/wp-themes-shop/?plugin=ad-injection" target="_blank"><img src="'. WP_PLUGIN_URL . '/ad-injection/themefuse.jpg" width="220" height="220" border="0" alt="themefuse" /></a>';
855
  }
856
 
857
  function adinj_side_status_box(){
406
  adinj_add_checkbox('exclude_ads_from_form_tags');
407
  ?>
408
  </td></tr>
409
+ <tr>
410
+ <td colspan="2">Exclude ads from &lt;table&gt;&lt;/table&gt; blocks:</td>
411
+ <td colspan="2">
412
+ <?php
413
+ adinj_add_checkbox('exclude_ads_from_table_tags');
414
+ ?>
415
+ </td></tr>
416
  <tr><td colspan="4"><p><span style="font-size:10px;">Ad Injection also supports &lt;!--adinj_exclude_start--&gt;&lt;!--adinj_exclude_end--&gt; tags. You don't need to tick the box for these to be enabled.</span></p></td></tr>
417
 
418
  </table>
858
  }
859
 
860
  function adinj_get_advert_1(){
861
+ return 'If you are interested in advertising here (a 220x220px would work) get <a href="http://www.reviewmylife.co.uk/contact-us/" target="_blank">in contact</a>.<!--<a href="http://www.reviewmylife.co.uk/contact-us/" target="_blank"><img src="'. WP_PLUGIN_URL . '/ad-injection/advert-1_placeholder.png" width="220" height="220" border="0" alt="Ad Injection advert" /></a>-->';
862
  }
863
 
864
  function adinj_side_status_box(){