Quick Adsense - Version 1.9.1

Version Description

  • Bug Fix - Fix the Quicktag Buttons display error on the HTML Edit Post SubPanel.
  • Bug Fix - Fix the conflict with Jetpack by WordPress.com & some other plugins.
  • Info update.
  • Date: 11-January-2013
Download this release

Release Info

Developer philipze
Plugin Icon 128x128 Quick Adsense
Version 1.9.1
Comparing to
See all releases

Code changes from version 1.9 to 1.9.1

Files changed (5) hide show
  1. quick-adsense-admin.php +9 -16
  2. quick-adsense.php +20 -11
  3. readme.txt +12 -7
  4. screenshot-1.png +0 -0
  5. screenshot-2.png +0 -0
quick-adsense-admin.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- /* Copyright 2009-2010 Philip Ze [ http://techmilieu.com/quick-adsense ]
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -217,7 +217,7 @@
217
  <span>[ </span>
218
  <input type="checkbox" id="AppSide" name="AppSide" value="true" <?php if($asd){echo('checked');} ?> /> <?php _e('Disable AdsWidget on Homepage'); ?><span> ]</span><br/>
219
  <span>[ </span>
220
- <input type="checkbox" id="AppLogg" name="AppLogg" value="true" <?php if($lgg){echo('checked');} ?> /> <?php _e('Hide Ads when user is logged in to Wordpress'); ?><span> ]</span><span style="color:#a00;font-size:75%"> <b>(NEW !)</b></span><br/>
221
  <br/>
222
  </td>
223
  </tr>
@@ -239,23 +239,16 @@
239
  <tr valign="top">
240
  <td style="width:110px"><?php _e('Infomation :'); ?></td>
241
  <td>
242
- <?php echo(__(
243
- 'A link from your blog to <b>TechMilieu</b> (http://techmilieu.com/) would be highly appreciated. A tiny button is also available for the link (http://techmilieu.com/images/link-20x20.png). '.
244
- 'Visit <a href="http://techmilieu.com/quick-adsense" target="_blank">http://techmilieu.com/quick-adsense</a> for more information & updates about this plugin.'
245
- )); ?>
246
  </td>
247
  </tr>
248
- <tr valign="top">
249
- <td style="width:110px"></td>
250
- <td style="padding-top:8px">
251
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8609041" target="_blank" rel="nofollow"><img alt="PayPal" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" /></a>
252
- <br/>
253
- </td>
254
- </tr>
255
-
256
  </table>
257
 
258
- <br/>
 
259
  <h3 style="font-size:120%;margin-bottom:5px"><?php _e('Adsense Codes'); ?></h3>
260
  <p style="margin-top:0px"><span class="description"><?php _e('Paste up to <b>'.$QData['Ads'].' Ads codes</b> on Post Body as assigned above, and up to <b>'.$QData['AdsWid'].' Ads codes</b> on Sidebar Widget. Ads codes provided must <b>not</b> be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.') ?></span></p>
261
 
@@ -299,7 +292,7 @@
299
  <?php /* <input type="hidden" name="page_options" value="<?php echo $optionsupdate; ?>" /> */ ?>
300
  <?php settings_fields('qa-options'); ?>
301
  <div style="width:580px">
302
- <span style="float:right;padding-top:18px">[ <a href="javascript:defaultoptions()"><?php _e('Load Default Setting') ?></a> ]</span>
303
  <p class="submit">
304
  <input type="submit" value="<?php _e('Save Changes') ?>" />
305
  </p>
1
  <?php
2
 
3
+ /* Copyright 2009-2013 BuySellAds [ http://quicksense.net/ ]
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
217
  <span>[ </span>
218
  <input type="checkbox" id="AppSide" name="AppSide" value="true" <?php if($asd){echo('checked');} ?> /> <?php _e('Disable AdsWidget on Homepage'); ?><span> ]</span><br/>
219
  <span>[ </span>
220
+ <input type="checkbox" id="AppLogg" name="AppLogg" value="true" <?php if($lgg){echo('checked');} ?> /> <?php _e('Hide Ads when user is logged in to Wordpress'); ?><span> ]</span><br/>
221
  <br/>
222
  </td>
223
  </tr>
239
  <tr valign="top">
240
  <td style="width:110px"><?php _e('Infomation :'); ?></td>
241
  <td>
242
+ <span><?php echo(__(
243
+ 'A link from your blog to <a href="http://quicksense.net" target="_blank">http://quicksense.net</a> would be appreciated.'
244
+ )); ?></span>
 
245
  </td>
246
  </tr>
247
+
 
 
 
 
 
 
 
248
  </table>
249
 
250
+ <p style="margin-top:20px">( <a href="javascript:defaultoptions()"><?php _e('Load Default Setting') ?></a> )<br/><br/></p>
251
+
252
  <h3 style="font-size:120%;margin-bottom:5px"><?php _e('Adsense Codes'); ?></h3>
253
  <p style="margin-top:0px"><span class="description"><?php _e('Paste up to <b>'.$QData['Ads'].' Ads codes</b> on Post Body as assigned above, and up to <b>'.$QData['AdsWid'].' Ads codes</b> on Sidebar Widget. Ads codes provided must <b>not</b> be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.') ?></span></p>
254
 
292
  <?php /* <input type="hidden" name="page_options" value="<?php echo $optionsupdate; ?>" /> */ ?>
293
  <?php settings_fields('qa-options'); ?>
294
  <div style="width:580px">
295
+
296
  <p class="submit">
297
  <input type="submit" value="<?php _e('Save Changes') ?>" />
298
  </p>
quick-adsense.php CHANGED
@@ -2,14 +2,14 @@
2
 
3
  /*
4
  Plugin Name: Quick Adsense
5
- Plugin URI: http://techmilieu.com/quick-adsense
6
  Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
7
- Author: Philip Ze
8
- Version: 1.9
9
- Author URI: http://techmilieu.com/
10
  */
11
 
12
- /* Copyright 2009-2010 Philip Ze [ http://techmilieu.com/quick-adsense ]
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
@@ -34,8 +34,8 @@ global $QData;
34
  $QData['AdsWid'] = 10; /* Ads on Widget */
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
- $QData['Version'] = '1.9';
38
- $QData['URI'] = 'http://techmilieu.com/quick-adsense';
39
  $QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
40
  $QData['Default'] = array(
41
  'AdsDisp'=>'3',
@@ -155,8 +155,7 @@ function ads_head_java() {
155
  <?php }
156
  }
157
  if ($wpvcomp) {
158
- add_action('edit_form_advanced', 'ads_head_java');
159
- add_action('edit_page_form', 'ads_head_java');
160
  }else{
161
  add_action('admin_head', 'ads_head_java');
162
  }
@@ -315,6 +314,7 @@ function process_content($content)
315
  }
316
  }
317
  }
 
318
  /* ... Replace Beginning/Middle/End random Ads ... */
319
  if( strpos($content, '<!--'.$cusrnd.'-->') && ($showall || !$ismany) ) {
320
  $tcx = count($AdsId);
@@ -328,6 +328,7 @@ function process_content($content)
328
  $ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
329
  }
330
  }
 
331
  /* ... Replace RndAds ... */
332
  if( strpos($content, '<!--RndAds-->') && ($showall || !$ismany) ) {
333
  $AdsIdTmp = array();
@@ -355,6 +356,9 @@ function process_content($content)
355
  }
356
  function clean_tags($content, $trimonly = false) {
357
  global $QData;
 
 
 
358
  $tagnames = array('EmptyClear','RndAds','NoAds','OffAds','CusRnd');
359
  for($i=1;$i<=$QData['Ads'];$i++) { array_push($tagnames, 'CusAds'.$i); array_push($tagnames, 'Ads'.$i); };
360
  foreach ($tagnames as $tgn) {
@@ -365,6 +369,11 @@ function clean_tags($content, $trimonly = false) {
365
  $content = str_replace(array('<p><!--'.$tgn.'--></p>','<!--'.$tgn.'-->'), '', $content);
366
  }
367
  }
 
 
 
 
 
368
  }
369
  return $content;
370
  }
@@ -415,7 +424,7 @@ function ads_widget_register() {
415
  'extract($args);'.
416
  '$title = get_option("WidCode-title-'.$i.'");'.
417
  '$codetxt = get_option("WidCode'.$i.'");'.
418
- 'echo "\n"."<!-- Quick Adsense Wordpress Plugin: http://techmilieu.com/quick-adsense -->"."\n";'.
419
  'echo $before_widget."\n";'.
420
  'if (!empty($title)) { '.
421
  'echo $before_title.$title.$after_title."\n"; '.
@@ -456,7 +465,7 @@ function update_option_en($nameid, $text, $opt='')
456
  update_option($nameid, $txt);
457
  if(!empty($txt)) { return $txt; }else{ return ""; };
458
  }
459
- add_action('init', ads_widget_register);
460
 
461
 
462
 
2
 
3
  /*
4
  Plugin Name: Quick Adsense
5
+ Plugin URI: http://quicksense.net/
6
  Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
7
+ Author: Quicksense
8
+ Version: 1.9.1
9
+ Author URI: http://quicksense.net/
10
  */
11
 
12
+ /* Copyright 2009-2013 BuySellAds [ http://quicksense.net/ ]
13
 
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License as published by
34
  $QData['AdsWid'] = 10; /* Ads on Widget */
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
+ $QData['Version'] = '1.9.1';
38
+ $QData['URI'] = 'http://quicksense.net/';
39
  $QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
40
  $QData['Default'] = array(
41
  'AdsDisp'=>'3',
155
  <?php }
156
  }
157
  if ($wpvcomp) {
158
+ add_action('admin_print_footer_scripts', 'ads_head_java');
 
159
  }else{
160
  add_action('admin_head', 'ads_head_java');
161
  }
314
  }
315
  }
316
  }
317
+
318
  /* ... Replace Beginning/Middle/End random Ads ... */
319
  if( strpos($content, '<!--'.$cusrnd.'-->') && ($showall || !$ismany) ) {
320
  $tcx = count($AdsId);
328
  $ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
329
  }
330
  }
331
+
332
  /* ... Replace RndAds ... */
333
  if( strpos($content, '<!--RndAds-->') && ($showall || !$ismany) ) {
334
  $AdsIdTmp = array();
356
  }
357
  function clean_tags($content, $trimonly = false) {
358
  global $QData;
359
+ global $ShownAds;
360
+ global $AdsId;
361
+ global $beginend;
362
  $tagnames = array('EmptyClear','RndAds','NoAds','OffAds','CusRnd');
363
  for($i=1;$i<=$QData['Ads'];$i++) { array_push($tagnames, 'CusAds'.$i); array_push($tagnames, 'Ads'.$i); };
364
  foreach ($tagnames as $tgn) {
369
  $content = str_replace(array('<p><!--'.$tgn.'--></p>','<!--'.$tgn.'-->'), '', $content);
370
  }
371
  }
372
+ }
373
+ if(!$trimonly && (is_single() || is_page()) ) {
374
+ $ShownAds = 0;
375
+ $AdsId = array();
376
+ $beginend = 0;
377
  }
378
  return $content;
379
  }
424
  'extract($args);'.
425
  '$title = get_option("WidCode-title-'.$i.'");'.
426
  '$codetxt = get_option("WidCode'.$i.'");'.
427
+ 'echo "\n"."<!-- Quick Adsense Wordpress Plugin: http://quicksense.net/ -->"."\n";'.
428
  'echo $before_widget."\n";'.
429
  'if (!empty($title)) { '.
430
  'echo $before_title.$title.$after_title."\n"; '.
465
  update_option($nameid, $txt);
466
  if(!empty($txt)) { return $txt; }else{ return ""; };
467
  }
468
+ add_action('init', 'ads_widget_register');
469
 
470
 
471
 
readme.txt CHANGED
@@ -1,10 +1,9 @@
1
  === Quick Adsense ===
2
- Contributors: Philip Ze
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8609041
4
  Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
5
  Requires at least: 2.5
6
- Tested up to: 3.1.3
7
- Stable tag: 1.9
8
 
9
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
10
 
@@ -29,7 +28,7 @@ Here are some **features** that come with this plugin:
29
 
30
  Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate revenue from your blog, if you don't have one.
31
 
32
- [Installation](http://wordpress.org/extend/plugins/quick-adsense/installation/) | [Screen Shots](http://wordpress.org/extend/plugins/quick-adsense/screenshots/) | [Plugin Homepage](http://techmilieu.com/quick-adsense)
33
 
34
  == Screenshots ==
35
 
@@ -45,10 +44,16 @@ Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate r
45
 
46
  == Frequently Asked Questions ==
47
 
48
- Please feedback to [http://techmilieu.com/quick-adsense](http://techmilieu.com/quick-adsense) for any bug you might have found, or any suggestion you like to add.
49
 
50
  == Change Log ==
51
 
 
 
 
 
 
 
52
  = 1.9 =
53
  * New functionality added - Hide Ads when user is logged in to Wordpress, giving you option to exclude ads view by you from the total ads impression.
54
  * Date: 12-June-2011
@@ -96,7 +101,7 @@ Please feedback to [http://techmilieu.com/quick-adsense](http://techmilieu.com/q
96
  * You can now disable AdsWidget (Sidebar Ads) on Homepage.
97
  * Insert a &lt;!--OffDef--&gt; to temporary disable the default positioned Ads, so that you can insert the specific Ads or Random ad tags in the post.
98
  * Google allows publishers to place up to 3 Adsense for Content on a page. If you are using other Ads, you may now display up to 10 Ads.
99
- * Minor bug fixed & code modifications.
100
  * Date: 09-Dec-2009
101
 
102
  = 1.4 =
1
  === Quick Adsense ===
2
+ Contributors: toddynho, philipze
 
3
  Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
4
  Requires at least: 2.5
5
+ Tested up to: 3.5
6
+ Stable tag: 1.9.1
7
 
8
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
9
 
28
 
29
  Sign up for a [Google Adsense Account](http://adsense.google.com/) to generate revenue from your blog, if you don't have one.
30
 
31
+ [Installation](http://wordpress.org/extend/plugins/quick-adsense/installation/) | [Screen Shots](http://wordpress.org/extend/plugins/quick-adsense/screenshots/) | [Plugin Homepage](http://quicksense.net/)
32
 
33
  == Screenshots ==
34
 
44
 
45
  == Frequently Asked Questions ==
46
 
47
+ Please feedback to [http://quicksense.net/](http://quicksense.net/) for any bug you might have found, or any suggestion you like to add.
48
 
49
  == Change Log ==
50
 
51
+ = 1.9.1 =
52
+ * Bug Fix - Fix the Quicktag Buttons display error on the HTML Edit Post SubPanel.
53
+ * Bug Fix - Fix the conflict with Jetpack by WordPress.com & some other plugins.
54
+ * Info update.
55
+ * Date: 11-January-2013
56
+
57
  = 1.9 =
58
  * New functionality added - Hide Ads when user is logged in to Wordpress, giving you option to exclude ads view by you from the total ads impression.
59
  * Date: 12-June-2011
101
  * You can now disable AdsWidget (Sidebar Ads) on Homepage.
102
  * Insert a &lt;!--OffDef--&gt; to temporary disable the default positioned Ads, so that you can insert the specific Ads or Random ad tags in the post.
103
  * Google allows publishers to place up to 3 Adsense for Content on a page. If you are using other Ads, you may now display up to 10 Ads.
104
+ * Minor bug fix & code modifications.
105
  * Date: 09-Dec-2009
106
 
107
  = 1.4 =
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file