Version Description
- Update the depreciated wp code function for AdsWidget in the plugin.
- New Feature - Enable user to insert Ads after Image's outer div wp-caption & not just right below the image.
- New Feature - Enable user to insert Ads before the last paragraph of the post.
- New Feature - Option to disable ads at particular positions, such as Beginning, Middle & End of post, ads on Sidebar, ads after 'more' tag and ads before last paragraph.
- Date: 8-May-2013
Download this release
Release Info
Developer | philipze |
Plugin | Quick Adsense |
Version | 1.9.2 |
Comparing to | |
See all releases |
Code changes from version 1.9.1 to 1.9.2
- quick-adsense-admin.php +41 -19
- quick-adsense.php +82 -50
- readme.txt +13 -5
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
quick-adsense-admin.php
CHANGED
@@ -30,6 +30,8 @@
|
|
30 |
$rb2 = get_option('EndiRnd');
|
31 |
$rr1 = get_option('MoreAds');
|
32 |
$rr2 = get_option('MoreRnd');
|
|
|
|
|
33 |
$rc = 3;
|
34 |
for ($j=1;$j<=$rc;$j++) {
|
35 |
$rc1[$j] = get_option('Par'.$j.'Ads');
|
@@ -40,6 +42,7 @@
|
|
40 |
$rd1 = get_option('Img1Ads');
|
41 |
$rd2 = get_option('Img1Rnd');
|
42 |
$rd3 = get_option('Img1Nup');
|
|
|
43 |
$aps = get_option('AppPost');
|
44 |
$apg = get_option('AppPage');
|
45 |
$ahm = get_option('AppHome');
|
@@ -52,6 +55,7 @@
|
|
52 |
$aqt = get_option('QckTags');
|
53 |
$aqr = get_option('QckRnds');
|
54 |
$aqf = get_option('QckOffs');
|
|
|
55 |
$optionsupdate = '';
|
56 |
foreach ($QData['Default'] as $key => $value) {
|
57 |
$optionsupdate .= $key.',' ;
|
@@ -75,7 +79,9 @@
|
|
75 |
document.getElementById("EndiAds").checked = <?php echo(truefalse($QData['Default']['EndiAds'])) ?>;
|
76 |
document.getElementById("EndiRnd").selectedIndex = <?php echo($QData['Default']['EndiRnd']) ?>;
|
77 |
document.getElementById("MoreAds").checked = <?php echo(truefalse($QData['Default']['MoreAds'])) ?>;
|
78 |
-
document.getElementById("MoreRnd").selectedIndex = <?php echo($QData['Default']['MoreRnd']) ?>;
|
|
|
|
|
79 |
<?php for ($j=1;$j<=$rc;$j++) { ?>
|
80 |
document.getElementById("Par<?php echo $j; ?>Ads").checked = <?php echo(truefalse($QData['Default']['Par'.$j.'Ads'])) ?>;
|
81 |
document.getElementById("Par<?php echo $j; ?>Rnd").selectedIndex = <?php echo($QData['Default']['Par'.$j.'Rnd']) ?>;
|
@@ -84,7 +90,8 @@
|
|
84 |
<?php } ?>
|
85 |
document.getElementById("Img1Ads").checked = <?php echo(truefalse($QData['Default']['Img1Ads'])) ?>;
|
86 |
document.getElementById("Img1Rnd").selectedIndex = <?php echo($QData['Default']['Img1Rnd']) ?>;
|
87 |
-
document.getElementById("Img1Nup").selectedIndex = <?php echo($QData['Default']['Img1Nup']) ?>;
|
|
|
88 |
document.getElementById("AppHome").checked = <?php echo(truefalse($QData['Default']['AppHome'])) ?>;
|
89 |
document.getElementById("AppPost").checked = <?php echo(truefalse($QData['Default']['AppPost'])) ?>;
|
90 |
document.getElementById("AppPage").checked = <?php echo(truefalse($QData['Default']['AppPage'])) ?>;
|
@@ -97,6 +104,7 @@
|
|
97 |
document.getElementById("QckTags").checked = <?php echo(truefalse($QData['Default']['QckTags'])) ?>;
|
98 |
document.getElementById("QckRnds").checked = <?php echo(truefalse($QData['Default']['QckRnds'])) ?>;
|
99 |
document.getElementById("QckOffs").checked = <?php echo(truefalse($QData['Default']['QckOffs'])) ?>;
|
|
|
100 |
for(i=1;i<=<?php echo($QData['Ads']) ?>;i++){
|
101 |
tp=document.getElementById("AdsCode"+i.toString()).innerHTML;
|
102 |
if(tp==''){
|
@@ -112,7 +120,8 @@
|
|
112 |
document.getElementById('BegnRnd'),
|
113 |
document.getElementById('MiddRnd'),
|
114 |
document.getElementById('EndiRnd'),
|
115 |
-
document.getElementById('MoreRnd'),
|
|
|
116 |
document.getElementById('Par1Rnd'),
|
117 |
document.getElementById('Par2Rnd'),
|
118 |
document.getElementById('Par3Rnd'),
|
@@ -126,7 +135,7 @@
|
|
126 |
function checkinfo1(selnme,ts) {
|
127 |
document.getElementById(selnme).disabled=!ts.checked;
|
128 |
}
|
129 |
-
function checkinfo2(ts,selnm1,selnm2,selnm3) {
|
130 |
if(selnm1){document.getElementById(selnm1).disabled=!ts.checked};
|
131 |
if(selnm2){document.getElementById(selnm2).disabled=!ts.checked};
|
132 |
if(selnm3){document.getElementById(selnm3).disabled=!ts.checked};
|
@@ -135,11 +144,12 @@
|
|
135 |
checkinfo1('BegnRnd',document.getElementById('BegnAds'));
|
136 |
checkinfo1('MiddRnd',document.getElementById('MiddAds'));
|
137 |
checkinfo1('EndiRnd',document.getElementById('EndiAds'));
|
138 |
-
checkinfo1('MoreRnd',document.getElementById('MoreAds'));
|
|
|
139 |
for (i=1;i<=3;i++) {
|
140 |
checkinfo2(document.getElementById('Par'+i+'Ads'),'Par'+i+'Rnd','Par'+i+'Nup','Par'+i+'Con');
|
141 |
}
|
142 |
-
checkinfo2(document.getElementById('Img1Ads'),'Img1Rnd','Img1Nup');
|
143 |
}
|
144 |
</script>
|
145 |
|
@@ -158,7 +168,7 @@
|
|
158 |
<?php for ($i=0;$i<=(int)$QData['Ads'];$i++) { ?>
|
159 |
<option id="DisTot<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($dis==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
|
160 |
<?php } ?></select><?php _e(' Ads on a page. Select up to <b>3 Ads</b> only if you are solely using Google Ads.'); ?><br/>
|
161 |
-
<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
|
162 |
<br/>
|
163 |
</td>
|
164 |
</tr>
|
@@ -180,7 +190,11 @@
|
|
180 |
<input type="checkbox" id="MoreAds" name="MoreAds" value="false" <?php if($rr1){echo('checked');} ?> onchange="checkinfo1('MoreRnd',this)" /> <?php _e('Assign') ; ?> <select id="MoreRnd" name="MoreRnd" onchange="selectinfo(this)">
|
181 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
182 |
<option id="OptMore<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rr2==(string)$i){echo('selected');} ?>><?php _e(($i==0)?'Random Ads':'Ads'.$i) ; ?></option>
|
183 |
-
<?php } ?></select> <?php _e('right after <b>the') ?> <span style="font-family:Courier New,Courier,Fixed;
|
|
|
|
|
|
|
|
|
184 |
<?php for ($j=1;$j<=$rc;$j++) { ?>
|
185 |
<input type="checkbox" id="Par<?php echo $j; ?>Ads" name="Par<?php echo $j; ?>Ads" value="false" <?php if($rc1[$j]){echo('checked');} ?> onchange="checkinfo2(this,'Par<?php echo $j; ?>Rnd','Par<?php echo $j; ?>Nup','Par<?php echo $j; ?>Con')" /> <?php _e('Assign') ; ?> <select id="Par<?php echo $j; ?>Rnd" name="Par<?php echo $j; ?>Rnd" onchange="selectinfo(this)">
|
186 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
@@ -191,13 +205,14 @@
|
|
191 |
<?php } ?></select> →
|
192 |
<input type="checkbox" id="Par<?php echo $j; ?>Con" name="Par<?php echo $j; ?>Con" value="false" <?php if($rc4[$j]){echo('checked');} ?> /> <?php _e('to <b>End of Post</b> if fewer paragraphs are found.') ; ?><br/>
|
193 |
<?php } ?>
|
194 |
-
<input type="checkbox" id="Img1Ads" name="Img1Ads" value="false" <?php if($rd1){echo('checked');} ?> onchange="checkinfo2(this,'Img1Rnd','Img1Nup')" /> <?php _e('Assign') ; ?> <select id="Img1Rnd" name="Img1Rnd" onchange="selectinfo(this)">
|
195 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
196 |
<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>
|
197 |
<?php } ?></select> <?php _e('<b>After Image</b> ') ?> <select id="Img1Nup" name="Img1Nup">
|
198 |
<?php for ($i=1;$i<=50;$i++) { ?>
|
199 |
<option id="Opt1Im<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
|
200 |
-
<?php } ?></select
|
|
|
201 |
<br/>
|
202 |
<script type="text/javascript">deftcheckinfo();</script>
|
203 |
</td>
|
@@ -223,17 +238,24 @@
|
|
223 |
</tr>
|
224 |
<tr valign="top">
|
225 |
<td style="width:110px"><?php _e('Quicktag :'); ?></td>
|
226 |
-
<td><
|
227 |
<ol style="margin-top:5px;">
|
228 |
-
<li><?php _e('Insert
|
229 |
-
<li><?php _e('Insert
|
230 |
-
<li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--NoAds--></span> to temporary <b>Disable Ads</b> in a post.'); ?></li>
|
231 |
-
<li><?php _e('Insert a <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffDef--></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>
|
232 |
</ol>
|
233 |
-
|
234 |
-
|
235 |
-
<span class="description" style="font-style:italic"><?php _e('(
|
236 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
</td>
|
238 |
</tr>
|
239 |
<tr valign="top">
|
30 |
$rb2 = get_option('EndiRnd');
|
31 |
$rr1 = get_option('MoreAds');
|
32 |
$rr2 = get_option('MoreRnd');
|
33 |
+
$rp1 = get_option('LapaAds');
|
34 |
+
$rp2 = get_option('LapaRnd');
|
35 |
$rc = 3;
|
36 |
for ($j=1;$j<=$rc;$j++) {
|
37 |
$rc1[$j] = get_option('Par'.$j.'Ads');
|
42 |
$rd1 = get_option('Img1Ads');
|
43 |
$rd2 = get_option('Img1Rnd');
|
44 |
$rd3 = get_option('Img1Nup');
|
45 |
+
$rd4 = get_option('Img1Con');
|
46 |
$aps = get_option('AppPost');
|
47 |
$apg = get_option('AppPage');
|
48 |
$ahm = get_option('AppHome');
|
55 |
$aqt = get_option('QckTags');
|
56 |
$aqr = get_option('QckRnds');
|
57 |
$aqf = get_option('QckOffs');
|
58 |
+
$aqp = get_option('QckOfPs');
|
59 |
$optionsupdate = '';
|
60 |
foreach ($QData['Default'] as $key => $value) {
|
61 |
$optionsupdate .= $key.',' ;
|
79 |
document.getElementById("EndiAds").checked = <?php echo(truefalse($QData['Default']['EndiAds'])) ?>;
|
80 |
document.getElementById("EndiRnd").selectedIndex = <?php echo($QData['Default']['EndiRnd']) ?>;
|
81 |
document.getElementById("MoreAds").checked = <?php echo(truefalse($QData['Default']['MoreAds'])) ?>;
|
82 |
+
document.getElementById("MoreRnd").selectedIndex = <?php echo($QData['Default']['MoreRnd']) ?>;
|
83 |
+
document.getElementById("LapaAds").checked = <?php echo(truefalse($QData['Default']['LapaAds'])) ?>;
|
84 |
+
document.getElementById("LapaRnd").selectedIndex = <?php echo($QData['Default']['LapaRnd']) ?>;
|
85 |
<?php for ($j=1;$j<=$rc;$j++) { ?>
|
86 |
document.getElementById("Par<?php echo $j; ?>Ads").checked = <?php echo(truefalse($QData['Default']['Par'.$j.'Ads'])) ?>;
|
87 |
document.getElementById("Par<?php echo $j; ?>Rnd").selectedIndex = <?php echo($QData['Default']['Par'.$j.'Rnd']) ?>;
|
90 |
<?php } ?>
|
91 |
document.getElementById("Img1Ads").checked = <?php echo(truefalse($QData['Default']['Img1Ads'])) ?>;
|
92 |
document.getElementById("Img1Rnd").selectedIndex = <?php echo($QData['Default']['Img1Rnd']) ?>;
|
93 |
+
document.getElementById("Img1Nup").selectedIndex = <?php echo($QData['Default']['Img1Nup']) ?>;
|
94 |
+
document.getElementById("Img1Con").checked = <?php echo(truefalse($QData['Default']['Img1Con'])) ?>;
|
95 |
document.getElementById("AppHome").checked = <?php echo(truefalse($QData['Default']['AppHome'])) ?>;
|
96 |
document.getElementById("AppPost").checked = <?php echo(truefalse($QData['Default']['AppPost'])) ?>;
|
97 |
document.getElementById("AppPage").checked = <?php echo(truefalse($QData['Default']['AppPage'])) ?>;
|
104 |
document.getElementById("QckTags").checked = <?php echo(truefalse($QData['Default']['QckTags'])) ?>;
|
105 |
document.getElementById("QckRnds").checked = <?php echo(truefalse($QData['Default']['QckRnds'])) ?>;
|
106 |
document.getElementById("QckOffs").checked = <?php echo(truefalse($QData['Default']['QckOffs'])) ?>;
|
107 |
+
document.getElementById("QckOfPs").checked = <?php echo(truefalse($QData['Default']['QckOfPs'])) ?>;
|
108 |
for(i=1;i<=<?php echo($QData['Ads']) ?>;i++){
|
109 |
tp=document.getElementById("AdsCode"+i.toString()).innerHTML;
|
110 |
if(tp==''){
|
120 |
document.getElementById('BegnRnd'),
|
121 |
document.getElementById('MiddRnd'),
|
122 |
document.getElementById('EndiRnd'),
|
123 |
+
document.getElementById('MoreRnd'),
|
124 |
+
document.getElementById('LapaRnd'),
|
125 |
document.getElementById('Par1Rnd'),
|
126 |
document.getElementById('Par2Rnd'),
|
127 |
document.getElementById('Par3Rnd'),
|
135 |
function checkinfo1(selnme,ts) {
|
136 |
document.getElementById(selnme).disabled=!ts.checked;
|
137 |
}
|
138 |
+
function checkinfo2(ts,selnm1,selnm2,selnm3,selnm4) {
|
139 |
if(selnm1){document.getElementById(selnm1).disabled=!ts.checked};
|
140 |
if(selnm2){document.getElementById(selnm2).disabled=!ts.checked};
|
141 |
if(selnm3){document.getElementById(selnm3).disabled=!ts.checked};
|
144 |
checkinfo1('BegnRnd',document.getElementById('BegnAds'));
|
145 |
checkinfo1('MiddRnd',document.getElementById('MiddAds'));
|
146 |
checkinfo1('EndiRnd',document.getElementById('EndiAds'));
|
147 |
+
checkinfo1('MoreRnd',document.getElementById('MoreAds'));
|
148 |
+
checkinfo1('LapaRnd',document.getElementById('LapaAds'));
|
149 |
for (i=1;i<=3;i++) {
|
150 |
checkinfo2(document.getElementById('Par'+i+'Ads'),'Par'+i+'Rnd','Par'+i+'Nup','Par'+i+'Con');
|
151 |
}
|
152 |
+
checkinfo2(document.getElementById('Img1Ads'),'Img1Rnd','Img1Nup','Img1Con');
|
153 |
}
|
154 |
</script>
|
155 |
|
168 |
<?php for ($i=0;$i<=(int)$QData['Ads'];$i++) { ?>
|
169 |
<option id="DisTot<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($dis==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
|
170 |
<?php } ?></select><?php _e(' Ads on a page. Select up to <b>3 Ads</b> only if you are solely using Google Ads.'); ?><br/>
|
171 |
+
<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 manually 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/>
|
172 |
<br/>
|
173 |
</td>
|
174 |
</tr>
|
190 |
<input type="checkbox" id="MoreAds" name="MoreAds" value="false" <?php if($rr1){echo('checked');} ?> onchange="checkinfo1('MoreRnd',this)" /> <?php _e('Assign') ; ?> <select id="MoreRnd" name="MoreRnd" onchange="selectinfo(this)">
|
191 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
192 |
<option id="OptMore<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rr2==(string)$i){echo('selected');} ?>><?php _e(($i==0)?'Random Ads':'Ads'.$i) ; ?></option>
|
193 |
+
<?php } ?></select> <?php _e('right after <b>the') ?> <span style="font-family:Courier New,Courier,Fixed;"><!--more--></span> <?php _e('tag') ?></b><br/>
|
194 |
+
<input type="checkbox" id="LapaAds" name="LapaAds" value="false" <?php if($rp1){echo('checked');} ?> onchange="checkinfo1('LapaRnd',this)" /> <?php _e('Assign') ; ?> <select id="LapaRnd" name="LapaRnd" onchange="selectinfo(this)">
|
195 |
+
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
196 |
+
<option id="OptLapa<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rp2==(string)$i){echo('selected');} ?>><?php _e(($i==0)?'Random Ads':'Ads'.$i) ; ?></option>
|
197 |
+
<?php } ?></select> <?php _e('right before <b>the last Paragraph</b>') ?><span style="color:#a00;"> <b>(New)</b></span><br/>
|
198 |
<?php for ($j=1;$j<=$rc;$j++) { ?>
|
199 |
<input type="checkbox" id="Par<?php echo $j; ?>Ads" name="Par<?php echo $j; ?>Ads" value="false" <?php if($rc1[$j]){echo('checked');} ?> onchange="checkinfo2(this,'Par<?php echo $j; ?>Rnd','Par<?php echo $j; ?>Nup','Par<?php echo $j; ?>Con')" /> <?php _e('Assign') ; ?> <select id="Par<?php echo $j; ?>Rnd" name="Par<?php echo $j; ?>Rnd" onchange="selectinfo(this)">
|
200 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
205 |
<?php } ?></select> →
|
206 |
<input type="checkbox" id="Par<?php echo $j; ?>Con" name="Par<?php echo $j; ?>Con" value="false" <?php if($rc4[$j]){echo('checked');} ?> /> <?php _e('to <b>End of Post</b> if fewer paragraphs are found.') ; ?><br/>
|
207 |
<?php } ?>
|
208 |
+
<input type="checkbox" id="Img1Ads" name="Img1Ads" value="false" <?php if($rd1){echo('checked');} ?> onchange="checkinfo2(this,'Img1Rnd','Img1Nup','Img1Con')" /> <?php _e('Assign') ; ?> <select id="Img1Rnd" name="Img1Rnd" onchange="selectinfo(this)">
|
209 |
<?php for ($i=0;$i<=$QData['Ads'];$i++) { ?>
|
210 |
<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>
|
211 |
<?php } ?></select> <?php _e('<b>After Image</b> ') ?> <select id="Img1Nup" name="Img1Nup">
|
212 |
<?php for ($i=1;$i<=50;$i++) { ?>
|
213 |
<option id="Opt1Im<?php echo $i; ?>" value="<?php echo $i; ?>" <?php if($rd3==(string)$i){echo('selected');} ?>><?php echo $i; ?></option>
|
214 |
+
<?php } ?></select> →
|
215 |
+
<input type="checkbox" id="Img1Con" name="Img1Con" value="false" <?php if($rd4){echo('checked');} ?> /> <?php _e('after <b>Image's outer</b>'); ?><b><span style="font-family:Courier New,Courier,Fixed;"> <div> wp-caption</span></b> if any.<span style="color:#a00;"> <b>(New)</b></span><br/>
|
216 |
<br/>
|
217 |
<script type="text/javascript">deftcheckinfo();</script>
|
218 |
</td>
|
238 |
</tr>
|
239 |
<tr valign="top">
|
240 |
<td style="width:110px"><?php _e('Quicktag :'); ?></td>
|
241 |
+
<td><span style="display:block;font-style:normal;padding-bottom:0px"><?php _e('Insert Ads into a post, on-the-fly :'); ?></span>
|
242 |
<ol style="margin-top:5px;">
|
243 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--Ads1--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--Ads2--></span>, etc. into a post to show the <b>Particular Ads</b> at specific location.'); ?></li>
|
244 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--RndAds--></span> (or more) into a post to show the <b>Random Ads</b> at specific location.'); ?></li>
|
|
|
|
|
245 |
</ol>
|
246 |
+
<span style="display:block;font-style:normal;padding-bottom:0px"><?php _e('Disable Ads in a post, on-the-fly :'); ?></span>
|
247 |
+
<ol style="margin-top:5px;">
|
248 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--NoAds--></span> to <b>disable all Ads</b> in a post.'); ?><span class="description" style="font-style:italic"><?php _e(' (does not affect Ads on Sidebar)'); ?></span></li>
|
249 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffDef--></span> to <b>disable the default positioned Ads</b>, and use <span style="font-family:Courier New,Courier,Fixed;"><!--Ads1--></span>, <span style="font-family:Courier New,Courier,Fixed;"><!--Ads2--></span>, etc. to insert Ads.'); ?><span class="description" style="font-style:italic"><?php _e(' (does not affect Ads on Sidebar)'); ?></span></li>
|
250 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffWidget--></span> to <b>disable all Ads on Sidebar</b>.'); ?><span style="color:#a00;"> <b>(New)</b></span></li>
|
251 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffBegin--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffMiddle--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffEnd--></span> to <b>disable Ads at Beginning, Middle</b> or <b>End of Post</b>.'); ?><span style="color:#a00;"> <b>(New)</b></span></li>
|
252 |
+
<li><?php _e('Insert <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffAfMore--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffBfLastPara--></span> to <b>disable Ads right after the <span style="font-family:Courier New,Courier,Fixed;"><!--more--></span> tag</b>, or <b>right before the last Paragraph</b>.'); ?><span style="color:#a00;"> <b>(New)</b></span></li>
|
253 |
+
</ol>
|
254 |
+
[ <input type="checkbox" id="QckTags" name="QckTags" value="true" <?php if($aqt){echo('checked');} ?> /> <?php _e('Show Quicktag Buttons on the HTML Edit Post SubPanel'); ?> ]<br/>
|
255 |
+
[ <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"><!--RndAds--></span> from Quicktag Buttons'); ?> ]<br/>
|
256 |
+
[ <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"><!--NoAds--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffDef--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffWidget--></span> from Quicktag Buttons'); ?> ]<br/>
|
257 |
+
[ <input type="checkbox" id="QckOfPs" name="QckOfPs" value="true" <?php if($aqp){echo('checked');} ?> /> <?php _e('Hide <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffBegin--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffMiddle--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffEnd--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffAfMore--></span>, <span style="font-family:Courier New,Courier,Fixed;color:#050"><!--OffBfLastPara--></span> from Quicktag Buttons'); ?> ]<br/>
|
258 |
+
<span class="description" style="display:block;font-style:italic;padding-top:10px"><?php _e('Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.'); ?></span><br/>
|
259 |
</td>
|
260 |
</tr>
|
261 |
<tr valign="top">
|
quick-adsense.php
CHANGED
@@ -5,7 +5,7 @@
|
|
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.
|
9 |
Author URI: http://quicksense.net/
|
10 |
*/
|
11 |
|
@@ -34,18 +34,18 @@ 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://quicksense.net/';
|
39 |
$QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
|
40 |
$QData['Default'] = array(
|
41 |
'AdsDisp'=>'3',
|
42 |
-
'BegnAds'=>true,'BegnRnd'=>'1','EndiAds'=>true,'EndiRnd'=>'0','MiddAds'=>false,'MiddRnd'=>'0','MoreAds'=>false,'MoreRnd'=>'0',
|
43 |
'Par1Ads'=>false,'Par1Rnd'=>'0','Par1Nup'=>'0','Par1Con'=>false,
|
44 |
'Par2Ads'=>false,'Par2Rnd'=>'0','Par2Nup'=>'0','Par2Con'=>false,
|
45 |
'Par3Ads'=>false,'Par3Rnd'=>'0','Par3Nup'=>'0','Par3Con'=>false,
|
46 |
-
'Img1Ads'=>false,'Img1Rnd'=>'0','Img1Nup'=>'0',
|
47 |
'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,'AppSide'=>false,'AppLogg'=>false,
|
48 |
-
'QckTags'=>true,'QckRnds'=>false,'QckOffs'=>false
|
49 |
);
|
50 |
$QData['DefaultAdsOpt'] = array(
|
51 |
'AdsMargin'=>'10','AdsAlign'=>'2'
|
@@ -131,7 +131,6 @@ function ads_head_java() {
|
|
131 |
edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
|
132 |
edaddID[edaddID.length] = "random_ads";
|
133 |
edaddNm[edaddNm.length] = "RndAds";
|
134 |
-
|
135 |
<?php } ?>
|
136 |
<?php if(!get_option('QckOffs')){ ?>
|
137 |
edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
|
@@ -140,7 +139,27 @@ function ads_head_java() {
|
|
140 |
edButtons[edButtons.length]=new edButton("off_def","OffDef","\n<!--OffDef-->\n","","",-1);
|
141 |
edaddID[edaddID.length] = "off_def";
|
142 |
edaddNm[edaddNm.length] = "OffDef";
|
|
|
|
|
|
|
143 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
};
|
145 |
(function(){
|
146 |
if(typeof(edButtons)!='undefined' && typeof(jQuery)!='undefined' && wpvcomp){
|
@@ -174,8 +193,8 @@ function process_content($content)
|
|
174 |
|
175 |
/* verifying */
|
176 |
if( (is_feed()) ||
|
177 |
-
(strpos($content,'<!--NoAds-->')) ||
|
178 |
-
(strpos($content,'<!--OffAds-->')) ||
|
179 |
(is_single() && !(get_option('AppPost'))) ||
|
180 |
(is_page() && !(get_option('AppPage'))) ||
|
181 |
(is_home() && !(get_option('AppHome'))) ||
|
@@ -187,10 +206,12 @@ function process_content($content)
|
|
187 |
}
|
188 |
|
189 |
$AdsToShow = get_option('AdsDisp');
|
190 |
-
|
191 |
-
$
|
192 |
-
|
193 |
-
|
|
|
|
|
194 |
if( $ShownAds >= $AdsToShow ) { $content = clean_tags($content); return $content; };
|
195 |
|
196 |
if( !count($AdsId) ) {
|
@@ -204,11 +225,14 @@ function process_content($content)
|
|
204 |
if( !count($AdsId) ) { $content = clean_tags($content); return $content; };
|
205 |
|
206 |
/* ... Tidy up content ... */
|
207 |
-
$
|
|
|
|
|
208 |
if( !$offdef ) {
|
209 |
$AdsIdCus = array();
|
210 |
$cusads = 'CusAds'; $cusrnd = 'CusRnd';
|
211 |
-
$more1 = get_option('MoreAds'); $more2 = get_option('MoreRnd');
|
|
|
212 |
$begn1 = get_option('BegnAds'); $begn2 = get_option('BegnRnd');
|
213 |
$midd1 = get_option('MiddAds'); $midd2 = get_option('MiddRnd');
|
214 |
$endi1 = get_option('EndiAds'); $endi2 = get_option('EndiRnd');
|
@@ -216,16 +240,17 @@ function process_content($content)
|
|
216 |
for($i=1;$i<=$rc;$i++) {
|
217 |
$para1[$i] = get_option('Par'.$i.'Ads'); $para2[$i] = get_option('Par'.$i.'Rnd'); $para3[$i] = get_option('Par'.$i.'Nup'); $para4[$i] = get_option('Par'.$i.'Con');
|
218 |
}
|
219 |
-
$imge1 = get_option('Img1Ads'); $imge2 = get_option('Img1Rnd'); $imge3 = get_option('Img1Nup');
|
220 |
if ( $begn2 == 0 ) { $b1 = $cusrnd; } else { $b1 = $cusads.$begn2; array_push($AdsIdCus, $begn2); };
|
221 |
if ( $more2 == 0 ) { $r1 = $cusrnd; } else { $r1 = $cusads.$more2; array_push($AdsIdCus, $more2); };
|
222 |
if ( $midd2 == 0 ) { $m1 = $cusrnd; } else { $m1 = $cusads.$midd2; array_push($AdsIdCus, $midd2); };
|
|
|
223 |
if ( $endi2 == 0 ) { $b2 = $cusrnd; } else { $b2 = $cusads.$endi2; array_push($AdsIdCus, $endi2); };
|
224 |
for($i=1;$i<=$rc;$i++) {
|
225 |
if ( $para2[$i] == 0 ) { $b3[$i] = $cusrnd; } else { $b3[$i] = $cusads.$para2[$i]; array_push($AdsIdCus, $para2[$i]); };
|
226 |
}
|
227 |
if ( $imge2 == 0 ) { $b4 = $cusrnd; } else { $b4 = $cusads.$imge2; array_push($AdsIdCus, $imge2); };
|
228 |
-
if( $midd1 ) {
|
229 |
if( substr_count(strtolower($content), '</p>')>=2 ) {
|
230 |
$sch = "</p>";
|
231 |
$content = str_replace("</P>", $sch, $content);
|
@@ -245,17 +270,25 @@ function process_content($content)
|
|
245 |
$content = implode($sch, $arr);
|
246 |
}
|
247 |
}
|
248 |
-
if( $more1 ) {
|
249 |
$mmr = '<!--'.$r1.'-->';
|
250 |
$postid = get_the_ID();
|
251 |
$content = str_replace('<span id="more-'.$postid.'"></span>', $mmr, $content);
|
252 |
}
|
253 |
-
if( $begn1 ) {
|
254 |
$content = '<!--'.$b1.'-->'.$content;
|
255 |
}
|
256 |
-
if( $endi1 ) {
|
257 |
$content = $content.'<!--'.$b2.'-->';
|
258 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
for($i=$rc;$i>=1;$i--) {
|
260 |
if ( $para1[$i] ){
|
261 |
$sch = "</p>";
|
@@ -269,14 +302,24 @@ function process_content($content)
|
|
269 |
}
|
270 |
}
|
271 |
if ( $imge1 ){
|
272 |
-
$sch = "<img";
|
273 |
-
$bch = ">";
|
274 |
$content = str_replace("<IMG", $sch, $content);
|
|
|
275 |
$arr = explode($sch, $content);
|
276 |
if ( (int)$imge3 < count($arr) ) {
|
277 |
$trr = explode($bch, $arr[$imge3]);
|
278 |
-
if ( count($trr) ) {
|
279 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
}
|
281 |
$content = implode($sch, $arr);
|
282 |
}
|
@@ -293,7 +336,7 @@ function process_content($content)
|
|
293 |
if( !$offdef ) {
|
294 |
for( $i=1; $i<=count($AdsIdCus); $i++ ) {
|
295 |
if( $showall || !$ismany || $beginend != $i ) {
|
296 |
-
if( strpos($content,
|
297 |
$content = replace_ads( $content, $cusads.$AdsIdCus[$i-1], $AdsIdCus[$i-1] ); $AdsId = del_element($AdsId, array_search($AdsIdCus[$i-1], $AdsId)) ;
|
298 |
$ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
|
299 |
$beginend = $i; if(!$showall && $ismany){break;}
|
@@ -306,7 +349,7 @@ function process_content($content)
|
|
306 |
if( $showall || !$ismany ) {
|
307 |
$tcn = count($AdsId); $tt = 0;
|
308 |
for( $i=1; $i<=$tcn; $i++ ) {
|
309 |
-
if( strpos($content, '<!--Ads'.$AdsId[$tt].'-->') ) {
|
310 |
$content = replace_ads( $content, 'Ads'.$AdsId[$tt], $AdsId[$tt] ); $AdsId = del_element($AdsId, $tt) ;
|
311 |
$ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
|
312 |
} else {
|
@@ -316,7 +359,7 @@ function process_content($content)
|
|
316 |
}
|
317 |
|
318 |
/* ... Replace Beginning/Middle/End random Ads ... */
|
319 |
-
if( strpos($content, '<!--'.$cusrnd.'-->') && ($showall || !$ismany) ) {
|
320 |
$tcx = count($AdsId);
|
321 |
$tcy = substr_count($content, '<!--'.$cusrnd.'-->');
|
322 |
for( $i=$tcx; $i<=$tcy-1; $i++ ) {
|
@@ -330,7 +373,7 @@ function process_content($content)
|
|
330 |
}
|
331 |
|
332 |
/* ... Replace RndAds ... */
|
333 |
-
if( strpos($content, '<!--RndAds-->') && ($showall || !$ismany) ) {
|
334 |
$AdsIdTmp = array();
|
335 |
shuffle($AdsId);
|
336 |
for( $i=1; $i<=$AdsToShow-$ShownAds; $i++ ) {
|
@@ -350,7 +393,7 @@ function process_content($content)
|
|
350 |
if($tmp != -1){$ShownAds += 1;}; if( $ShownAds >= $AdsToShow || !count($AdsIdTmp) ){ $content = clean_tags($content); return $content; };
|
351 |
}
|
352 |
}
|
353 |
-
|
354 |
/* ... That's it. DONE :) ... */
|
355 |
$content = clean_tags($content); return $content;
|
356 |
}
|
@@ -359,14 +402,16 @@ function clean_tags($content, $trimonly = false) {
|
|
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) {
|
365 |
-
if(strpos($content,'<!--'.$tgn.'-->') || $tgn=='EmptyClear') {
|
366 |
if($trimonly) {
|
367 |
$content = str_replace('<p><!--'.$tgn.'--></p>', '<!--'.$tgn.'-->', $content);
|
368 |
}else{
|
369 |
$content = str_replace(array('<p><!--'.$tgn.'--></p>','<!--'.$tgn.'-->'), '', $content);
|
|
|
|
|
370 |
}
|
371 |
}
|
372 |
}
|
@@ -378,7 +423,7 @@ function clean_tags($content, $trimonly = false) {
|
|
378 |
return $content;
|
379 |
}
|
380 |
function replace_ads($content, $nme, $adn) {
|
381 |
-
if(
|
382 |
global $QData;
|
383 |
if ($adn != -1) {
|
384 |
$arr = array('',
|
@@ -415,12 +460,12 @@ add_filter('the_content', 'process_content');
|
|
415 |
|
416 |
function ads_widget_register() {
|
417 |
global $QData;
|
418 |
-
if (!function_exists('
|
419 |
for($i=1;$i<=$QData['AdsWid'];$i++) {
|
420 |
if(get_option('WidCode'.$i)!='') {
|
421 |
$displaystr =
|
422 |
-
'$cont = get_the_content(
|
423 |
-
'if(
|
424 |
'extract($args);'.
|
425 |
'$title = get_option("WidCode-title-'.$i.'");'.
|
426 |
'$codetxt = get_option("WidCode'.$i.'");'.
|
@@ -432,23 +477,10 @@ function ads_widget_register() {
|
|
432 |
'echo $codetxt;'.
|
433 |
'echo "\n".$after_widget;'.
|
434 |
'}';
|
435 |
-
$controlstr =
|
436 |
-
'if ($_POST["WidCodeSubmit'.$i.'"]) {'.
|
437 |
-
' update_option_en("WidCode-title-'.$i.'", $_POST["WidCode-title-'.$i.'"], "strip_tags");'.
|
438 |
-
' update_option_en("WidCode'.$i.'", $_POST["WidCode'.$i.'"]);'.
|
439 |
-
'}'.
|
440 |
-
'$title = get_option_en("WidCode-title-'.$i.'");'.
|
441 |
-
'$codetxt = get_option_en("WidCode'.$i.'");'.
|
442 |
-
'echo "<p><label>'.__('Title:').'</label>";'.
|
443 |
-
'echo "<input style=\"width:100%;\" id=\"WidCode-title-'.$i.'\" name=\"WidCode-title-'.$i.'\" type=\"text\" value=\"".$title."\" />";'.
|
444 |
-
'echo "<p><textarea style=\"width:100%;height:150px;\" id=\"WidCode'.$i.'\" name=\"WidCode'.$i.'\">".$codetxt."</textarea><br\>";'.
|
445 |
-
'echo "<a style=\"font-size:8pt;text-decoration:none\" href=\"options-general.php?page='.basename(__FILE__).'\">'.__('Quick Adsense Setting').'</a></p>";'.
|
446 |
-
'echo "<input type=\"hidden\" id=\"WidCodeSubmit'.$i.'\" name=\"WidCodeSubmit'.$i.'\" value=\"true\" />";';
|
447 |
$displaycall[$i] = create_function('$args', $displaystr);
|
448 |
-
$
|
449 |
-
$wadsid =
|
450 |
-
|
451 |
-
register_widget_control($wadsid, $controlcall[$i]);
|
452 |
}
|
453 |
}
|
454 |
}
|
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.2
|
9 |
Author URI: http://quicksense.net/
|
10 |
*/
|
11 |
|
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.2';
|
38 |
$QData['URI'] = 'http://quicksense.net/';
|
39 |
$QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
|
40 |
$QData['Default'] = array(
|
41 |
'AdsDisp'=>'3',
|
42 |
+
'BegnAds'=>true,'BegnRnd'=>'1','EndiAds'=>true,'EndiRnd'=>'0','MiddAds'=>false,'MiddRnd'=>'0','MoreAds'=>false,'MoreRnd'=>'0','LapaAds'=>false,'LapaRnd'=>'0',
|
43 |
'Par1Ads'=>false,'Par1Rnd'=>'0','Par1Nup'=>'0','Par1Con'=>false,
|
44 |
'Par2Ads'=>false,'Par2Rnd'=>'0','Par2Nup'=>'0','Par2Con'=>false,
|
45 |
'Par3Ads'=>false,'Par3Rnd'=>'0','Par3Nup'=>'0','Par3Con'=>false,
|
46 |
+
'Img1Ads'=>false,'Img1Rnd'=>'0','Img1Nup'=>'0','Img1Con'=>true,
|
47 |
'AppPost'=>true,'AppPage'=>true,'AppHome'=>false,'AppCate'=>false,'AppArch'=>false,'AppTags'=>false,'AppMaxA'=>false,'AppSide'=>false,'AppLogg'=>false,
|
48 |
+
'QckTags'=>true,'QckRnds'=>false,'QckOffs'=>false,'QckOfPs'=>false
|
49 |
);
|
50 |
$QData['DefaultAdsOpt'] = array(
|
51 |
'AdsMargin'=>'10','AdsAlign'=>'2'
|
131 |
edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
|
132 |
edaddID[edaddID.length] = "random_ads";
|
133 |
edaddNm[edaddNm.length] = "RndAds";
|
|
|
134 |
<?php } ?>
|
135 |
<?php if(!get_option('QckOffs')){ ?>
|
136 |
edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
|
139 |
edButtons[edButtons.length]=new edButton("off_def","OffDef","\n<!--OffDef-->\n","","",-1);
|
140 |
edaddID[edaddID.length] = "off_def";
|
141 |
edaddNm[edaddNm.length] = "OffDef";
|
142 |
+
edButtons[edButtons.length]=new edButton("off_wid","OffWidget","\n<!--OffWidget-->\n","","",-1);
|
143 |
+
edaddID[edaddID.length] = "off_wid";
|
144 |
+
edaddNm[edaddNm.length] = "OffWidget";
|
145 |
<?php } ?>
|
146 |
+
<?php if(!get_option('QckOfPs')){ ?>
|
147 |
+
edButtons[edButtons.length]=new edButton("off_bgn","OffBegin","\n<!--OffBegin-->\n","","",-1);
|
148 |
+
edaddID[edaddID.length] = "off_bgn";
|
149 |
+
edaddNm[edaddNm.length] = "OffBegin";
|
150 |
+
edButtons[edButtons.length]=new edButton("off_mid","OffMiddle","\n<!--OffMiddle-->\n","","",-1);
|
151 |
+
edaddID[edaddID.length] = "off_mid";
|
152 |
+
edaddNm[edaddNm.length] = "OffMiddle";
|
153 |
+
edButtons[edButtons.length]=new edButton("off_end","OffEnd","\n<!--OffEnd-->\n","","",-1);
|
154 |
+
edaddID[edaddID.length] = "off_end";
|
155 |
+
edaddNm[edaddNm.length] = "OffEnd";
|
156 |
+
edButtons[edButtons.length]=new edButton("off_more","OffAfMore","\n<!--OffAfMore-->\n","","",-1);
|
157 |
+
edaddID[edaddID.length] = "off_more";
|
158 |
+
edaddNm[edaddNm.length] = "OffAfMore";
|
159 |
+
edButtons[edButtons.length]=new edButton("off_last","OffBfLastPara","\n<!--OffBfLastPara-->\n","","",-1);
|
160 |
+
edaddID[edaddID.length] = "off_last";
|
161 |
+
edaddNm[edaddNm.length] = "OffBfLastPara";
|
162 |
+
<?php } ?>
|
163 |
};
|
164 |
(function(){
|
165 |
if(typeof(edButtons)!='undefined' && typeof(jQuery)!='undefined' && wpvcomp){
|
193 |
|
194 |
/* verifying */
|
195 |
if( (is_feed()) ||
|
196 |
+
(strpos($content,'<!--NoAds-->')!==false) ||
|
197 |
+
(strpos($content,'<!--OffAds-->')!==false) ||
|
198 |
(is_single() && !(get_option('AppPost'))) ||
|
199 |
(is_page() && !(get_option('AppPage'))) ||
|
200 |
(is_home() && !(get_option('AppHome'))) ||
|
206 |
}
|
207 |
|
208 |
$AdsToShow = get_option('AdsDisp');
|
209 |
+
if (strpos($content,'<!--OffWidget-->')===false) {
|
210 |
+
for($i=1;$i<=$QData['AdsWid'];$i++) {
|
211 |
+
$wadsid = sanitize_title(str_replace(array('(',')'),'',sprintf($QData['AdsWidName'],$i)));
|
212 |
+
$AdsToShow -= (is_active_widget(true, $wadsid)) ? 1 : 0 ;
|
213 |
+
}
|
214 |
+
}
|
215 |
if( $ShownAds >= $AdsToShow ) { $content = clean_tags($content); return $content; };
|
216 |
|
217 |
if( !count($AdsId) ) {
|
225 |
if( !count($AdsId) ) { $content = clean_tags($content); return $content; };
|
226 |
|
227 |
/* ... Tidy up content ... */
|
228 |
+
$content = str_replace("<p></p>", "##QA-TP1##", $content);
|
229 |
+
$content = str_replace("<p> </p>", "##QA-TP2##", $content);
|
230 |
+
$offdef = (strpos($content,'<!--OffDef-->')!==false);
|
231 |
if( !$offdef ) {
|
232 |
$AdsIdCus = array();
|
233 |
$cusads = 'CusAds'; $cusrnd = 'CusRnd';
|
234 |
+
$more1 = get_option('MoreAds'); $more2 = get_option('MoreRnd');
|
235 |
+
$lapa1 = get_option('LapaAds'); $lapa2 = get_option('LapaRnd');
|
236 |
$begn1 = get_option('BegnAds'); $begn2 = get_option('BegnRnd');
|
237 |
$midd1 = get_option('MiddAds'); $midd2 = get_option('MiddRnd');
|
238 |
$endi1 = get_option('EndiAds'); $endi2 = get_option('EndiRnd');
|
240 |
for($i=1;$i<=$rc;$i++) {
|
241 |
$para1[$i] = get_option('Par'.$i.'Ads'); $para2[$i] = get_option('Par'.$i.'Rnd'); $para3[$i] = get_option('Par'.$i.'Nup'); $para4[$i] = get_option('Par'.$i.'Con');
|
242 |
}
|
243 |
+
$imge1 = get_option('Img1Ads'); $imge2 = get_option('Img1Rnd'); $imge3 = get_option('Img1Nup'); $imge4 = get_option('Img1Con');
|
244 |
if ( $begn2 == 0 ) { $b1 = $cusrnd; } else { $b1 = $cusads.$begn2; array_push($AdsIdCus, $begn2); };
|
245 |
if ( $more2 == 0 ) { $r1 = $cusrnd; } else { $r1 = $cusads.$more2; array_push($AdsIdCus, $more2); };
|
246 |
if ( $midd2 == 0 ) { $m1 = $cusrnd; } else { $m1 = $cusads.$midd2; array_push($AdsIdCus, $midd2); };
|
247 |
+
if ( $lapa2 == 0 ) { $g1 = $cusrnd; } else { $g1 = $cusads.$lapa2; array_push($AdsIdCus, $lapa2); };
|
248 |
if ( $endi2 == 0 ) { $b2 = $cusrnd; } else { $b2 = $cusads.$endi2; array_push($AdsIdCus, $endi2); };
|
249 |
for($i=1;$i<=$rc;$i++) {
|
250 |
if ( $para2[$i] == 0 ) { $b3[$i] = $cusrnd; } else { $b3[$i] = $cusads.$para2[$i]; array_push($AdsIdCus, $para2[$i]); };
|
251 |
}
|
252 |
if ( $imge2 == 0 ) { $b4 = $cusrnd; } else { $b4 = $cusads.$imge2; array_push($AdsIdCus, $imge2); };
|
253 |
+
if( $midd1 && strpos($content,'<!--OffMiddle-->')===false) {
|
254 |
if( substr_count(strtolower($content), '</p>')>=2 ) {
|
255 |
$sch = "</p>";
|
256 |
$content = str_replace("</P>", $sch, $content);
|
270 |
$content = implode($sch, $arr);
|
271 |
}
|
272 |
}
|
273 |
+
if( $more1 && strpos($content,'<!--OffAfMore-->')===false) {
|
274 |
$mmr = '<!--'.$r1.'-->';
|
275 |
$postid = get_the_ID();
|
276 |
$content = str_replace('<span id="more-'.$postid.'"></span>', $mmr, $content);
|
277 |
}
|
278 |
+
if( $begn1 && strpos($content,'<!--OffBegin-->')===false) {
|
279 |
$content = '<!--'.$b1.'-->'.$content;
|
280 |
}
|
281 |
+
if( $endi1 && strpos($content,'<!--OffEnd-->')===false) {
|
282 |
$content = $content.'<!--'.$b2.'-->';
|
283 |
}
|
284 |
+
if( $lapa1 && strpos($content,'<!--OffBfLastPara-->')===false){
|
285 |
+
$sch = "<p>";
|
286 |
+
$content = str_replace("<P>", $sch, $content);
|
287 |
+
$arr = explode($sch, $content);
|
288 |
+
if ( count($arr) > 2 ) {
|
289 |
+
$content = implode($sch, array_slice($arr, 0, count($arr)-1)) .'<!--'.$g1.'-->'. $sch. $arr[count($arr)-1];
|
290 |
+
}
|
291 |
+
}
|
292 |
for($i=$rc;$i>=1;$i--) {
|
293 |
if ( $para1[$i] ){
|
294 |
$sch = "</p>";
|
302 |
}
|
303 |
}
|
304 |
if ( $imge1 ){
|
305 |
+
$sch = "<img"; $bch = ">"; $cph = "[/caption]"; $csa = "</a>";
|
|
|
306 |
$content = str_replace("<IMG", $sch, $content);
|
307 |
+
$content = str_replace("</A>", $csa, $content);
|
308 |
$arr = explode($sch, $content);
|
309 |
if ( (int)$imge3 < count($arr) ) {
|
310 |
$trr = explode($bch, $arr[$imge3]);
|
311 |
+
if ( count($trr) > 1 ) {
|
312 |
+
$tss = explode($cph, $arr[$imge3]);
|
313 |
+
$ccp = ( count($tss) > 1 ) ? strpos(strtolower($tss[0]),'[caption ')===false : false ;
|
314 |
+
$tuu = explode($csa, $arr[$imge3]);
|
315 |
+
$cdu = ( count($tuu) > 1 ) ? strpos(strtolower($tuu[0]),'<a href')===false : false ;
|
316 |
+
if ( $imge4 && $ccp ) {
|
317 |
+
$arr[$imge3] = implode($cph, array_slice($tss, 0, 1)).$cph. "\r\n".'<!--'.$b4.'-->'."\r\n". implode($cph, array_slice($tss, 1));
|
318 |
+
}else if ( $cdu ) {
|
319 |
+
$arr[$imge3] = implode($csa, array_slice($tuu, 0, 1)).$csa. "\r\n".'<!--'.$b4.'-->'."\r\n". implode($csa, array_slice($tuu, 1));
|
320 |
+
}else{
|
321 |
+
$arr[$imge3] = implode($bch, array_slice($trr, 0, 1)).$bch. "\r\n".'<!--'.$b4.'-->'."\r\n". implode($bch, array_slice($trr, 1));
|
322 |
+
}
|
323 |
}
|
324 |
$content = implode($sch, $arr);
|
325 |
}
|
336 |
if( !$offdef ) {
|
337 |
for( $i=1; $i<=count($AdsIdCus); $i++ ) {
|
338 |
if( $showall || !$ismany || $beginend != $i ) {
|
339 |
+
if( strpos($content,'<!--'.$cusads.$AdsIdCus[$i-1].'-->')!==false && in_array($AdsIdCus[$i-1], $AdsId)) {
|
340 |
$content = replace_ads( $content, $cusads.$AdsIdCus[$i-1], $AdsIdCus[$i-1] ); $AdsId = del_element($AdsId, array_search($AdsIdCus[$i-1], $AdsId)) ;
|
341 |
$ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
|
342 |
$beginend = $i; if(!$showall && $ismany){break;}
|
349 |
if( $showall || !$ismany ) {
|
350 |
$tcn = count($AdsId); $tt = 0;
|
351 |
for( $i=1; $i<=$tcn; $i++ ) {
|
352 |
+
if( strpos($content, '<!--Ads'.$AdsId[$tt].'-->')!==false ) {
|
353 |
$content = replace_ads( $content, 'Ads'.$AdsId[$tt], $AdsId[$tt] ); $AdsId = del_element($AdsId, $tt) ;
|
354 |
$ShownAds += 1; if( $ShownAds >= $AdsToShow || !count($AdsId) ){ $content = clean_tags($content); return $content; };
|
355 |
} else {
|
359 |
}
|
360 |
|
361 |
/* ... Replace Beginning/Middle/End random Ads ... */
|
362 |
+
if( strpos($content, '<!--'.$cusrnd.'-->')!==false && ($showall || !$ismany) ) {
|
363 |
$tcx = count($AdsId);
|
364 |
$tcy = substr_count($content, '<!--'.$cusrnd.'-->');
|
365 |
for( $i=$tcx; $i<=$tcy-1; $i++ ) {
|
373 |
}
|
374 |
|
375 |
/* ... Replace RndAds ... */
|
376 |
+
if( strpos($content, '<!--RndAds-->')!==false && ($showall || !$ismany) ) {
|
377 |
$AdsIdTmp = array();
|
378 |
shuffle($AdsId);
|
379 |
for( $i=1; $i<=$AdsToShow-$ShownAds; $i++ ) {
|
393 |
if($tmp != -1){$ShownAds += 1;}; if( $ShownAds >= $AdsToShow || !count($AdsIdTmp) ){ $content = clean_tags($content); return $content; };
|
394 |
}
|
395 |
}
|
396 |
+
|
397 |
/* ... That's it. DONE :) ... */
|
398 |
$content = clean_tags($content); return $content;
|
399 |
}
|
402 |
global $ShownAds;
|
403 |
global $AdsId;
|
404 |
global $beginend;
|
405 |
+
$tagnames = array('EmptyClear','RndAds','NoAds','OffDef','OffAds','OffWidget','OffBegin','OffMiddle','OffEnd','OffBfMore','OffAfLastPara','CusRnd');
|
406 |
for($i=1;$i<=$QData['Ads'];$i++) { array_push($tagnames, 'CusAds'.$i); array_push($tagnames, 'Ads'.$i); };
|
407 |
foreach ($tagnames as $tgn) {
|
408 |
+
if(strpos($content,'<!--'.$tgn.'-->')!==false || $tgn=='EmptyClear') {
|
409 |
if($trimonly) {
|
410 |
$content = str_replace('<p><!--'.$tgn.'--></p>', '<!--'.$tgn.'-->', $content);
|
411 |
}else{
|
412 |
$content = str_replace(array('<p><!--'.$tgn.'--></p>','<!--'.$tgn.'-->'), '', $content);
|
413 |
+
$content = str_replace("##QA-TP1##", "<p></p>", $content);
|
414 |
+
$content = str_replace("##QA-TP2##", "<p> </p>", $content);
|
415 |
}
|
416 |
}
|
417 |
}
|
423 |
return $content;
|
424 |
}
|
425 |
function replace_ads($content, $nme, $adn) {
|
426 |
+
if( strpos($content,'<!--'.$nme.'-->')===false ) { return $content; }
|
427 |
global $QData;
|
428 |
if ($adn != -1) {
|
429 |
$arr = array('',
|
460 |
|
461 |
function ads_widget_register() {
|
462 |
global $QData;
|
463 |
+
if (!function_exists('wp_register_sidebar_widget')) { return; };
|
464 |
for($i=1;$i<=$QData['AdsWid'];$i++) {
|
465 |
if(get_option('WidCode'.$i)!='') {
|
466 |
$displaystr =
|
467 |
+
'$cont = get_the_content();'.
|
468 |
+
'if( strpos($cont,"<!--OffAds-->")===false && strpos($cont,"<!--OffWidget-->")===false && !(is_home()&&get_option("AppSide")) ) {'.
|
469 |
'extract($args);'.
|
470 |
'$title = get_option("WidCode-title-'.$i.'");'.
|
471 |
'$codetxt = get_option("WidCode'.$i.'");'.
|
477 |
'echo $codetxt;'.
|
478 |
'echo "\n".$after_widget;'.
|
479 |
'}';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
480 |
$displaycall[$i] = create_function('$args', $displaystr);
|
481 |
+
$wadnam = sprintf($QData['AdsWidName'],$i);
|
482 |
+
$wadsid = sanitize_title(str_replace(array('(',')'),'',$wadnam));
|
483 |
+
wp_register_sidebar_widget($wadsid, $wadnam, $displaycall[$i], array('description' => 'Quick Adsense on Sidebar Widget'));
|
|
|
484 |
}
|
485 |
}
|
486 |
}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
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.
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
@@ -16,15 +16,16 @@ In general, placing Adsense randomly within a post is a good way to experiment a
|
|
16 |
Here are some **features** that come with this plugin:
|
17 |
|
18 |
1. Absolutely NO author revenue reward or revenue sharing from your Adsense or that kind of features.
|
19 |
-
1. Default Ads positioning: Assign Ads to the beginning of post, assign Ads to the middle of post, assign Ads to the end of post, assign Ads after certain paragraphs (3 options available) & assign Ads after certain images.
|
20 |
1. Flexible Ads placement, insert Ads specifically or randomly anywhere within a post.
|
21 |
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.
|
22 |
1. Support any Ads code, not limited to Adsense code only.
|
23 |
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.
|
24 |
1. Support up to a maximum of 10 Ads codes on Sidebar Widgets.
|
25 |
1. Support up to a maximum of 10 Ads codes for specific placement & randomization within a post.
|
26 |
-
1. Ads
|
27 |
-
1.
|
|
|
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 |
|
@@ -48,6 +49,13 @@ Please feedback to [http://quicksense.net/](http://quicksense.net/) for any bug
|
|
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.
|
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.1
|
6 |
+
Stable tag: 1.9.2
|
7 |
|
8 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
9 |
|
16 |
Here are some **features** that come with this plugin:
|
17 |
|
18 |
1. Absolutely NO author revenue reward or revenue sharing from your Adsense or that kind of features.
|
19 |
+
1. Default Ads positioning: Assign Ads to the beginning of post, assign Ads to the middle of post, assign Ads to the end of post, assign Ads after 'more' tag, assign Ads before last paragraph, assign Ads after certain paragraphs (3 options available) & assign Ads after certain images.
|
20 |
1. Flexible Ads placement, insert Ads specifically or randomly anywhere within a post.
|
21 |
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.
|
22 |
1. Support any Ads code, not limited to Adsense code only.
|
23 |
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.
|
24 |
1. Support up to a maximum of 10 Ads codes on Sidebar Widgets.
|
25 |
1. Support up to a maximum of 10 Ads codes for specific placement & randomization within a post.
|
26 |
+
1. Insert Ads on-the-fly, simply insert <!--Ads1-->, <!--Ads2--> ... , <!--RndAds--> to a post to accomplish this.
|
27 |
+
1. Disable Ads on-the-fly, simply insert <!--NoAds-->, <!--OffDef-->, <!--OffWidget-->, <!--OffBegin--> ... and more to a post to accomplish this.
|
28 |
+
1. The above Tags 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.
|
31 |
|
49 |
|
50 |
== Change Log ==
|
51 |
|
52 |
+
= 1.9.2 =
|
53 |
+
* Update the depreciated wp code function for AdsWidget in the plugin.
|
54 |
+
* New Feature - Enable user to insert Ads after Image's outer div wp-caption & not just right below the image.
|
55 |
+
* New Feature - Enable user to insert Ads before the last paragraph of the post.
|
56 |
+
* New Feature - Option to disable ads at particular positions, such as Beginning, Middle & End of post, ads on Sidebar, ads after 'more' tag and ads before last paragraph.
|
57 |
+
* Date: 8-May-2013
|
58 |
+
|
59 |
= 1.9.1 =
|
60 |
* Bug Fix - Fix the Quicktag Buttons display error on the HTML Edit Post SubPanel.
|
61 |
* Bug Fix - Fix the conflict with Jetpack by WordPress.com & some other plugins.
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|