Version Description
Major re-organization of the code.
=
Download this release
Release Info
Developer | manojtd |
Plugin | Easy Plugin for AdSense |
Version | 6.00 |
Comparing to | |
See all releases |
Code changes from version 5.24 to 6.00
- admin.php +88 -88
- easy-adsense-lite.php +457 -566
- lang/easy-translator.php +13 -6
- readme.txt +5 -4
- screenshot-1.gif +0 -0
admin.php
CHANGED
@@ -39,8 +39,8 @@ else {
|
|
39 |
<?php
|
40 |
$plgDir = dirname(__FILE__) ;
|
41 |
$plgName = 'easy-adsense' ;
|
42 |
-
if (
|
43 |
-
if (
|
44 |
?>
|
45 |
<table class="form-table">
|
46 |
<tr><th scope="row"><h3><?php _e('Instructions', 'easy-adsenser') ; ?></h3></th></tr>
|
@@ -73,7 +73,7 @@ printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em
|
|
73 |
<br />
|
74 |
|
75 |
<table class="form-table">
|
76 |
-
<tr><th scope="row"><h3><?php printf(__('Options (for the %s theme)', 'easy-adsenser'),
|
77 |
</table>
|
78 |
|
79 |
<table width="100%">
|
@@ -111,31 +111,31 @@ printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em
|
|
111 |
<td width="50%" height="220px" valign="middle">
|
112 |
<b><?php _e('Lead-in AdSense Text', 'easy-adsenser') ; ?></b>
|
113 |
<?php _e('(Appears near the beginning of the post)', 'easy-adsenser') ; ?><br />
|
114 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextLeadin" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($
|
115 |
<br />
|
116 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
117 |
-
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezLeadInWC" name="ezLeadInWC" value="<?php echo(stripslashes(htmlspecialchars($
|
118 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLeadInMargin" name="ezLeadInMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
119 |
<br />
|
120 |
|
121 |
<label for="ezHeaderLeadin" onmouseover="Tip('<?php _e('Select where you would like to show the lead-in ad block. A placement above or below the blog header would be suitable for a wide AdSense block.', 'easy-adsenser') ; echo (htmlspecialchars('<br />Note that <b>Below Header</b> and <b>End of Page</b> options are hacks that may not be compatible with the WordPress default widget for <b>Recent Posts</b> or anything else that may use DB queries or loops. If you have problems with your sidebars and/or font sizes, please choose some other <b>Postion</b> option.')) ; ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
122 |
<?php _e('Position:', 'easy-adsenser') ; ?>
|
123 |
<select style="width:30%;" id="ezHeaderLeadin" name="ezHeaderLeadin">
|
124 |
-
<option <?php if ($
|
125 |
-
<option <?php if ($
|
126 |
-
<option <?php if ($
|
127 |
</select>
|
128 |
</label>
|
129 |
|
130 |
<label for="ezAdSenseShowLeadin" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
131 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
132 |
<select style="width:42%;" id="ezAdSenseShowLeadin" name="ezAdSenseShowLeadin">
|
133 |
-
<option <?php if ($
|
134 |
-
<option <?php if ($
|
135 |
-
<option <?php if ($
|
136 |
-
<option <?php if ($
|
137 |
-
<option <?php if ($
|
138 |
-
<option <?php if ($
|
139 |
</select>
|
140 |
</label>
|
141 |
<br />
|
@@ -145,23 +145,23 @@ printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em
|
|
145 |
<td width="50%" height="220px" valign="middle">
|
146 |
<b><?php _e('Mid-Post AdSense Text', 'easy-adsenser') ; ?></b>
|
147 |
<?php _e('(Appears near the middle of the post)', 'easy-adsenser') ; ?><br />
|
148 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextMidtext" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($
|
149 |
<br />
|
150 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
151 |
-
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezMidTextWC" name="ezMidTextWC" value="<?php echo(stripslashes(htmlspecialchars($
|
152 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezMidTextMargin" name="ezMidTextMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
153 |
<br />
|
154 |
<label for="ezForceMidAd" onmouseover="Tip('<?php _e('Force mid-text ad (if enabled) even in short posts.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Force Mid-post Ad', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
155 |
-
<input type="checkbox" id="ezForceMidAd" name="ezForceMidAd" <?php if ($
|
156 |
<label for="ezAdSenseShowMidtext" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
157 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
158 |
<select style="width:42%;" id="ezAdSenseShowMidtext" name="ezAdSenseShowMidtext">
|
159 |
-
<option <?php if ($
|
160 |
-
<option <?php if ($
|
161 |
-
<option <?php if ($
|
162 |
-
<option <?php if ($
|
163 |
-
<option <?php if ($
|
164 |
-
<option <?php if ($
|
165 |
</select>
|
166 |
</label>
|
167 |
|
@@ -171,32 +171,32 @@ printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em
|
|
171 |
<td width="50%" height="250px" valign="middle">
|
172 |
<b><?php _e('Post Lead-out AdSense Text', 'easy-adsenser') ; ?></b>
|
173 |
<?php _e('(Appears near the end of the post)', 'easy-adsenser') ; ?><br />
|
174 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextLeadout" style="width: 95%; height: 162px;"><?php echo(stripslashes(htmlspecialchars($
|
175 |
<br />
|
176 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
177 |
-
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezLeadOutWC" name="ezLeadOutWC" value="<?php echo(stripslashes(htmlspecialchars($
|
178 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLeadOutMargin" name="ezLeadOutMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
179 |
<br />
|
180 |
|
181 |
<label for="ezFooterLeadout" onmouseover="Tip('<?php _e('Select where you would like to show the lead-out ad block. A placement above or below the blog footer would be suitable for a wide AdSense block.', 'easy-adsenser') ; echo (htmlspecialchars('<br />Note that <b>Below Header</b> and <b>End of Page</b> options are hacks that may not be compatible with the WordPress default widget for <b>Recent Posts</b> or anything else that may use DB queries or loops. If you have problems with your sidebars and/or font sizes, please choose some other <b>Position</b> option.')) ; ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
182 |
<?php _e('Position:', 'easy-adsenser') ; ?>
|
183 |
<select style="width:30%;" id="ezFooterLeadout" name="ezFooterLeadout">
|
184 |
-
<option <?php if ($
|
185 |
-
<option <?php if ($
|
186 |
-
<option <?php if ($
|
187 |
-
<option <?php if ($
|
188 |
</select>
|
189 |
</label>
|
190 |
|
191 |
<label for="ezAdSenseShowLeadout" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
192 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
193 |
<select style="width:42%;" id="ezAdSenseShowLeadout" name="ezAdSenseShowLeadout">
|
194 |
-
<option <?php if ($
|
195 |
-
<option <?php if ($
|
196 |
-
<option <?php if ($
|
197 |
-
<option <?php if ($
|
198 |
-
<option <?php if ($
|
199 |
-
<option <?php if ($
|
200 |
</select>
|
201 |
</label>
|
202 |
<br />
|
@@ -211,52 +211,52 @@ printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em
|
|
211 |
<font size="-2"></font>
|
212 |
<br />
|
213 |
<label for="ezAdSenseMax3">
|
214 |
-
<input type="radio" id="ezAdSenseMax3" name="ezAdSenseMax" value="3" <?php if ($
|
215 |
<label for="ezAdSenseMax2">
|
216 |
-
<input type="radio" id="ezAdSenseMax2" name="ezAdSenseMax" value="2" <?php if ($
|
217 |
<label for="ezAdSenseMax1">
|
218 |
-
<input type="radio" id="ezAdSenseMax1" name="ezAdSenseMax" value="1" <?php if ($
|
219 |
<label for="ezAdSenseMax0">
|
220 |
-
<input type="radio" id="ezAdSenseMax0" name="ezAdSenseMax" value="0" <?php if ($
|
221 |
<label for="ezAdSenseMax9">
|
222 |
-
<input type="radio" id="ezAdSenseMax9" name="ezAdSenseMax" value="99" <?php if ($
|
223 |
|
224 |
-
<?php if (get_bloginfo('version') < 2.8) {_e('Number of Link Units widgets (≤ 3) [Google serves only three]:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLimitLU" name="ezLimitLU" value="<?php echo(stripslashes(htmlspecialchars($
|
225 |
|
226 |
<b><?php _e('Suppress AdSense Ad Blocks on:', 'easy-adsenser') ; ?></b>
|
227 |
-
<input type="checkbox" id="ezKillPages" name="ezKillPages" value="true" <?php if ($
|
228 |
<label for="ezKillAttach" title="<?php _e('Pages that show attachments', 'easy-adsenser') ; ?>">
|
229 |
-
<input type="checkbox" id="ezKillAttach" name="ezKillAttach" <?php if ($
|
230 |
<label for="ezKillHome" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
|
231 |
-
<input type="checkbox" id="ezKillHome" name="ezKillHome" <?php if ($
|
232 |
<label for="ezKillFront" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
|
233 |
-
<input type="checkbox" id="ezKillFront" name="ezKillFront" <?php if ($
|
234 |
<br />
|
235 |
<label for="ezKillCat" title="<?php _e('Pages that come up when you click on category names', 'easy-adsenser') ; ?>">
|
236 |
-
<input type="checkbox" id="ezKillCat" name="ezKillCat" <?php if ($
|
237 |
<label for="ezKillTag" title="<?php _e('Pages that come up when you click on tag names', 'easy-adsenser') ; ?>">
|
238 |
-
<input type="checkbox" id="ezKillTag" name="ezKillTag" <?php if ($
|
239 |
<label for="ezKillArchive" title="<?php _e('Pages that come up when you click on year/month archives', 'easy-adsenser') ; ?>">
|
240 |
-
<input type="checkbox" id="ezKillArchive" name="ezKillArchive" <?php if ($
|
241 |
<br style="line-height: 5px;" />
|
242 |
|
243 |
<b><?php _e('Other Options', 'easy-adsenser') ; ?></b><br />
|
244 |
<!-- <label for="ezAllowFeeds">
|
245 |
-
<input type="checkbox" id="ezAllowFeeds" name="ezAllowFeeds" <?php if ($
|
246 |
<label for="ezForceWidget">
|
247 |
-
<input type="checkbox" id="ezForceWidget" name="ezForceWidget" <?php if ($
|
248 |
|
249 |
<label for="ezShowBorders" onmouseover="Tip('<?php _e('Google Policy says that you may not direct user attention to the ads via arrows or other graphical gimmicks. Please convince yourself that showing a mouseover decoration does not violate this Google statement before enabling this option.', 'easy-adsenser') ?>',WIDTH, 240, TITLE, 'Your call')" onmouseout="UnTip()" >
|
250 |
-
<input type="checkbox" id="ezShowBorders" name="ezShowBorders" <?php if ($
|
251 |
<label for="ezBorderWidget" title="<?php _e('Show the same border on the sidebar widget as well?', 'easy-adsenser') ; ?>">
|
252 |
-
<input type="checkbox" id="ezBorderWidget" name="ezBorderWidget" <?php if ($
|
253 |
<label for="ezBorderLU" title="<?php _e('Show the same border on the link units too?', 'easy-adsenser') ; ?>">
|
254 |
-
<input type="checkbox" id="ezBorderLU" name="ezBorderLU" <?php if ($
|
255 |
-
Width: <input style="width:25px;text-align:center;" id="ezBorderWidth" name="ezBorderWidth" value="<?php echo(stripslashes(htmlspecialchars($
|
256 |
-
Colors: Normal:#<input style="width:55px;text-align:center;" id="ezBorderNormal" name="ezBorderNormal" value="<?php echo(stripslashes(htmlspecialchars($
|
257 |
|
258 |
<label for="ezKillInLine" onmouseover="Tip('<?php _e('All <code>&lt;div&gt;</code>s that <em>Easy AdSense</em> creates have the class attribute <code>adsense</code>. Furthermore, they have class attributes like <code>adsense-leadin</code>, <code>adsense-midtext</code>, <code>adsense-leadout</code>, <code>adsense-widget</code> and <code>adsense-lu</code> depending on the type. You can set the style for these classes in your theme <code>style.css</code> to control their appearance.<br />If this is all Greek to you, please leave the option unchecked.', 'easy-adsenser'); ?>',WIDTH, 290, TITLE, 'CSS vs. In-Line')" onmouseout="UnTip()" >
|
259 |
-
<input type="checkbox" id="ezKillInLine" name="ezKillInLine" <?php if ($
|
260 |
</td>
|
261 |
</tr>
|
262 |
</table>
|
@@ -269,67 +269,67 @@ Colors: Normal:#<input style="width:55px;text-align:center;" id="ezBorderN
|
|
269 |
<td width="50%" height="220px" valign="middle">
|
270 |
<b><?php _e('AdSense Widget Text', 'easy-adsenser') ; ?></b>
|
271 |
<?php _e('(Appears in the Sidebar as a Widget)', 'easy-adsenser') ; ?><br />
|
272 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextWidget" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($
|
273 |
<br />
|
274 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
275 |
<?php _e('(Where to show?)', 'easy-adsenser') ; ?>
|
276 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezWidgetMargin" name="ezWidgetMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
277 |
<br />
|
278 |
<label for="ezAdSenseShowWidget_left">
|
279 |
-
<input type="radio" id="ezAdSenseShowWidget_left" name="ezAdSenseShowWidget" value="text-align:left" <?php if ($
|
280 |
<label for="ezAdSenseShowWidget_center">
|
281 |
-
<input type="radio" id="ezAdSenseShowWidget_center" name="ezAdSenseShowWidget" value="text-align:center" <?php if ($
|
282 |
<label for="ezAdSenseShowWidget_right">
|
283 |
-
<input type="radio" id="ezAdSenseShowWidget_right" name="ezAdSenseShowWidget" value="text-align:right" <?php if ($
|
284 |
<label for="ezAdSenseShowWidget_no">
|
285 |
-
<input type="radio" id="ezAdSenseShowWidget_no" name="ezAdSenseShowWidget" value="no" <?php if ($
|
286 |
-
<label for="ezAdWidgetTitle"><b><?php _e('Widget Title:', 'easy-adsenser') ; ?></b> <input style="width:200px" id="ezAdWidgetTitle" name="ezAdWidgetTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($
|
287 |
-
<label for="ezAdKillWidgetTitle"><input type="checkbox" id="ezAdKillWidgetTitle" name="ezAdKillWidgetTitle" <?php if ($
|
288 |
</td>
|
289 |
</tr>
|
290 |
<tr valign="top">
|
291 |
<td width="50%" height="220px" valign="middle">
|
292 |
<b><?php _e('AdSense Link-Units Text', 'easy-adsenser') ; ?></b>
|
293 |
<?php _e('(Appears in the Sidebar as Widgets)', 'easy-adsenser') ; ?><br />
|
294 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextLU" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($
|
295 |
<br />
|
296 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
297 |
<?php _e('(Where to show?)', 'easy-adsenser') ; ?>
|
298 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLUMargin" name="ezLUMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
299 |
<br />
|
300 |
<label for="ezAdSenseShowLU_left">
|
301 |
-
<input type="radio" id="ezAdSenseShowLU_left" name="ezAdSenseShowLU" value="text-align:left" <?php if ($
|
302 |
<label for="ezAdSenseShowLU_center">
|
303 |
-
<input type="radio" id="ezAdSenseShowLU_center" name="ezAdSenseShowLU" value="text-align:center" <?php if ($
|
304 |
<label for="ezAdSenseShowLU_right">
|
305 |
-
<input type="radio" id="ezAdSenseShowLU_right" name="ezAdSenseShowLU" value="text-align:right" <?php if ($
|
306 |
<label for="ezAdSenseShowLU_no">
|
307 |
-
<input type="radio" id="ezAdSenseShowLU_no" name="ezAdSenseShowLU" value="no" <?php if ($
|
308 |
-
<label for="ezAdLUTitle"><b><?php _e('Link Unit Title:', 'easy-adsenser') ; ?></b> <input style="width: 200px;" id="ezAdLUTitle" name="ezAdLUTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($
|
309 |
-
<label for="ezAdKillLUTitle"><input type="checkbox" id="ezAdKillLUTitle" name="ezAdKillLUTitle" <?php if ($
|
310 |
</td>
|
311 |
</tr>
|
312 |
<tr valign="top">
|
313 |
<td width="50%" height="250px" valign="middle">
|
314 |
<b><?php _e('Google Search Widget', 'easy-adsenser') ; ?></b>
|
315 |
<?php _e('(Adds a Google Search Box to your sidebar)', 'easy-adsenser') ; ?><br />
|
316 |
-
<textarea cols="50" rows="15" name="ezAdSenseTextGSearch" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($
|
317 |
<br />
|
318 |
<b><?php _e('Search Title', 'easy-adsenser') ; ?></b>
|
319 |
<?php _e('(Title of the Google Search Widget)', 'easy-adsenser') ; ?>
|
320 |
-
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezSearchMargin" name="ezSearchMargin" value="<?php echo(stripslashes(htmlspecialchars($
|
321 |
<br />
|
322 |
<label for="ezAdSenseShowGSearch_dark">
|
323 |
-
<input type="radio" id="ezAdSenseShowGSearch_dark" name="ezAdSenseShowGSearch" value="dark" <?php if ($
|
324 |
<label for="ezAdSenseShowGSearch_light">
|
325 |
-
<input type="radio" id="ezAdSenseShowGSearch_light" name="ezAdSenseShowGSearch" value="light" <?php if ($
|
326 |
<label for="ezAdSenseShowGSearch_no">
|
327 |
-
<input type="radio" id="ezAdSenseShowGSearch_no" name="ezAdSenseShowGSearch" value="no" <?php if ($
|
328 |
<label for="ezAdSenseShowGSearch_text">
|
329 |
-
<input type="radio" id="ezAdSenseShowGSearch_text" name="ezAdSenseShowGSearch" value="text" <?php $title = $
|
330 |
<label for="ezAdSearchTitle">
|
331 |
-
<input style="width: 200px;" id="ezAdSearchTitle" name="ezAdSearchTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($
|
332 |
-
<label for="ezAdKillSearchTitle"><input type="checkbox" id="ezAdKillSearchTitle" name="ezAdKillSearchTitle" <?php if ($
|
333 |
</td>
|
334 |
</tr>
|
335 |
</table>
|
@@ -343,13 +343,13 @@ Colors: Normal:#<input style="width:55px;text-align:center;" id="ezBorderN
|
|
343 |
<b><?php _e('Link-backs to', 'easy-adsenser') ; ?> <a href="http://www.Thulasidas.com" target="_blank">Unreal Blog</a></b>
|
344 |
<?php _e('(Consider showing at least one link.)', 'easy-adsenser') ; ?><br />
|
345 |
<label for="ezAdSenseLinkMax99">
|
346 |
-
<input type="radio" id="ezAdSenseLinkMax99" name="ezAdSenseLinkMax" value="99" <?php if ($
|
347 |
<label for="ezAdSenseLinkMax1">
|
348 |
-
<input type="radio" id="ezAdSenseLinkMax1" name="ezAdSenseLinkMax" value="1" <?php if ($
|
349 |
<label for="ezAdSenseLinkMax-1">
|
350 |
-
<input type="radio" id="ezAdSenseLinkMax-1" name="ezAdSenseLinkMax" value="-1" <?php if ($
|
351 |
<label for="ezAdSenseLinkMax0">
|
352 |
-
<input type="radio" id="ezAdSenseLinkMax0" name="ezAdSenseLinkMax" value="0" <?php if ($
|
353 |
<br />
|
354 |
<br style="line-height: 12px;" />
|
355 |
<?php echo '<span onmouseover="TagToTip(\'pro\', WIDTH, 350, TITLE, \'Buy the Pro Version\',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])"><b>Buy the <a href="http://buy.thulasidas.com/easy-adsense" target="_blank" ' . "onclick=\"popupwindow('http://buy.thulasidas.com/easy-adsense','Get Easy AdSense Pro', 1024, 768);return false;\"" . '>Pro Version</a></b><br />More features, more power!</span>' ; ?>
|
@@ -449,7 +449,7 @@ no', 'easy-adsenser') ;?>
|
|
449 |
<b><?php _e('Kill this plugin. (Are you quite sure?)', 'easy-adsenser') ?></b></span>
|
450 |
|
451 |
<?php
|
452 |
-
if (!$
|
453 |
echo '<div style="background-color:#cff;padding:5px;border: solid 1px;margin:5px;">' ;
|
454 |
@include (dirname (__FILE__).'/why-pro.php');
|
455 |
echo '</div>' ;
|
39 |
<?php
|
40 |
$plgDir = dirname(__FILE__) ;
|
41 |
$plgName = 'easy-adsense' ;
|
42 |
+
if (empty($this->options['kill_rating'])) renderRating($myPlugins[$plgName], $plgDir) ;
|
43 |
+
if (empty($this->options['kill_invites'])) renderInvite($myPlugins[$plgName], $plgName) ;
|
44 |
?>
|
45 |
<table class="form-table">
|
46 |
<tr><th scope="row"><h3><?php _e('Instructions', 'easy-adsenser') ; ?></h3></th></tr>
|
73 |
<br />
|
74 |
|
75 |
<table class="form-table">
|
76 |
+
<tr><th scope="row"><h3><?php printf(__('Options (for the %s theme)', 'easy-adsenser'), get_option('stylesheet')); ?> </h3></th></tr>
|
77 |
</table>
|
78 |
|
79 |
<table width="100%">
|
111 |
<td width="50%" height="220px" valign="middle">
|
112 |
<b><?php _e('Lead-in AdSense Text', 'easy-adsenser') ; ?></b>
|
113 |
<?php _e('(Appears near the beginning of the post)', 'easy-adsenser') ; ?><br />
|
114 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextLeadin" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_leadin']))) ?></textarea>
|
115 |
<br />
|
116 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
117 |
+
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezLeadInWC" name="ezLeadInWC" value="<?php echo(stripslashes(htmlspecialchars($this->options['wc_leadin'])));?>" /></span>
|
118 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLeadInMargin" name="ezLeadInMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_leadin'])));?>" />px</span>
|
119 |
<br />
|
120 |
|
121 |
<label for="ezHeaderLeadin" onmouseover="Tip('<?php _e('Select where you would like to show the lead-in ad block. A placement above or below the blog header would be suitable for a wide AdSense block.', 'easy-adsenser') ; echo (htmlspecialchars('<br />Note that <b>Below Header</b> and <b>End of Page</b> options are hacks that may not be compatible with the WordPress default widget for <b>Recent Posts</b> or anything else that may use DB queries or loops. If you have problems with your sidebars and/or font sizes, please choose some other <b>Postion</b> option.')) ; ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
122 |
<?php _e('Position:', 'easy-adsenser') ; ?>
|
123 |
<select style="width:30%;" id="ezHeaderLeadin" name="ezHeaderLeadin">
|
124 |
+
<option <?php if ($this->options['header_leadin'] == 'send_headers') { echo('selected="selected"'); }?> value ="send_headers"><?php _e('Above Header', 'easy-adsenser') ?></option>
|
125 |
+
<option <?php if ($this->options['header_leadin'] == 'the_content') { echo('selected="selected"'); }?> value ="the_content"><?php _e('Below Header', 'easy-adsenser') ?></option>
|
126 |
+
<option <?php if ($this->options['header_leadin'] == '') { echo('selected="selected"'); }?> value =""><?php _e('Beginning of Post', 'easy-adsenser') ?></option>
|
127 |
</select>
|
128 |
</label>
|
129 |
|
130 |
<label for="ezAdSenseShowLeadin" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
131 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
132 |
<select style="width:42%;" id="ezAdSenseShowLeadin" name="ezAdSenseShowLeadin">
|
133 |
+
<option <?php if ($this->options['show_leadin'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Lead-in Ad', 'easy-adsenser') ?></option>
|
134 |
+
<option <?php if ($this->options['show_leadin'] == 'float:left') { echo('selected="selected"'); }?> value ="float:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
135 |
+
<option <?php if ($this->options['show_leadin'] == 'text-align:left') { echo('selected="selected"'); }?> value ="text-align:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
136 |
+
<option <?php if ($this->options['show_leadin'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
|
137 |
+
<option <?php if ($this->options['show_leadin'] == 'float:right') { echo('selected="selected"'); }?> value ="float:right"><?php _e('Align Right', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
138 |
+
<option <?php if ($this->options['show_leadin'] == 'text-align:right') { echo('selected="selected"'); }?> value ="text-align:right"><?php _e('Align Rigth', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
139 |
</select>
|
140 |
</label>
|
141 |
<br />
|
145 |
<td width="50%" height="220px" valign="middle">
|
146 |
<b><?php _e('Mid-Post AdSense Text', 'easy-adsenser') ; ?></b>
|
147 |
<?php _e('(Appears near the middle of the post)', 'easy-adsenser') ; ?><br />
|
148 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextMidtext" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_midtext']))) ?></textarea>
|
149 |
<br />
|
150 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
151 |
+
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezMidTextWC" name="ezMidTextWC" value="<?php echo(stripslashes(htmlspecialchars($this->options['wc_midtext'])));?>" /></span>
|
152 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezMidTextMargin" name="ezMidTextMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_midtext'])));?>" />px</span>
|
153 |
<br />
|
154 |
<label for="ezForceMidAd" onmouseover="Tip('<?php _e('Force mid-text ad (if enabled) even in short posts.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Force Mid-post Ad', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
155 |
+
<input type="checkbox" id="ezForceMidAd" name="ezForceMidAd" <?php if ($this->options['force_midad']) { echo('checked="checked"'); }?> /> <?php _e('Force Mid-post Ad', 'easy-adsenser') ; ?></label>
|
156 |
<label for="ezAdSenseShowMidtext" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
157 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
158 |
<select style="width:42%;" id="ezAdSenseShowMidtext" name="ezAdSenseShowMidtext">
|
159 |
+
<option <?php if ($this->options['show_midtext'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Mid-post Ad', 'easy-adsenser') ?></option>
|
160 |
+
<option <?php if ($this->options['show_midtext'] == 'float:left') { echo('selected="selected"'); }?> value ="float:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
161 |
+
<option <?php if ($this->options['show_midtext'] == 'text-align:left') { echo('selected="selected"'); }?> value ="text-align:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
162 |
+
<option <?php if ($this->options['show_midtext'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
|
163 |
+
<option <?php if ($this->options['show_midtext'] == 'float:right') { echo('selected="selected"'); }?> value ="float:right"><?php _e('Align Right', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
164 |
+
<option <?php if ($this->options['show_midtext'] == 'text-align:right') { echo('selected="selected"'); }?> value ="text-align:right"><?php _e('Align Rigth', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
165 |
</select>
|
166 |
</label>
|
167 |
|
171 |
<td width="50%" height="250px" valign="middle">
|
172 |
<b><?php _e('Post Lead-out AdSense Text', 'easy-adsenser') ; ?></b>
|
173 |
<?php _e('(Appears near the end of the post)', 'easy-adsenser') ; ?><br />
|
174 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextLeadout" style="width: 95%; height: 162px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_leadout']))) ?></textarea>
|
175 |
<br />
|
176 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
177 |
+
<span onmouseover="Tip('<?php _e('Suppress this ad block if the post is not at least this many words long. Enter 0 or a small number if you do not want to suppress ads based on the number of words in the page/post.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Min. Word Count', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Min. Word Count', 'easy-adsenser') ; ?>: <input style="width:40px;text-align:center;" id="ezLeadOutWC" name="ezLeadOutWC" value="<?php echo(stripslashes(htmlspecialchars($this->options['wc_leadout'])));?>" /></span>
|
178 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLeadOutMargin" name="ezLeadOutMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_leadout'])));?>" />px</span>
|
179 |
<br />
|
180 |
|
181 |
<label for="ezFooterLeadout" onmouseover="Tip('<?php _e('Select where you would like to show the lead-out ad block. A placement above or below the blog footer would be suitable for a wide AdSense block.', 'easy-adsenser') ; echo (htmlspecialchars('<br />Note that <b>Below Header</b> and <b>End of Page</b> options are hacks that may not be compatible with the WordPress default widget for <b>Recent Posts</b> or anything else that may use DB queries or loops. If you have problems with your sidebars and/or font sizes, please choose some other <b>Position</b> option.')) ; ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
182 |
<?php _e('Position:', 'easy-adsenser') ; ?>
|
183 |
<select style="width:30%;" id="ezFooterLeadout" name="ezFooterLeadout">
|
184 |
+
<option <?php if ($this->options['footer_leadout'] == '') { echo('selected="selected"'); }?> value =""><?php _e('End of Post', 'easy-adsenser') ?></option>
|
185 |
+
<option <?php if ($this->options['footer_leadout'] == 'loop_end') { echo('selected="selected"'); }?> value ="loop_end"><?php _e('End of Page', 'easy-adsenser') ?></option>
|
186 |
+
<option <?php if ($this->options['footer_leadout'] == 'get_footer') { echo('selected="selected"'); }?> value ="get_footer"><?php _e('Above Footer', 'easy-adsenser') ?></option>
|
187 |
+
<option <?php if ($this->options['footer_leadout'] == 'wp_footer') { echo('selected="selected"'); }?> value ="wp_footer"><?php _e('Below Footer', 'easy-adsenser') ?></option>
|
188 |
</select>
|
189 |
</label>
|
190 |
|
191 |
<label for="ezAdSenseShowLeadout" onmouseover="Tip('<?php _e('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('(Where to show?)', 'easy-adsenser') ?>')" onmouseout="UnTip()">
|
192 |
<?php _e('Show:', 'easy-adsenser') ; ?>
|
193 |
<select style="width:42%;" id="ezAdSenseShowLeadout" name="ezAdSenseShowLeadout">
|
194 |
+
<option <?php if ($this->options['show_leadout'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Lead-out Ad', 'easy-adsenser') ?></option>
|
195 |
+
<option <?php if ($this->options['show_leadout'] == 'float:left') { echo('selected="selected"'); }?> value ="float:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
196 |
+
<option <?php if ($this->options['show_leadout'] == 'text-align:left') { echo('selected="selected"'); }?> value ="text-align:left"><?php _e('Align Left', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
197 |
+
<option <?php if ($this->options['show_leadout'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
|
198 |
+
<option <?php if ($this->options['show_leadout'] == 'float:right') { echo('selected="selected"'); }?> value ="float:right"><?php _e('Align Right', 'easy-adsenser'); echo ', ' ; _e('Text-wrapped', 'easy-adsenser'); ?></option>
|
199 |
+
<option <?php if ($this->options['show_leadout'] == 'text-align:right') { echo('selected="selected"'); }?> value ="text-align:right"><?php _e('Align Rigth', 'easy-adsenser'); echo ', ' ; _e('No wrap', 'easy-adsenser'); ?></option>
|
200 |
</select>
|
201 |
</label>
|
202 |
<br />
|
211 |
<font size="-2"></font>
|
212 |
<br />
|
213 |
<label for="ezAdSenseMax3">
|
214 |
+
<input type="radio" id="ezAdSenseMax3" name="ezAdSenseMax" value="3" <?php if ($this->options['max_count'] == 3) { echo('checked="checked"'); }?> /> <?php _e('Three ad blocks (including the side bar widget, if enabled).', 'easy-adsenser') ; ?></label><br />
|
215 |
<label for="ezAdSenseMax2">
|
216 |
+
<input type="radio" id="ezAdSenseMax2" name="ezAdSenseMax" value="2" <?php if ($this->options['max_count'] == 2) { echo('checked="checked"'); }?> /> <?php _e('Two ad blocks.', 'easy-adsenser') ; ?></label>
|
217 |
<label for="ezAdSenseMax1">
|
218 |
+
<input type="radio" id="ezAdSenseMax1" name="ezAdSenseMax" value="1" <?php if ($this->options['max_count'] == 1) { echo('checked="checked"'); }?> /> <?php _e('One ad block.', 'easy-adsenser') ; ?></label>
|
219 |
<label for="ezAdSenseMax0">
|
220 |
+
<input type="radio" id="ezAdSenseMax0" name="ezAdSenseMax" value="0" <?php if ($this->options['max_count'] == 0) { echo('checked="checked"'); }?> /> <?php _e('No ad blocks in posts.', 'easy-adsenser') ; ?></label><br />
|
221 |
<label for="ezAdSenseMax9">
|
222 |
+
<input type="radio" id="ezAdSenseMax9" name="ezAdSenseMax" value="99" <?php if ($this->options['max_count'] == 99) { echo('checked="checked"'); }?> /> <?php _e('Any number of ad blocks (At your own risk!)', 'easy-adsenser') ; ?></label><br />
|
223 |
|
224 |
+
<?php if (get_bloginfo('version') < 2.8) {_e('Number of Link Units widgets (≤ 3) [Google serves only three]:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLimitLU" name="ezLimitLU" value="<?php echo(stripslashes(htmlspecialchars($this->options['limit_lu'])));?>" /><br /><br style="line-height: 3px;" /> <?php } else echo '<br style="line-height: 3px;" />' ;?>
|
225 |
|
226 |
<b><?php _e('Suppress AdSense Ad Blocks on:', 'easy-adsenser') ; ?></b>
|
227 |
+
<input type="checkbox" id="ezKillPages" name="ezKillPages" value="true" <?php if ($this->options['kill_pages']) { echo('checked="checked"'); }?> /> <a href="http://codex.wordpress.org/Pages" target="_blank" title="<?php _e('Click to see the difference between posts and pages', 'easy-adsenser') ; ?>"><?php _e('Pages (Ads only on Posts)', 'easy-adsenser') ; ?></a><br />
|
228 |
<label for="ezKillAttach" title="<?php _e('Pages that show attachments', 'easy-adsenser') ; ?>">
|
229 |
+
<input type="checkbox" id="ezKillAttach" name="ezKillAttach" <?php if ($this->options['kill_attach']) { echo('checked="checked"'); }?> /> <?php _e('Attachment Page', 'easy-adsenser') ; ?></label>
|
230 |
<label for="ezKillHome" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
|
231 |
+
<input type="checkbox" id="ezKillHome" name="ezKillHome" <?php if ($this->options['kill_home']) { echo('checked="checked"'); }?> /> <?php _e('Home Page', 'easy-adsenser') ; ?></label>
|
232 |
<label for="ezKillFront" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
|
233 |
+
<input type="checkbox" id="ezKillFront" name="ezKillFront" <?php if ($this->options['kill_front']) { echo('checked="checked"'); }?> /> <?php _e('Front Page', 'easy-adsenser') ; ?></label>
|
234 |
<br />
|
235 |
<label for="ezKillCat" title="<?php _e('Pages that come up when you click on category names', 'easy-adsenser') ; ?>">
|
236 |
+
<input type="checkbox" id="ezKillCat" name="ezKillCat" <?php if ($this->options['kill_cat']) { echo('checked="checked"'); }?> /> <?php _e('Category Pages', 'easy-adsenser') ; ?></label>
|
237 |
<label for="ezKillTag" title="<?php _e('Pages that come up when you click on tag names', 'easy-adsenser') ; ?>">
|
238 |
+
<input type="checkbox" id="ezKillTag" name="ezKillTag" <?php if ($this->options['kill_tag']) { echo('checked="checked"'); }?> /> <?php _e('Tag Pages', 'easy-adsenser') ; ?></label>
|
239 |
<label for="ezKillArchive" title="<?php _e('Pages that come up when you click on year/month archives', 'easy-adsenser') ; ?>">
|
240 |
+
<input type="checkbox" id="ezKillArchive" name="ezKillArchive" <?php if ($this->options['kill_archive']) { echo('checked="checked"'); }?> /> <?php _e('Archive Pages', 'easy-adsenser') ; ?></label>
|
241 |
<br style="line-height: 5px;" />
|
242 |
|
243 |
<b><?php _e('Other Options', 'easy-adsenser') ; ?></b><br />
|
244 |
<!-- <label for="ezAllowFeeds">
|
245 |
+
<input type="checkbox" id="ezAllowFeeds" name="ezAllowFeeds" <?php if ($this->options['allow_feeds']) { echo('checked="checked"'); }?> /> <?php _e('Allow ad blocks in feeds. [Please report any problems with this option.]', 'easy-adsenser') ; ?></label><br /> -->
|
246 |
<label for="ezForceWidget">
|
247 |
+
<input type="checkbox" id="ezForceWidget" name="ezForceWidget" <?php if ($this->options['force_widget']) { echo('checked="checked"'); }?> /> <?php _e('Prioritize sidebar widget. (Always shows the widget, if enabled.)', 'easy-adsenser') ; ?></label><br />
|
248 |
|
249 |
<label for="ezShowBorders" onmouseover="Tip('<?php _e('Google Policy says that you may not direct user attention to the ads via arrows or other graphical gimmicks. Please convince yourself that showing a mouseover decoration does not violate this Google statement before enabling this option.', 'easy-adsenser') ?>',WIDTH, 240, TITLE, 'Your call')" onmouseout="UnTip()" >
|
250 |
+
<input type="checkbox" id="ezShowBorders" name="ezShowBorders" <?php if ($this->options['show_borders']) { echo('checked="checked"'); }?> /> <?php _e('Show a border around the ads?', 'easy-adsenser') ; ?></label>
|
251 |
<label for="ezBorderWidget" title="<?php _e('Show the same border on the sidebar widget as well?', 'easy-adsenser') ; ?>">
|
252 |
+
<input type="checkbox" id="ezBorderWidget" name="ezBorderWidget" <?php if ($this->options['border_widget']) { echo('checked="checked"'); }?> /> <?php _e('Widget?', 'easy-adsenser') ; ?></label>
|
253 |
<label for="ezBorderLU" title="<?php _e('Show the same border on the link units too?', 'easy-adsenser') ; ?>">
|
254 |
+
<input type="checkbox" id="ezBorderLU" name="ezBorderLU" <?php if ($this->options['border_lu']) { echo('checked="checked"'); }?> /> <?php _e('Link Units?', 'easy-adsenser') ; ?></label><br />
|
255 |
+
Width: <input style="width:25px;text-align:center;" id="ezBorderWidth" name="ezBorderWidth" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_width'])));?>" />px
|
256 |
+
Colors: Normal:#<input style="width:55px;text-align:center;" id="ezBorderNormal" name="ezBorderNormal" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_normal'])));?>" /> Hover:#<input style="width:55px;text-align:center;" id="ezBorderColor" name="ezBorderColor" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_color'])));?>" /><br />
|
257 |
|
258 |
<label for="ezKillInLine" onmouseover="Tip('<?php _e('All <code>&lt;div&gt;</code>s that <em>Easy AdSense</em> creates have the class attribute <code>adsense</code>. Furthermore, they have class attributes like <code>adsense-leadin</code>, <code>adsense-midtext</code>, <code>adsense-leadout</code>, <code>adsense-widget</code> and <code>adsense-lu</code> depending on the type. You can set the style for these classes in your theme <code>style.css</code> to control their appearance.<br />If this is all Greek to you, please leave the option unchecked.', 'easy-adsenser'); ?>',WIDTH, 290, TITLE, 'CSS vs. In-Line')" onmouseout="UnTip()" >
|
259 |
+
<input type="checkbox" id="ezKillInLine" name="ezKillInLine" <?php if ($this->options['kill_inline']) { echo('checked="checked"'); }?> /> <?php _e('Suppress in-line styles (Control ad-blocks using style.css)', 'easy-adsenser') ; ?></label>
|
260 |
</td>
|
261 |
</tr>
|
262 |
</table>
|
269 |
<td width="50%" height="220px" valign="middle">
|
270 |
<b><?php _e('AdSense Widget Text', 'easy-adsenser') ; ?></b>
|
271 |
<?php _e('(Appears in the Sidebar as a Widget)', 'easy-adsenser') ; ?><br />
|
272 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextWidget" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_widget']))) ?></textarea>
|
273 |
<br />
|
274 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
275 |
<?php _e('(Where to show?)', 'easy-adsenser') ; ?>
|
276 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezWidgetMargin" name="ezWidgetMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_widget'])));?>" />px</span>
|
277 |
<br />
|
278 |
<label for="ezAdSenseShowWidget_left">
|
279 |
+
<input type="radio" id="ezAdSenseShowWidget_left" name="ezAdSenseShowWidget" value="text-align:left" <?php if ($this->options['show_widget'] == "text-align:left") { echo('checked="checked"'); }?> /> <?php _e('Align Left', 'easy-adsenser') ; ?> </label>
|
280 |
<label for="ezAdSenseShowWidget_center">
|
281 |
+
<input type="radio" id="ezAdSenseShowWidget_center" name="ezAdSenseShowWidget" value="text-align:center" <?php if ($this->options['show_widget'] == "text-align:center") { echo('checked="checked"'); }?> /> <?php _e('Center', 'easy-adsenser') ; ?> </label>
|
282 |
<label for="ezAdSenseShowWidget_right">
|
283 |
+
<input type="radio" id="ezAdSenseShowWidget_right" name="ezAdSenseShowWidget" value="text-align:right" <?php if ($this->options['show_widget'] == "text-align:right") { echo('checked="checked"'); }?> /> <?php _e('Align Right', 'easy-adsenser') ; ?> </label>
|
284 |
<label for="ezAdSenseShowWidget_no">
|
285 |
+
<input type="radio" id="ezAdSenseShowWidget_no" name="ezAdSenseShowWidget" value="no" <?php if ($this->options['show_widget'] == "no") { echo('checked="checked"'); }?> /> <?php _e('Suppress Widget', 'easy-adsenser') ; ?></label><br />
|
286 |
+
<label for="ezAdWidgetTitle"><b><?php _e('Widget Title:', 'easy-adsenser') ; ?></b> <input style="width:200px" id="ezAdWidgetTitle" name="ezAdWidgetTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_widget']))) ?>" /></label>
|
287 |
+
<label for="ezAdKillWidgetTitle"><input type="checkbox" id="ezAdKillWidgetTitle" name="ezAdKillWidgetTitle" <?php if ($this->options['kill_widget_title']) { echo('checked="checked"'); }?> /> <?php _e('Hide Title', 'easy-adsenser') ; ?> </label>
|
288 |
</td>
|
289 |
</tr>
|
290 |
<tr valign="top">
|
291 |
<td width="50%" height="220px" valign="middle">
|
292 |
<b><?php _e('AdSense Link-Units Text', 'easy-adsenser') ; ?></b>
|
293 |
<?php _e('(Appears in the Sidebar as Widgets)', 'easy-adsenser') ; ?><br />
|
294 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextLU" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_lu']))) ?></textarea>
|
295 |
<br />
|
296 |
<b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>
|
297 |
<?php _e('(Where to show?)', 'easy-adsenser') ; ?>
|
298 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezLUMargin" name="ezLUMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_lu'])));?>" />px</span>
|
299 |
<br />
|
300 |
<label for="ezAdSenseShowLU_left">
|
301 |
+
<input type="radio" id="ezAdSenseShowLU_left" name="ezAdSenseShowLU" value="text-align:left" <?php if ($this->options['show_lu'] == "text-align:left") { echo('checked="checked"'); }?> /> <?php _e('Align Left', 'easy-adsenser') ; ?> </label>
|
302 |
<label for="ezAdSenseShowLU_center">
|
303 |
+
<input type="radio" id="ezAdSenseShowLU_center" name="ezAdSenseShowLU" value="text-align:center" <?php if ($this->options['show_lu'] == "text-align:center") { echo('checked="checked"'); }?> /> <?php _e('Center', 'easy-adsenser') ; ?> </label>
|
304 |
<label for="ezAdSenseShowLU_right">
|
305 |
+
<input type="radio" id="ezAdSenseShowLU_right" name="ezAdSenseShowLU" value="text-align:right" <?php if ($this->options['show_lu'] == "text-align:right") { echo('checked="checked"'); }?> /> <?php _e('Align Right', 'easy-adsenser') ; ?> </label>
|
306 |
<label for="ezAdSenseShowLU_no">
|
307 |
+
<input type="radio" id="ezAdSenseShowLU_no" name="ezAdSenseShowLU" value="no" <?php if ($this->options['show_lu'] == "no") { echo('checked="checked"'); }?> /> <?php _e('Suppress Link Units', 'easy-adsenser') ; ?></label><br />
|
308 |
+
<label for="ezAdLUTitle"><b><?php _e('Link Unit Title:', 'easy-adsenser') ; ?></b> <input style="width: 200px;" id="ezAdLUTitle" name="ezAdLUTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_lu']))) ?>" /></label>
|
309 |
+
<label for="ezAdKillLUTitle"><input type="checkbox" id="ezAdKillLUTitle" name="ezAdKillLUTitle" <?php if ($this->options['kill_lu_title']) { echo('checked="checked"'); }?> /> <?php _e('Hide Title', 'easy-adsenser') ; ?> </label>
|
310 |
</td>
|
311 |
</tr>
|
312 |
<tr valign="top">
|
313 |
<td width="50%" height="250px" valign="middle">
|
314 |
<b><?php _e('Google Search Widget', 'easy-adsenser') ; ?></b>
|
315 |
<?php _e('(Adds a Google Search Box to your sidebar)', 'easy-adsenser') ; ?><br />
|
316 |
+
<textarea cols="50" rows="15" name="ezAdSenseTextGSearch" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_gsearch']))) ?></textarea>
|
317 |
<br />
|
318 |
<b><?php _e('Search Title', 'easy-adsenser') ; ?></b>
|
319 |
<?php _e('(Title of the Google Search Widget)', 'easy-adsenser') ; ?>
|
320 |
+
<span onmouseover="Tip('<?php _e('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser') ?>', WIDTH, 240, TITLE, '<?php _e('Tweak Margins', 'easy-adsenser') ?>')" onmouseout="UnTip()"><?php _e('Margin:', 'easy-adsenser') ; ?> <input style="width:30px;text-align:center;" id="ezSearchMargin" name="ezSearchMargin" value="<?php echo(stripslashes(htmlspecialchars($this->options['margin_gsearch'])));?>" />px</span>
|
321 |
<br />
|
322 |
<label for="ezAdSenseShowGSearch_dark">
|
323 |
+
<input type="radio" id="ezAdSenseShowGSearch_dark" name="ezAdSenseShowGSearch" value="dark" <?php if ($this->options['title_gsearch'] == "dark") { echo('checked="checked"'); }?> /> <?php echo '<img src=" ' . $this->plugindir . '/google-dark.gif" border="0" alt="Google (dark)" style="background:black;vertical-align:-40%;"'; ?> /> </label>
|
324 |
<label for="ezAdSenseShowGSearch_light">
|
325 |
+
<input type="radio" id="ezAdSenseShowGSearch_light" name="ezAdSenseShowGSearch" value="light" <?php if ($this->options['title_gsearch'] == "light") { echo('checked="checked"'); }?> /> <?php echo '<img src=" ' . $this->plugindir . '/google-light.gif" border="0" alt="Google (light)" style="background:white;vertical-align:-40%;"'; ?> /> </label>
|
326 |
<label for="ezAdSenseShowGSearch_no">
|
327 |
+
<input type="radio" id="ezAdSenseShowGSearch_no" name="ezAdSenseShowGSearch" value="no" <?php if ($this->options['title_gsearch'] == "no") { echo('checked="checked"'); }?> /> <?php _e('Suppress Search Box', 'easy-adsenser') ; ?></label><br /><br />
|
328 |
<label for="ezAdSenseShowGSearch_text">
|
329 |
+
<input type="radio" id="ezAdSenseShowGSearch_text" name="ezAdSenseShowGSearch" value="text" <?php $title = $this->options['title_gsearch'] ; if ($title != 'dark' && $title != 'light' && $title != 'no') { echo('checked="checked"'); }?> /> <b><?php _e('Custom Title:', 'easy-adsenser') ; ?></b></label>
|
330 |
<label for="ezAdSearchTitle">
|
331 |
+
<input style="width: 200px;" id="ezAdSearchTitle" name="ezAdSearchTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_gsearch']))) ?>" /></label>
|
332 |
+
<label for="ezAdKillSearchTitle"><input type="checkbox" id="ezAdKillSearchTitle" name="ezAdKillSearchTitle" <?php if ($this->options['kill_gsearch_title']) { echo('checked="checked"'); }?> /> <?php _e('Hide Title', 'easy-adsenser') ; ?> </label>
|
333 |
</td>
|
334 |
</tr>
|
335 |
</table>
|
343 |
<b><?php _e('Link-backs to', 'easy-adsenser') ; ?> <a href="http://www.Thulasidas.com" target="_blank">Unreal Blog</a></b>
|
344 |
<?php _e('(Consider showing at least one link.)', 'easy-adsenser') ; ?><br />
|
345 |
<label for="ezAdSenseLinkMax99">
|
346 |
+
<input type="radio" id="ezAdSenseLinkMax99" name="ezAdSenseLinkMax" value="99" <?php if ($this->options['max_link'] == 99) { echo('checked="checked"'); }?> /> <?php _e('Show a link under every ad block.', 'easy-adsenser') ; ?></label><br />
|
347 |
<label for="ezAdSenseLinkMax1">
|
348 |
+
<input type="radio" id="ezAdSenseLinkMax1" name="ezAdSenseLinkMax" value="1" <?php if ($this->options['max_link'] == 1) { echo('checked="checked"'); }?> /> <?php _e('Show the link only under the first ad block.', 'easy-adsenser') ; ?></label><br />
|
349 |
<label for="ezAdSenseLinkMax-1">
|
350 |
+
<input type="radio" id="ezAdSenseLinkMax-1" name="ezAdSenseLinkMax" value="-1" <?php if ($this->options['max_link'] == -1) { echo('checked="checked"'); }?> /> <?php _e('Show the link at the bottom of your blog page.', 'easy-adsenser') ; ?></label><br />
|
351 |
<label for="ezAdSenseLinkMax0">
|
352 |
+
<input type="radio" id="ezAdSenseLinkMax0" name="ezAdSenseLinkMax" value="0" <?php if ($this->options['max_link'] == 0) { echo('checked="checked"'); }?> /> <?php _e('Show no links to my blog anywhere (Are you sure?!)', 'easy-adsenser') ; echo '</label>' ?>
|
353 |
<br />
|
354 |
<br style="line-height: 12px;" />
|
355 |
<?php echo '<span onmouseover="TagToTip(\'pro\', WIDTH, 350, TITLE, \'Buy the Pro Version\',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])"><b>Buy the <a href="http://buy.thulasidas.com/easy-adsense" target="_blank" ' . "onclick=\"popupwindow('http://buy.thulasidas.com/easy-adsense','Get Easy AdSense Pro', 1024, 768);return false;\"" . '>Pro Version</a></b><br />More features, more power!</span>' ; ?>
|
449 |
<b><?php _e('Kill this plugin. (Are you quite sure?)', 'easy-adsenser') ?></b></span>
|
450 |
|
451 |
<?php
|
452 |
+
if (!$this->options['kill_invites']) {
|
453 |
echo '<div style="background-color:#cff;padding:5px;border: solid 1px;margin:5px;">' ;
|
454 |
@include (dirname (__FILE__).'/why-pro.php');
|
455 |
echo '</div>' ;
|
easy-adsense-lite.php
CHANGED
@@ -1,57 +1,221 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: Easy AdSense
|
4 |
-
Plugin URI: http://www.thulasidas.com/adsense
|
5 |
-
Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings → Easy AdSense</a>.
|
6 |
-
Version:
|
7 |
-
Author: Manoj Thulasidas
|
8 |
-
Author URI: http://www.thulasidas.com
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
-
Copyright (C) 2008 www.thulasidas.com
|
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
|
16 |
-
the Free Software Foundation; either version 3 of the License, or
|
17 |
-
(at your option) any later version.
|
18 |
|
19 |
-
This program is distributed in the hope that it will be useful,
|
20 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
GNU General Public License for more details.
|
23 |
|
24 |
-
You should have received a copy of the GNU General Public License
|
25 |
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
*/
|
27 |
|
28 |
-
if (!class_exists("
|
29 |
-
class
|
30 |
var $plugindir, $invite, $locale, $defaults, $ezTran,
|
31 |
-
$leadin, $leadout, $
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
include (dirname (__FILE__).'/defaults.php');
|
35 |
$this->defaults = $defaults ;
|
36 |
}
|
37 |
if (empty($this->defaults)) {
|
38 |
-
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
if (file_exists (dirname (__FILE__).'/lang/easy-translator.php')){
|
47 |
include (dirname (__FILE__).'/lang/easy-translator.php');
|
48 |
$this->ezTran = new ezTran ;
|
49 |
}
|
50 |
}
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
function setLang() {
|
@@ -72,7 +236,7 @@ if (!class_exists("ezAdSense")) {
|
|
72 |
else {
|
73 |
// look for any other similar locale with the same first three characters
|
74 |
$foo = glob(dirname(__FILE__) . '/lang/' . substr($this->locale, 0, 2) .
|
75 |
-
|
76 |
if (!empty($foo)>0) {
|
77 |
$moFile = $foo[0] ;
|
78 |
load_textdomain($name, $moFile);
|
@@ -81,24 +245,14 @@ if (!class_exists("ezAdSense")) {
|
|
81 |
$this->invite = '<hr /><font color="red"> Would you like to see ' .
|
82 |
'<b>Easy Adsense</b> in your langugage (<b>' . $locale .
|
83 |
"</b>)? <input type='submit' name='ezAds-translate' onmouseover=\"Tip('It is easy to have <b>Easy AdSense</b> in your language. All you have to do is to translate some strings, and email the file to the author.<br /><br />If you would like to help, please use the translation interface. It picks up the translatable strings in <b>Easy AdSense</b> and presents them (and their existing translations in <b>" . $this->locale .
|
84 |
-
|
85 |
}
|
86 |
}
|
87 |
}
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
return $this->adminOptions ;
|
93 |
-
}
|
94 |
-
$this->setLang() ;
|
95 |
-
$mThemeName = get_option('stylesheet') ;
|
96 |
-
$mOptions = "ezAdSense" . $mThemeName ;
|
97 |
-
$this->plugindir = get_option('siteurl') . '/' . PLUGINDIR .
|
98 |
-
'/' . basename(dirname(__FILE__)) ;
|
99 |
-
|
100 |
-
$ezAdSenseAdminOptions =
|
101 |
-
array('info' => "<!-- Easy AdSense V4.00 -->\n",
|
102 |
'show_leadin' => 'float:right',
|
103 |
'wc_leadin' => 0,
|
104 |
'margin_leadin' => 12,
|
@@ -148,30 +302,20 @@ if (!class_exists("ezAdSense")) {
|
|
148 |
'kill_archive' => false,
|
149 |
'kill_inline' => false,
|
150 |
'kill_widget_title' => false,
|
151 |
-
'title_widget' => ''
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
if (!empty($ezAdOptions) && ! $reset) {
|
161 |
-
foreach ($ezAdOptions as $key => $option)
|
162 |
-
$ezAdSenseAdminOptions[$key] = $option;
|
163 |
-
}
|
164 |
-
|
165 |
-
update_option($mOptions, $ezAdSenseAdminOptions);
|
166 |
-
$this->adminOptions = $ezAdSenseAdminOptions ;
|
167 |
-
$this->adminOptionName = $mOptions ;
|
168 |
-
return $ezAdSenseAdminOptions;
|
169 |
}
|
170 |
|
171 |
function handleDefaultText($text, $key = '300x250') {
|
172 |
$ret = $text ;
|
173 |
-
if ($ret == $this->defaults['defaultText']
|
174 |
-
|| strlen(trim($ret)) == 0) {
|
175 |
$x = strpos($key, 'x') ;
|
176 |
$w = substr($key, 0, $x);
|
177 |
$h = substr($key, $x+1);
|
@@ -181,193 +325,34 @@ if (!class_exists("ezAdSense")) {
|
|
181 |
return $ret ;
|
182 |
}
|
183 |
|
184 |
-
function handleDefaults(
|
185 |
-
{
|
186 |
$texts = array('text_leadin', 'text_midtext', 'text_leadout') ;
|
187 |
-
foreach ($texts as $t)
|
188 |
-
|
189 |
-
$
|
190 |
-
$options[$t] = $this->handleDefaultText($text) ;
|
191 |
}
|
192 |
-
return $options ;
|
193 |
}
|
|
|
194 |
// Prints out the admin page
|
195 |
function printAdminPage() {
|
196 |
// if the defaults are not loaded, send error message
|
197 |
if (empty($this->defaults)) return ;
|
198 |
-
|
199 |
-
|
200 |
-
$ezAdOptions = $this->getAdminOptions();
|
201 |
-
|
202 |
-
if (isset($_POST['update_ezAdSenseSettings'])) {
|
203 |
-
if (isset($_POST['ezAdSenseShowLeadin']))
|
204 |
-
$ezAdOptions['show_leadin'] = $_POST['ezAdSenseShowLeadin'];
|
205 |
-
if (isset($_POST['ezAdSenseTextLeadin']))
|
206 |
-
$ezAdOptions['text_leadin'] = $_POST['ezAdSenseTextLeadin'];
|
207 |
-
if (isset($_POST['ezLeadInMargin']))
|
208 |
-
$ezAdOptions['margin_leadin'] = $_POST['ezLeadInMargin'];
|
209 |
-
if (isset($_POST['ezLeadInWC']))
|
210 |
-
$ezAdOptions['wc_leadin'] = $_POST['ezLeadInWC'];
|
211 |
-
if (isset($_POST['ezHeaderLeadin']))
|
212 |
-
$ezAdOptions['header_leadin'] = $_POST['ezHeaderLeadin'];
|
213 |
-
|
214 |
-
if (isset($_POST['ezAdSenseShowMidtext']))
|
215 |
-
$ezAdOptions['show_midtext'] = $_POST['ezAdSenseShowMidtext'];
|
216 |
-
if (isset($_POST['ezAdSenseTextMidtext']))
|
217 |
-
$ezAdOptions['text_midtext'] = $_POST['ezAdSenseTextMidtext'];
|
218 |
-
if (isset($_POST['ezMidTextWC']))
|
219 |
-
$ezAdOptions['wc_midtext'] = $_POST['ezMidTextWC'];
|
220 |
-
if (isset($_POST['ezMidTextMargin']))
|
221 |
-
$ezAdOptions['margin_midtext'] = $_POST['ezMidTextMargin'];
|
222 |
-
|
223 |
-
if (isset($_POST['ezAdSenseShowLeadout']))
|
224 |
-
$ezAdOptions['show_leadout'] = $_POST['ezAdSenseShowLeadout'];
|
225 |
-
if (isset($_POST['ezAdSenseTextLeadout']))
|
226 |
-
$ezAdOptions['text_leadout'] = $_POST['ezAdSenseTextLeadout'];
|
227 |
-
if (isset($_POST['ezLeadOutWC']))
|
228 |
-
$ezAdOptions['wc_leadout'] = $_POST['ezLeadOutWC'];
|
229 |
-
if (isset($_POST['ezLeadOutMargin']))
|
230 |
-
$ezAdOptions['margin_leadout'] = $_POST['ezLeadOutMargin'];
|
231 |
-
if (isset($_POST['ezFooterLeadout']))
|
232 |
-
$ezAdOptions['footer_leadout'] = $_POST['ezFooterLeadout'];
|
233 |
-
|
234 |
-
if (isset($_POST['ezAdSenseShowWidget']))
|
235 |
-
$ezAdOptions['show_widget'] = $_POST['ezAdSenseShowWidget'];
|
236 |
-
if (isset($_POST['ezAdWidgetTitle']))
|
237 |
-
$ezAdOptions['title_widget'] = $_POST['ezAdWidgetTitle'];
|
238 |
-
if (isset($_POST['ezAdSenseTextWidget']))
|
239 |
-
$ezAdOptions['text_widget'] = $_POST['ezAdSenseTextWidget'];
|
240 |
-
$ezAdOptions['kill_widget_title'] = isset($_POST['ezAdKillWidgetTitle']);
|
241 |
-
if (isset($_POST['ezWidgetMargin']))
|
242 |
-
$ezAdOptions['margin_widget'] = $_POST['ezWidgetMargin'];
|
243 |
-
|
244 |
-
if (isset($_POST['ezAdSenseShowLU']))
|
245 |
-
$ezAdOptions['show_lu'] = $_POST['ezAdSenseShowLU'];
|
246 |
-
if (isset($_POST['ezAdLUTitle']))
|
247 |
-
$ezAdOptions['title_lu'] = $_POST['ezAdLUTitle'];
|
248 |
-
if (isset($_POST['ezAdSenseTextLU']))
|
249 |
-
$ezAdOptions['text_lu'] = $_POST['ezAdSenseTextLU'];
|
250 |
-
$ezAdOptions['kill_lu_title'] = isset($_POST['ezAdKillLUTitle']);
|
251 |
-
if (isset($_POST['ezLUMargin']))
|
252 |
-
$ezAdOptions['margin_lu'] = $_POST['ezLUMargin'];
|
253 |
-
|
254 |
-
if (isset($_POST['ezAdSenseShowGSearch'])) {
|
255 |
-
$title = $_POST['ezAdSenseShowGSearch']; ;
|
256 |
-
if ($title != 'dark' && $title != 'light' && $title != 'no')
|
257 |
-
$title = $_POST['ezAdSearchTitle'];
|
258 |
-
$ezAdOptions['title_gsearch'] = $title;
|
259 |
-
}
|
260 |
-
if (isset($_POST['killInvites']))
|
261 |
-
$ezAdOptions['kill_invites'] = $_POST['killInvites'];
|
262 |
-
if (isset($_POST['killRating']))
|
263 |
-
$ezAdOptions['kill_rating'] = $_POST['killRating'];
|
264 |
-
$ezAdOptions['kill_gsearch_title'] = isset($_POST['ezAdKillSearchTitle']);
|
265 |
-
if (isset($_POST['ezAdSenseTextGSearch']))
|
266 |
-
$ezAdOptions['text_gsearch'] = $_POST['ezAdSenseTextGSearch'];
|
267 |
-
if (isset($_POST['ezSearchMargin']))
|
268 |
-
$ezAdOptions['margin_gsearch'] = $_POST['ezSearchMargin'];
|
269 |
-
|
270 |
-
if (isset($_POST['ezAdSenseMax']))
|
271 |
-
$ezAdOptions['max_count'] = $_POST['ezAdSenseMax'];
|
272 |
-
if (isset($_POST['ezAdSenseLinkMax']))
|
273 |
-
$ezAdOptions['max_link'] = $_POST['ezAdSenseLinkMax'];
|
274 |
-
|
275 |
-
$ezAdOptions['force_midad'] = isset($_POST['ezForceMidAd']);
|
276 |
-
$ezAdOptions['force_widget'] = isset($_POST['ezForceWidget']);
|
277 |
-
$ezAdOptions['allow_feeds'] = isset($_POST['ezAllowFeeds']);
|
278 |
-
$ezAdOptions['kill_pages'] = isset($_POST['ezKillPages']);
|
279 |
-
$ezAdOptions['kill_home'] = isset($_POST['ezKillHome']);
|
280 |
-
$ezAdOptions['kill_attach'] = isset($_POST['ezKillAttach']);
|
281 |
-
$ezAdOptions['kill_front'] = isset($_POST['ezKillFront']);
|
282 |
-
$ezAdOptions['kill_cat'] = isset($_POST['ezKillCat']);
|
283 |
-
$ezAdOptions['kill_tag'] = isset($_POST['ezKillTag']);
|
284 |
-
$ezAdOptions['kill_archive'] = isset($_POST['ezKillArchive']);
|
285 |
-
$ezAdOptions['kill_inline'] = isset($_POST['ezKillInLine']);
|
286 |
-
|
287 |
-
$ezAdOptions['show_borders'] = isset($_POST['ezShowBorders']);
|
288 |
-
if (isset($_POST['ezBorderWidth']))
|
289 |
-
$ezAdOptions['border_width'] = intval($_POST['ezBorderWidth']) ;
|
290 |
-
if (isset($_POST['ezBorderNormal']))
|
291 |
-
$ezAdOptions['border_normal'] = strval($_POST['ezBorderNormal']) ;
|
292 |
-
if (isset($_POST['ezBorderColor']))
|
293 |
-
$ezAdOptions['border_color'] = strval($_POST['ezBorderColor']) ;
|
294 |
-
if (isset($_POST['ezBorderWidget']))
|
295 |
-
$ezAdOptions['border_widget'] = $_POST['ezBorderWidget'];
|
296 |
-
if (isset($_POST['ezBorderLU']))
|
297 |
-
$ezAdOptions['border_lu'] = $_POST['ezBorderLU'];
|
298 |
-
|
299 |
-
if (isset($_POST['ezLimitLU'])) {
|
300 |
-
$limit = min(intval($_POST['ezLimitLU']), 3) ;
|
301 |
-
$ezAdOptions['limit_lu'] = $limit ;
|
302 |
-
}
|
303 |
-
$ezAdOptions['info'] = $this->info() ;
|
304 |
-
|
305 |
-
update_option($mOptions, $ezAdOptions);
|
306 |
-
echo '<div class="updated"><p><strong>' ;
|
307 |
-
_e("Settings Updated.", "easy-adsenser");
|
308 |
-
echo '</strong></p> </div>' ;
|
309 |
-
}
|
310 |
-
else if (isset($_POST['reset_ezAdSenseSettings'])) {
|
311 |
-
$reset = true ;
|
312 |
-
$ezAdOptions = $this->getAdminOptions($reset);
|
313 |
-
echo '<div class="updated"><p><strong>' ;
|
314 |
-
_e("Ok, all your settings have been discarded!", "easy-adsenser");
|
315 |
-
echo '</strong></p> </div>' ;
|
316 |
-
}
|
317 |
-
else if (isset($_POST['english'])) {
|
318 |
-
$this->locale = "en_US" ;
|
319 |
-
$moFile = dirname(__FILE__) . '/lang/easy-adsenser.mo';
|
320 |
-
// Dodgy..., but hey, it works. Idea from the function
|
321 |
-
// load_textdomain($domain, $mofile) in /wp-includes/l10n.php
|
322 |
-
global $l10n;
|
323 |
-
$version = (float)get_bloginfo('version') ;
|
324 |
-
if ($version < 2.80)
|
325 |
-
$l10n['easy-adsenser']->cache_translations = array() ;
|
326 |
-
else
|
327 |
-
unset($l10n['easy-adsenser']) ; // this is probably a memory leak!
|
328 |
-
load_textdomain('easy-adsenser', $moFile);
|
329 |
-
echo '<div class="updated"><p><strong>Ok, in English for now. ' .
|
330 |
-
'<a href="options-general.php?page=easy-adsense-lite.php">Switch back</a>.</strong></p> </div>' ;
|
331 |
-
}
|
332 |
-
else if (isset($_POST['clean_db']) || isset($_POST['kill_me'])) {
|
333 |
-
$reset = true ;
|
334 |
-
$ezAdOptions = $this->getAdminOptions($reset);
|
335 |
-
$this->cleanDB('ezAdSense');
|
336 |
-
echo '<div class="updated"><p><strong>' ;
|
337 |
-
_e("Database has been cleaned. All your options for this plugin (for all themes) have been removed.",
|
338 |
-
"easy-adsenser");
|
339 |
-
echo '</strong></p> </div>' ;
|
340 |
-
|
341 |
-
if (isset($_POST['kill_me'])) {
|
342 |
-
remove_action('admin_menu', 'ezAdSense_ap');
|
343 |
-
$me = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
|
344 |
-
deactivate_plugins($me, true);
|
345 |
-
echo '<div class="updated"><p><strong>' ;
|
346 |
-
_e("This plugin has been deactivated.", "easy-adsenser");
|
347 |
-
echo '<a href="plugins.php?deactivate=true">';
|
348 |
-
_e("Refresh", "easy-adsenser");
|
349 |
-
echo '</a></strong></p></div>' ;
|
350 |
-
return;
|
351 |
-
}
|
352 |
-
}
|
353 |
-
if (file_exists (dirname (__FILE__).'/admin.php'))
|
354 |
include (dirname (__FILE__).'/admin.php');
|
|
|
355 |
else {
|
356 |
echo '<font size="+1" color="red">' ;
|
357 |
_e("Error locating the admin page!\nEnsure admin.php exists, or reinstall the plugin.",
|
358 |
-
|
359 |
echo '</font>' ;
|
360 |
}
|
361 |
-
}
|
362 |
|
363 |
function info($hide=true) {
|
364 |
-
$
|
365 |
-
$plugins = get_plugins() ;
|
366 |
if ($hide)
|
367 |
-
$str =
|
368 |
-
$plugins[$me]['Version'] . " -->\n";
|
369 |
-
else
|
370 |
-
$str = $plugins[$me]['Title'] . " V" . $plugins[$me]['Version'] ;
|
371 |
return $str ;
|
372 |
}
|
373 |
|
@@ -376,21 +361,16 @@ if (!class_exists("ezAdSense")) {
|
|
376 |
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '$prefix%'") ;
|
377 |
}
|
378 |
|
379 |
-
var $ezMax = 99 ;
|
380 |
-
var $urMax = 99 ;
|
381 |
-
var $luMax = 4 ;
|
382 |
-
|
383 |
function plugin_action($links, $file) {
|
384 |
if ($file == plugin_basename(dirname(__FILE__).'/easy-adsense-lite.php')) {
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
}
|
389 |
return $links;
|
390 |
}
|
391 |
|
392 |
function contentMeta() {
|
393 |
-
$ezAdOptions = $this->getAdminOptions();
|
394 |
global $post;
|
395 |
$lookup = array('adsense' => 'adsense',
|
396 |
'adsense-top' =>'show_leadin',
|
@@ -401,7 +381,7 @@ if (!class_exists("ezAdSense")) {
|
|
401 |
'adsense-linkunits' => 'show_lu') ;
|
402 |
$metaOptions = array() ;
|
403 |
foreach ($lookup as $metaKey => $optKey) {
|
404 |
-
if (!empty($
|
405 |
else $metaOptions[$optKey] = '' ;
|
406 |
$customStyle = get_post_custom_values($metaKey, $post->ID, true);
|
407 |
if (is_array($customStyle))
|
@@ -422,70 +402,68 @@ if (!class_exists("ezAdSense")) {
|
|
422 |
}
|
423 |
|
424 |
function ezAdSense_content($content) {
|
425 |
-
|
426 |
-
if (
|
427 |
-
if ($
|
428 |
-
if ($
|
429 |
-
if ($
|
430 |
-
if ($
|
431 |
-
if ($
|
432 |
-
if ($
|
433 |
-
|
434 |
-
$this->
|
435 |
-
|
436 |
-
$this->
|
437 |
-
global $ezCount ;
|
438 |
-
if ($ezCount >= $this->ezMax) return $content ;
|
439 |
if(strpos($content, "<!--noadsense-->") !== false) return $content;
|
440 |
$metaOptions = $this->contentMeta() ;
|
441 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no')
|
442 |
return $content;
|
443 |
-
$this->handleDefaults(
|
|
|
444 |
|
445 |
$wc = str_word_count($content) ;
|
446 |
-
global $urCount ;
|
447 |
$unreal = '' ;
|
448 |
-
if ((is_single() || is_page()) && $urCount < $this->urMax)
|
449 |
$unreal = '<div align="center"><font size="-3">' .
|
450 |
'<a href="http://www.thulasidas.com/adsense/" ' .
|
451 |
'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
|
452 |
'Easy AdSense</a> by <a href="http://www.Thulasidas.com/" ' .
|
453 |
-
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense
|
454 |
'Unreal</a></font></div>';
|
455 |
|
456 |
$border = '' ;
|
457 |
-
if ($
|
458 |
-
$border='border:#' . $
|
459 |
-
' solid ' . $
|
460 |
-
' onmouseover="this.style.border=\'#' . $
|
461 |
-
' solid ' . $
|
462 |
-
'onmouseout="this.style.border=\'#' . $
|
463 |
-
' solid ' . $
|
464 |
|
465 |
$show_leadin = $metaOptions['show_leadin'] ;
|
466 |
$leadin = '' ;
|
467 |
-
if ($show_leadin != 'no' && $wc > $
|
468 |
-
if ($ezCount < $this->ezMax) {
|
469 |
-
$ezCount++;
|
470 |
-
$margin = $
|
471 |
-
if ($
|
472 |
$inline = '' ;
|
473 |
else
|
474 |
$inline = 'style="' . $show_leadin .
|
475 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
476 |
$leadin =
|
477 |
-
stripslashes($
|
478 |
-
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
479 |
'<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
|
480 |
-
$
|
481 |
-
($urCount++ < $this->urMax ? $unreal : '') .
|
482 |
-
"</div>\n" . $
|
483 |
}
|
484 |
}
|
485 |
|
486 |
$show_midtext = $metaOptions['show_midtext'] ;
|
487 |
-
if ($show_midtext != 'no' && $wc > $
|
488 |
-
if ($ezCount < $this->ezMax) {
|
489 |
$poses = array();
|
490 |
$lastpos = -1;
|
491 |
$repchar = "<p";
|
@@ -501,22 +479,21 @@ if (!class_exists("ezAdSense")) {
|
|
501 |
array_pop($poses);
|
502 |
$pickme = 0 ;
|
503 |
if (!empty($poses)) $pickme = $poses[floor(sizeof($poses)/2)];
|
504 |
-
if ($
|
505 |
-
|
506 |
-
$
|
507 |
-
|
508 |
-
if ($ezAdOptions['kill_inline'])
|
509 |
$inline = '' ;
|
510 |
else
|
511 |
$inline = 'style="' . $show_midtext .
|
512 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
513 |
$midtext =
|
514 |
-
stripslashes($
|
515 |
-
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
516 |
'<div class="ezAdsense adsense adsense-midtext" ' . $inline . '>' .
|
517 |
-
$
|
518 |
-
($urCount++ < $this->urMax ? $unreal : '') .
|
519 |
-
"</div>\n" . $
|
520 |
$content = substr_replace($content, $midtext.$repchar, $pickme, 2);
|
521 |
}
|
522 |
}
|
@@ -524,29 +501,29 @@ if (!class_exists("ezAdSense")) {
|
|
524 |
|
525 |
$show_leadout = $metaOptions['show_leadout'] ;
|
526 |
$leadout = '' ;
|
527 |
-
if ($show_leadout != 'no' && $wc > $
|
528 |
-
if ($ezCount < $this->ezMax) {
|
529 |
-
$ezCount++;
|
530 |
-
$margin = $
|
531 |
-
if ($
|
532 |
$inline = '' ;
|
533 |
else
|
534 |
$inline = 'style="' . $show_leadout .
|
535 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
536 |
$leadout =
|
537 |
-
stripslashes($
|
538 |
-
"<!-- Post[count: " . $ezCount . "] -->\n" .
|
539 |
'<div class="ezAdsense adsense adsense-leadout" ' . $inline . '>' .
|
540 |
-
$
|
541 |
-
($urCount++ < $this->urMax ? $unreal : '') .
|
542 |
-
"</div>\n" . $
|
543 |
}
|
544 |
}
|
545 |
-
if ($
|
546 |
$this->leadin = $leadin ;
|
547 |
$leadin = '' ;
|
548 |
}
|
549 |
-
if ($
|
550 |
$this->leadout = $leadout ;
|
551 |
$leadout = '' ;
|
552 |
}
|
@@ -563,49 +540,41 @@ if (!class_exists("ezAdSense")) {
|
|
563 |
echo $unreal ;
|
564 |
}
|
565 |
|
566 |
-
function header_leadin(){
|
567 |
-
// if it is an admin page, don't show ads
|
568 |
if (is_admin()) return ;
|
569 |
-
// there are issues with feeds as well
|
570 |
// is_feed() is not ready, because the WP query hasn't been run yet.
|
571 |
if (strpos($_SERVER['REQUEST_URI'], 'feed') !== false) return ;
|
572 |
// This is sad: Need to pre-construct $this->leadin
|
573 |
-
$mThemeName = get_option('stylesheet') ;
|
574 |
-
$mOptions = "ezAdSense" . $mThemeName ;
|
575 |
-
$ezAdOptions = get_option($mOptions);
|
576 |
-
$mc = $ezAdOptions['mc'] ;
|
577 |
-
global $urCount, $ezCount ;
|
578 |
$unreal = '' ;
|
579 |
$border = '' ;
|
580 |
-
if ($
|
581 |
-
$border='border:#' . $
|
582 |
-
' solid ' . $
|
583 |
-
' onmouseover="this.style.border=\'#' . $
|
584 |
-
' solid ' . $
|
585 |
-
'onmouseout="this.style.border=\'#' . $
|
586 |
-
' solid ' . $
|
587 |
-
$show_leadin = $
|
588 |
if ($show_leadin != 'no') {
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
}
|
605 |
}
|
606 |
|
607 |
function footer_leadout(){
|
608 |
-
// if it is an admin page, don't show ads
|
609 |
if (is_admin()) return ;
|
610 |
echo $this->leadout ;
|
611 |
}
|
@@ -613,32 +582,30 @@ if (!class_exists("ezAdSense")) {
|
|
613 |
// ===== widget functions =====
|
614 |
function widget_ezAd_ads($args) {
|
615 |
extract($args);
|
616 |
-
$
|
617 |
-
|
618 |
-
|
619 |
$metaOptions = $this->contentMeta() ;
|
620 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
621 |
$show_widget = $metaOptions['show_widget'] ;
|
622 |
if ($show_widget == 'no') return ;
|
623 |
-
$this->ezMax = $
|
624 |
-
$this->urMax = $
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
}
|
631 |
-
$title = empty($ezAdOptions['title_widget']) ?
|
632 |
__('Sponsored Links', 'easy-adsenser') :
|
633 |
-
stripslashes(htmlspecialchars($
|
634 |
$border = '' ;
|
635 |
-
if ($
|
636 |
-
$border='border:#' . $
|
637 |
-
' solid ' . $
|
638 |
-
' onmouseover="this.style.border=\'#' . $
|
639 |
-
' solid ' . $
|
640 |
-
'onmouseout="this.style.border=\'#' . $
|
641 |
-
' solid ' . $
|
642 |
$unreal = '<div align="center"><font size="-3">' .
|
643 |
'<a href="http://thulasidas.com/adsense" ' .
|
644 |
'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
|
@@ -646,53 +613,52 @@ if (!class_exists("ezAdSense")) {
|
|
646 |
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
|
647 |
'Unreal</a></font></div>';
|
648 |
echo $before_widget;
|
649 |
-
if (!$
|
650 |
echo $before_title . $title . $after_title;
|
651 |
-
$margin = $
|
652 |
-
if ($
|
653 |
$inline = '' ;
|
654 |
else
|
655 |
$inline = 'style="' . $show_widget .
|
656 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
657 |
-
echo stripslashes($
|
658 |
-
"<!-- Widg[count: " . $ezCount . "] -->\n" .
|
659 |
'<div class="ezAdsense adsense adsense-widget"><div ' . $inline. '>' .
|
660 |
-
$
|
661 |
-
($urCount++ < $this->urMax ? $unreal : '') .
|
662 |
-
"</div></div>\n" . $
|
663 |
echo $after_widget;
|
664 |
}
|
665 |
|
666 |
function widget_ezAd_lu($args) {
|
667 |
extract($args);
|
668 |
-
$
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
$before_title . stripslashes(htmlspecialchars($ezAdOptions['title_lu'])) . $after_title ;
|
673 |
$metaOptions = $this->contentMeta() ;
|
674 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
675 |
$show_lu = $metaOptions['show_lu'] ;
|
676 |
$border = '' ;
|
677 |
-
if ($
|
678 |
-
$border='border:#' . $
|
679 |
-
' solid ' . $
|
680 |
-
' onmouseover="this.style.border=\'#' . $
|
681 |
-
' solid ' . $
|
682 |
-
'onmouseout="this.style.border=\'#' . $
|
683 |
-
' solid ' . $
|
684 |
if ($show_lu != 'no') {
|
685 |
echo $before_widget ;
|
686 |
-
if (!$
|
687 |
-
$margin = $
|
688 |
-
if ($
|
689 |
$inline = '' ;
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
echo stripslashes('<div class="ezAdsense adsense adsense-lu"><div ' .
|
694 |
$inline. '>' . "\n" .
|
695 |
-
$
|
696 |
'</div></div>') ;
|
697 |
echo $after_widget ;
|
698 |
}
|
@@ -700,9 +666,8 @@ if (!class_exists("ezAdSense")) {
|
|
700 |
|
701 |
function widget_ezAd_search($args) {
|
702 |
extract($args);
|
703 |
-
$
|
704 |
-
|
705 |
-
$this->handleDefaultText($ezAdOptions['text_gsearch'], '160x160') ;
|
706 |
$metaOptions = $this->contentMeta() ;
|
707 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
708 |
$title_gsearch = $metaOptions['title_gsearch'] ;
|
@@ -715,15 +680,15 @@ if (!class_exists("ezAdSense")) {
|
|
715 |
$title = '<img src=" ' . $this->plugindir . '/google-light.gif" ' .
|
716 |
' border="0" alt="[Google]" align="middle" />' ;
|
717 |
echo $before_widget ;
|
718 |
-
if (!$
|
719 |
-
$margin = $
|
720 |
-
if ($
|
721 |
$inline = '' ;
|
722 |
-
|
723 |
-
|
724 |
echo stripslashes('<div class="ezAdsense adsense adsense-search"><div ' .
|
725 |
$inline . '>' . "\n" .
|
726 |
-
$
|
727 |
'</div></div>') ;
|
728 |
echo $after_widget ;
|
729 |
}
|
@@ -742,202 +707,128 @@ if (!class_exists("ezAdSense")) {
|
|
742 |
echo 'Settings → Easy AdSense</a>' ;
|
743 |
echo '</p>' ;
|
744 |
}
|
745 |
-
|
746 |
-
function register_ezAdSenseWidgets() {
|
747 |
-
if (function_exists('wp_register_sidebar_widget')) {
|
748 |
-
$widget_ops =
|
749 |
-
array('classname' => 'widget_ezAd_ads', 'description' =>
|
750 |
-
'Easy AdSense: ' .
|
751 |
-
__('Show a Google AdSense block in your sidebar as a widget',
|
752 |
-
'easy-adsenser'));
|
753 |
-
wp_register_sidebar_widget('ezAd_ads', 'Google Ads',
|
754 |
-
array(&$this, 'widget_ezAd_ads'), $widget_ops);
|
755 |
-
$widget_ops =
|
756 |
-
array('classname' => 'widget_ezAd_search', 'description' =>
|
757 |
-
'Easy AdSense: ' .
|
758 |
-
__('Show a Google Search Box in your sidebar as a widget',
|
759 |
-
'easy-adsenser'));
|
760 |
-
wp_register_sidebar_widget('ezAd_search', 'Google Search',
|
761 |
-
array(&$this, 'widget_ezAd_search'), $widget_ops);
|
762 |
-
wp_register_widget_control('ezAd_ads','Google Ads',
|
763 |
-
array(&$this, 'widget_ezAd_control'));
|
764 |
-
wp_register_widget_control('ezAd_search','Google Search',
|
765 |
-
array(&$this, 'widget_ezAd_control'));
|
766 |
-
}
|
767 |
-
}
|
768 |
-
|
769 |
-
function register_ezAdSenseLU() {
|
770 |
-
if (function_exists('wp_register_sidebar_widget')) {
|
771 |
-
for ($id = 0; $id < $this->luMax; $id++) {
|
772 |
-
$reg_wid = 'ezad-lu-' . $id ;
|
773 |
-
$jd = $id + 1;
|
774 |
-
$widget_ops =
|
775 |
-
array('classname' => 'widget_ezAd_lu', 'description' =>
|
776 |
-
'Easy AdSense: ' .
|
777 |
-
__('Show a Google Links Unit in your sidebar as a widget',
|
778 |
-
'easy-adsenser') . " ($jd)");
|
779 |
-
wp_register_sidebar_widget($reg_wid, 'Google Link Units' . " ($jd)",
|
780 |
-
array(&$this, 'widget_ezAd_lu'), $widget_ops);
|
781 |
-
wp_register_widget_control($reg_wid ,'Google Link Units' . " ($jd)",
|
782 |
-
array(&$this, 'widget_ezAd_lu_control'));
|
783 |
-
}
|
784 |
-
}
|
785 |
-
}
|
786 |
}
|
787 |
} //End Class ezAdSense
|
788 |
|
789 |
-
|
790 |
-
$
|
791 |
-
|
792 |
-
// provide a replacement for htmlspecialchars_decode() (for PHP4 compatibility)
|
793 |
-
if (!function_exists("htmlspecialchars_decode")) {
|
794 |
-
function htmlspecialchars_decode($string,$style=ENT_COMPAT) {
|
795 |
-
$translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS,$style));
|
796 |
-
if($style === ENT_QUOTES){ $translation['''] = '\''; }
|
797 |
-
return strtr($string,$translation);
|
798 |
-
}
|
799 |
-
}
|
800 |
-
|
801 |
-
if (class_exists("ezAdSense")) {
|
802 |
-
$ez_ad = new ezAdSense();
|
803 |
-
if (isset($ez_ad) && !empty($ez_ad->defaults)) {
|
804 |
-
//Initialize the admin panel
|
805 |
if (!function_exists("ezAdSense_ap")) {
|
806 |
function ezAdSense_ap() {
|
807 |
-
global $
|
808 |
if (function_exists('add_options_page')) {
|
809 |
add_options_page('Easy AdSense', 'Easy AdSense', 'activate_plugins',
|
810 |
-
basename(__FILE__), array(&$
|
811 |
}
|
812 |
}
|
813 |
}
|
814 |
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
'
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
$ez_ad->widget_ezAd_ads($args) ;
|
832 |
-
}
|
833 |
-
|
834 |
-
function update($new_instance, $old_instance) {
|
835 |
-
// processes widget options to be saved
|
836 |
-
return $new_instance ;
|
837 |
-
}
|
838 |
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
$ez_ad->widget_ezAd_control() ;
|
843 |
-
}
|
844 |
}
|
845 |
-
add_action('widgets_init',
|
846 |
-
create_function('', 'return register_widget("ezAdsWidget");'));
|
847 |
-
|
848 |
-
// sidebar Search Widget
|
849 |
-
class ezAdsSearch extends WP_Widget {
|
850 |
-
function ezAdsSearch() {
|
851 |
-
$widget_ops =
|
852 |
-
array('classname' => 'ezAdsSearch',
|
853 |
-
'description' =>
|
854 |
-
__('Show a Google Search Box in your sidebar as a widget',
|
855 |
-
'easy-adsenser') );
|
856 |
-
$this->WP_Widget('ezAdsSearch', 'Easy AdSense: Google Search',
|
857 |
-
$widget_ops);
|
858 |
-
}
|
859 |
-
function widget($args, $instance) {
|
860 |
-
// outputs the content of the widget
|
861 |
-
global $ez_ad ;
|
862 |
-
$ez_ad->widget_ezAd_search($args) ;
|
863 |
-
}
|
864 |
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
|
|
|
|
|
|
|
|
869 |
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
875 |
}
|
876 |
-
add_action('widgets_init',
|
877 |
-
create_function('', 'return register_widget("ezAdsSearch");'));
|
878 |
-
|
879 |
-
// sidebar Link Units
|
880 |
-
class ezAdsLU extends WP_Widget {
|
881 |
-
function ezAdsLU() {
|
882 |
-
$widget_ops =
|
883 |
-
array('classname' => 'ezAdsLU',
|
884 |
-
'description' =>
|
885 |
-
__('Show a Google Links Unit in your sidebar as a widget',
|
886 |
-
'easy-adsenser') );
|
887 |
-
$this->WP_Widget('ezAdsLU', 'Easy AdSense: Google Link Unit',
|
888 |
-
$widget_ops);
|
889 |
-
}
|
890 |
-
function widget($args, $instance) {
|
891 |
-
// outputs the content of the widget
|
892 |
-
global $ez_ad ;
|
893 |
-
$ez_ad->widget_ezAd_lu($args) ;
|
894 |
-
}
|
895 |
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
}
|
906 |
}
|
907 |
-
add_action('widgets_init',
|
908 |
-
create_function('', 'return register_widget("ezAdsLU");'));
|
909 |
-
}
|
910 |
-
else {
|
911 |
-
add_action('plugins_loaded', array($ez_ad, 'register_ezAdSenseWidgets'));
|
912 |
-
add_action('plugins_loaded', array($ez_ad, 'register_ezAdsenseLU')) ;
|
913 |
}
|
|
|
|
|
914 |
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
925 |
}
|
926 |
-
|
|
|
|
|
|
|
|
|
927 |
add_action('admin_menu', 'ezAdSense_ap');
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
if ($ezAdOptions['max_link'] == -1)
|
932 |
-
add_action('wp_footer', array($ez_ad, 'footer_action'));
|
933 |
else
|
934 |
-
remove_action('wp_footer', array($
|
935 |
|
936 |
-
if ($
|
937 |
-
add_action($
|
938 |
|
939 |
-
if ($
|
940 |
-
add_action($
|
941 |
}
|
942 |
}
|
943 |
-
?>
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Easy AdSense
|
4 |
+
Plugin URI: http://www.thulasidas.com/adsense
|
5 |
+
Description: Easiest way to show AdSense and make money from your blog. Configure it at <a href="options-general.php?page=easy-adsense-lite.php">Settings → Easy AdSense</a>.
|
6 |
+
Version: 6.00
|
7 |
+
Author: Manoj Thulasidas
|
8 |
+
Author URI: http://www.thulasidas.com
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
+
Copyright (C) 2008 www.thulasidas.com
|
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
|
16 |
+
the Free Software Foundation; either version 3 of the License, or
|
17 |
+
(at your option) any later version.
|
18 |
|
19 |
+
This program is distributed in the hope that it will be useful,
|
20 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
GNU General Public License for more details.
|
23 |
|
24 |
+
You should have received a copy of the GNU General Public License
|
25 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
*/
|
27 |
|
28 |
+
if (!class_exists("EzAdSense")) {
|
29 |
+
class EzAdSense {
|
30 |
var $plugindir, $invite, $locale, $defaults, $ezTran,
|
31 |
+
$leadin, $leadout, $options, $optionName ;
|
32 |
+
var $ezMax, $urMax, $luMax, $urCount, $ezCount ;
|
33 |
+
var $adminMsg ;
|
34 |
+
|
35 |
+
function EzAdSense() {
|
36 |
+
$this->adminMsg = '' ;
|
37 |
+
if (file_exists (dirname (__FILE__).'/defaults.php')) {
|
38 |
include (dirname (__FILE__).'/defaults.php');
|
39 |
$this->defaults = $defaults ;
|
40 |
}
|
41 |
if (empty($this->defaults)) {
|
42 |
+
$this->adminMsg = '<div class="error"><p><b><em>Easy AdSense</em></b>: Error locating or loading the defaults! Ensure <code>defaults.php</code> exists, or reinstall the plugin.</p></div>' ;
|
43 |
+
}
|
44 |
+
$this->optionName = "ezAdSense" . get_option('stylesheet') ;
|
45 |
+
$this->options = get_option($this->optionName) ;
|
46 |
+
if (empty($this->options)) {
|
47 |
+
$this->options = $this->mkDefaultOptions() ;
|
48 |
+
}
|
49 |
+
$this->setLang() ;
|
50 |
+
$this->handleSubmits() ;
|
51 |
+
$this->plugindir = get_option('siteurl') . '/' . PLUGINDIR .
|
52 |
+
'/' . basename(dirname(__FILE__)) ;
|
53 |
+
// Counts and limis
|
54 |
+
$this->ezMax = 99 ;
|
55 |
+
$this->urMax = 99 ;
|
56 |
+
$this->luMax = 4 ;
|
57 |
+
$this->urCount = 0 ;
|
58 |
+
$this->ezCount = 0 ;
|
59 |
+
}
|
60 |
+
|
61 |
+
function handleSubmits() {
|
62 |
+
if (empty($_POST)) {
|
63 |
+
return ;
|
64 |
+
}
|
65 |
+
if ((isset($_POST['ezAds-translate']) && !empty($_POST['ezAds-translate'])) ||
|
66 |
+
(isset($_POST['ezAds-make']) && !empty($_POST['ezAds-make'])) ||
|
67 |
+
(isset($_POST['ezAds-clear']) && !empty($_POST['ezAds-clear'])) ||
|
68 |
+
(isset($_POST['ezAds-savePot']) && !empty($_POST['ezAds-savePot'])) ||
|
69 |
+
(isset($_POST['ezAds-mailPot']) && !empty($_POST['ezAds-mailPot'])) ||
|
70 |
+
(isset($_POST['ezAds-editMore']) && !empty($_POST['ezAds-editMore']))) {
|
71 |
if (file_exists (dirname (__FILE__).'/lang/easy-translator.php')){
|
72 |
include (dirname (__FILE__).'/lang/easy-translator.php');
|
73 |
$this->ezTran = new ezTran ;
|
74 |
}
|
75 |
}
|
76 |
+
if (isset($_POST['update_ezAdSenseSettings'])) {
|
77 |
+
if (isset($_POST['ezAdSenseShowLeadin']))
|
78 |
+
$this->options['show_leadin'] = $_POST['ezAdSenseShowLeadin'];
|
79 |
+
if (isset($_POST['ezAdSenseTextLeadin']))
|
80 |
+
$this->options['text_leadin'] = $_POST['ezAdSenseTextLeadin'];
|
81 |
+
if (isset($_POST['ezLeadInMargin']))
|
82 |
+
$this->options['margin_leadin'] = $_POST['ezLeadInMargin'];
|
83 |
+
if (isset($_POST['ezLeadInWC']))
|
84 |
+
$this->options['wc_leadin'] = $_POST['ezLeadInWC'];
|
85 |
+
if (isset($_POST['ezHeaderLeadin']))
|
86 |
+
$this->options['header_leadin'] = $_POST['ezHeaderLeadin'];
|
87 |
+
|
88 |
+
if (isset($_POST['ezAdSenseShowMidtext']))
|
89 |
+
$this->options['show_midtext'] = $_POST['ezAdSenseShowMidtext'];
|
90 |
+
if (isset($_POST['ezAdSenseTextMidtext']))
|
91 |
+
$this->options['text_midtext'] = $_POST['ezAdSenseTextMidtext'];
|
92 |
+
if (isset($_POST['ezMidTextWC']))
|
93 |
+
$this->options['wc_midtext'] = $_POST['ezMidTextWC'];
|
94 |
+
if (isset($_POST['ezMidTextMargin']))
|
95 |
+
$this->options['margin_midtext'] = $_POST['ezMidTextMargin'];
|
96 |
+
|
97 |
+
if (isset($_POST['ezAdSenseShowLeadout']))
|
98 |
+
$this->options['show_leadout'] = $_POST['ezAdSenseShowLeadout'];
|
99 |
+
if (isset($_POST['ezAdSenseTextLeadout']))
|
100 |
+
$this->options['text_leadout'] = $_POST['ezAdSenseTextLeadout'];
|
101 |
+
if (isset($_POST['ezLeadOutWC']))
|
102 |
+
$this->options['wc_leadout'] = $_POST['ezLeadOutWC'];
|
103 |
+
if (isset($_POST['ezLeadOutMargin']))
|
104 |
+
$this->options['margin_leadout'] = $_POST['ezLeadOutMargin'];
|
105 |
+
if (isset($_POST['ezFooterLeadout']))
|
106 |
+
$this->options['footer_leadout'] = $_POST['ezFooterLeadout'];
|
107 |
+
|
108 |
+
if (isset($_POST['ezAdSenseShowWidget']))
|
109 |
+
$this->options['show_widget'] = $_POST['ezAdSenseShowWidget'];
|
110 |
+
if (isset($_POST['ezAdWidgetTitle']))
|
111 |
+
$this->options['title_widget'] = $_POST['ezAdWidgetTitle'];
|
112 |
+
if (isset($_POST['ezAdSenseTextWidget']))
|
113 |
+
$this->options['text_widget'] = $_POST['ezAdSenseTextWidget'];
|
114 |
+
$this->options['kill_widget_title'] = isset($_POST['ezAdKillWidgetTitle']);
|
115 |
+
if (isset($_POST['ezWidgetMargin']))
|
116 |
+
$this->options['margin_widget'] = $_POST['ezWidgetMargin'];
|
117 |
+
|
118 |
+
if (isset($_POST['ezAdSenseShowLU']))
|
119 |
+
$this->options['show_lu'] = $_POST['ezAdSenseShowLU'];
|
120 |
+
if (isset($_POST['ezAdLUTitle']))
|
121 |
+
$this->options['title_lu'] = $_POST['ezAdLUTitle'];
|
122 |
+
if (isset($_POST['ezAdSenseTextLU']))
|
123 |
+
$this->options['text_lu'] = $_POST['ezAdSenseTextLU'];
|
124 |
+
$this->options['kill_lu_title'] = isset($_POST['ezAdKillLUTitle']);
|
125 |
+
if (isset($_POST['ezLUMargin']))
|
126 |
+
$this->options['margin_lu'] = $_POST['ezLUMargin'];
|
127 |
+
|
128 |
+
if (isset($_POST['ezAdSenseShowGSearch'])) {
|
129 |
+
$title = $_POST['ezAdSenseShowGSearch']; ;
|
130 |
+
if ($title != 'dark' && $title != 'light' && $title != 'no')
|
131 |
+
$title = $_POST['ezAdSearchTitle'];
|
132 |
+
$this->options['title_gsearch'] = $title;
|
133 |
+
}
|
134 |
+
if (isset($_POST['killInvites']))
|
135 |
+
$this->options['kill_invites'] = $_POST['killInvites'];
|
136 |
+
if (isset($_POST['killRating']))
|
137 |
+
$this->options['kill_rating'] = $_POST['killRating'];
|
138 |
+
$this->options['kill_gsearch_title'] = isset($_POST['ezAdKillSearchTitle']);
|
139 |
+
if (isset($_POST['ezAdSenseTextGSearch']))
|
140 |
+
$this->options['text_gsearch'] = $_POST['ezAdSenseTextGSearch'];
|
141 |
+
if (isset($_POST['ezSearchMargin']))
|
142 |
+
$this->options['margin_gsearch'] = $_POST['ezSearchMargin'];
|
143 |
+
|
144 |
+
if (isset($_POST['ezAdSenseMax']))
|
145 |
+
$this->options['max_count'] = $_POST['ezAdSenseMax'];
|
146 |
+
if (isset($_POST['ezAdSenseLinkMax']))
|
147 |
+
$this->options['max_link'] = $_POST['ezAdSenseLinkMax'];
|
148 |
+
|
149 |
+
$this->options['force_midad'] = isset($_POST['ezForceMidAd']);
|
150 |
+
$this->options['force_widget'] = isset($_POST['ezForceWidget']);
|
151 |
+
$this->options['allow_feeds'] = isset($_POST['ezAllowFeeds']);
|
152 |
+
$this->options['kill_pages'] = isset($_POST['ezKillPages']);
|
153 |
+
$this->options['kill_home'] = isset($_POST['ezKillHome']);
|
154 |
+
$this->options['kill_attach'] = isset($_POST['ezKillAttach']);
|
155 |
+
$this->options['kill_front'] = isset($_POST['ezKillFront']);
|
156 |
+
$this->options['kill_cat'] = isset($_POST['ezKillCat']);
|
157 |
+
$this->options['kill_tag'] = isset($_POST['ezKillTag']);
|
158 |
+
$this->options['kill_archive'] = isset($_POST['ezKillArchive']);
|
159 |
+
$this->options['kill_inline'] = isset($_POST['ezKillInLine']);
|
160 |
+
|
161 |
+
$this->options['show_borders'] = isset($_POST['ezShowBorders']);
|
162 |
+
if (isset($_POST['ezBorderWidth']))
|
163 |
+
$this->options['border_width'] = intval($_POST['ezBorderWidth']) ;
|
164 |
+
if (isset($_POST['ezBorderNormal']))
|
165 |
+
$this->options['border_normal'] = strval($_POST['ezBorderNormal']) ;
|
166 |
+
if (isset($_POST['ezBorderColor']))
|
167 |
+
$this->options['border_color'] = strval($_POST['ezBorderColor']) ;
|
168 |
+
if (isset($_POST['ezBorderWidget']))
|
169 |
+
$this->options['border_widget'] = $_POST['ezBorderWidget'];
|
170 |
+
if (isset($_POST['ezBorderLU']))
|
171 |
+
$this->options['border_lu'] = $_POST['ezBorderLU'];
|
172 |
|
173 |
+
if (isset($_POST['ezLimitLU'])) {
|
174 |
+
$limit = min(intval($_POST['ezLimitLU']), 3) ;
|
175 |
+
$this->options['limit_lu'] = $limit ;
|
176 |
+
}
|
177 |
+
update_option($this->optionName, $this->options);
|
178 |
+
$this->adminMsg = '<div class="updated"><p><strong>' .
|
179 |
+
__("Settings Updated.", "easy-adsenser") .
|
180 |
+
'</strong></p> </div>' ;
|
181 |
+
}
|
182 |
+
else if (isset($_POST['reset_ezAdSenseSettings'])) {
|
183 |
+
$this->resetOptions();
|
184 |
+
$this->adminMsg = '<div class="updated"><p><strong>' .
|
185 |
+
__("Ok, all your settings have been discarded!", "easy-adsenser") .
|
186 |
+
'</strong></p> </div>' ;
|
187 |
+
}
|
188 |
+
else if (isset($_POST['english'])) {
|
189 |
+
$this->locale = "en_US" ;
|
190 |
+
$moFile = dirname(__FILE__) . '/lang/easy-adsenser.mo';
|
191 |
+
global $l10n;
|
192 |
+
$version = (float)get_bloginfo('version') ;
|
193 |
+
if ($version < 2.80)
|
194 |
+
$l10n['easy-adsenser']->cache_translations = array() ;
|
195 |
+
else
|
196 |
+
unset($l10n['easy-adsenser']) ;
|
197 |
+
load_textdomain('easy-adsenser', $moFile);
|
198 |
+
$this->adminMsg = '<div class="updated"><p><strong>Ok, in English for now. ' .
|
199 |
+
'<a href="options-general.php?page=easy-adsense-lite.php">Switch back</a>. ' .
|
200 |
+
'</strong></p> </div>' ;
|
201 |
+
}
|
202 |
+
else if (isset($_POST['clean_db']) || isset($_POST['kill_me'])) {
|
203 |
+
$this->resetOptions();
|
204 |
+
$this->cleanDB('ezAdSense');
|
205 |
+
$this->adminMsg = '<div class="updated"><p><strong>' .
|
206 |
+
__("Database has been cleaned. All your options for this plugin (for all themes) have been removed.", "easy-adsenser") .
|
207 |
+
'</strong></p> </div>' ;
|
208 |
+
|
209 |
+
if (isset($_POST['kill_me'])) {
|
210 |
+
remove_action('admin_menu', 'ezAdSense_ap');
|
211 |
+
$me = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
|
212 |
+
$this->adminMsg = '<div class="updated"><p><strong>' .
|
213 |
+
__("This plugin can be deactivated now. ", "easy-adsenser") .
|
214 |
+
'<a href="plugins.php">' .
|
215 |
+
__("Go to Plugins", "easy-adsenser") .
|
216 |
+
'</a>.</strong></p></div>' ;
|
217 |
+
}
|
218 |
+
}
|
219 |
}
|
220 |
|
221 |
function setLang() {
|
236 |
else {
|
237 |
// look for any other similar locale with the same first three characters
|
238 |
$foo = glob(dirname(__FILE__) . '/lang/' . substr($this->locale, 0, 2) .
|
239 |
+
'*/easy-adsenser.mo') ;
|
240 |
if (!empty($foo)>0) {
|
241 |
$moFile = $foo[0] ;
|
242 |
load_textdomain($name, $moFile);
|
245 |
$this->invite = '<hr /><font color="red"> Would you like to see ' .
|
246 |
'<b>Easy Adsense</b> in your langugage (<b>' . $locale .
|
247 |
"</b>)? <input type='submit' name='ezAds-translate' onmouseover=\"Tip('It is easy to have <b>Easy AdSense</b> in your language. All you have to do is to translate some strings, and email the file to the author.<br /><br />If you would like to help, please use the translation interface. It picks up the translatable strings in <b>Easy AdSense</b> and presents them (and their existing translations in <b>" . $this->locale .
|
248 |
+
"</b>, if any) in an easy-to-edit form. You can then generate a translation file and email it to the author all from the same form. Slick, isn\'t it? I will include your translation in the next release.', WIDTH, 350, TITLE, 'How to Translate?', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 0, 5])\" onmouseout=\"UnTip()\" value ='Please help translate ' /></font>" ;
|
249 |
}
|
250 |
}
|
251 |
}
|
252 |
|
253 |
+
function mkDefaultOptions(){
|
254 |
+
$defaultOptions =
|
255 |
+
array('info' => "<!-- Easy AdSense V6.01 -->\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
'show_leadin' => 'float:right',
|
257 |
'wc_leadin' => 0,
|
258 |
'margin_leadin' => 12,
|
302 |
'kill_archive' => false,
|
303 |
'kill_inline' => false,
|
304 |
'kill_widget_title' => false,
|
305 |
+
'title_widget' => '');
|
306 |
+
return $defaultOptions ;
|
307 |
+
}
|
308 |
+
|
309 |
+
// Reset all options to defaults
|
310 |
+
function resetOptions() {
|
311 |
+
$defaultOptions = $this->mkDefaultOptions() ;
|
312 |
+
update_option($this->optionName, $defaultOptions);
|
313 |
+
$this->options = $defaultOptions ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
}
|
315 |
|
316 |
function handleDefaultText($text, $key = '300x250') {
|
317 |
$ret = $text ;
|
318 |
+
if ($ret == $this->defaults['defaultText'] || strlen(trim($ret)) == 0) {
|
|
|
319 |
$x = strpos($key, 'x') ;
|
320 |
$w = substr($key, 0, $x);
|
321 |
$h = substr($key, $x+1);
|
325 |
return $ret ;
|
326 |
}
|
327 |
|
328 |
+
function handleDefaults() {
|
|
|
329 |
$texts = array('text_leadin', 'text_midtext', 'text_leadout') ;
|
330 |
+
foreach ($texts as $t) {
|
331 |
+
$text = $this->options[$t] ;
|
332 |
+
$this->options[$t] = $this->handleDefaultText($text) ;
|
|
|
333 |
}
|
|
|
334 |
}
|
335 |
+
|
336 |
// Prints out the admin page
|
337 |
function printAdminPage() {
|
338 |
// if the defaults are not loaded, send error message
|
339 |
if (empty($this->defaults)) return ;
|
340 |
+
if (file_exists (dirname (__FILE__).'/admin.php')) {
|
341 |
+
echo $this->adminMsg ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
include (dirname (__FILE__).'/admin.php');
|
343 |
+
}
|
344 |
else {
|
345 |
echo '<font size="+1" color="red">' ;
|
346 |
_e("Error locating the admin page!\nEnsure admin.php exists, or reinstall the plugin.",
|
347 |
+
'easy-adsenser') ;
|
348 |
echo '</font>' ;
|
349 |
}
|
350 |
+
}
|
351 |
|
352 |
function info($hide=true) {
|
353 |
+
$str = "Easy AdSense (WP) V6.00" ;
|
|
|
354 |
if ($hide)
|
355 |
+
$str = "<!-- $str -->\n";
|
|
|
|
|
|
|
356 |
return $str ;
|
357 |
}
|
358 |
|
361 |
$wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '$prefix%'") ;
|
362 |
}
|
363 |
|
|
|
|
|
|
|
|
|
364 |
function plugin_action($links, $file) {
|
365 |
if ($file == plugin_basename(dirname(__FILE__).'/easy-adsense-lite.php')) {
|
366 |
+
$settings_link = "<a href='options-general.php?page=easy-adsense-lite.php'>" .
|
367 |
+
__('Settings', 'easy-adsenser') . "</a>";
|
368 |
+
array_unshift( $links, $settings_link );
|
369 |
}
|
370 |
return $links;
|
371 |
}
|
372 |
|
373 |
function contentMeta() {
|
|
|
374 |
global $post;
|
375 |
$lookup = array('adsense' => 'adsense',
|
376 |
'adsense-top' =>'show_leadin',
|
381 |
'adsense-linkunits' => 'show_lu') ;
|
382 |
$metaOptions = array() ;
|
383 |
foreach ($lookup as $metaKey => $optKey) {
|
384 |
+
if (!empty($this->options[$optKey])) $metaOptions[$optKey] = $this->options[$optKey] ;
|
385 |
else $metaOptions[$optKey] = '' ;
|
386 |
$customStyle = get_post_custom_values($metaKey, $post->ID, true);
|
387 |
if (is_array($customStyle))
|
402 |
}
|
403 |
|
404 |
function ezAdSense_content($content) {
|
405 |
+
if (!$this->options['allow_feeds'] && is_feed()) return $content ;
|
406 |
+
if ($this->options['kill_pages'] && is_page()) return $content ;
|
407 |
+
if ($this->options['kill_attach'] && is_attachment()) return $content ;
|
408 |
+
if ($this->options['kill_home'] && is_home()) return $content ;
|
409 |
+
if ($this->options['kill_front'] && is_front_page()) return $content ;
|
410 |
+
if ($this->options['kill_cat'] && is_category()) return $content ;
|
411 |
+
if ($this->options['kill_tag'] && is_tag()) return $content ;
|
412 |
+
if ($this->options['kill_archive'] && is_archive()) return $content ;
|
413 |
+
$this->ezMax = $this->options['max_count'] ;
|
414 |
+
if ($this->options['force_widget']) $this->ezMax-- ;
|
415 |
+
$this->urMax = $this->options['max_link'] ;
|
416 |
+
if ($this->ezCount >= $this->ezMax) return $content ;
|
|
|
|
|
417 |
if(strpos($content, "<!--noadsense-->") !== false) return $content;
|
418 |
$metaOptions = $this->contentMeta() ;
|
419 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no')
|
420 |
return $content;
|
421 |
+
$this->handleDefaults() ;
|
422 |
+
$this->options['info'] = $this->info() ;
|
423 |
|
424 |
$wc = str_word_count($content) ;
|
|
|
425 |
$unreal = '' ;
|
426 |
+
if ((is_single() || is_page()) && $this->urCount < $this->urMax)
|
427 |
$unreal = '<div align="center"><font size="-3">' .
|
428 |
'<a href="http://www.thulasidas.com/adsense/" ' .
|
429 |
'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
|
430 |
'Easy AdSense</a> by <a href="http://www.Thulasidas.com/" ' .
|
431 |
+
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
|
432 |
'Unreal</a></font></div>';
|
433 |
|
434 |
$border = '' ;
|
435 |
+
if ($this->options['show_borders'])
|
436 |
+
$border='border:#' . $this->options['border_normal'] .
|
437 |
+
' solid ' . $this->options['border_width'] . 'px;" ' .
|
438 |
+
' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
|
439 |
+
' solid ' . $this->options['border_width'] . 'px\'" ' .
|
440 |
+
'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
|
441 |
+
' solid ' . $this->options['border_width'] . 'px\'"' ;
|
442 |
|
443 |
$show_leadin = $metaOptions['show_leadin'] ;
|
444 |
$leadin = '' ;
|
445 |
+
if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
|
446 |
+
if ($this->ezCount < $this->ezMax) {
|
447 |
+
$this->ezCount++;
|
448 |
+
$margin = $this->options['margin_leadin'] ;
|
449 |
+
if ($this->options['kill_inline'])
|
450 |
$inline = '' ;
|
451 |
else
|
452 |
$inline = 'style="' . $show_leadin .
|
453 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
454 |
$leadin =
|
455 |
+
stripslashes($this->options['info'] .
|
456 |
+
"<!-- Post[count: " . $this->ezCount . "] -->\n" .
|
457 |
'<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
|
458 |
+
$this->options['text_leadin'] .
|
459 |
+
($this->urCount++ < $this->urMax ? $unreal : '') .
|
460 |
+
"</div>\n" . $this->options['info'] . "\n") ;
|
461 |
}
|
462 |
}
|
463 |
|
464 |
$show_midtext = $metaOptions['show_midtext'] ;
|
465 |
+
if ($show_midtext != 'no' && $wc > $this->options['wc_midtext']) {
|
466 |
+
if ($this->ezCount < $this->ezMax) {
|
467 |
$poses = array();
|
468 |
$lastpos = -1;
|
469 |
$repchar = "<p";
|
479 |
array_pop($poses);
|
480 |
$pickme = 0 ;
|
481 |
if (!empty($poses)) $pickme = $poses[floor(sizeof($poses)/2)];
|
482 |
+
if ($this->options['force_midad'] || $half > 10) {
|
483 |
+
$this->ezCount++;
|
484 |
+
$margin = $this->options['margin_midtext'] ;
|
485 |
+
if ($this->options['kill_inline'])
|
|
|
486 |
$inline = '' ;
|
487 |
else
|
488 |
$inline = 'style="' . $show_midtext .
|
489 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
490 |
$midtext =
|
491 |
+
stripslashes($this->options['info'] .
|
492 |
+
"<!-- Post[count: " . $this->ezCount . "] -->\n" .
|
493 |
'<div class="ezAdsense adsense adsense-midtext" ' . $inline . '>' .
|
494 |
+
$this->options['text_midtext'] .
|
495 |
+
($this->urCount++ < $this->urMax ? $unreal : '') .
|
496 |
+
"</div>\n" . $this->options['info'] . "\n") ;
|
497 |
$content = substr_replace($content, $midtext.$repchar, $pickme, 2);
|
498 |
}
|
499 |
}
|
501 |
|
502 |
$show_leadout = $metaOptions['show_leadout'] ;
|
503 |
$leadout = '' ;
|
504 |
+
if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
|
505 |
+
if ($this->ezCount < $this->ezMax) {
|
506 |
+
$this->ezCount++;
|
507 |
+
$margin = $this->options['margin_leadout'] ;
|
508 |
+
if ($this->options['kill_inline'])
|
509 |
$inline = '' ;
|
510 |
else
|
511 |
$inline = 'style="' . $show_leadout .
|
512 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
513 |
$leadout =
|
514 |
+
stripslashes($this->options['info'] .
|
515 |
+
"<!-- Post[count: " . $this->ezCount . "] -->\n" .
|
516 |
'<div class="ezAdsense adsense adsense-leadout" ' . $inline . '>' .
|
517 |
+
$this->options['text_leadout'] .
|
518 |
+
($this->urCount++ < $this->urMax ? $unreal : '') .
|
519 |
+
"</div>\n" . $this->options['info'] . "\n") ;
|
520 |
}
|
521 |
}
|
522 |
+
if ($this->options['header_leadin']) {
|
523 |
$this->leadin = $leadin ;
|
524 |
$leadin = '' ;
|
525 |
}
|
526 |
+
if ($this->options['footer_leadout']) {
|
527 |
$this->leadout = $leadout ;
|
528 |
$leadout = '' ;
|
529 |
}
|
540 |
echo $unreal ;
|
541 |
}
|
542 |
|
543 |
+
function header_leadin() {
|
|
|
544 |
if (is_admin()) return ;
|
|
|
545 |
// is_feed() is not ready, because the WP query hasn't been run yet.
|
546 |
if (strpos($_SERVER['REQUEST_URI'], 'feed') !== false) return ;
|
547 |
// This is sad: Need to pre-construct $this->leadin
|
|
|
|
|
|
|
|
|
|
|
548 |
$unreal = '' ;
|
549 |
$border = '' ;
|
550 |
+
if ($this->options['show_borders'])
|
551 |
+
$border='border:#' . $this->options['border_normal'] .
|
552 |
+
' solid ' . $this->options['border_width'] . 'px;" ' .
|
553 |
+
' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
|
554 |
+
' solid ' . $this->options['border_width'] . 'px\'" ' .
|
555 |
+
'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
|
556 |
+
' solid ' . $this->options['border_width'] . 'px\'"' ;
|
557 |
+
$show_leadin = $this->options['show_leadin'] ;
|
558 |
if ($show_leadin != 'no') {
|
559 |
+
$margin = $this->options['margin_leadin'] ;
|
560 |
+
if ($this->options['kill_inline'])
|
561 |
+
$inline = '' ;
|
562 |
+
else
|
563 |
+
$inline = 'style="' . $show_leadin .
|
564 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
565 |
+
$this->ezCount++ ;
|
566 |
+
$this->leadin =
|
567 |
+
stripslashes($this->options['info'] .
|
568 |
+
"<!-- Post[count: " . $this->ezCount . "] -->\n" .
|
569 |
+
'<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
|
570 |
+
$this->options['text_leadin'] .
|
571 |
+
($this->urCount++ < $this->urMax ? $unreal : '') .
|
572 |
+
"</div>\n" . $this->options['info'] . "\n") ;
|
573 |
+
echo $this->leadin ;
|
574 |
}
|
575 |
}
|
576 |
|
577 |
function footer_leadout(){
|
|
|
578 |
if (is_admin()) return ;
|
579 |
echo $this->leadout ;
|
580 |
}
|
582 |
// ===== widget functions =====
|
583 |
function widget_ezAd_ads($args) {
|
584 |
extract($args);
|
585 |
+
$this->options['text_widget'] =
|
586 |
+
$this->handleDefaultText($this->options['text_widget'], '160x600') ;
|
587 |
+
$this->options['info'] = $this->info() ;
|
588 |
$metaOptions = $this->contentMeta() ;
|
589 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
590 |
$show_widget = $metaOptions['show_widget'] ;
|
591 |
if ($show_widget == 'no') return ;
|
592 |
+
$this->ezMax = $this->options['max_count'] ;
|
593 |
+
$this->urMax = $this->options['max_link'] ;
|
594 |
+
if (!$this->options['force_widget']) {
|
595 |
+
if ($this->ezCount >= $this->ezMax) return ;
|
596 |
+
$this->ezCount++;
|
597 |
+
}
|
598 |
+
$title = empty($this->options['title_widget']) ?
|
|
|
|
|
599 |
__('Sponsored Links', 'easy-adsenser') :
|
600 |
+
stripslashes(htmlspecialchars($this->options['title_widget'])) ;
|
601 |
$border = '' ;
|
602 |
+
if ($this->options['show_borders'] && $this->options['border_widget'] )
|
603 |
+
$border='border:#' . $this->options['border_normal'] .
|
604 |
+
' solid ' . $this->options['border_width'] . 'px ;"' .
|
605 |
+
' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
|
606 |
+
' solid ' . $this->options['border_width'] . 'px\'" ' .
|
607 |
+
'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
|
608 |
+
' solid ' . $this->options['border_width'] . 'px\'"' ;
|
609 |
$unreal = '<div align="center"><font size="-3">' .
|
610 |
'<a href="http://thulasidas.com/adsense" ' .
|
611 |
'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
|
613 |
'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
|
614 |
'Unreal</a></font></div>';
|
615 |
echo $before_widget;
|
616 |
+
if (!$this->options['kill_widget_title'])
|
617 |
echo $before_title . $title . $after_title;
|
618 |
+
$margin = $this->options['margin_widget'] ;
|
619 |
+
if ($this->options['kill_inline'])
|
620 |
$inline = '' ;
|
621 |
else
|
622 |
$inline = 'style="' . $show_widget .
|
623 |
';margin:' . $margin . 'px;' . $border. '"' ;
|
624 |
+
echo stripslashes($this->options['info'] .
|
625 |
+
"<!-- Widg[count: " . $this->ezCount . "] -->\n" .
|
626 |
'<div class="ezAdsense adsense adsense-widget"><div ' . $inline. '>' .
|
627 |
+
$this->options['text_widget'] .
|
628 |
+
($this->urCount++ < $this->urMax ? $unreal : '') .
|
629 |
+
"</div></div>\n" . $this->options['info'] . "\n") ;
|
630 |
echo $after_widget;
|
631 |
}
|
632 |
|
633 |
function widget_ezAd_lu($args) {
|
634 |
extract($args);
|
635 |
+
$this->options['text_lu'] =
|
636 |
+
$this->handleDefaultText($this->options['text_lu'], '160x160') ;
|
637 |
+
$title = empty($this->options['title_lu']) ? '' :
|
638 |
+
$before_title . stripslashes(htmlspecialchars($this->options['title_lu'])) . $after_title ;
|
|
|
639 |
$metaOptions = $this->contentMeta() ;
|
640 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
641 |
$show_lu = $metaOptions['show_lu'] ;
|
642 |
$border = '' ;
|
643 |
+
if ($this->options['show_borders'] && $this->options['border_lu'] )
|
644 |
+
$border='border:#' . $this->options['border_normal'] .
|
645 |
+
' solid ' . $this->options['border_width'] . 'px;" ' .
|
646 |
+
' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
|
647 |
+
' solid ' . $this->options['border_width'] . 'px\'" ' .
|
648 |
+
'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
|
649 |
+
' solid ' . $this->options['border_width'] . 'px\'"' ;
|
650 |
if ($show_lu != 'no') {
|
651 |
echo $before_widget ;
|
652 |
+
if (!$this->options['kill_widget_title']) echo $title ;
|
653 |
+
$margin = $this->options['margin_lu'] ;
|
654 |
+
if ($this->options['kill_inline'])
|
655 |
$inline = '' ;
|
656 |
+
else
|
657 |
+
$inline = 'style="' . $show_widget .
|
658 |
+
';margin:' . $margin . 'px;' . $border. '"' ;
|
659 |
echo stripslashes('<div class="ezAdsense adsense adsense-lu"><div ' .
|
660 |
$inline. '>' . "\n" .
|
661 |
+
$this->options['text_lu'] . "\n" .
|
662 |
'</div></div>') ;
|
663 |
echo $after_widget ;
|
664 |
}
|
666 |
|
667 |
function widget_ezAd_search($args) {
|
668 |
extract($args);
|
669 |
+
$this->options['text_gsearch'] =
|
670 |
+
$this->handleDefaultText($this->options['text_gsearch'], '160x160') ;
|
|
|
671 |
$metaOptions = $this->contentMeta() ;
|
672 |
if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
|
673 |
$title_gsearch = $metaOptions['title_gsearch'] ;
|
680 |
$title = '<img src=" ' . $this->plugindir . '/google-light.gif" ' .
|
681 |
' border="0" alt="[Google]" align="middle" />' ;
|
682 |
echo $before_widget ;
|
683 |
+
if (!$this->options['kill_gsearch_title']) echo $title ;
|
684 |
+
$margin = $this->options['margin_gsearch'] ;
|
685 |
+
if ($this->options['kill_inline'])
|
686 |
$inline = '' ;
|
687 |
+
else
|
688 |
+
$inline = 'style="margin:' . $margin . 'px; "' ;
|
689 |
echo stripslashes('<div class="ezAdsense adsense adsense-search"><div ' .
|
690 |
$inline . '>' . "\n" .
|
691 |
+
$this->options['text_gsearch'] . "\n" .
|
692 |
'</div></div>') ;
|
693 |
echo $after_widget ;
|
694 |
}
|
707 |
echo 'Settings → Easy AdSense</a>' ;
|
708 |
echo '</p>' ;
|
709 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
710 |
}
|
711 |
} //End Class ezAdSense
|
712 |
|
713 |
+
if (class_exists("EzAdSense")) {
|
714 |
+
$ezAdSense = new EzAdSense();
|
715 |
+
if (isset($ezAdSense) && !empty($ezAdSense->defaults)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
716 |
if (!function_exists("ezAdSense_ap")) {
|
717 |
function ezAdSense_ap() {
|
718 |
+
global $ezAdSense ;
|
719 |
if (function_exists('add_options_page')) {
|
720 |
add_options_page('Easy AdSense', 'Easy AdSense', 'activate_plugins',
|
721 |
+
basename(__FILE__), array(&$ezAdSense, 'printAdminPage'));
|
722 |
}
|
723 |
}
|
724 |
}
|
725 |
|
726 |
+
// sidebar AdSense Widget (skyscraper)
|
727 |
+
class ezAdsWidget extends WP_Widget {
|
728 |
+
function ezAdsWidget() {
|
729 |
+
$widget_ops =
|
730 |
+
array('classname' => 'ezAdsWidget',
|
731 |
+
'description' =>
|
732 |
+
__('Show a Google AdSense block in your sidebar as a widget',
|
733 |
+
'easy-adsenser') );
|
734 |
+
$this->WP_Widget('ezAdsWidget', 'Easy AdSense: Google Ads',
|
735 |
+
$widget_ops);
|
736 |
+
}
|
737 |
+
function widget($args, $instance) {
|
738 |
+
// outputs the content of the widget
|
739 |
+
global $ezAdSense ;
|
740 |
+
$ezAdSense->widget_ezAd_ads($args) ;
|
741 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
742 |
|
743 |
+
function update($new_instance, $old_instance) {
|
744 |
+
// processes widget options to be saved
|
745 |
+
return $new_instance ;
|
|
|
|
|
746 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
|
748 |
+
function form($instance) {
|
749 |
+
// outputs the options form on admin
|
750 |
+
global $ezAdSense ;
|
751 |
+
$ezAdSense->widget_ezAd_control() ;
|
752 |
+
}
|
753 |
+
}
|
754 |
+
add_action('widgets_init',
|
755 |
+
create_function('', 'return register_widget("ezAdsWidget");'));
|
756 |
|
757 |
+
// sidebar Search Widget
|
758 |
+
class ezAdsSearch extends WP_Widget {
|
759 |
+
function ezAdsSearch() {
|
760 |
+
$widget_ops =
|
761 |
+
array('classname' => 'ezAdsSearch',
|
762 |
+
'description' =>
|
763 |
+
__('Show a Google Search Box in your sidebar as a widget',
|
764 |
+
'easy-adsenser') );
|
765 |
+
$this->WP_Widget('ezAdsSearch', 'Easy AdSense: Google Search',
|
766 |
+
$widget_ops);
|
767 |
+
}
|
768 |
+
function widget($args, $instance) {
|
769 |
+
// outputs the content of the widget
|
770 |
+
global $ezAdSense ;
|
771 |
+
$ezAdSense->widget_ezAd_search($args) ;
|
772 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
|
774 |
+
function update($new_instance, $old_instance) {
|
775 |
+
// processes widget options to be saved
|
776 |
+
return $new_instance ;
|
777 |
+
}
|
778 |
|
779 |
+
function form($instance) {
|
780 |
+
// outputs the options form on admin
|
781 |
+
global $ezAdSense ;
|
782 |
+
$ezAdSense->widget_ezAd_control() ;
|
|
|
783 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
}
|
785 |
+
add_action('widgets_init',
|
786 |
+
create_function('', 'return register_widget("ezAdsSearch");'));
|
787 |
|
788 |
+
// sidebar Link Units
|
789 |
+
class ezAdsLU extends WP_Widget {
|
790 |
+
function ezAdsLU() {
|
791 |
+
$widget_ops =
|
792 |
+
array('classname' => 'ezAdsLU',
|
793 |
+
'description' =>
|
794 |
+
__('Show a Google Links Unit in your sidebar as a widget',
|
795 |
+
'easy-adsenser') );
|
796 |
+
$this->WP_Widget('ezAdsLU', 'Easy AdSense: Google Link Unit',
|
797 |
+
$widget_ops);
|
798 |
+
}
|
799 |
+
function widget($args, $instance) {
|
800 |
+
// outputs the content of the widget
|
801 |
+
global $ezAdSense ;
|
802 |
+
$ezAdSense->widget_ezAd_lu($args) ;
|
803 |
+
}
|
804 |
+
|
805 |
+
function update($new_instance, $old_instance) {
|
806 |
+
// processes widget options to be saved
|
807 |
+
return $new_instance ;
|
808 |
+
}
|
809 |
+
|
810 |
+
function form($instance) {
|
811 |
+
// outputs the options form on admin
|
812 |
+
global $ezAdSense ;
|
813 |
+
$ezAdSense->widget_ezAd_control() ;
|
814 |
+
}
|
815 |
}
|
816 |
+
add_action('widgets_init',
|
817 |
+
create_function('', 'return register_widget("ezAdsLU");'));
|
818 |
+
|
819 |
+
add_filter('the_content', array($ezAdSense, 'ezAdSense_content'));
|
820 |
+
$ezAdSense->luMax = $ezAdSense->options['limit_lu'] ;
|
821 |
add_action('admin_menu', 'ezAdSense_ap');
|
822 |
+
add_filter('plugin_action_links', array($ezAdSense, 'plugin_action'), -10, 2);
|
823 |
+
if ($ezAdSense->options['max_link'] == -1)
|
824 |
+
add_action('wp_footer', array($ezAdSense, 'footer_action'));
|
|
|
|
|
825 |
else
|
826 |
+
remove_action('wp_footer', array($ezAdSense, 'footer_action'));
|
827 |
|
828 |
+
if ($ezAdSense->options['header_leadin'])
|
829 |
+
add_action($ezAdSense->options['header_leadin'], array($ezAdSense, 'header_leadin'));
|
830 |
|
831 |
+
if ($ezAdSense->options['footer_leadout'])
|
832 |
+
add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
|
833 |
}
|
834 |
}
|
|
lang/easy-translator.php
CHANGED
@@ -52,6 +52,7 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
52 |
function textId() {
|
53 |
$ht = round(strlen($this->id)/52 + 1) * 25 ;
|
54 |
$col = 'background-color:#f5f5f5;' ;
|
|
|
55 |
if ($this->keyVal > MINMATCH+1) {
|
56 |
$col = "background-color:#ffc;border: solid 1px #f00" ;
|
57 |
$tit = 'onmouseover = "Tip(\'Another similar string: ' .
|
@@ -70,6 +71,7 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
70 |
|
71 |
function textStr() {
|
72 |
$ht = round(strlen($this->id)/52 + 1) * 25 ;
|
|
|
73 |
if ($this->tranVal > MINMATCH+1){
|
74 |
$col = "background-color:#fdd;border: solid 1px #f00" ;
|
75 |
$tit = 'onmouseover = "Tip(\'Using the translation for a similar string: ' .
|
@@ -79,7 +81,7 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
79 |
'onmouseout="UnTip()"';
|
80 |
}
|
81 |
$s = '<textarea cols="50" rows="15" name="' . $this->num .
|
82 |
-
'" style="width: 45%;height:' . $ht . 'px;' . $col. '" ' .
|
83 |
$tit . '>';
|
84 |
$s .= htmlspecialchars($this->str, ENT_QUOTES) ;
|
85 |
$s .= '</textarea><br />' ;
|
@@ -94,7 +96,7 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
94 |
session_start() ;
|
95 |
$this->status = '' ;
|
96 |
$this->error = '' ;
|
97 |
-
if ($_POST['ezAds-savePot']) {
|
98 |
$file = $_POST['potFile'] ;
|
99 |
$str = $_POST['potStr'] ;
|
100 |
header('Content-Disposition: attachment; filename="' . $file .'"');
|
@@ -107,12 +109,12 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
107 |
$this->status = '<div class="updated">Pot file: ' . $file . ' was saved.</div> ' ;
|
108 |
exit(0) ;
|
109 |
}
|
110 |
-
if ($_POST['ezAds-clear']) {
|
111 |
$this->status =
|
112 |
'<div class="updated">Reloaded the translations from PHP files and MO.</div> ' ;
|
113 |
unset($_SESSION['ezAds-POs']) ;
|
114 |
}
|
115 |
-
if ($_POST['ezAds-mailPot']) {
|
116 |
$file = $_POST['potFile'] ;
|
117 |
$str = stripslashes($_POST['potStr']) ;
|
118 |
$str = str_replace("\'", "'", $str) ;
|
@@ -197,8 +199,13 @@ if (!class_exists("ezTran") && !class_exists("PO")) {
|
|
197 |
$keys = array_unique($matches[1]) ;
|
198 |
$keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys) ;
|
199 |
foreach ($keys as $n => $k) {
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
202 |
$po = new PO($k, $t) ;
|
203 |
$po->num = $n ;
|
204 |
array_push($POs, $po) ;
|
52 |
function textId() {
|
53 |
$ht = round(strlen($this->id)/52 + 1) * 25 ;
|
54 |
$col = 'background-color:#f5f5f5;' ;
|
55 |
+
$col = $tit = '' ;
|
56 |
if ($this->keyVal > MINMATCH+1) {
|
57 |
$col = "background-color:#ffc;border: solid 1px #f00" ;
|
58 |
$tit = 'onmouseover = "Tip(\'Another similar string: ' .
|
71 |
|
72 |
function textStr() {
|
73 |
$ht = round(strlen($this->id)/52 + 1) * 25 ;
|
74 |
+
$col = $tit = '' ;
|
75 |
if ($this->tranVal > MINMATCH+1){
|
76 |
$col = "background-color:#fdd;border: solid 1px #f00" ;
|
77 |
$tit = 'onmouseover = "Tip(\'Using the translation for a similar string: ' .
|
81 |
'onmouseout="UnTip()"';
|
82 |
}
|
83 |
$s = '<textarea cols="50" rows="15" name="' . $this->num .
|
84 |
+
'" style="width: 45%;height:' . $ht . 'px;' . $col . '" ' .
|
85 |
$tit . '>';
|
86 |
$s .= htmlspecialchars($this->str, ENT_QUOTES) ;
|
87 |
$s .= '</textarea><br />' ;
|
96 |
session_start() ;
|
97 |
$this->status = '' ;
|
98 |
$this->error = '' ;
|
99 |
+
if (!empty($_POST['ezAds-savePot'])) {
|
100 |
$file = $_POST['potFile'] ;
|
101 |
$str = $_POST['potStr'] ;
|
102 |
header('Content-Disposition: attachment; filename="' . $file .'"');
|
109 |
$this->status = '<div class="updated">Pot file: ' . $file . ' was saved.</div> ' ;
|
110 |
exit(0) ;
|
111 |
}
|
112 |
+
if (!empty($_POST['ezAds-clear'])) {
|
113 |
$this->status =
|
114 |
'<div class="updated">Reloaded the translations from PHP files and MO.</div> ' ;
|
115 |
unset($_SESSION['ezAds-POs']) ;
|
116 |
}
|
117 |
+
if (!empty($_POST['ezAds-mailPot'])) {
|
118 |
$file = $_POST['potFile'] ;
|
119 |
$str = stripslashes($_POST['potStr']) ;
|
120 |
$str = str_replace("\'", "'", $str) ;
|
199 |
$keys = array_unique($matches[1]) ;
|
200 |
$keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys) ;
|
201 |
foreach ($keys as $n => $k) {
|
202 |
+
if (!empty($mo[$k])) {
|
203 |
+
$v = $mo[$k] ;
|
204 |
+
$t = $v->translations[0] ;
|
205 |
+
}
|
206 |
+
else {
|
207 |
+
$t = '' ;
|
208 |
+
}
|
209 |
$po = new PO($k, $t) ;
|
210 |
$po->num = $n ;
|
211 |
array_push($POs, $po) ;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://buy.thulasidas.com/easy-adsense
|
|
4 |
Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.4
|
7 |
-
Stable tag:
|
8 |
|
9 |
Easy AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
|
10 |
|
@@ -32,13 +32,13 @@ Easy AdSense is the freely distributed version of a premium plugin. The [Pro ver
|
|
32 |
|
33 |
= New in this Release =
|
34 |
|
35 |
-
|
36 |
|
37 |
== Upgrade Notice ==
|
38 |
|
39 |
-
=
|
40 |
|
41 |
-
|
42 |
|
43 |
== Screenshots ==
|
44 |
|
@@ -126,6 +126,7 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
|
|
126 |
|
127 |
== Change Log ==
|
128 |
|
|
|
129 |
* V5.24: Fixing some warning notices. [Oct 27, 2012]
|
130 |
* V5.23: The above-header placement does not mess up the RSS feed now. [Oct 27, 2012]
|
131 |
* V5.22: Adding a user support link on the admin page. [Oct 5, 2012]
|
4 |
Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.4
|
7 |
+
Stable tag: 6.00
|
8 |
|
9 |
Easy AdSense manages all aspects of AdSense: insert ads into posts and sidebar, and add a Google Search box. Easiest and most complete AdSense Plugin!
|
10 |
|
32 |
|
33 |
= New in this Release =
|
34 |
|
35 |
+
Major re-organization of the code.
|
36 |
|
37 |
== Upgrade Notice ==
|
38 |
|
39 |
+
= 6.00 =
|
40 |
|
41 |
+
Major re-organization of the code.
|
42 |
|
43 |
== Screenshots ==
|
44 |
|
126 |
|
127 |
== Change Log ==
|
128 |
|
129 |
+
* V6.00: Major re-organization of the code. [Nov 1, 2012]
|
130 |
* V5.24: Fixing some warning notices. [Oct 27, 2012]
|
131 |
* V5.23: The above-header placement does not mess up the RSS feed now. [Oct 27, 2012]
|
132 |
* V5.22: Adding a user support link on the admin page. [Oct 5, 2012]
|
screenshot-1.gif
CHANGED
Binary file
|