Quick Adsense - Version 1.4

Version Description

  • Fix for plugin user Roles. Now, only Administrator is allowed to read & modified the plugin.
  • Quicktag Buttons for Ads1-Ads10 are now automatically shown only when the Ads codes are available. You will have the option to hide the RndAds, NoAds & OffAds Quicktag Buttons.
  • Minor code modification on the AdsWidget portions.
  • Update plugin screenshots & add a Paypal donation button.
  • Date: 14-Nov-2009
Download this release

Release Info

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

Code changes from version 1.3 to 1.4

quick-adsense-admin.php CHANGED
@@ -34,6 +34,8 @@
34
  $atg = get_option('AppTags');
35
  $amx = get_option('AppMaxA');
36
  $aqt = get_option('QckTags');
 
 
37
  $optionsupdate = '';
38
  foreach ($QData['Default'] as $key => $value) {
39
  $optionsupdate .= $key.',' ;
@@ -62,6 +64,8 @@
62
  document.getElementById("AppTags").checked = <?php echo(truefalse($QData['Default']['AppTags'])) ?>;
63
  document.getElementById("AppMaxA").checked = <?php echo(truefalse($QData['Default']['AppMaxA'])) ?>;
64
  document.getElementById("QckTags").checked = <?php echo(truefalse($QData['Default']['QckTags'])) ?>;
 
 
65
  for(i=1;i<=<?php echo($QData['Ads']) ?>;i++){
66
  tp=document.getElementById("AdsCode"+i.toString()).innerHTML;
67
  if(tp==''){
@@ -140,7 +144,7 @@
140
  <input type="checkbox" id="AppCate" name="AppCate" value="true" <?php if($act){echo('checked');} ?> /> <?php _e('Categories'); ?>
141
  <input type="checkbox" id="AppArch" name="AppArch" value="true" <?php if($aar){echo('checked');} ?> /> <?php _e('Archives'); ?>
142
  <input type="checkbox" id="AppTags" name="AppTags" value="true" <?php if($atg){echo('checked');} ?> /> <?php _e('Tags'); ?><span> ] &rarr; </span>
143
- <input type="checkbox" id="AppMaxA" name="AppMaxA" value="true" <?php if($amx){echo('checked');} ?> /> <?php _e('Place all possible Ads on these pages <span style="color:#f00">(New!)</span>.'); ?><br/>
144
  <br/>
145
  </td>
146
  </tr>
@@ -153,7 +157,9 @@
153
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--NoAds--&gt;</span> to <b>Disable Ads</b> in a post.'); ?></li>
154
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffAds--&gt;</span> to <b>Disable All Ads</b> including AdsWidget.'); ?></li>
155
  </ol>
156
- <span class="description" style="font-style:italic"><?php _e('(Tags above tags can be inserted into a post via the additional Quicktag Buttons added to the HTML Edit Post SubPanel.)'); ?></span><br/>
 
 
157
  <br/>
158
  </td>
159
  </tr>
@@ -164,7 +170,16 @@
164
  '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). '.
165
  'Visit <a href="http://techmilieu.com/quick-adsense" target="_blank">http://techmilieu.com/quick-adsense</a> for more information & updates about this plugin.'
166
  )); ?>
 
167
  </tr>
 
 
 
 
 
 
 
 
168
  </table>
169
 
170
  <br/>
34
  $atg = get_option('AppTags');
35
  $amx = get_option('AppMaxA');
36
  $aqt = get_option('QckTags');
37
+ $aqr = get_option('QckRnds');
38
+ $aqf = get_option('QckOffs');
39
  $optionsupdate = '';
40
  foreach ($QData['Default'] as $key => $value) {
41
  $optionsupdate .= $key.',' ;
64
  document.getElementById("AppTags").checked = <?php echo(truefalse($QData['Default']['AppTags'])) ?>;
65
  document.getElementById("AppMaxA").checked = <?php echo(truefalse($QData['Default']['AppMaxA'])) ?>;
66
  document.getElementById("QckTags").checked = <?php echo(truefalse($QData['Default']['QckTags'])) ?>;
67
+ document.getElementById("QckRnds").checked = <?php echo(truefalse($QData['Default']['QckRnds'])) ?>;
68
+ document.getElementById("QckOffs").checked = <?php echo(truefalse($QData['Default']['QckOffs'])) ?>;
69
  for(i=1;i<=<?php echo($QData['Ads']) ?>;i++){
70
  tp=document.getElementById("AdsCode"+i.toString()).innerHTML;
71
  if(tp==''){
144
  <input type="checkbox" id="AppCate" name="AppCate" value="true" <?php if($act){echo('checked');} ?> /> <?php _e('Categories'); ?>
145
  <input type="checkbox" id="AppArch" name="AppArch" value="true" <?php if($aar){echo('checked');} ?> /> <?php _e('Archives'); ?>
146
  <input type="checkbox" id="AppTags" name="AppTags" value="true" <?php if($atg){echo('checked');} ?> /> <?php _e('Tags'); ?><span> ] &rarr; </span>
147
+ <input type="checkbox" id="AppMaxA" name="AppMaxA" value="true" <?php if($amx){echo('checked');} ?> /> <?php _e('Place all possible Ads on these pages.'); ?><br/>
148
  <br/>
149
  </td>
150
  </tr>
157
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--NoAds--&gt;</span> to <b>Disable Ads</b> in a post.'); ?></li>
158
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffAds--&gt;</span> to <b>Disable All Ads</b> including AdsWidget.'); ?></li>
159
  </ol>
160
+ [ <input type="checkbox" id="QckRnds" name="QckRnds" value="true" <?php if($aqr){echo('checked');} ?> /> <?php _e('Hide <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--RndAds--&gt;</span> Quicktag Buttons <span style="color:#f00">(New!)</span>'); ?> ]<br/>
161
+ [ <input type="checkbox" id="QckOffs" name="QckOffs" value="true" <?php if($aqf){echo('checked');} ?> /> <?php _e('Hide <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--NoAds--&gt;</span>, <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffAds--&gt;</span> Quicktag Buttons <span style="color:#f00">(New!)</span>'); ?> ]<br/>
162
+ <span class="description" style="font-style:italic"><?php _e('(Tags above tags can be inserted into a post via the additional Quicktag Buttons added to the HTML Edit Post SubPanel.)'); ?></span><br/>
163
  <br/>
164
  </td>
165
  </tr>
170
  '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). '.
171
  'Visit <a href="http://techmilieu.com/quick-adsense" target="_blank">http://techmilieu.com/quick-adsense</a> for more information & updates about this plugin.'
172
  )); ?>
173
+ </td>
174
  </tr>
175
+ <tr valign="top">
176
+ <td style="width:110px">
177
+ <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_SM.gif" /></a>
178
+ <br/>
179
+ </td>
180
+ <td></td>
181
+ </tr>
182
+
183
  </table>
184
 
185
  <br/>
quick-adsense.php CHANGED
@@ -5,7 +5,7 @@
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.3
9
  Author URI: http://techmilieu.com/
10
  */
11
 
@@ -34,14 +34,14 @@ global $QData;
34
  $QData['AdsWid'] = 3; /* Ads on Widget */
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
- $QData['Version'] = '1.3';
38
  $QData['URI'] = 'http://techmilieu.com/quick-adsense';
39
  $QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
40
  $QData['Default'] = array(
41
  'AdsDisp'=>'3',
42
  'BegnAds'=>true,'BegnRnd'=>'1','EndiAds'=>true,'EndiRnd'=>'0',
43
  'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,
44
- 'QckTags'=>true
45
  );
46
  $QData['DefaultAdsOpt'] = array(
47
  'AdsMargin'=>'10','AdsAlign'=>'2'
@@ -60,7 +60,7 @@ function ads_admin_page_inc() {
60
  include('quick-adsense-admin.php');
61
  }
62
  function ads_admin_page() {
63
- add_options_page("Quick Adsense Options", "Quick Adsense", 1, basename(__FILE__), "ads_admin_page_inc");
64
  }
65
  function register_ads_settings() {
66
  global $QData;
@@ -104,16 +104,24 @@ register_activation_hook( __FILE__, 'plugin_activated' );
104
 
105
  function ads_head_java() {
106
  global $QData;
107
- $tp = get_option('QckTags');
108
- if ($tp) { ?>
109
  <script type="text/javascript">
110
  if(typeof(edButtons)!='undefined') {
 
 
 
111
  for(i=1;i<=<?php echo($QData['Ads']) ?>;i++) {
112
- edButtons[edButtons.length]=new edButton("ads"+i.toString(),"Ads"+i.toString(),"\n<!--Ads"+i.toString()+"-->\n","","",-1);
 
 
113
  }
114
- edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
115
- edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
116
- edButtons[edButtons.length]=new edButton("off_ads","OffAds","\n<!--OffAds-->\n","","",-1);
 
 
 
 
117
  };
118
  </script>
119
  <?php }
@@ -301,10 +309,13 @@ function ads_widget_register() {
301
  'extract($args);'.
302
  '$title = get_option("WidCode-title-'.$i.'");'.
303
  '$codetxt = get_option("WidCode'.$i.'");'.
304
- 'echo $before_widget;'.
305
- 'if (!empty($title)) { echo $before_title.$title.$after_title; };'.
 
 
 
306
  'echo $codetxt;'.
307
- 'echo $after_widget;'.
308
  '}';
309
  $controlstr =
310
  'if ($_POST["WidCodeSubmit'.$i.'"]) {'.
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.4
9
  Author URI: http://techmilieu.com/
10
  */
11
 
34
  $QData['AdsWid'] = 3; /* Ads on Widget */
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
+ $QData['Version'] = '1.4';
38
  $QData['URI'] = 'http://techmilieu.com/quick-adsense';
39
  $QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
40
  $QData['Default'] = array(
41
  'AdsDisp'=>'3',
42
  'BegnAds'=>true,'BegnRnd'=>'1','EndiAds'=>true,'EndiRnd'=>'0',
43
  'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,
44
+ 'QckTags'=>true,'QckRnds'=>false,'QckOffs'=>false
45
  );
46
  $QData['DefaultAdsOpt'] = array(
47
  'AdsMargin'=>'10','AdsAlign'=>'2'
60
  include('quick-adsense-admin.php');
61
  }
62
  function ads_admin_page() {
63
+ add_options_page("Quick Adsense Options", "Quick Adsense", 8, basename(__FILE__), "ads_admin_page_inc");
64
  }
65
  function register_ads_settings() {
66
  global $QData;
104
 
105
  function ads_head_java() {
106
  global $QData;
107
+ if (get_option('QckTags')) { ?>
 
108
  <script type="text/javascript">
109
  if(typeof(edButtons)!='undefined') {
110
+ var dynads={"all":[
111
+ <?php for ($i=1;$i<=$QData['Ads'];$i++) { if(get_option('AdsCode'.$i)!=''){echo('"1",');}else{echo('"0",');}; } ?>
112
+ "0"]};
113
  for(i=1;i<=<?php echo($QData['Ads']) ?>;i++) {
114
+ if(dynads.all[i-1]=="1") {
115
+ edButtons[edButtons.length]=new edButton("ads"+i.toString(),"Ads"+i.toString(),"\n<!--Ads"+i.toString()+"-->\n","","",-1);
116
+ }
117
  }
118
+ <?php if(!get_option('QckRnds')){ ?>
119
+ edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
120
+ <?php } ?>
121
+ <?php if(!get_option('QckOffs')){ ?>
122
+ edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
123
+ edButtons[edButtons.length]=new edButton("off_ads","OffAds","\n<!--OffAds-->\n","","",-1);
124
+ <?php } ?>
125
  };
126
  </script>
127
  <?php }
309
  'extract($args);'.
310
  '$title = get_option("WidCode-title-'.$i.'");'.
311
  '$codetxt = get_option("WidCode'.$i.'");'.
312
+ 'echo PHP_EOL."<!-- Quick Adsense Wordpress Plugin: http://techmilieu.com/quick-adsense -->".PHP_EOL;'.
313
+ 'echo $before_widget.PHP_EOL;'.
314
+ 'if (!empty($title)) { '.
315
+ 'echo $before_title.$title.$after_title.PHP_EOL; '.
316
+ '};'.
317
  'echo $codetxt;'.
318
+ 'echo PHP_EOL.$after_widget;'.
319
  '}';
320
  $controlstr =
321
  'if ($_POST["WidCodeSubmit'.$i.'"]) {'.
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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: 2.8.4
7
- Stable tag: 1.3
8
 
9
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
10
 
@@ -48,6 +48,13 @@ Please feedback to [http://techmilieu.com/quick-adsense](http://techmilieu.com/q
48
 
49
  == Change Log ==
50
 
 
 
 
 
 
 
 
51
  = 1.3 =
52
  * Code modification: Option to place all possible Ads on Homepage, Categories, Archives and Tags page. Previously, only one Ads (the one assigned to the Beginning of Post) is displayed.
53
  * Code update to take advantage of some WP functions for options page, also for forward compatibility in future version.
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: 2.8.4
7
+ Stable tag: 1.4
8
 
9
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
10
 
48
 
49
  == Change Log ==
50
 
51
+ = 1.4 =
52
+ * Fix for plugin user Roles. Now, only Administrator is allowed to read & modified the plugin.
53
+ * Quicktag Buttons for Ads1-Ads10 are now automatically shown only when the Ads codes are available. You will have the option to hide the RndAds, NoAds & OffAds Quicktag Buttons.
54
+ * Minor code modification on the AdsWidget portions.
55
+ * Update plugin screenshots & add a Paypal donation button.
56
+ * Date: 14-Nov-2009
57
+
58
  = 1.3 =
59
  * Code modification: Option to place all possible Ads on Homepage, Categories, Archives and Tags page. Previously, only one Ads (the one assigned to the Beginning of Post) is displayed.
60
  * Code update to take advantage of some WP functions for options page, also for forward compatibility in future version.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file