AdRotate Banner Manager - Version 4.11.2

Version Description

FREE = * [rollback] Post Injection to previous version * [fix] Shortcodes for W3 Total Cache not reliable for some users

Download this release

Release Info

Developer adegans
Plugin Icon 128x128 AdRotate Banner Manager
Version 4.11.2
Comparing to
See all releases

Code changes from version 4.11.1 to 4.11.2

adrotate-output.php CHANGED
@@ -233,7 +233,7 @@ function adrotate_inject_posts($post_content) {
233
  if(!is_array($pages)) $pages = array();
234
 
235
  if(in_array($post->ID, $pages)) {
236
- $group_array[$id->id] = array('location' => $id->page_loc, 'paragraph' => $id->page_par, 'posts' => $pages);
237
  }
238
  }
239
  unset($ids, $pages);
@@ -250,7 +250,7 @@ function adrotate_inject_posts($post_content) {
250
 
251
  foreach($wp_categories as &$value) {
252
  if(in_array($value, $categories)) {
253
- $group_array[$id->id] = array('location' => $id->cat_loc, 'paragraph' => $id->cat_par, 'posts' => $categories);
254
  }
255
  }
256
  }
@@ -269,40 +269,47 @@ function adrotate_inject_posts($post_content) {
269
 
270
  if($group_count > 0) {
271
  $before = $after = $inside = 0;
272
-
273
- $paragraphs = explode('</p>', $post_content);
274
- $paragraph_count = count($paragraphs);
275
-
276
  foreach($group_array as $group_id => $group) {
277
- if(is_page($group['posts']) OR is_category($group['posts']) OR in_category($group['posts'])) {
278
  // Advert in front of content
279
  if(($group['location'] == 1 OR $group['location'] == 3) AND $before == 0) {
280
- array_splice($paragraphs, 0, 0, adrotate_group($group_id));
 
281
  $before = 1;
282
  }
283
 
284
  // Advert behind the content
285
  if(($group['location'] == 2 OR $group['location'] == 3) AND $after == 0) {
286
- array_splice($paragraphs, $paragraph_count, 0, adrotate_group($group_id));
 
287
  $after = 1;
288
  }
289
 
290
  // Adverts inside the content
291
- if($group['location'] == 4 AND $inside == 0) {
292
- $insert_after = ($group['paragraph'] == 99) ? ceil($paragraph_count / 2) : $group['paragraph'];
293
- array_splice($paragraphs, $insert_after, 0, adrotate_group($group_id));
294
- $inside = 1;
295
- } else {
296
- // Reset
297
- $inside = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  }
299
-
300
- unset($group_array[$group_id]);
301
  }
302
  }
303
- $post_content = implode('', $paragraphs);
304
-
305
- unset($group_array, $before, $after, $inside, $paragraphs, $paragraph_count);
306
  }
307
 
308
  return $post_content;
233
  if(!is_array($pages)) $pages = array();
234
 
235
  if(in_array($post->ID, $pages)) {
236
+ $group_array[$id->id] = array('location' => $id->page_loc, 'paragraph' => $id->page_par, 'ids' => $pages);
237
  }
238
  }
239
  unset($ids, $pages);
250
 
251
  foreach($wp_categories as &$value) {
252
  if(in_array($value, $categories)) {
253
+ $group_array[$id->id] = array('location' => $id->cat_loc, 'paragraph' => $id->cat_par, 'ids' => $categories);
254
  }
255
  }
256
  }
269
 
270
  if($group_count > 0) {
271
  $before = $after = $inside = 0;
 
 
 
 
272
  foreach($group_array as $group_id => $group) {
273
+ if(is_page($group['ids']) OR is_category($group['ids']) OR in_category($group['ids'])) {
274
  // Advert in front of content
275
  if(($group['location'] == 1 OR $group['location'] == 3) AND $before == 0) {
276
+ $post_content = adrotate_group($group_id).$post_content;
277
+ unset($group_array[$group_id]);
278
  $before = 1;
279
  }
280
 
281
  // Advert behind the content
282
  if(($group['location'] == 2 OR $group['location'] == 3) AND $after == 0) {
283
+ $post_content = $post_content.adrotate_group($group_id);
284
+ unset($group_array[$group_id]);
285
  $after = 1;
286
  }
287
 
288
  // Adverts inside the content
289
+ if($group['location'] == 4) {
290
+ $paragraphs = explode('</p>', $post_content);
291
+ $paragraph_count = count($paragraphs);
292
+ $count_p = ($group['paragraph'] == 99) ? ceil($paragraph_count / 2) : $group['paragraph'];
293
+
294
+ foreach($paragraphs as $index => $paragraph) {
295
+ if(trim($paragraph)) {
296
+ $paragraphs[$index] .= '</p>';
297
+ }
298
+
299
+ if($count_p == $index + 1 AND $inside == 0) {
300
+ $paragraphs[$index] .= adrotate_group($group_id);
301
+ unset($group_array[$group_id]);
302
+ $inside = 1;
303
+ }
304
+ }
305
+
306
+ $inside = 0; // Reset for the next paragraph
307
+ $post_content = implode('', $paragraphs);
308
+ unset($paragraphs, $paragraph_count);
309
  }
 
 
310
  }
311
  }
312
+ unset($group_array, $before, $after, $inside);
 
 
313
  }
314
 
315
  return $post_content;
adrotate.php CHANGED
@@ -7,7 +7,7 @@ Author URI: http://www.arnan.me/
7
  Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
  Text Domain: adrotate
9
  Domain Path: /languages/
10
- Version: 4.11.1
11
  License: GPLv3
12
  */
13
 
@@ -22,7 +22,7 @@ License: GPLv3
22
  ------------------------------------------------------------------------------------ */
23
 
24
  /*--- AdRotate values ---------------------------------------*/
25
- define("ADROTATE_DISPLAY", '4.11.1');
26
  define("ADROTATE_VERSION", 391);
27
  define("ADROTATE_DB_VERSION", 64);
28
  $plugin_folder = plugin_dir_path(__FILE__);
7
  Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
  Text Domain: adrotate
9
  Domain Path: /languages/
10
+ Version: 4.11.2
11
  License: GPLv3
12
  */
13
 
22
  ------------------------------------------------------------------------------------ */
23
 
24
  /*--- AdRotate values ---------------------------------------*/
25
+ define("ADROTATE_DISPLAY", '4.11.2');
26
  define("ADROTATE_VERSION", 391);
27
  define("ADROTATE_DB_VERSION", 64);
28
  $plugin_folder = plugin_dir_path(__FILE__);
dashboard/publisher/adverts-edit.php CHANGED
@@ -225,26 +225,26 @@ if($edit_banner->imagetype == "field") {
225
  <tr>
226
  <th><?php _e('Start date', 'adrotate'); ?></th>
227
  <td>
228
- <input tabindex="9" type="text" id="startdate_picker" name="adrotate_start_date" value="<?php echo $start_date; ?>" class="datepicker" />
229
  </td>
230
  <th><?php _e('End date', 'adrotate'); ?></th>
231
  <td>
232
- <input tabindex="10" type="text" id="enddate_picker" name="adrotate_end_date" value="<?php echo $end_date; ?>" class="datepicker" />
233
  </td>
234
  </tr>
235
  <tr>
236
  <th><?php _e('Start time (hh:mm)', 'adrotate'); ?></th>
237
  <td>
238
  <label for="adrotate_sday">
239
- <input tabindex="11" name="adrotate_start_hour" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $start_hour; ?>" /> :
240
- <input tabindex="12" name="adrotate_start_minute" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $start_hour; ?>" />
241
  </label>
242
  </td>
243
  <th><?php _e('End time (hh:mm)', 'adrotate'); ?></th>
244
  <td>
245
  <label for="adrotate_eday">
246
- <input tabindex="13" name="adrotate_end_hour" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $end_hour; ?>" /> :
247
- <input tabindex="14" name="adrotate_end_minute" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $end_minute; ?>" />
248
  </label>
249
  </td>
250
  </tr>
225
  <tr>
226
  <th><?php _e('Start date', 'adrotate'); ?></th>
227
  <td>
228
+ <input tabindex="9" type="text" id="startdate_picker" name="adrotate_start_date" value="<?php echo $start_date; ?>" class="datepicker" autocomplete="off" />
229
  </td>
230
  <th><?php _e('End date', 'adrotate'); ?></th>
231
  <td>
232
+ <input tabindex="10" type="text" id="enddate_picker" name="adrotate_end_date" value="<?php echo $end_date; ?>" class="datepicker" autocomplete="off" />
233
  </td>
234
  </tr>
235
  <tr>
236
  <th><?php _e('Start time (hh:mm)', 'adrotate'); ?></th>
237
  <td>
238
  <label for="adrotate_sday">
239
+ <input tabindex="11" name="adrotate_start_hour" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $start_hour; ?>" autocomplete="off" /> :
240
+ <input tabindex="12" name="adrotate_start_minute" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $start_hour; ?>" autocomplete="off" />
241
  </label>
242
  </td>
243
  <th><?php _e('End time (hh:mm)', 'adrotate'); ?></th>
244
  <td>
245
  <label for="adrotate_eday">
246
+ <input tabindex="13" name="adrotate_end_hour" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $end_hour; ?>" autocomplete="off" /> :
247
+ <input tabindex="14" name="adrotate_end_minute" class="search-input" type="text" size="2" maxlength="4" value="<?php echo $end_minute; ?>" autocomplete="off" />
248
  </label>
249
  </td>
250
  </tr>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.arnan.me/#donate
4
  Tags: ad, advert, adsense, advertising, doubleclick, responsive, ad rotator, ad manager, banner manager, advert manager, analytics, advertisement,
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
- Stable tag: 4.11.1
8
  License: GPLv3
9
 
10
  Monetise your website with adverts while keeping things simple. Start making money today!
@@ -99,11 +99,22 @@ You can also post your questions on the [forum](https://ajdg.solutions/forums/?u
99
  Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate)!
100
 
101
 
 
 
 
 
102
  = 4.11.1 FREE =
103
  * [fix] Date pickers not setting the right dates for some users
104
  * [fix] Editing schedules now sets right date format in all browsers
105
  * [new] More attractive theme for date pickers
106
 
 
 
 
 
 
 
 
107
  = 4.13.1 PRO =
108
  * [fix] Date pickers not setting the right dates for some users
109
  * [fix] Editing schedules now sets right date format in all browsers
@@ -114,9 +125,8 @@ All recent changes are available on the [AdRotate website](https://ajdg.solution
114
 
115
  == Upgrade Notice ==
116
 
117
- * [fix] Date pickers not setting the right dates for some users
118
- * [fix] Editing schedules now sets right date format in all browsers
119
- * [new] More attractive theme for date pickers
120
 
121
  == Screenshots ==
122
 
4
  Tags: ad, advert, adsense, advertising, doubleclick, responsive, ad rotator, ad manager, banner manager, advert manager, analytics, advertisement,
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
+ Stable tag: 4.11.2
8
  License: GPLv3
9
 
10
  Monetise your website with adverts while keeping things simple. Start making money today!
99
  Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate)!
100
 
101
 
102
+ = 4.11.2 FREE =
103
+ * [rollback] Post Injection to previous version
104
+ * [fix] Shortcodes for W3 Total Cache not reliable for some users
105
+
106
  = 4.11.1 FREE =
107
  * [fix] Date pickers not setting the right dates for some users
108
  * [fix] Editing schedules now sets right date format in all browsers
109
  * [new] More attractive theme for date pickers
110
 
111
+ = 4.13.2 PRO =
112
+ * [rollback] Post Injection to previous version
113
+ * [fix] Advert widget looking for a network variable
114
+ * [fix] Group widget looking for a network variable
115
+ * [fix] Shortcodes for W3 Total Cache not reliable for some users
116
+ * [fix] Legacy licenses not able to activate or de-activate
117
+
118
  = 4.13.1 PRO =
119
  * [fix] Date pickers not setting the right dates for some users
120
  * [fix] Editing schedules now sets right date format in all browsers
125
 
126
  == Upgrade Notice ==
127
 
128
+ * [rollback] Post Injection to previous version
129
+ * [fix] Shortcodes for W3 Total Cache not reliable for some users
 
130
 
131
  == Screenshots ==
132