Ad Injection - Version 1.2.0.4

Version Description

  • New: Support for Ad Logger's AdSense click blocking feature (that is my new plugin!).
  • New: Make more parts of the ad placement settings UI fade away if they can't be used.
Download this release

Release Info

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

Code changes from version 1.2.0.3 to 1.2.0.4

Files changed (5) hide show
  1. ad-injection-admin.php +3 -3
  2. ad-injection.php +1 -1
  3. adshow.php +5 -0
  4. readme.txt +11 -1
  5. ui-tab-main.php +102 -8
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 "27th September 2011: New option to allow Ad Injection's priority to be changed in case your theme causes problems with it (in the Advanced tab). Plus other fixes. 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
  }
@@ -410,6 +410,7 @@ function adinj_side_info_box(){
410
 
411
  <h4>More by this author</h4>
412
  <ul>
 
413
  <li><a href="http://www.reviewmylife.co.uk/" target="_new">www.reviewmylife.co.uk</a></li>
414
  <li><a href="http://www.advancedhtml.co.uk/" target="_new">www.advancedhtml.co.uk</a></li>
415
  </ul>
@@ -438,8 +439,7 @@ function adinj_add_checkbox($name, $class=NULL, $all=NULL){
438
  if ($all != NULL && adinj_ticked($name)){
439
  ?>
440
  <script type="text/javascript">
441
- //document.write('<style type="text/css" media="screen">.<?php echo $class; ?> { display: none; }</style>');
442
- document.write('<style type="text/css" media="screen">.<?php echo $class; ?> { opacity:0.3; filter:alpha(opacity=30)" }</style>');
443
  </script>
444
  <?php
445
  }
342
 
343
  } else if (!isset($_GET['tab'])){
344
  echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
345
+ echo "28th September 2011: Support for my new <a href='http://wordpress.org/extend/plugins/ad-logger/' target='_new'>Ad Logger</a> plugin's AdSense click blocking feature. And make more parts of the ad placement UI fade out if other options prevent their use. 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
  }
410
 
411
  <h4>More by this author</h4>
412
  <ul>
413
+ <li><a href="http://wordpress.org/extend/plugins/ad-logger/" target="_new">Ad Logger plugin for WordPress</a></li>
414
  <li><a href="http://www.reviewmylife.co.uk/" target="_new">www.reviewmylife.co.uk</a></li>
415
  <li><a href="http://www.advancedhtml.co.uk/" target="_new">www.advancedhtml.co.uk</a></li>
416
  </ul>
439
  if ($all != NULL && adinj_ticked($name)){
440
  ?>
441
  <script type="text/javascript">
442
+ document.write('<style type="text/css" media="screen">.<?php echo $class; ?> { opacity:0.3; filter:alpha(opacity=30) }</style>');
 
443
  </script>
444
  <?php
445
  }
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.3
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.4
7
  Author: reviewmylife
8
  Author URI: http://www.reviewmylife.co.uk/
9
  License: GPLv2
adshow.php CHANGED
@@ -241,6 +241,11 @@ function adshow_show_adverts(){
241
  //echo 'ref:'.$_SERVER['HTTP_REFERER'];
242
  //if (adinj_config_block_after_ad_click() && adshow_clicked_ad()) return "click_blocked"; //TODO
243
 
 
 
 
 
 
244
  if (adinj_config_block_ips() && adshow_blocked_ip()) return "blocked_ip";
245
 
246
  if ($_COOKIE["adinj"]==1) {
241
  //echo 'ref:'.$_SERVER['HTTP_REFERER'];
242
  //if (adinj_config_block_after_ad_click() && adshow_clicked_ad()) return "click_blocked"; //TODO
243
 
244
+ if ($_COOKIE["adlogblocked"]==1) {
245
+ if (adinj_config_debug_mode()){ echo "<!--ADINJ DEBUG: no ads because adlogblocked cookie set-->\n"; }
246
+ return "click_blocked";
247
+ }
248
+
249
  if (adinj_config_block_ips() && adshow_blocked_ip()) return "blocked_ip";
250
 
251
  if ($_COOKIE["adinj"]==1) {
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.3
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
 
@@ -303,6 +303,8 @@ This is because you have inserted adverts that are too wide for your site's layo
303
 
304
  Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
305
 
 
 
306
  = How can I show different ads for different categories? =
307
 
308
  If you want to show different ads for different categories using widgets you can set up filters for the different ads from the widget UI. If you want to show different top, random, or bottom adverts on different categories you can use some very simple PHP in the ad box (this will also work for the widgets as well if you don't like the UI method).
@@ -585,6 +587,10 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
585
 
586
  == Changelog ==
587
 
 
 
 
 
588
  = 1.2.0.3 =
589
  * New: Setting to allow priority of Ad Injection's the_content filter to be changed. This may help with some themes that are overriding the WordPress default 'wpautop' behaviour.
590
  * Fix: Start at paragraph setting may have been incorrectly upgraded if previously using an old version of this plugin.
@@ -799,6 +805,10 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
799
 
800
  == Upgrade Notice ==
801
 
 
 
 
 
802
  = 1.2.0.3 =
803
  * New: Setting to allow priority of Ad Injection's the_content filter to be changed to help with problem themes.
804
  * Fix: Start at paragraph setting may have been incorrectly upgraded if previously using an old version of this plugin.
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.4
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
 
303
 
304
  Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
305
 
306
+ You may find that your right sidebar ad doesn't show if you have too many ads. Google renders the ads in the order that they are in the HTML, and your right sidebar will be at the bottom of HTML. If you need your right sidebar AdSense ad you will have to limit the number of ads on the rest of the page from the 'Ad placement settings'.
307
+
308
  = How can I show different ads for different categories? =
309
 
310
  If you want to show different ads for different categories using widgets you can set up filters for the different ads from the widget UI. If you want to show different top, random, or bottom adverts on different categories you can use some very simple PHP in the ad box (this will also work for the widgets as well if you don't like the UI method).
587
 
588
  == Changelog ==
589
 
590
+ = 1.2.0.4 =
591
+ * New: Support for Ad Logger's AdSense click blocking feature (that is my new plugin!).
592
+ * New: Make more parts of the ad placement settings UI fade away if they can't be used.
593
+
594
  = 1.2.0.3 =
595
  * New: Setting to allow priority of Ad Injection's the_content filter to be changed. This may help with some themes that are overriding the WordPress default 'wpautop' behaviour.
596
  * Fix: Start at paragraph setting may have been incorrectly upgraded if previously using an old version of this plugin.
805
 
806
  == Upgrade Notice ==
807
 
808
+ = 1.2.0.4 =
809
+ * New: Support for Ad Logger's AdSense click blocking feature (that is my new plugin!).
810
+ * New: Make more parts of the ad placement settings UI fade away if they can't be used.
811
+
812
  = 1.2.0.3 =
813
  * New: Setting to allow priority of Ad Injection's the_content filter to be changed to help with problem themes.
814
  * Fix: Start at paragraph setting may have been incorrectly upgraded if previously using an old version of this plugin.
ui-tab-main.php CHANGED
@@ -93,6 +93,58 @@ function adinj_placement_settings_box($ops){
93
  <p></p>
94
  </td></tr>
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  <tr><td colspan="4"><input type="submit" style="float:right" name="adinj_action" value="<?php _e('Save all settings', 'adinj') ?>" /><h3><a name="randomadplacement"></a>Random ads [<a href="#randomadcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
97
  <tr><td>Max num of ads on whole page:</td><td>
98
  n/a
@@ -106,9 +158,9 @@ function adinj_placement_settings_box($ops){
106
  <tr><td>|_ Max num of random ads per post:</td><td>
107
  <?php
108
  adinj_selection_box("max_num_of_ads", $num_ads_array);
109
- echo '</td><td><div class="adinj_home">';
110
  adinj_selection_box("home_max_num_random_ads_per_post", $num_ads_array);
111
- echo '</div></td><td><div class="adinj_archive">';
112
  adinj_selection_box("archive_max_num_random_ads_per_post", $num_ads_array);
113
  ?>
114
  </div></td></tr>
@@ -138,12 +190,16 @@ function adinj_placement_settings_box($ops){
138
  </td><td colspan="2">
139
  <table class="adinjtable">
140
  <tr><td>
 
141
  <input type="radio" name="random_ads_start_unit" value="paragraph" <?php if ($ops['random_ads_start_unit']=='paragraph') echo 'checked="checked"'; ?> /> paragraph:<br />
142
  <input type="radio" name="random_ads_start_unit" value="character" <?php if ($ops['random_ads_start_unit']=='character') echo 'checked="checked"'; ?> /> character:<br />
 
143
  </td><td>
 
144
  <?php
145
  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), " ");
146
  ?>
 
147
  </td>
148
  </tr>
149
  </table>
@@ -152,7 +208,7 @@ function adinj_placement_settings_box($ops){
152
 
153
  <tr><td></td>
154
  <td colspan="3">
155
- <div id="random_ads_start_warning"><span style="font-size:10px;color:red;">Note: If starting 'at character x', the start point will be the next paragraph.</span><br /></div>
156
  <br />
157
  </td>
158
  </tr>
@@ -181,17 +237,23 @@ function adinj_placement_settings_box($ops){
181
  </td><td>
182
  <table class="adinjtable">
183
  <tr><td>
 
184
  <input type="radio" name="random_ads_end_unit" value="paragraph" <?php if ($ops['random_ads_end_unit']=='paragraph') echo 'checked="checked"'; ?> /> paragraph:<br />
185
  <input type="radio" name="random_ads_end_unit" value="character" <?php if ($ops['random_ads_end_unit']=='character') echo 'checked="checked"'; ?> /> character:<br />
 
186
  </td><td>
 
187
  <?php
188
  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), " ");
189
  ?>
 
190
  </td>
191
  <td>
 
192
  <?php
193
  adinj_selection_box("random_ads_end_direction", array('fromstart'=>'from the start', 'fromend'=>'from the end'), " ");
194
  ?>
 
195
  </td>
196
  </table>
197
  <br />
@@ -224,6 +286,24 @@ function adinj_placement_settings_box($ops){
224
 
225
  <script type="text/javascript">
226
  jQuery(document).ready(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  jQuery('input[name=random_ads_start_unit]:radio').change(function() {
228
  if (jQuery('input[name=random_ads_start_unit]:checked').val() == "character"){
229
  jQuery('#random_ads_start_warning').slideDown(300);
@@ -233,7 +313,13 @@ function adinj_placement_settings_box($ops){
233
  return true;
234
  });
235
  });
236
- if ('<?php echo $ops['random_ads_start_unit'] ?>' == 'paragraph') {
 
 
 
 
 
 
237
  document.write('<style type="text/css">#random_ads_start_warning { display: none; }</style>');
238
  }
239
  </script>
@@ -614,27 +700,33 @@ function adinj_random_ad_limit_table(){
614
 
615
  foreach ($prefixes as $prefix){
616
  echo '<td><div class="adinj_'.$prefix.'">';
 
 
617
  if (!empty($prefix)) $prefix = $prefix.'_';
618
  adinj_selection_box($prefix."no_random_ads_if_shorter_than", $ad_limit_settings, $unit);
619
- echo '</div></td>';
620
  } ?>
621
  </tr>
622
  <tr><td>&nbsp;|_ Max 1 ad if post shorter than:</td>
623
  <?php
624
  foreach ($prefixes as $prefix){
625
  echo '<td><div class="adinj_'.$prefix.'">';
 
 
626
  if (!empty($prefix)) $prefix = $prefix.'_';
627
  adinj_selection_box($prefix."one_ad_if_shorter_than", $ad_limit_settings, $unit);
628
- echo '</div></td>';
629
  } ?>
630
  </tr>
631
  <tr><td>&nbsp;|_ Max 2 ads if post shorter than:</td>
632
  <?php
633
  foreach ($prefixes as $prefix){
634
  echo '<td><div class="adinj_'.$prefix.'">';
 
 
635
  if (!empty($prefix)) $prefix = $prefix.'_';
636
  adinj_selection_box($prefix."two_ads_if_shorter_than", $ad_limit_settings, $unit);
637
- echo '</div></td>';
638
  }
639
  ?>
640
  </tr>
@@ -642,9 +734,11 @@ function adinj_random_ad_limit_table(){
642
  <?php
643
  foreach ($prefixes as $prefix){
644
  echo '<td><div class="adinj_'.$prefix.'">';
 
 
645
  if (!empty($prefix)) $prefix = $prefix.'_';
646
  adinj_selection_box($prefix."three_ads_if_shorter_than", $ad_limit_settings, $unit);
647
- echo '</div></td>';
648
  } ?>
649
  </tr>
650
  <?php
93
  <p></p>
94
  </td></tr>
95
 
96
+ <script type="text/javascript">
97
+ <?php
98
+ foreach (array("home_", "archive_") as $prefix){
99
+ echo <<<JQUERYOPACITY
100
+ jQuery(document).ready(function(){
101
+ jQuery('#{$prefix}max_num_random_ads_per_page').change(function() {
102
+ if (jQuery('#{$prefix}max_num_random_ads_per_page').val() == "0"){
103
+ jQuery('.{$prefix}max_num_random_ads_per_page').css({ opacity: 0.3 });
104
+ } else {
105
+ jQuery('.{$prefix}max_num_random_ads_per_page').css({ opacity: 1.0 });
106
+ }
107
+ return true;
108
+ });
109
+ jQuery('#{$prefix}max_num_random_ads_per_post').change(function() {
110
+ if (jQuery('#{$prefix}max_num_random_ads_per_post').val() == "0"){
111
+ jQuery('.{$prefix}max_num_random_ads_per_post').css({ opacity: 0.3 });
112
+ } else {
113
+ jQuery('.{$prefix}max_num_random_ads_per_post').css({ opacity: 1.0 });
114
+ }
115
+ return true;
116
+ });
117
+ });
118
+ JQUERYOPACITY;
119
+ }
120
+ ?>
121
+ jQuery(document).ready(function(){
122
+ jQuery('#max_num_of_ads').change(function() { //todo change to make consistent with home/archive
123
+ if (jQuery('#max_num_of_ads').val() == "0"){
124
+ jQuery('._max_num_random_ads_per_post').css({ opacity: 0.3 });
125
+ } else {
126
+ jQuery('._max_num_random_ads_per_post').css({ opacity: 1.0 });
127
+ }
128
+ return true;
129
+ });
130
+ });
131
+
132
+ <?php
133
+ foreach (array("page", "post") as $type){
134
+ foreach (array("home_", "archive_") as $prefix){
135
+ ?>
136
+ if (<?php echo $ops[$prefix.'max_num_random_ads_per_'.$type]; ?> == "0") {
137
+ document.write('<style type="text/css">.<?php echo $prefix.'max_num_random_ads_per_'.$type; ?> { opacity:0.3; filter:alpha(opacity=30) }</style>');
138
+ }
139
+ <?php
140
+ }
141
+ }
142
+ ?>
143
+ if (<?php echo $ops['max_num_of_ads']; ?> == "0") {
144
+ document.write('<style type="text/css">._max_num_random_ads_per_post { opacity:0.3; filter:alpha(opacity=30) }</style>');
145
+ }
146
+ </script>
147
+
148
  <tr><td colspan="4"><input type="submit" style="float:right" name="adinj_action" value="<?php _e('Save all settings', 'adinj') ?>" /><h3><a name="randomadplacement"></a>Random ads [<a href="#randomadcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
149
  <tr><td>Max num of ads on whole page:</td><td>
150
  n/a
158
  <tr><td>|_ Max num of random ads per post:</td><td>
159
  <?php
160
  adinj_selection_box("max_num_of_ads", $num_ads_array);
161
+ echo '</td><td><div class="adinj_home"><div class="home_max_num_random_ads_per_page">';
162
  adinj_selection_box("home_max_num_random_ads_per_post", $num_ads_array);
163
+ echo '</div></div></td><td><div class="adinj_archive">';
164
  adinj_selection_box("archive_max_num_random_ads_per_post", $num_ads_array);
165
  ?>
166
  </div></td></tr>
190
  </td><td colspan="2">
191
  <table class="adinjtable">
192
  <tr><td>
193
+ <div class="random_ads_start_unit">
194
  <input type="radio" name="random_ads_start_unit" value="paragraph" <?php if ($ops['random_ads_start_unit']=='paragraph') echo 'checked="checked"'; ?> /> paragraph:<br />
195
  <input type="radio" name="random_ads_start_unit" value="character" <?php if ($ops['random_ads_start_unit']=='character') echo 'checked="checked"'; ?> /> character:<br />
196
+ </div>
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>
204
  </tr>
205
  </table>
208
 
209
  <tr><td></td>
210
  <td colspan="3">
211
+ <div id="random_ads_start_warning"><div class="random_ads_start_unit"><span style="font-size:10px;color:red;">Note: If starting 'at character x', the start point will be the next paragraph.</span></div><br /></div>
212
  <br />
213
  </td>
214
  </tr>
237
  </td><td>
238
  <table class="adinjtable">
239
  <tr><td>
240
+ <div class="random_ads_end_unit">
241
  <input type="radio" name="random_ads_end_unit" value="paragraph" <?php if ($ops['random_ads_end_unit']=='paragraph') echo 'checked="checked"'; ?> /> paragraph:<br />
242
  <input type="radio" name="random_ads_end_unit" value="character" <?php if ($ops['random_ads_end_unit']=='character') echo 'checked="checked"'; ?> /> character:<br />
243
+ </div>
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>
251
  <td>
252
+ <div class="random_ads_end_unit">
253
  <?php
254
  adinj_selection_box("random_ads_end_direction", array('fromstart'=>'from the start', 'fromend'=>'from the end'), " ");
255
  ?>
256
+ </div>
257
  </td>
258
  </table>
259
  <br />
286
 
287
  <script type="text/javascript">
288
  jQuery(document).ready(function(){
289
+ jQuery('input[name=random_ads_start_mode]:radio').change(function() {
290
+ if (jQuery('input[name=random_ads_start_mode]:checked').val() != "at" && jQuery('input[name=random_ads_start_mode]:checked').val() != "after"){
291
+ jQuery('.random_ads_start_unit').css({ opacity: 0.3 });
292
+ } else {
293
+ jQuery('.random_ads_start_unit').css({ opacity: 1.0 });
294
+ }
295
+ return true;
296
+ });
297
+ //
298
+ jQuery('input[name=random_ads_end_mode]:radio').change(function() {
299
+ if (jQuery('input[name=random_ads_end_mode]:checked').val() != "at" && jQuery('input[name=random_ads_end_mode]:checked').val() != "after"){
300
+ jQuery('.random_ads_end_unit').css({ opacity: 0.3 });
301
+ } else {
302
+ jQuery('.random_ads_end_unit').css({ opacity: 1.0 });
303
+ }
304
+ return true;
305
+ });
306
+ //
307
  jQuery('input[name=random_ads_start_unit]:radio').change(function() {
308
  if (jQuery('input[name=random_ads_start_unit]:checked').val() == "character"){
309
  jQuery('#random_ads_start_warning').slideDown(300);
313
  return true;
314
  });
315
  });
316
+ if ('<?php echo $ops['random_ads_start_mode']; ?>' != 'at' && '<?php echo $ops['random_ads_start_mode'] ?>' != 'after') {
317
+ document.write('<style type="text/css">.random_ads_start_unit { opacity:0.3; filter:alpha(opacity=30) }</style>');
318
+ }
319
+ if ('<?php echo $ops['random_ads_end_mode']; ?>' != 'at' && '<?php echo $ops['random_ads_end_mode'] ?>' != 'after') {
320
+ document.write('<style type="text/css">.random_ads_end_unit { opacity:0.3; filter:alpha(opacity=30) }</style>');
321
+ }
322
+ if ('<?php echo $ops['random_ads_start_unit']; ?>' == 'paragraph') {
323
  document.write('<style type="text/css">#random_ads_start_warning { display: none; }</style>');
324
  }
325
  </script>
700
 
701
  foreach ($prefixes as $prefix){
702
  echo '<td><div class="adinj_'.$prefix.'">';
703
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_page">';
704
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_post">';
705
  if (!empty($prefix)) $prefix = $prefix.'_';
706
  adinj_selection_box($prefix."no_random_ads_if_shorter_than", $ad_limit_settings, $unit);
707
+ echo '</div></div></div></td>';
708
  } ?>
709
  </tr>
710
  <tr><td>&nbsp;|_ Max 1 ad if post shorter than:</td>
711
  <?php
712
  foreach ($prefixes as $prefix){
713
  echo '<td><div class="adinj_'.$prefix.'">';
714
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_page">';
715
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_post">';
716
  if (!empty($prefix)) $prefix = $prefix.'_';
717
  adinj_selection_box($prefix."one_ad_if_shorter_than", $ad_limit_settings, $unit);
718
+ echo '</div></div></div></td>';
719
  } ?>
720
  </tr>
721
  <tr><td>&nbsp;|_ Max 2 ads if post shorter than:</td>
722
  <?php
723
  foreach ($prefixes as $prefix){
724
  echo '<td><div class="adinj_'.$prefix.'">';
725
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_page">';
726
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_post">';
727
  if (!empty($prefix)) $prefix = $prefix.'_';
728
  adinj_selection_box($prefix."two_ads_if_shorter_than", $ad_limit_settings, $unit);
729
+ echo '</div></div></div></td>';
730
  }
731
  ?>
732
  </tr>
734
  <?php
735
  foreach ($prefixes as $prefix){
736
  echo '<td><div class="adinj_'.$prefix.'">';
737
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_page">';
738
+ echo '<div class="'.$prefix.'_max_num_random_ads_per_post">';
739
  if (!empty($prefix)) $prefix = $prefix.'_';
740
  adinj_selection_box($prefix."three_ads_if_shorter_than", $ad_limit_settings, $unit);
741
+ echo '</div></div></div></td>';
742
  } ?>
743
  </tr>
744
  <?php