Quick Adsense - Version 1.6

Version Description

  • Fix for the problem on Setting page stop loading & the disappearing of "Save Setting" button in some cases.
  • Fix the AdsWidget div tag's class name. Now you can use CSS to style the AdsWidget.
  • Extend the number of AdsWidget (Sidebar Ads) from 3 to 10, as requested by users. Now, AdsWidgets are automatically appear in Appearance->Widgets page only when the code is available.
  • Remove the <!--OffAds--> option as this function doesn't work well in certain theme. However, if you are using this function in previous version, you can continue to use it.
  • Minor code modifications.
Download this release

Release Info

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

Code changes from version 1.5.1 to 1.6

Files changed (5) hide show
  1. quick-adsense-admin.php +15 -16
  2. quick-adsense.php +39 -40
  3. readme.txt +10 -3
  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 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
@@ -21,7 +21,7 @@
21
 
22
  <?php
23
  global $QData;
24
- $dis = get_option('AdsDisp');
25
  $ra1 = get_option('BegnAds');
26
  $ra2 = get_option('BegnRnd');
27
  $rb1 = get_option('EndiAds');
@@ -129,10 +129,10 @@
129
  <tr valign="top">
130
  <td style="width:110px"><?php _e('Adsense :'); ?></td>
131
  <td><?php _e('Place up to '); ?><select name="AdsDisp" style="width:50px;font-weight:bold">
132
- <?php for ($i=0;$i<=(int)$QData['Default']['AdsDisp'];$i++) { ?>
133
  <option id="DisTot<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($dis==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
134
  <?php } ?></select><?php _e(' Ads on a page. Select up to <b>3 Ads</b> only if you are solely using Google Ads.'); ?><br/>
135
- <span class="description" style="font-style:italic"><?php _e('(Google allows publishers to place up to <b>3 Adsense</b> for Content on a page. If you have placed these ads somewhere in the page, you will need to take those into account. If you are using other Ads, you may select up to <b>10 Ads</b>.)<span style="color:#a00;font-size:75%;font-style:normal"> (New!)</span>'); ?></span><br/>
136
  <br/>
137
  </td>
138
  </tr>
@@ -153,14 +153,14 @@
153
  <?php } ?></select> <?php _e('<b>After Paragraph</b> ') ?> <select id="Par1Nup" name="Par1Nup">
154
  <?php for ($i=1;$i<=50;$i++) { ?>
155
  <option id="Opt1Nu<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rc3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
156
- <?php } ?></select><span style="color:#a00;font-size:75%"> (New!)</span><br/>
157
  <input type="checkbox" id="Img1Ads" name="Img1Ads" value="false" <?php if($rd1){echo('checked');} ?> onchange="checkinfo2('Img1Rnd','Img1Nup',this)" /> <?php _e('Assign') ; ?> <select id="Img1Rnd" name="Img1Rnd" onchange="selectinfo(this)">
158
  <?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
159
  <option id="OptImg1<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd2==(string)$i){echo('selected');} ?>><?php _e(($i==0)?'Random Ads':'Ads'.$i) ; ?></option>
160
  <?php } ?></select> <?php _e('<b>After Image</b> ') ?> <select id="Img1Nup" name="Img1Nup">
161
  <?php for ($i=1;$i<=50;$i++) { ?>
162
  <option id="Opt1Im<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
163
- <?php } ?></select><span style="color:#a00;font-size:75%"> (New!)</span><br/>
164
  <br/>
165
  <script type="text/javascript">deftcheckinfo();</script>
166
  </td>
@@ -176,7 +176,7 @@
176
  <input type="checkbox" id="AppArch" name="AppArch" value="true" <?php if($aar){echo('checked');} ?> /> <?php _e('Archives'); ?>
177
  <input type="checkbox" id="AppTags" name="AppTags" value="true" <?php if($atg){echo('checked');} ?> /> <?php _e('Tags'); ?><span> ] &rarr; </span>
178
  <input type="checkbox" id="AppMaxA" name="AppMaxA" value="true" <?php if($amx){echo('checked');} ?> /> <?php _e('Place all possible Ads on these pages.'); ?><br/><span>[ </span>
179
- <input type="checkbox" id="AppSide" name="AppSide" value="true" <?php if($asd){echo('checked');} ?> /> <?php _e('Disable AdsWidget on Homepage'); ?><span> ]</span> <span style="color:#a00;font-size:75%"> (New!)</span><br/>
180
  <br/>
181
  </td>
182
  </tr>
@@ -187,11 +187,10 @@
187
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--Ads1--&gt;</span>, <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--Ads2--&gt;</span>, etc. into a post to show the <b>Particular Ads</b> at specific location.'); ?></li>
188
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--RndAds--&gt;</span> (or more) into a post to show the <b>Random Ads</b> at specific location.'); ?></li>
189
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--NoAds--&gt;</span> to temporary <b>Disable Ads</b> in a post.'); ?></li>
190
- <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffAds--&gt;</span> to temporary <b>Disable All Ads</b> including AdsWidget.'); ?></li>
191
- <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffDef--&gt;</span> to temporary <b>Disable The Default Positioned Ads</b>. You can then insert specific Ads as per item 1 above to the page.'); ?> <span style="color:#a00;font-size:75%"> (New!)</span></li>
192
  </ol>
193
  [ <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'); ?> ]<br/>
194
- [ <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>, <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffDef--&gt;</span> Quicktag Buttons'); ?> ]<br/>
195
  <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/>
196
  <br/>
197
  </td>
@@ -217,18 +216,18 @@
217
 
218
  <br/>
219
  <h3 style="font-size:120%;margin-bottom:5px"><?php _e('Adsense Codes'); ?></h3>
220
- <p style="margin-top:0px"><span class="description"><?php _e('Paste up to <b>'.$QData['Ads'].' Ads codes</b> on Post Body, as options assigned above, and <b>'.$QData['AdsWid'].' Ads codes</b> on Sidebar Widget. Ads codes provided must be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.') ?></span></p>
221
 
222
  <h4><?php _e('Ads on Post Body :'); ?></h4>
223
  <table border="0" cellspacing="0" cellpadding="0">
224
  <?php for ($i=1;$i<=$QData['Ads'];$i++) {
225
- $cod = get_option('AdsCode'.$i);
226
  $agn = get_option('AdsAlign'.$i);
227
  $mar = get_option('AdsMargin'.$i);
228
  $optionsupdate .= ',AdsCode'.$i.',AdsAlign'.$i.',AdsMargin'.$i;
229
  ?>
230
  <tr valign="top">
231
- <td align="left" style="width:100px">Ads<?php echo $i; ?> :</td>
232
  <td align="left"><textarea style="margin:0 5px 3px 0" id="AdsCode<?php echo $i; ?>" name="AdsCode<?php echo $i; ?>" rows="3" cols="50"><?php echo $cod; ?></textarea></td>
233
  <td align="left">
234
  <select name="AdsAlign<?php echo $i; ?>">
@@ -242,14 +241,14 @@
242
  <?php } ?>
243
  </table>
244
 
245
- <h4><?php _e('Ads on Sidebar Widget '); ?><span style="font-weight:normal">(<a href="widgets.php"><?php _e('Setting'); ?></a>)</span> :</h4>
246
  <table border="0" cellspacing="0" cellpadding="0">
247
  <?php for ($i=1;$i<=$QData['AdsWid'];$i++) {
248
- $cod = get_option('WidCode'.$i);
249
  $optionsupdate .= ',WidCode'.$i;
250
  ?>
251
  <tr valign="top">
252
- <td align="left" style="width:100px">AdsWidget<?php echo $i; ?> :</td>
253
  <td align="left"><textarea style="margin:0 5px 3px 0" id="WidCode<?php echo $i; ?>" name="WidCode<?php echo $i; ?>" rows="3" cols="50"><?php echo $cod; ?></textarea></td>
254
  </tr>
255
  <?php } ?>
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
21
 
22
  <?php
23
  global $QData;
24
+ $dis = get_option('AdsDisp');if(!$dis&&is_bool($dis)){$dis=$QData['Default']['AdsDisp'];};
25
  $ra1 = get_option('BegnAds');
26
  $ra2 = get_option('BegnRnd');
27
  $rb1 = get_option('EndiAds');
129
  <tr valign="top">
130
  <td style="width:110px"><?php _e('Adsense :'); ?></td>
131
  <td><?php _e('Place up to '); ?><select name="AdsDisp" style="width:50px;font-weight:bold">
132
+ <?php for ($i=0;$i<=(int)$QData['Ads'];$i++) { ?>
133
  <option id="DisTot<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($dis==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
134
  <?php } ?></select><?php _e(' Ads on a page. Select up to <b>3 Ads</b> only if you are solely using Google Ads.'); ?><br/>
135
+ <span class="description" style="font-style:italic"><?php _e('(Google allows publishers to place up to <b>3 Adsense</b> for Content on a page. If you have placed these ads somewhere in the page, you will need to take those into account. If you are using other Ads, you may select up to <b>10 Ads</b>.)'); ?></span><br/>
136
  <br/>
137
  </td>
138
  </tr>
153
  <?php } ?></select> <?php _e('<b>After Paragraph</b> ') ?> <select id="Par1Nup" name="Par1Nup">
154
  <?php for ($i=1;$i<=50;$i++) { ?>
155
  <option id="Opt1Nu<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rc3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
156
+ <?php } ?></select><br/>
157
  <input type="checkbox" id="Img1Ads" name="Img1Ads" value="false" <?php if($rd1){echo('checked');} ?> onchange="checkinfo2('Img1Rnd','Img1Nup',this)" /> <?php _e('Assign') ; ?> <select id="Img1Rnd" name="Img1Rnd" onchange="selectinfo(this)">
158
  <?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
159
  <option id="OptImg1<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd2==(string)$i){echo('selected');} ?>><?php _e(($i==0)?'Random Ads':'Ads'.$i) ; ?></option>
160
  <?php } ?></select> <?php _e('<b>After Image</b> ') ?> <select id="Img1Nup" name="Img1Nup">
161
  <?php for ($i=1;$i<=50;$i++) { ?>
162
  <option id="Opt1Im<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
163
+ <?php } ?></select><br/>
164
  <br/>
165
  <script type="text/javascript">deftcheckinfo();</script>
166
  </td>
176
  <input type="checkbox" id="AppArch" name="AppArch" value="true" <?php if($aar){echo('checked');} ?> /> <?php _e('Archives'); ?>
177
  <input type="checkbox" id="AppTags" name="AppTags" value="true" <?php if($atg){echo('checked');} ?> /> <?php _e('Tags'); ?><span> ] &rarr; </span>
178
  <input type="checkbox" id="AppMaxA" name="AppMaxA" value="true" <?php if($amx){echo('checked');} ?> /> <?php _e('Place all possible Ads on these pages.'); ?><br/><span>[ </span>
179
+ <input type="checkbox" id="AppSide" name="AppSide" value="true" <?php if($asd){echo('checked');} ?> /> <?php _e('Disable AdsWidget on Homepage'); ?><span> ]</span><br/>
180
  <br/>
181
  </td>
182
  </tr>
187
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--Ads1--&gt;</span>, <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--Ads2--&gt;</span>, etc. into a post to show the <b>Particular Ads</b> at specific location.'); ?></li>
188
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--RndAds--&gt;</span> (or more) into a post to show the <b>Random Ads</b> at specific location.'); ?></li>
189
  <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--NoAds--&gt;</span> to temporary <b>Disable Ads</b> in a post.'); ?></li>
190
+ <li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050">&lt;!--OffDef--&gt;</span> to temporary <b>Disable The Default Positioned Ads</b>. You can then insert specific Ads as per item 1 above to the page.'); ?></li>
 
191
  </ol>
192
  [ <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'); ?> ]<br/>
193
+ [ <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;!--OffDef--&gt;</span> Quicktag Buttons'); ?> ]<br/>
194
  <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/>
195
  <br/>
196
  </td>
216
 
217
  <br/>
218
  <h3 style="font-size:120%;margin-bottom:5px"><?php _e('Adsense Codes'); ?></h3>
219
+ <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><span style="color:#a00;font-size:75%"> <b>(New!)</b></span> on Sidebar Widget. Ads codes provided must be identical, repeated codes may result the Ads not being display correctly. Ads will never displays more than once in a page.') ?></span></p>
220
 
221
  <h4><?php _e('Ads on Post Body :'); ?></h4>
222
  <table border="0" cellspacing="0" cellpadding="0">
223
  <?php for ($i=1;$i<=$QData['Ads'];$i++) {
224
+ $cod = htmlentities(get_option('AdsCode'.$i));
225
  $agn = get_option('AdsAlign'.$i);
226
  $mar = get_option('AdsMargin'.$i);
227
  $optionsupdate .= ',AdsCode'.$i.',AdsAlign'.$i.',AdsMargin'.$i;
228
  ?>
229
  <tr valign="top">
230
+ <td align="left" style="width:110px">Ads<?php echo $i; ?> :</td>
231
  <td align="left"><textarea style="margin:0 5px 3px 0" id="AdsCode<?php echo $i; ?>" name="AdsCode<?php echo $i; ?>" rows="3" cols="50"><?php echo $cod; ?></textarea></td>
232
  <td align="left">
233
  <select name="AdsAlign<?php echo $i; ?>">
241
  <?php } ?>
242
  </table>
243
 
244
+ <h4><?php _e('Ads on Sidebar Widget '); ?><span style="font-weight:normal">(<a href="widgets.php"><?php _e('Drag to Sidebar'); ?></a>)</span> :</h4>
245
  <table border="0" cellspacing="0" cellpadding="0">
246
  <?php for ($i=1;$i<=$QData['AdsWid'];$i++) {
247
+ $cod = htmlentities(get_option('WidCode'.$i));
248
  $optionsupdate .= ',WidCode'.$i;
249
  ?>
250
  <tr valign="top">
251
+ <td align="left" style="width:110px">AdsWidget<?php echo $i; ?> :</td>
252
  <td align="left"><textarea style="margin:0 5px 3px 0" id="WidCode<?php echo $i; ?>" name="WidCode<?php echo $i; ?>" rows="3" cols="50"><?php echo $cod; ?></textarea></td>
253
  </tr>
254
  <?php } ?>
quick-adsense.php CHANGED
@@ -5,11 +5,11 @@
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.5.1
9
  Author URI: http://techmilieu.com/
10
  */
11
 
12
- /* Copyright 2009 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
@@ -29,16 +29,16 @@
29
 
30
 
31
 
32
- global $QData;
33
 
34
- $QData['AdsWid'] = 3; /* Ads on Widget */
 
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
- $QData['Version'] = '1.5.1';
38
  $QData['URI'] = 'http://techmilieu.com/quick-adsense';
39
  $QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
40
  $QData['Default'] = array(
41
- 'AdsDisp'=>'10',
42
  'BegnAds'=>true,'BegnRnd'=>'1','EndiAds'=>true,'EndiRnd'=>'0',
43
  'Par1Ads'=>false,'Par1Rnd'=>'0','Par1Nup'=>'0','Img1Ads'=>false,'Img1Rnd'=>'0','Img1Nup'=>'0',
44
  'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,'AppSide'=>false,
@@ -121,7 +121,6 @@ function ads_head_java() {
121
  <?php } ?>
122
  <?php if(!get_option('QckOffs')){ ?>
123
  edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
124
- edButtons[edButtons.length]=new edButton("off_ads","OffAds","\n<!--OffAds-->\n","","",-1);
125
  edButtons[edButtons.length]=new edButton("off_def","OffDef","\n<!--OffDef-->\n","","",-1);
126
  <?php } ?>
127
  };
@@ -337,40 +336,40 @@ function ads_widget_register() {
337
  global $QData;
338
  if (!function_exists('register_sidebar_widget') || !function_exists('register_widget_control')) { return; };
339
  for($i=1;$i<=$QData['AdsWid'];$i++) {
340
- $displaystr =
341
- '$cont = get_the_content("",0,"");'.
342
- 'if( !strpos($cont,"<!--OffAds-->") && !(is_home()&&get_option("AppSide")) ) {'.
343
- 'extract($args);'.
344
- '$title = get_option("WidCode-title-'.$i.'");'.
345
- '$codetxt = get_option("WidCode'.$i.'");'.
346
- 'echo "\n"."<!-- Quick Adsense Wordpress Plugin: http://techmilieu.com/quick-adsense -->"."\n";'.
347
- 'echo $before_widget."\n";'.
348
- 'if (!empty($title)) { '.
349
- 'echo $before_title.$title.$after_title."\n"; '.
350
- '};'.
351
- 'echo $codetxt;'.
352
- 'echo "\n".$after_widget;'.
353
- '}';
354
- $controlstr =
355
- 'if ($_POST["WidCodeSubmit'.$i.'"]) {'.
356
- ' update_option_en("WidCode-title-'.$i.'", $_POST["WidCode-title-'.$i.'"], "strip_tags");'.
357
- ' update_option_en("WidCode'.$i.'", $_POST["WidCode'.$i.'"]);'.
358
- '}'.
359
- '$title = get_option_en("WidCode-title-'.$i.'");'.
360
- '$codetxt = get_option_en("WidCode'.$i.'");'.
361
- 'echo "<p><label>'.__('Title:').'</label>";'.
362
- 'echo "<input style=\"width:100%;\" id=\"WidCode-title-'.$i.'\" name=\"WidCode-title-'.$i.'\" type=\"text\" value=\"".$title."\" />";'.
363
- 'echo "<p><textarea style=\"width:100%;height:150px;\" id=\"WidCode'.$i.'\" name=\"WidCode'.$i.'\">".$codetxt."</textarea><br\>";'.
364
- 'echo "<a style=\"font-size:8pt;text-decoration:none\" href=\"options-general.php?page='.basename(__FILE__).'\">'.__('Quick Adsense Setting').'</a></p>";'.
365
- 'echo "<input type=\"hidden\" id=\"WidCodeSubmit'.$i.'\" name=\"WidCodeSubmit'.$i.'\" value=\"true\" />";';
366
- $displaycall[$i] = create_function('$args', $displaystr);
367
- $controlcall[$i] = create_function('', $controlstr);
 
 
 
 
 
368
  }
369
- for($i=1;$i<=$QData['AdsWid'];$i++) {
370
- $wadsid = sprintf($QData['AdsWidName'],$i);
371
- register_sidebar_widget($wadsid, $displaycall[$i]);
372
- register_widget_control($wadsid, $controlcall[$i]);
373
- }
374
  }
375
  function get_option_en($nameid)
376
  {
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.6
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
29
 
30
 
31
 
 
32
 
33
+
34
+ $QData['AdsWid'] = 10; /* Ads on Widget */
35
  $QData['Ads'] = 10; /* Ads on Post body */
36
  $QData['Name'] = 'Quick Adsense';
37
+ $QData['Version'] = '1.6';
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
  'Par1Ads'=>false,'Par1Rnd'=>'0','Par1Nup'=>'0','Img1Ads'=>false,'Img1Rnd'=>'0','Img1Nup'=>'0',
44
  'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,'AppSide'=>false,
121
  <?php } ?>
122
  <?php if(!get_option('QckOffs')){ ?>
123
  edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
 
124
  edButtons[edButtons.length]=new edButton("off_def","OffDef","\n<!--OffDef-->\n","","",-1);
125
  <?php } ?>
126
  };
336
  global $QData;
337
  if (!function_exists('register_sidebar_widget') || !function_exists('register_widget_control')) { return; };
338
  for($i=1;$i<=$QData['AdsWid'];$i++) {
339
+ if(get_option('WidCode'.$i)!='') {
340
+ $displaystr =
341
+ '$cont = get_the_content("",0,"");'.
342
+ 'if( !strpos($cont,"<!--OffAds-->") && !(is_home()&&get_option("AppSide")) ) {'.
343
+ 'extract($args);'.
344
+ '$title = get_option("WidCode-title-'.$i.'");'.
345
+ '$codetxt = get_option("WidCode'.$i.'");'.
346
+ 'echo "\n"."<!-- Quick Adsense Wordpress Plugin: http://techmilieu.com/quick-adsense -->"."\n";'.
347
+ 'echo $before_widget."\n";'.
348
+ 'if (!empty($title)) { '.
349
+ 'echo $before_title.$title.$after_title."\n"; '.
350
+ '};'.
351
+ 'echo $codetxt;'.
352
+ 'echo "\n".$after_widget;'.
353
+ '}';
354
+ $controlstr =
355
+ 'if ($_POST["WidCodeSubmit'.$i.'"]) {'.
356
+ ' update_option_en("WidCode-title-'.$i.'", $_POST["WidCode-title-'.$i.'"], "strip_tags");'.
357
+ ' update_option_en("WidCode'.$i.'", $_POST["WidCode'.$i.'"]);'.
358
+ '}'.
359
+ '$title = get_option_en("WidCode-title-'.$i.'");'.
360
+ '$codetxt = get_option_en("WidCode'.$i.'");'.
361
+ 'echo "<p><label>'.__('Title:').'</label>";'.
362
+ 'echo "<input style=\"width:100%;\" id=\"WidCode-title-'.$i.'\" name=\"WidCode-title-'.$i.'\" type=\"text\" value=\"".$title."\" />";'.
363
+ 'echo "<p><textarea style=\"width:100%;height:150px;\" id=\"WidCode'.$i.'\" name=\"WidCode'.$i.'\">".$codetxt."</textarea><br\>";'.
364
+ 'echo "<a style=\"font-size:8pt;text-decoration:none\" href=\"options-general.php?page='.basename(__FILE__).'\">'.__('Quick Adsense Setting').'</a></p>";'.
365
+ 'echo "<input type=\"hidden\" id=\"WidCodeSubmit'.$i.'\" name=\"WidCodeSubmit'.$i.'\" value=\"true\" />";';
366
+ $displaycall[$i] = create_function('$args', $displaystr);
367
+ $controlcall[$i] = create_function('', $controlstr);
368
+ $wadsid = sprintf($QData['AdsWidName'],$i);
369
+ register_sidebar_widget($wadsid, $displaycall[$i], "adswidget");
370
+ register_widget_control($wadsid, $controlcall[$i]);
371
+ }
372
  }
 
 
 
 
 
373
  }
374
  function get_option_en($nameid)
375
  {
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.9
7
- Stable tag: 1.5.1
8
 
9
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
10
 
@@ -22,9 +22,9 @@ Here are some **features** that come with this plugin:
22
  1. Simple configuration interface, requires no coding knowledge: Just copy and paste AdSense code, tick & select options, the plugin will then do the rest for you.
23
  1. Support any Ads code, not limited to Adsense code only.
24
  1. Display up to a maximum of 10 Ads on a page. Google allows publishers to place up to 3 Adsense for Content on a page. If you are using other Ads, you may display up to 10 Ads.
25
- 1. Support up to a maximum of 3 Ads codes on Sidebar Widgets.
26
  1. Support up to a maximum of 10 Ads codes for specific placement & randomization within a post.
27
- 1. Ads placement on the fly, simply insert &lt;!--Ads1--&gt;, &lt;!--Ads2--&gt; ... , &lt;!--RndAds--&gt;, &lt;!--NoAds--&gt;, &lt;!--OffAds--&gt; to a post to accomplish this.
28
  1. Tags above can be inserted into a post easily via the additional Quicktag Buttons added to the HTML Edit Post SubPanel.
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.
@@ -49,6 +49,13 @@ Please feedback to [http://techmilieu.com/quick-adsense](http://techmilieu.com/q
49
 
50
  == Change Log ==
51
 
 
 
 
 
 
 
 
52
  = 1.5.1 =
53
  * v1.5 has been tested up to WP2.9, update the compatible version notice.
54
 
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.9
7
+ Stable tag: 1.6
8
 
9
  Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
10
 
22
  1. Simple configuration interface, requires no coding knowledge: Just copy and paste AdSense code, tick & select options, the plugin will then do the rest for you.
23
  1. Support any Ads code, not limited to Adsense code only.
24
  1. Display up to a maximum of 10 Ads on a page. Google allows publishers to place up to 3 Adsense for Content on a page. If you are using other Ads, you may display up to 10 Ads.
25
+ 1. Support up to a maximum of 10 Ads codes on Sidebar Widgets.
26
  1. Support up to a maximum of 10 Ads codes for specific placement & randomization within a post.
27
+ 1. Ads placement on the fly, simply insert &lt;!--Ads1--&gt;, &lt;!--Ads2--&gt; ... , &lt;!--RndAds--&gt;, &lt;!--NoAds--&gt;, &lt;!--OffDef--&gt; to a post to accomplish this.
28
  1. Tags above can be inserted into a post easily via the additional Quicktag Buttons added to the HTML Edit Post SubPanel.
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.
49
 
50
  == Change Log ==
51
 
52
+ = 1.6 =
53
+ * Fix for the problem on Setting page stop loading & the disappearing of "Save Setting" button in some cases.
54
+ * Fix the AdsWidget div tag's class name. Now you can use CSS to style the AdsWidget.
55
+ * Extend the number of AdsWidget (Sidebar Ads) from 3 to 10, as requested by users. Now, AdsWidgets are automatically appear in Appearance-&gt;Widgets page only when the code is available.
56
+ * Remove the &lt;!--OffAds--&gt; option as this function doesn't work well in certain theme. However, if you are using this function in previous version, you can continue to use it.
57
+ * Minor code modifications.
58
+
59
  = 1.5.1 =
60
  * v1.5 has been tested up to WP2.9, update the compatible version notice.
61
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file