Easy Plugin for AdSense - Version 7.00

Version Description

Major changes to the options data model and the translation interface. If you notice anything not working as expected, please leave a note.

Download this release

Release Info

Developer manojtd
Plugin Icon 128x128 Easy Plugin for AdSense
Version 7.00
Comparing to
See all releases

Code changes from version 6.51 to 7.00

Files changed (58) hide show
  1. EzAdmin.php +480 -0
  2. EzOptions.php +598 -0
  3. EzTran.php +650 -0
  4. admin.php +316 -447
  5. defaults.php +0 -2
  6. easy-adsense-lite.php +1002 -641
  7. english.gif +0 -0
  8. head-text.php +10 -170
  9. lang/{ar_MA/easy-adsenser.mo → ar_MA.mo} +0 -0
  10. lang/{ar_MA/easy-adsenser.po → ar_MA.po} +0 -0
  11. lang/{by_BY/easy-adsenser.mo → by_BY.mo} +0 -0
  12. lang/{by_BY/easy-adsenser.po → by_BY.po} +0 -0
  13. lang/{da_DK/easy-adsenser.mo → da_DK.mo} +0 -0
  14. lang/{da_DK/easy-adsenser.po → da_DK.po} +0 -0
  15. lang/{de_DE/easy-adsenser.mo → de_DE.mo} +0 -0
  16. lang/{de_DE/easy-adsenser.po → de_DE.po} +0 -0
  17. lang/easy-translator.php +0 -375
  18. lang/{es_ES/easy-adsenser.mo → es_ES.mo} +0 -0
  19. lang/{es_ES/easy-adsenser.po → es_ES.po} +0 -0
  20. lang/{fa_IR/easy-adsenser.mo → fa_IR.mo} +0 -0
  21. lang/{fa_IR/easy-adsenser.po → fa_IR.po} +0 -0
  22. lang/{fr_FR/easy-adsenser.mo → fr_FR.mo} +0 -0
  23. lang/{fr_FR/easy-adsenser.po → fr_FR.po} +0 -0
  24. lang/{id_ID/easy-adsenser.mo → id_ID.mo} +0 -0
  25. lang/{id_ID/easy-adsenser.po → id_ID.po} +0 -0
  26. lang/{it_IT/easy-adsenser.mo → it_IT.mo} +0 -0
  27. lang/{it_IT/easy-adsenser.po → it_IT.po} +0 -0
  28. lang/{ko_KR/easy-adsenser.mo → ko_KR.mo} +0 -0
  29. lang/{ko_KR/easy-adsenser.po → ko_KR.po} +0 -0
  30. lang/{nb_NO/easy-adsenser.mo → nb_NO.mo} +0 -0
  31. lang/{nb_NO/easy-adsenser.po → nb_NO.po} +0 -0
  32. lang/{nl_NL/easy-adsenser.mo → nl_NL.mo} +0 -0
  33. lang/{nl_NL/easy-adsenser.po → nl_NL.po} +0 -0
  34. lang/{pl_PL/easy-adsenser.mo → pl_PL.mo} +0 -0
  35. lang/{pl_PL/easy-adsenser.po → pl_PL.po} +0 -0
  36. lang/{pt_BR/easy-adsenser.mo → pt_BR.mo} +0 -0
  37. lang/{pt_BR/easy-adsenser.po → pt_BR.po} +0 -0
  38. lang/{pt_PT/easy-adsenser.mo → pt_PT.mo} +0 -0
  39. lang/{pt_PT/easy-adsenser.po → pt_PT.po} +0 -0
  40. lang/{ro_RO/easy-adsenser.mo → ro_RO.mo} +0 -0
  41. lang/{ro_RO/easy-adsenser.po → ro_RO.po} +0 -0
  42. lang/{ru_RU/easy-adsenser.mo → ru_RU.mo} +0 -0
  43. lang/{ru_RU/easy-adsenser.po → ru_RU.po} +0 -0
  44. lang/{th_TH/easy-adsenser.mo → th_TH.mo} +0 -0
  45. lang/{th_TH/easy-adsenser.po → th_TH.po} +0 -0
  46. lang/{tr_TR/easy-adsenser.mo → tr_TR.mo} +0 -0
  47. lang/{tr_TR/easy-adsenser.po → tr_TR.po} +0 -0
  48. lang/{uk_UE/easy-adsenser.mo → uk_UE.mo} +0 -0
  49. lang/{uk_UE/easy-adsenser.po → uk_UE.po} +0 -0
  50. lang/{zh_CN/easy-adsenser.mo → zh_CN.mo} +0 -0
  51. lang/{zh_CN/easy-adsenser.po → zh_CN.po} +0 -0
  52. lang/{zh_TW/easy-adsenser.mo → zh_TW.mo} +0 -0
  53. lang/{zh_TW/easy-adsenser.po → zh_TW.po} +0 -0
  54. myPlugins.php +22 -85
  55. readme.txt +21 -17
  56. support.php +0 -120
  57. tail-text.php +63 -153
  58. why-pro.php +0 -21
EzAdmin.php ADDED
@@ -0,0 +1,480 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Copyright (C) 2008 www.ads-ez.com
5
+
6
+ This program is free software; you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation; either version 3 of the License, or (at
9
+ your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ if (!class_exists('EzAdmin')) {
21
+
22
+ class EzAdmin {
23
+
24
+ var $plgURL, $plgFile, $plg, $slug, $name;
25
+ var $killAuthor = false;
26
+
27
+ function __construct($plg, $slug, $plgURL) {
28
+ $this->plg = $plg;
29
+ $this->slug = $slug;
30
+ $this->plgURL = $plgURL;
31
+ }
32
+
33
+ function __destruct() {
34
+
35
+ }
36
+
37
+ function EzAdmin($plg, $slug, $plgURL) {
38
+ if (version_compare(PHP_VERSION, "5.0.0", "<")) {
39
+ $this->__construct($plg, $slug, $plgURL);
40
+ register_shutdown_function(array($this, "__destruct"));
41
+ }
42
+ }
43
+
44
+ function renderInvite() {
45
+ if ($this->killAuthor) {
46
+ return;
47
+ }
48
+ $plg = $this->plg;
49
+ $slug = $this->slug;
50
+ $plgLongName = $plg['value'];
51
+ $plgPrice = $plg['price'];
52
+ $benefits = $plg['benefits'];
53
+ $yesTip = sprintf(__('Buy %s Pro for $%s. PayPal payment. Instant download.', 'easy-adsenser'), $plgLongName, $plgPrice);
54
+ $yesTitle = __('Get the Pro version now!', 'easy-adsenser');
55
+ $noTip = __('Continue using the Lite version, and hide this message. After clicking this button, please remember to save your options to hide this box for good.', 'easy-adsenser');
56
+ $noTitle = __('Stay Lite', 'easy-adsenser');
57
+ if (empty($benefits)) {
58
+ return;
59
+ }
60
+ echo <<<ENDINVITE
61
+ <input type="hidden" id="kill_invites" name="kill_invites" value="" />
62
+ <div class="updated" id="tnc">
63
+ <p><h3>Want More Features? <a href="#" onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" onclick = "buttonwhich('Yes')">Go Pro!</a></h3>
64
+ The Pro version of this plugin gives you more features and benefits. For instance,
65
+ <ol>
66
+ $benefits
67
+ </ol>
68
+ And much more. New features and bug fixes will first appear in the Pro version before being ported to this freely distributed Lite edition. <br />
69
+ <input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "Go Pro!" onclick = "buttonwhich('Yes')" />
70
+ <input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "No thanks" onclick = "buttonwhich('No')" />
71
+ <script type = "text/javascript">
72
+ function hideInvite() {
73
+ document.getElementById("tnc").style.display = 'none';
74
+ }
75
+ function buttonwhich(message) {
76
+ document.getElementById("ybutton").style.display = 'none';
77
+ document.getElementById("nbutton").disabled = 'true';
78
+ document.getElementById("kill_invites").value = 'true' ;
79
+ setTimeout('hideInvite()', 5000);
80
+ if (message == 'Yes') popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768) ;
81
+ if (message == 'No') document.getElementById("nbutton").value = 'Thank you for using $plgLongName! Please save options to hide this box forever';
82
+ }
83
+ </script>
84
+ </div>
85
+ ENDINVITE;
86
+ }
87
+
88
+ function renderRating($killable = true) {
89
+ if ($this->killAuthor) {
90
+ return;
91
+ }
92
+ $plgFile = $this->plgFile;
93
+ $plg = $this->plg;
94
+ $plgCTime = filemtime($plgFile);
95
+ $plgLongName = $plg['value'];
96
+ $hideTip = __('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-adsenser');
97
+ if (time() > $plgCTime + (60 * 60 * 24 * 30)) {
98
+ $msg = "You've installed this plugin over a month ago.";
99
+ }
100
+ else {
101
+ $msg = "You will find it feature-rich and robust.";
102
+ }
103
+ $plgKey = basename($plgFile, '.php');
104
+ $display = '';
105
+ if (!$killable) {
106
+ $display = "style='display:none'";
107
+ }
108
+ echo <<<ENDRATING
109
+ <div class='updated' id='rating'>
110
+ <p>Thanks for using <i><b>$plgLongName</b></i>! $msg <br />
111
+ If you are satisfied with how well it works, why not <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','Rate it', 1024, 768);return false;">rate it</a>
112
+ and <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','Rate it', 1024, 768);return false;">recommend it</a> to others? :-)
113
+ <small style='font-weight:normal;'><a id='hideRating' $display href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLICKCLOSE, true, TITLE, 'Hide this Box')" onmouseout="UnTip()" onclick = "hideme()">
114
+ Don't show this anymore</a></small></p></div>
115
+ <input type="hidden" id="kill_rating" name="kill_rating" value="" />
116
+ <script type = "text/javascript">
117
+ function hideRating() {
118
+ document.getElementById("rating").style.display = 'none';
119
+ }
120
+ function hideme() {
121
+ document.getElementById("kill_rating").value = 'true' ;
122
+ document.getElementById("hideRating").innerHTML = 'Please hit the "Save Changes" button below to hide this box forever';
123
+ setTimeout('hideRating()', 4000);
124
+ }
125
+ </script>
126
+ ENDRATING;
127
+ }
128
+
129
+ function renderHeadText() {
130
+ $plgURL = $this->plgURL;
131
+ $plg = $this->plg;
132
+ $slug = $this->slug;
133
+ $value = '<em><strong>' . $plg['value'] . '</strong></em>';
134
+ $toolTip = $plg['title'];
135
+ $price = $plg['price'];
136
+ $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\"";
137
+ $moreInfo = "<b><a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of {$plg['value']} for \$$price. Instant download link.' $onclick>Pro Version</a></b>";
138
+ $toolTip .= addslashes('<br />' . $moreInfo);
139
+ $why = addslashes($plg['pro']);
140
+ $version = 'Lite';
141
+ echo "<b>Get Pro Version!</b>
142
+ <a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of the $slug plugin. Instant download link.' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright'/></a>
143
+ <br />
144
+ You are using the $version version of $value, which is also available in a Pro version.
145
+ <ul><li>
146
+ $moreInfo
147
+ </li>
148
+ <li>$why And it costs only \$$price!</li>
149
+ </ul>";
150
+ }
151
+
152
+ function renderProText() {
153
+ echo "<div id='pro' style='display:none'>";
154
+ $this->renderHeadText();
155
+ echo "</div>";
156
+ if ($this->killAuthor) {
157
+ return;
158
+ }
159
+ $plg = $this->plg;
160
+ $slug = $this->slug;
161
+ $value = '<em><strong>' . $plg['value'] . '</strong></em>';
162
+ $filter = '';
163
+ if (stripos($slug, 'adsense') !== FALSE) {
164
+ $filter = " (e.g., a filter to ensure AdSense policy compliance) ";
165
+ }
166
+ $toolTip = $plg['title'];
167
+ $price = $plg['price'];
168
+ $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\"";
169
+ $moreInfo = "&nbsp; <a href='http://buy.thulasidas.com/lite/$slug.zip' title='Download the Lite version of $value'>Lite Version </a>&nbsp; <a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of $value for \$$price' $onclick>Pro Version</a>";
170
+ $toolTip .= addslashes('<br />' . $moreInfo);
171
+ echo "<div style='background-color:#ffcccc;padding:5px;border: solid 1px;text-align:center;'>
172
+ <span style='font-size:14px;color:#a48;font-variant: small-caps;text-decoration:underline;text-align:center;' $onclick onmouseover=\"TagToTip('pro', WIDTH, 300, TITLE, 'Buy the Pro Version',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b>The Pro Version</b></span><br />";
173
+
174
+ $value .= '<b><i> Lite</i></b>';
175
+ echo "Thank you for using $value. The \"Pro\" version gives you more options$filter. Consider <a href='http://buy.thulasidas.com/$slug' title='Pro version of this plugin. Instant download link.' $onclick>buying it</a>. It costs only \$$price.";
176
+ echo "</div>";
177
+ }
178
+
179
+ function renderAffiliate() {
180
+ if ($this->killAuthor) {
181
+ return;
182
+ }
183
+ $plgURL = $this->plgURL;
184
+ echo "<div style='padding:0px;border:none; width:300px;text-align:center' id='support' onmouseover=\"Tip('<b>ezAffiliates</b>: The most affiliate-centric revenue sharing model on the Web. Finally, you can make some serious returns on your web presence.<br /><b>Generous 50% Commission</b>: perhaps the highest rate of revenue sharing on the web. With just a couple of sales of this plugin, you will have recovered your purchase price!<br /><b>$10 Minimum Payout</b> so that you will not be waiting forever before you qualify for payment.<br /><b>Lifetime Tracking</b>: ezAffiliates uses cookie-less tracking technology to attribute every purchase of your lead to your account. Whatever your leads buy from us, whenever they do, will earn you commission. No cookie expiry!<br /><b>High Quality Products</b> such as this plugin, and other premium plugins and PHP packages.<br /><b>Diverse Markets</b>: Bloggers who blog about plugins, PayPal integration, affiliate marketing, MacOS apps and even eBooks will find ezAffiliates attractive and more effective that their current ad campaigns.', WIDTH, 295, TITLE, 'ezAffiliates', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://affiliates.thulasidas.com'><img src='$plgURL/invite.gif' alt='ezAffiliates' onclick=\"popupwindow('http://affiliates.thulasidas.com/','50-50 Revenue Share', 1024, 768);return false;\"/></a></div>";
185
+ }
186
+
187
+ function renderSupportText() {
188
+ if ($this->killAuthor) {
189
+ return;
190
+ }
191
+ $plg = $this->plg;
192
+ $slug = $this->slug;
193
+ $long = $plg['long'];
194
+ $value = '<em><strong>' . $plg['value'] . '</strong></em>';
195
+ $supportText = "<div style=\"background-color:#cff;padding:5px;border: solid 1px\" id=\"support\"><b>Support $value. <a href=\"http://buy.thulasidas.com/$slug\" title=\"Pro version of this plugin. Instant download link.\" onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\">Go Pro!</a></b>";
196
+ if ($long) {
197
+ $longText = "How about ";
198
+ }
199
+ else {
200
+ $longText = '';
201
+ }
202
+ $supportText .= "<br />$longText<span onmouseover=\"TagToTip('dropbox', WIDTH, 440, TITLE, 'What is DropBox?',STICKY, 1, CLOSEBTN, true, FIX, [this, -150, 2])\"><a href='http://db.tt/qsogWB1' title='Sign up for Dropbox -- free 2GB online storage on the cloud!' target='_blank'>2GB of <em>free</em> online storage</a></span>?";
203
+ if ($long) {
204
+ $longText = "WordPress Hosting for ";
205
+ }
206
+ else {
207
+ $longText = 'Hosting for ';
208
+ }
209
+ $supportText .= "<br />$longText<span onmouseover=\"TagToTip('arvixe', WIDTH, 300, TITLE, 'Arvixe - My favorite provider!',STICKY, 1, CLOSEBTN, true, FIX, [this, -200, 2])\"><a href='http://www.arvixe.com/1933.html' target='_blank'>just $4/month</a></span>. ";
210
+ if ($long) {
211
+ $longText = "My books on ";
212
+ }
213
+ else {
214
+ $longText = 'Books: ';
215
+ }
216
+ $supportText .= "<br />$longText<span style=\"text-decoration:underline\" onmouseover=\"TagToTip('unreal', WIDTH, 205, TITLE, 'Buy &lt;em&gt;The Unreal Universe&lt;/em&gt;',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/unreal' target='_blank'>Physics &amp; Philosophy</a></b></span> or ";
217
+ $supportText .= "<span style=\"text-decoration:underline\" onmouseover=\"TagToTip('pqd', WIDTH, 205, TITLE, '&lt;em&gt;Principles of Quant. Devel.&lt;/em&gt;',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/pqd' target='_blank'>Money &amp; Finance</a></b></span>.</div>";
218
+ echo $supportText;
219
+ }
220
+
221
+ function renderTipDivs() {
222
+ $plgURL = $this->plgURL;
223
+ echo <<<ENDDIVS
224
+ <div id="arvixe" style='display:none;'>
225
+ <a href="http://www.arvixe.com/1933-27-1-310.html" target="_blank">Arvixe</a> is my favorite hosting provider. Friendly service, extremely competitive rates, and of course a great affiliate program.
226
+ </div>
227
+
228
+ <span id="dropbox" style='display:none;'>
229
+ Dropbox! gives you 2GB of network (cloud) storage for free, which I find quite adequate for any normal user. (That sounds like the famous last words by Bill Gates, doesn’t it? “64KB of memory should be enough for anyone!”) And, you can get 250MB extra for every successful referral you make. That brings me to my ulterior motive – please use this link to sign up. When you do, I get 250MB extra. Don’t worry, you get 250MB extra as well. So I can grow my online storage up to 8GB, which should keep me happy for a long time. Thank you!
230
+ </span>
231
+
232
+ <div id="unreal" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
233
+ <div style="text-align:center;width:200px;padding:1px;background:#aad;margin:2px;">
234
+ <div style="text-align:center;width:192px;height:180px;padding:2px;border:solid 1px #000;background:#ccf;margin:1px;">
235
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook, $15.95 for paperback). It will change the way you view life and reality!">
236
+ <span style="font-size:14px;font-family:arial;color:#a48;font-variant: small-caps;"><b>The Unreal Universe</b></span><br />
237
+ <small style="font-size:12px;font-family:arial;color:#000;">
238
+ A Book on Physics and Philosophy
239
+ </small>
240
+ </a>
241
+ <hr />
242
+ <table style="border-width:0;padding:2px;width:100%;margin-left:auto;margin-right:auto;border-spacing:0;border-collapse:collapse;">
243
+ <tr><td style="width:65%">
244
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook or Kindle, $15.95 for paperback). It will change the way you view life and reality!">
245
+ <small style="font-size:10px;font-family:arial;color:#000;">
246
+ Pages: 292<br />
247
+ (282 in eBook)<br />
248
+ Trimsize: 6" x 9" <br />
249
+ Illustrations: 34<br />
250
+ (9 in color in eBook)<br />
251
+ Tables: 8 <br />
252
+ Bibliography: Yes<br />
253
+ Index: Yes<br />
254
+ ISBN: 9789810575946&nbsp;<br />
255
+ <span style="font-color=#ff0000;"><b>Only $1.49!</b></span>
256
+ </small>
257
+ </a>
258
+ </td>
259
+ <td>
260
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook or Kindle, $15.95 for paperback). It will change the way you view life and reality!">
261
+ <img class="alignright" src="$plgURL/unreal.gif" alt="TheUnrealUniverse" title="Read more about The Unreal Universe" />
262
+ </a>
263
+ </td>
264
+ </tr>
265
+ </table>
266
+ </div>
267
+ </div>
268
+ </div>
269
+
270
+ <div id="pqd" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
271
+ <div style="text-align:center;width:200px;padding:1px;background:#000;margin:2px;">
272
+ <div style="text-align:center;width:190px;height:185px;padding:2px;padding-top:1px;padding-left:4px;border:solid 1px #fff;background:#411;margin:1px;">
273
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
274
+ <span style="font-size:14px;font-family:arial;color:#fff;font-variant: small-caps;">A Remarkable Book from Wiley-Finance</span>
275
+ </a>
276
+ <hr />
277
+ <table style="border-width:0;padding:2px;width:100%;margin-left:auto;margin-right:auto;border-spacing:0;border-collapse:collapse;">
278
+ <tr><td style="padding:0px">
279
+ <div style="border:solid 1px #faa;height:126px;width:82px;">
280
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
281
+ <img src="$plgURL/pqd-82x126.gif" alt="PQD" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)" />
282
+ </a>
283
+ </div>
284
+ </td>
285
+ <td style="padding:3px">
286
+ <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
287
+ <em style="font-size:14px;font-family:arial;color:#fff;">"An excellent book!"</em><br />
288
+ <small style="font-size:13px;font-family:arial;color:#faa;">&nbsp;&nbsp;&#8212; Paul Wilmott</small>
289
+ <br />
290
+ <small style="font-size:11px;font-family:arial;color:#fff;">
291
+ Want to break into the lucrative world of trading and quantitative finance? You <b>need </b> this book!
292
+ </small>
293
+ </a>
294
+ </td>
295
+ </tr>
296
+ </table>
297
+ </div>
298
+ </div>
299
+ </div>
300
+ ENDDIVS;
301
+ }
302
+
303
+ static function makeTextWithTooltip($text, $tip, $title = '', $width = '') {
304
+ if (!empty($title)) {
305
+ $titleText = "TITLE, '$title',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true,";
306
+ }
307
+ if (!empty($width)) {
308
+ $widthText = "WIDTH, $width,";
309
+ }
310
+ $return = "<span style='text-decoration:none' " .
311
+ "onmouseover=\"Tip('" . htmlspecialchars($tip) . "', " .
312
+ "$widthText $titleText FIX, [this, 5, 5])\" " .
313
+ "onmouseout=\"UnTip()\">$text</span>";
314
+ return $return;
315
+ }
316
+
317
+ static function makeTextWithTooltipTag($plg, $text, $tip, $title = '', $width = '') {
318
+ if (!empty($title)) {
319
+ $titleText = "TITLE, '$title',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true,";
320
+ }
321
+ if (!empty($width)) {
322
+ $widthText = "WIDTH, $width,";
323
+ }
324
+ $return = "<span style='text-decoration:none' " .
325
+ "onmouseover=\"TagToTip('" . $plg . "', " .
326
+ "$widthText $titleText FIX, [this, 5, 5])\" " .
327
+ "onmouseout=\"UnTip()\">$text</span>";
328
+ return $return;
329
+ }
330
+
331
+ function renderPlg($slug, $plg) {
332
+ if ($this->killAuthor) {
333
+ return;
334
+ }
335
+ $plgURL = $this->plgURL;
336
+ if (!empty($plg['hide']) && $plg['hide']) {
337
+ return;
338
+ }
339
+ if (!empty($plg['kind']) && $plg['kind'] != 'plugin') {
340
+ return;
341
+ }
342
+ $value = '<em><strong>' . $plg['value'] . '</strong></em>';
343
+ $desc = $plg['desc'];
344
+ $title = $plg['title'];
345
+ $url = 'http://www.thulasidas.com/plugins/' . $slug;
346
+ $link = '<b><a href="' . $url . '" target="_blank">' . $value . '</a></b>&nbsp; ';
347
+ $text = $link . $desc;
348
+ $price = $plg['price'];
349
+ $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\"";
350
+ $moreInfo = "&nbsp;&nbsp;<a href='http://www.thulasidas.com/plugins/$slug' title='More info about $value at Unreal Blog'>More Info</a> ";
351
+ $liteVersion = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/lite/$slug.zip' title='Download the Lite version of $value'>Get Lite Version</a> ";
352
+ $proVersion = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of $value for \$$price' $onclick>Get Pro Version</a><br />";
353
+ $why = "<a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of the $slug plugin' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright' /></a>
354
+ <br />" . $plg['pro'];
355
+ echo "<li>" . self::makeTextWithTooltip($text, $title, $value, 350) .
356
+ "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
357
+ self::makeTextWithTooltip($moreInfo, "Read more about $value at its own page.<br />" . $title, "More Information about $value", 300) .
358
+ self::makeTextWithTooltip($liteVersion, $title, "Download $value - the Lite version", 300) .
359
+ self::makeTextWithTooltipTag($slug, $proVersion, $why, "Get $value Pro!", 300) .
360
+ "<span id=$slug> $why </span>" .
361
+ "</li>\n";
362
+ }
363
+
364
+ function renderBook($slug, $plg) {
365
+ if ($this->killAuthor) {
366
+ return;
367
+ }
368
+ $plgURL = $this->plgURL;
369
+ if (empty($plg['kind']) || $plg['kind'] != 'book') {
370
+ return;
371
+ }
372
+ $value = '<em><strong>' . $plg['value'] . '</strong></em>';
373
+ $desc = $plg['desc'];
374
+ $title = $plg['title'];
375
+ $url = $plg['url'];
376
+ $link = '<b><a href="' . $url . '" target="_blank">' . $value . '</a></b>&nbsp; ';
377
+ $text = $link . $desc;
378
+ $price = $plg['price'];
379
+ $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get {$plg['value']}', 1024, 768);return false;\"";
380
+ $moreInfo = "&nbsp;&nbsp; <a href='$url' title='More info about $value' target=_blank>More Info</a> ";
381
+ $amazon = $plg['amazon'];
382
+ if (!empty($amazon)) {
383
+ $buyAmazon = "&nbsp;&nbsp; <a href='$amazon' title='Get $value from Amazon.com' target=_blank>Get it at Amazon</a> ";
384
+ }
385
+ $buyNow = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/$slug' title='Buy and download $value for \$$price' target=_blank $onclick>Buy and Download now!</a><br />";
386
+ $why = "<a href='http://buy.thulasidas.com/$slug' title='$slug' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright' /></a>
387
+ <br />" . $title . $desc . " $value costs only \$$price -- direct from the author.";
388
+ echo "<li>" . self::makeTextWithTooltip($text, $title, $value, 350) .
389
+ "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
390
+ self::makeTextWithTooltip($moreInfo, "Read all about $value at its own site.<br />", "$value", 300) .
391
+ self::makeTextWithTooltip($buyAmazon, $title, "Buy $value from Amazon", 350) .
392
+ self::makeTextWithTooltipTag("$slug-book", $buyNow, $why, "Buy $value!", 300) .
393
+ "<span id=$slug-book> $why </span>" .
394
+ "</li>\n";
395
+ }
396
+
397
+ function getPlgInfo() {
398
+ $me = $this->slug;
399
+ $plugins = get_plugins();
400
+ $ret = array('Version' => '', 'Info' => '');
401
+ $break = '';
402
+ foreach ($plugins as $k => $p) {
403
+ $baseDir = dirname($k);
404
+ if ($baseDir == $me) {
405
+ $version = $p['Version'];
406
+ if (!empty($_SERVER['HTTP_REFERER'])) {
407
+ $referer = $_SERVER['HTTP_REFERER'];
408
+ }
409
+ else {
410
+ $referer = 'Unknown';
411
+ }
412
+ $info = "$break{$p['Title']} V{$p['Version']} (Referer: $referer)";
413
+ $ret[] = array('Version' => $version, 'Info' => $info);
414
+ }
415
+ }
416
+ return $ret;
417
+ }
418
+
419
+ function renderSupport() {
420
+ $plgURL = $this->plgURL;
421
+ $plg = $this->plg;
422
+ $slug = $this->slug;
423
+ $value = $plg['value'];
424
+ $url = 'http://www.thulasidas.com/plugins/' . $slug . '#faq';
425
+ $link = '<a href="' . $url . '" target="_blank">' . $value . '</a>';
426
+ echo "&nbsp;<a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport for $value', 1024, 768);return false;\" title='";
427
+ _e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-adsenser');
428
+ echo "'><img src='$plgURL/ezsupport.png' class='alignright' alt='ezSupport Portal'/></a>";
429
+ printf(__("If you need help with %s, please read the FAQ section on the $link page. It may answer all your questions.", 'easy-adsenser'), $value, $link);
430
+ echo "<br style='line-height: 20px;'/>";
431
+ _e("Or, if you still need help, you can raise a support ticket.", 'easy-adsenser');
432
+ echo "&nbsp;<a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport for $value', 1024, 768);return false;\" title='";
433
+ _e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-adsenser');
434
+ echo "'>";
435
+ _e("[Request Paid Support]", 'easy-adsenser');
436
+ $info = $this->getPlgInfo();
437
+ echo "</a>&nbsp;<small><em>[";
438
+ _e('Using our ezSupport Ticket System.', 'easy-adsenser');
439
+ echo "]</em></small>";
440
+ echo "<small style='float:right'><em>[";
441
+ printf(__('You are using %s (V%s)', 'easy-adsenser'), $value, $info[0]['Version']);
442
+ echo "]</em></small>";
443
+ $_SESSION['ezSupport'] = $info[0]['Info'];
444
+ }
445
+
446
+ function renderWhyPro($short = false) {
447
+ if ($this->killAuthor && !$short) {
448
+ return;
449
+ }
450
+ $plgURL = $this->plgURL;
451
+ $plg = $this->plg;
452
+ $slug = $this->slug;
453
+ $value = $plg['value'];
454
+ $toolTip = $plg['title'];
455
+ $price = $plg['price'];
456
+ $buyURL = "http://buy.thulasidas.com/$slug";
457
+ $onclick = "onclick=\"popupwindow('$buyURL','Get $value', 1024, 768);return false;\"";
458
+ $moreInfo = " &nbsp; &nbsp; <a href='$buyURL' title='More info about $value'> More Info </a>&nbsp; <a href='$buyURL' $onclick title='Buy the Pro version of $value for \$$price'>Get Pro Version</a>";
459
+ $toolTip .= addslashes('<br />' . $moreInfo);
460
+ $why = addslashes($plg['pro']);
461
+ echo '<div style="background-color:#cff;padding:5px;border: solid 1px;margin:5px;">';
462
+ if ($short) {
463
+ 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='$buyURL' $onclick target='_blank'>Pro Version</a></b>&nbsp; More features, more power!<br /></span>";
464
+ }
465
+ else {
466
+ echo "<b>Get Pro Version!</b>
467
+ <a href='http://buy.thulasidas.com/$slug' title='Buy the Pro version of the $value plugin for \$$price'><img src='$plgURL/ezpaypal.png' alt='ezPayPal -- Your Instant PayPal Shop.' class='alignright' $onclick /></a>
468
+ <br />
469
+ You are using the Lite version of $value, which is available in two versions: <b>Lite</b> and <b>Pro</b>.
470
+ <ul><li>
471
+ $moreInfo
472
+ <li>$why</li>
473
+ </ul>";
474
+ }
475
+ echo '</div>';
476
+ }
477
+
478
+ }
479
+
480
+ }
EzOptions.php ADDED
@@ -0,0 +1,598 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Copyright (C) 2008 www.ads-ez.com
5
+
6
+ This program is free software; you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation; either version 3 of the License, or (at
9
+ your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ if (!class_exists("EzBaseOption")) {
21
+
22
+ class EzBaseOption { // base EzOption class
23
+
24
+ var $name, $desc, $title, $tipTitle, $tipWidth, $tipWarning, $value, $type;
25
+ var $width, $labelWidth, $height, $before, $between, $after, $style;
26
+
27
+ function EzBaseOption($type, $name) {
28
+ $vars = get_object_vars($this);
29
+ foreach ($vars as $k => $v) {
30
+ $this->$k = '';
31
+ }
32
+ $this->type = $type;
33
+ $this->name = $name;
34
+ $this->tipWidth = '240';
35
+ }
36
+
37
+ function __clone() {
38
+ foreach ($this as $key => $val) {
39
+ if (is_object($val) || (is_array($val))) {
40
+ $this->{$key} = unserialize(serialize($val));
41
+ }
42
+ }
43
+ }
44
+
45
+ function get() {
46
+ return $this->value;
47
+ }
48
+
49
+ function set($properties, $desc = '') {
50
+ if (!isset($properties)) {
51
+ return;
52
+ }
53
+ if (is_array($properties)) {
54
+ foreach ($properties as $k => $v) {
55
+ $key = strtolower($k);
56
+ if (floatval(phpversion()) > 5.3) {
57
+ if (property_exists($this, $key)) {
58
+ $this->$key = $v;
59
+ }
60
+ }
61
+ else {
62
+ if (array_key_exists($key, $this)) {
63
+ $this->$key = $v;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ else {
69
+ $this->value = $properties;
70
+ if (!empty($desc)) {
71
+ $this->desc = $desc;
72
+ }
73
+ }
74
+ }
75
+
76
+ function preRender() {
77
+ $toolTip = $this->mkToolTip();
78
+ if (!empty($this->labelWidth)) {
79
+ $style = "style='display:inline-block;width:{$this->labelWidth}'";
80
+ }
81
+ else {
82
+ $style = "";
83
+ }
84
+ echo "{$this->before}\n<label $style for='{$this->name}' $toolTip>\n";
85
+ }
86
+
87
+ function postRender() {
88
+ echo "</label>\n{$this->after}\n";
89
+ }
90
+
91
+ function render() {
92
+ $this->preRender();
93
+ echo "<input type='{$this->type}' id='{$this->name}' name='{$this->name}'";
94
+ if (!empty($this->style)) {
95
+ echo " style='{$this->style}'";
96
+ }
97
+ echo " value='{$this->value}' />{$this->desc}\n";
98
+ $this->postRender();
99
+ }
100
+
101
+ function updateValue() {
102
+ if (isset($_POST[$this->name])) {
103
+ $this->value = $_POST[$this->name];
104
+ }
105
+ }
106
+
107
+ function mkToolTip() {
108
+ if (!empty($this->title)) {
109
+ if (!empty($this->tipWarning)) {
110
+ if (empty($this->tipTitle)) {
111
+ $this->tipTitle = "Warning!";
112
+ }
113
+ $warning = ", BGCOLOR, '#ffcccc', FONTCOLOR, '#800000'"
114
+ . ", BORDERCOLOR, '#c00000'";
115
+ }
116
+ else {
117
+ $warning = '';
118
+ }
119
+ $toolTip = "onmouseover=\"Tip('" . htmlspecialchars($this->title)
120
+ . "', WIDTH, {$this->tipWidth}, TITLE, '{$this->tipTitle}'"
121
+ . $warning . ", FIX, [this, 5, 5])\" onmouseout=\"UnTip()\"";
122
+ }
123
+ else {
124
+ $toolTip = "";
125
+ }
126
+ return $toolTip;
127
+ }
128
+
129
+ function mkTagToTip() {
130
+ if (!empty($this->title)) {
131
+ $toolTip = "<span style='text-decoration:underline' "
132
+ . "onmouseover=\"Tip('{$this->title}')\" "
133
+ . "onclick=\"TagToTip('{$this->name}', WIDTH, 300, "
134
+ . "TITLE, '{$this->tipTitle}', STICKY, 1, CLOSEBTN, true, "
135
+ . "CLICKCLOSE, true, FIX, [this, 15, 5])\" "
136
+ . "onmouseout=\"UnTip();\">{$this->desc}</span>";
137
+ }
138
+ else {
139
+ $toolTip = "";
140
+ }
141
+ return $toolTip;
142
+ }
143
+
144
+ static function getValues($ezOptions) {
145
+ $options = array();
146
+ foreach ($ezOptions as $k => $o) {
147
+ $options[$k] = $o->get();
148
+ }
149
+ return $options;
150
+ }
151
+
152
+ static function setValues($options, &$ezOptions) {
153
+ $error = '';
154
+ foreach ($options as $k => $v) {
155
+ if (isset($ezOptions[$k])) {
156
+ if (!empty($_POST)) {
157
+ // Suppress errors because $_POST won't be set for checkboxes and flags
158
+ @$value = $_POST[$k];
159
+ }
160
+ else {
161
+ $value = $v;
162
+ }
163
+ $ezOptions[$k]->set($value);
164
+ }
165
+ else {
166
+ $error .= "Cannot find <code>ezOptions[$k]</code><br />";
167
+ }
168
+ }
169
+ return $error;
170
+ }
171
+
172
+ }
173
+
174
+ class EzCheckBox extends EzBaseOption {
175
+
176
+ function EzCheckBox($name) {
177
+ parent::EzBaseOption('checkbox', $name);
178
+ }
179
+
180
+ function render() {
181
+ $this->preRender();
182
+ echo "<input type='{$this->type}' id='{$this->name}' name='{$this->name}' ";
183
+ if (!empty($this->style)) {
184
+ echo " style='{$this->style}' ";
185
+ }
186
+ if ($this->value) {
187
+ echo "checked='checked' ";
188
+ }
189
+ echo "/>{$this->desc}\n";
190
+ $this->postRender();
191
+ }
192
+
193
+ function updateValue() {
194
+ $this->value = isset($_POST[$this->name]);
195
+ }
196
+
197
+ }
198
+
199
+ class EzRadioBox extends EzBaseOption { // Radiobox
200
+
201
+ var $choices;
202
+
203
+ function EzRadioBox($name) {
204
+ parent::EzBaseOption('radio', $name);
205
+ }
206
+
207
+ function &addChoice($name, $value, $desc) {
208
+ $subname = $this->name . '_' . $name;
209
+ $this->choices[$subname] = new EzBaseOption('radio', $subname);
210
+ $this->choices[$subname]->value = $value;
211
+ $this->choices[$subname]->desc = $desc;
212
+ return $this->choices[$subname];
213
+ }
214
+
215
+ function preRender() {
216
+ $toolTip = $this->mkToolTip();
217
+ if (!empty($this->labelWidth)) {
218
+ $style = "style='display:inline-block;width:{$this->labelWidth}'";
219
+ }
220
+ else {
221
+ $style = "";
222
+ }
223
+ echo "{$this->before}\n";
224
+ echo "<span $style id='{$this->name}' $toolTip>{$this->desc} {$this->between}</span>";
225
+ echo "\n{$this->after}\n";
226
+ }
227
+
228
+ function postRender() {
229
+
230
+ }
231
+
232
+ function render() {
233
+ $this->preRender();
234
+ if (!empty($this->choices)) {
235
+ foreach ($this->choices as $k => $v) {
236
+ echo $v->before, "\n";
237
+ echo "<label for='{$k}'>\n";
238
+ echo "<input type='{$v->type}' id='{$k}' name='{$this->name}' ";
239
+ if ($this->value == $v->value) {
240
+ echo "checked='checked'";
241
+ }
242
+ echo " value='{$v->value}' /> {$v->desc}\n</label>\n{$v->after}\n";
243
+ }
244
+ }
245
+ $this->postRender();
246
+ }
247
+
248
+ }
249
+
250
+ class EzSelect extends EzBaseOption { // Drop-down menu.
251
+
252
+ var $choices = array();
253
+
254
+ function EzSelect($name) {
255
+ parent::EzBaseOption('select', $name);
256
+ }
257
+
258
+ function &addChoice($name, $value = '', $desc = '') {
259
+ $subname = $this->name . '_' . $name;
260
+ if (is_array($this->choices) && array_key_exists($subname, $this->choices)) {
261
+ die("Fatal Error [addChoice]: New Choice $subname already exists "
262
+ . "in {$this->name}");
263
+ }
264
+ $this->choices[$subname] = new EzBaseOption('choice', $subname);
265
+ $this->choices[$subname]->value = $value;
266
+ $this->choices[$subname]->desc = $desc;
267
+ return $this->choices[$subname];
268
+ }
269
+
270
+ function render() {
271
+ $this->preRender();
272
+ echo "{$this->desc} {$this->between}\n"
273
+ . "<select id='{$this->name}' name='{$this->name}' ";
274
+ if (!empty($this->style)) {
275
+ echo " style='{$this->style}'";
276
+ }
277
+
278
+ echo '>';
279
+ if (!empty($this->choices)) {
280
+ foreach ($this->choices as $k => $v) {
281
+ echo "{$v->before}<option value='{$v->value}' ";
282
+ if ($this->value == $v->value) {
283
+ echo "selected='selected'";
284
+ }
285
+ echo ">{$v->desc}</option>{$v->after}\n";
286
+ }
287
+ }
288
+ echo "</select>\n";
289
+ $this->postRender();
290
+ }
291
+
292
+ }
293
+
294
+ class EzMessage extends EzBaseOption { // Not an option, but a Message in the admin panel
295
+
296
+ function EzMessage($name) { // constructor
297
+ parent::EzBaseOption('', $name);
298
+ }
299
+
300
+ function render() {
301
+ $this->preRender();
302
+ if (!empty($this->value)) {
303
+ echo $this->value, "\n";
304
+ }
305
+ if (!empty($this->desc)) {
306
+ echo $this->desc, "\n";
307
+ }
308
+ $this->postRender();
309
+ }
310
+
311
+ }
312
+
313
+ class EzHelpTag extends EzBaseOption { // Not an option, but to render help text
314
+
315
+ function EzHelpTag($name) { // constructor
316
+ parent::EzBaseOption('', $name);
317
+ }
318
+
319
+ function render() {
320
+ $toolTip = $this->mkTagToTip();
321
+ echo "{$this->before}\n";
322
+ echo "$toolTip\n";
323
+ echo "{$this->after}\n";
324
+ }
325
+
326
+ }
327
+
328
+ class EzHelpPopUp extends EzBaseOption { // Not an option, but to popup a url
329
+
330
+ function EzHelpPopUp($name) { // constructor
331
+ parent::EzBaseOption('', $name);
332
+ }
333
+
334
+ function render() {
335
+ echo "{$this->before}\n";
336
+ echo "<span style='text-decoration:underline' "
337
+ . "onmouseover=\"Tip('{$this->title}')\" "
338
+ . "onclick=\"popupwindow('{$this->name}', 'DontCare', 1024, 1024);"
339
+ . "return false;\" onmouseout=\"UnTip();\">"
340
+ . "{$this->desc}</span>\n";
341
+ echo "{$this->after}\n";
342
+ }
343
+
344
+ }
345
+
346
+ class EzTextArea extends EzBaseOption {
347
+
348
+ function EzTextArea($name) {
349
+ parent::EzBaseOption('textarea', $name);
350
+ $this->width = 50;
351
+ $this->height = 5;
352
+ $this->style = "width: 96%; height: 180px;";
353
+ }
354
+
355
+ function render() {
356
+ $this->preRender();
357
+ echo "{$this->desc}<textarea cols='{$this->width}' rows='{$this->height}'"
358
+ . " name='{$this->name}' id='{$this->name}' style='{$this->style}'>",
359
+ stripslashes(htmlspecialchars($this->value)),
360
+ "</textarea>\n";
361
+ $this->postRender();
362
+ }
363
+
364
+ }
365
+
366
+ class EzText extends EzBaseOption {
367
+
368
+ function EzText($name) {
369
+ parent::EzBaseOption('text', $name);
370
+ }
371
+
372
+ function render() {
373
+ $this->preRender();
374
+ echo "{$this->desc}{$this->between}"
375
+ . "<input type='{$this->type}' id='{$this->name}' name='{$this->name}' ";
376
+ if (!empty($this->style)) {
377
+ echo " style='{$this->style}'";
378
+ }
379
+ echo " value='{$this->value}' />\n";
380
+ $this->postRender();
381
+ }
382
+
383
+ }
384
+
385
+ class EzSubmit extends EzBaseOption {
386
+
387
+ function EzSubmit($name) {
388
+ parent::EzBaseOption('submit', $name);
389
+ $this->value = $this->desc;
390
+ }
391
+
392
+ function render() {
393
+ $this->preRender();
394
+ echo "<input type='{$this->type}' id='{$this->name}' name='{$this->name}' ";
395
+ if (!empty($this->style)) {
396
+ echo " style='{$this->style}'";
397
+ }
398
+ echo " value='{$this->desc}' />\n";
399
+ $this->postRender();
400
+ }
401
+
402
+ }
403
+
404
+ class EzColorPicker extends EzBaseOption { // ColorPickers
405
+
406
+ function EzColorPicker($name) {
407
+ parent::EzBaseOption('text', $name);
408
+ $this->style = "border:0px solid;";
409
+ }
410
+
411
+ function render() {
412
+ $this->preRender();
413
+ echo $this->desc;
414
+ echo "$this->between\n";
415
+ echo "&nbsp;<input type='{$this->type}' id='{$this->name}' name='{$this->name}' ";
416
+ if (!empty($this->style)) {
417
+ echo " style='{$this->style}'";
418
+ }
419
+
420
+ echo " class=\"color {hash:false,caps:true,pickerFaceColor:'transparent',pickerFace:3,pickerBorder:0,pickerInsetColor:'black'}\"";
421
+ echo " value='{$this->value}' />\n";
422
+ $this->postRender();
423
+ }
424
+
425
+ }
426
+
427
+ class EzOneTab extends EzBaseOption { // a tab in the mini-tab container, miniTab
428
+
429
+ var $mTabOptions;
430
+
431
+ function EzOneTab($name) {
432
+ parent::EzBaseOption('onetab', $name);
433
+ $this->mTabOptions = array();
434
+ }
435
+
436
+ function &addTabOption($type, $key) {
437
+ $subname = $this->name . '_' . $key;
438
+ if (is_array($this->mTabOptions) && array_key_exists($subname, $this->mTabOptions)) {
439
+ die("Fatal Error [addTabOption]: New Option $subname already exists in {$this->name}");
440
+ }
441
+ if (class_exists($type)) { // Specialized class for this type of input
442
+ $this->mTabOptions[$key] = new $type($subname);
443
+ }
444
+ else {
445
+ $this->mTabOptions[$key] = new EzBaseOption($type, $subname);
446
+ }
447
+ return $this->mTabOptions[$key];
448
+ }
449
+
450
+ function render() {
451
+ $toolTip = $this->mkToolTip();
452
+ echo "{$this->before}\n";
453
+ if (!empty($this->mTabOptions)) {
454
+ foreach ($this->mTabOptions as $k => $o) {
455
+ if (!empty($o)) {
456
+ $o->render();
457
+ }
458
+ }
459
+ }
460
+ echo "{$this->after}\n";
461
+ }
462
+
463
+ function updateValue() {
464
+ foreach ($this->mTabOptions as $option) {
465
+ $option->updateValue();
466
+ }
467
+ }
468
+
469
+ }
470
+
471
+ class EzMiniTab extends EzBaseOption { // a mini-tab container.
472
+
473
+ var $tabs;
474
+
475
+ function EzMiniTab($name) {
476
+ parent::EzBaseOption('minitab', $name);
477
+ $this->tabs = array();
478
+ }
479
+
480
+ function &addTab($name) {
481
+ $subname = $this->name . '-' . $name;
482
+ if (array_key_exists($subname, $this->tabs)) {
483
+ die("Fatal Error [addTab]: New Tab $subname already exists in {$this->name}");
484
+ }
485
+ $this->tabs[$subname] = new EzOneTab($subname);
486
+ return $this->tabs[$subname];
487
+ }
488
+
489
+ function render() {
490
+ $toolTip = $this->mkToolTip();
491
+ echo "{$this->before}\n";
492
+ echo "<div><ul class='tabs' name='tabs' id='{$this->name}_MiniTabs'>\n";
493
+ $class = "class='current'";
494
+ foreach ($this->tabs as $tab) {
495
+ echo "<li><a href='#' $class id='mtab_{$tab->name}_link'>{$tab->desc}</a></li>\n";
496
+ $class = '';
497
+ }
498
+ echo "</ul>\n</div><!-- of ul tabs -->\n";
499
+
500
+ $current = '_current';
501
+ foreach ($this->tabs as $tab) {
502
+ $name = $tab->name;
503
+ echo "<div class='tab$current' id='mtab_$name'>\n";
504
+ $tab->render();
505
+ echo "</div><!-- End: $name --> \n";
506
+ $current = '';
507
+ }
508
+ echo "{$this->after}\n";
509
+ }
510
+
511
+ function updateValue() {
512
+ foreach ($this->tabs as $tab) {
513
+ $tab->updateValue();
514
+ }
515
+ }
516
+
517
+ }
518
+
519
+ }
520
+
521
+ if (!class_exists("EzBasePlugin")) {
522
+
523
+ class EzBasePlugin {
524
+
525
+ var $slug, $domain, $name, $plgDir, $plgURL, $plgFile;
526
+ var $ezTran, $ezAdmin, $myPlugins;
527
+ var $isPro, $strPro;
528
+
529
+ function __construct($slug, $name, $file) {
530
+ $this->slug = $slug;
531
+ $this->plgDir = dirname($file);
532
+ $this->plgURL = plugin_dir_url($file);
533
+ $this->plgFile = $file;
534
+ $this->name = $name;
535
+ $this->isPro = is_dir("{$this->plgDir}/pro") && file_exists("{$this->plgDir}/pro/pro.php");
536
+ $this->strPro = ' Lite';
537
+ if ($this->isPro) {
538
+ $this->strPro = ' Pro';
539
+ }
540
+ if (is_admin()) {
541
+ require_once($this->plgDir . '/EzTran.php');
542
+ if ($this->slug == "easy-adsense") {
543
+ $this->domain = "easy-adsenser";
544
+ }
545
+ else {
546
+ $this->domain = $this->slug;
547
+ }
548
+ $this->ezTran = new EzTran($file, "{$name}{$this->strPro}", $this->domain);
549
+ $this->ezTran->setLang();
550
+ }
551
+ }
552
+
553
+ function __destruct() {
554
+
555
+ }
556
+
557
+ function EzBasePlugin($slug, $name, $file) {
558
+ if (version_compare(PHP_VERSION, "5.0.0", "<")) {
559
+ $this->__construct($slug, $name, $file);
560
+ register_shutdown_function(array($this, "__destruct"));
561
+ }
562
+ }
563
+
564
+ function handleSubmits() {
565
+ if (empty($_POST)) {
566
+ return;
567
+ }
568
+ }
569
+
570
+ function printAdminPage() {
571
+ // if translating, print translation interface
572
+ if ($this->ezTran->printAdminPage()) {
573
+ return;
574
+ }
575
+ $this->handleSubmits();
576
+ require_once($this->plgDir . '/myPlugins.php');
577
+ $slug = $this->slug;
578
+ $plg = $this->myPlugins[$slug];
579
+ $plgURL = $this->plgURL;
580
+ if ($this->isPro || file_exists($this->plgDir . '/EzAdminPro.php')) {
581
+ require_once($this->plgDir . '/EzAdminPro.php');
582
+ $this->ezAdmin = new EzAdminPro($plg, $slug, $plgURL);
583
+ }
584
+ else {
585
+ require_once($this->plgDir . '/EzAdmin.php');
586
+ $this->ezAdmin = new EzAdmin($plg, $slug, $plgURL);
587
+ }
588
+ if ($this->options['kill_author']) {
589
+ $this->ezAdmin->killAuthor = true;
590
+ }
591
+ $this->ezAdmin->domain = $this->domain;
592
+ $this->ezAdmin->plgFile = $this->plgFile;
593
+ return $this->ezAdmin;
594
+ }
595
+
596
+ }
597
+
598
+ }
EzTran.php ADDED
@@ -0,0 +1,650 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Copyright (C) 2008 www.ads-ez.com
5
+
6
+ This program is free software; you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation; either version 3 of the License, or (at
9
+ your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
+ if (!class_exists("PO")) {
21
+
22
+ class PO { // an id-str pair with attributes
23
+
24
+ var $num, $id, $str, $tranId, $tranVal, $keyId, $keyVal;
25
+
26
+ const MINMATCH = 89;
27
+
28
+ function __construct($id, $str) {
29
+ $this->id = (string) $id;
30
+ $this->str = (string) $str;
31
+ $this->tranVal = self::MINMATCH;
32
+ $this->keyVal = self::MINMATCH;
33
+ }
34
+
35
+ function PO($id, $str) {
36
+ if (version_compare(PHP_VERSION, "5.0.0", "<")) {
37
+ $this->__construct($id, $str);
38
+ register_shutdown_function(array($this, "__destruct"));
39
+ }
40
+ }
41
+
42
+ // Returns a properly escaped string
43
+ static function decorate($str, $esc) {
44
+ if (!get_magic_quotes_gpc()) {
45
+ $str = addcslashes($str, $esc);
46
+ }
47
+ return $str;
48
+ }
49
+
50
+ static function undecorate($str) {
51
+ if (!get_magic_quotes_gpc()) {
52
+ $str = stripslashes($str);
53
+ }
54
+ return $str;
55
+ }
56
+
57
+ // Returns a text-area string of the Id
58
+ function textId() {
59
+ $ht = round(strlen($this->id) / 52 + 1) * 25;
60
+ $col = 'background-color:#f5f5f5;';
61
+ $tit = '';
62
+ if ($this->keyVal > self::MINMATCH + 1) {
63
+ $col = "background-color:#ffc;border: solid 1px #f00";
64
+ $tit = 'onmouseover = "Tip(\'Another similar string: ' .
65
+ htmlspecialchars('<br /><em><b>' . addslashes($this->keyId) .
66
+ '</b></em><br /> ', ENT_QUOTES) .
67
+ 'exists. Please alert the author.\',WIDTH, 300)" ' .
68
+ 'onmouseout="UnTip()"';
69
+ }
70
+ $s = '<textarea cols="50" rows="15" name="k' . $this->num .
71
+ '" style="width: 45%;height:' . $ht . 'px;' . $col . '" ' .
72
+ $tit . ' readonly="readonly">';
73
+ $s .= htmlspecialchars($this->id, ENT_QUOTES);
74
+ $s .= '</textarea>&nbsp;&nbsp;';
75
+ return $s;
76
+ }
77
+
78
+ function textStr() {
79
+ $ht = round(strlen($this->id) / 52 + 1) * 25;
80
+ $col = '';
81
+ $tit = '';
82
+ if ($this->tranVal > self::MINMATCH + 1) {
83
+ $col = "background-color:#fdd;border: solid 1px #f00";
84
+ $tit = 'onmouseover = "Tip(\'Using the translation for a similar string: ' .
85
+ htmlspecialchars('<br /><em><b>' . addslashes($this->tranId) .
86
+ '</b></em><br />', ENT_QUOTES) .
87
+ 'Please check carefully.\',WIDTH, 300)" ' .
88
+ 'onmouseout="UnTip()"';
89
+ }
90
+ if (empty($this->str)) {
91
+ $col = "background-color:#dff;border: solid 1px #0ff";
92
+ $tit = 'onmouseover = "Tip(\'Using Machine Translation from Google.<br />Please check carefully.\',WIDTH, 300)" ' .
93
+ 'onmouseout="UnTip()"';
94
+ $this->str = $this->googleTran();
95
+ }
96
+ $s = '<textarea cols="50" rows="15" name="' . $this->num .
97
+ '" style="width: 45%;height:' . $ht . 'px;' . $col . '" ' .
98
+ $tit . '>';
99
+ $s .= htmlspecialchars($this->str, ENT_QUOTES);
100
+ $s .= '</textarea><br />';
101
+ return $s;
102
+ }
103
+
104
+ function googleTran() {
105
+ $q = urlencode($this->id);
106
+ $locale = get_locale();
107
+ $tl = substr($locale, 0, 2);
108
+ $sl = "auto";
109
+ if (!$q) {
110
+ return;
111
+ } // avoid unneeded curling
112
+ $url = 'http://translate.google.com/translate_a/t?client=a&q=' . $q . '&tl=' . $tl . '&sl=' . $sl;
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
116
+ //must set agent for google to respond with utf-8
117
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
118
+ $output = curl_exec($ch);
119
+ curl_close($ch);
120
+ if ($output === false) {
121
+ return "No help from Google!";
122
+ }
123
+ $jsonarr = json_decode($output);
124
+ if (!$jsonarr) {
125
+ return "No help from Google!";
126
+ }
127
+ if (!isset($jsonarr->results)) {
128
+ $jsonarr2->results[] = $jsonarr;
129
+ $jsonarr = $jsonarr2;
130
+ }
131
+ return $jsonarr->results[0]->sentences[0]->trans;
132
+ }
133
+
134
+ }
135
+
136
+ }
137
+
138
+ if (!class_exists("EzTran")) {
139
+
140
+ class EzTran {
141
+
142
+ var $status, $error, $plgName, $plgDir, $plgURL, $domain, $locale, $state;
143
+ var $adminMsg;
144
+ var $helpers;
145
+
146
+ function __construct($plgFile, $plgName, $domain = '') {
147
+ $this->helpers = array('easy-adsense');
148
+ if (!empty($_POST['ezt-savePot'])) {
149
+ // saving cannot be done from handleSubmits
150
+ // because it would be too late for the headers.
151
+ $file = $_POST['potFile'];
152
+ $str = $_POST['potStr'];
153
+ header('Content-Description: File Transfer');
154
+ header('Content-Disposition: attachment; filename="' . $file . '"');
155
+ header("Content-Transfer-Encoding: ascii");
156
+ header('Expires: 0');
157
+ header('Pragma: no-cache');
158
+ ob_start();
159
+ print htmlspecialchars_decode($str, ENT_QUOTES);
160
+ ob_end_flush();
161
+ $this->status = '<div class="updated">Pot file: ' . $file . ' was saved.</div> ';
162
+ exit(0);
163
+ }
164
+ $this->status = '';
165
+ $this->error = '';
166
+ if (empty($plgName)) {
167
+ $plgName = basename($plgFile, '.php');
168
+ $plgName = ucfirst(strtr('-_', ' ', $plgName));
169
+ }
170
+ $this->plgName = $plgName;
171
+ if (empty($domain)) {
172
+ $domain = strtolower(strtr(' !.,', '----', $plgName));
173
+ $domain = str_replace("--", "-", $domain);
174
+ }
175
+ $this->domain = $domain;
176
+ $this->plgDir = dirname($plgFile);
177
+ $this->plgURL = plugin_dir_url($plgFile);
178
+ $locale = get_locale();
179
+ $this->locale = str_replace('-', '_', $locale);
180
+ if (!session_id()) {
181
+ session_start();
182
+ }
183
+ if (empty($_SESSION[$this->domain])) {
184
+ $_SESSION[$this->domain] = array();
185
+ }
186
+ }
187
+
188
+ function EzTran($plgFile, $plgName = '', $domain = '') {
189
+ if (version_compare(PHP_VERSION, "5.0.0", "<")) {
190
+ $this->__construct($plgName, $domain);
191
+ register_shutdown_function(array($this, "__destruct"));
192
+ }
193
+ }
194
+
195
+ // Return the contents of all PHP files in the dir specified
196
+ function getFileContents() {
197
+ $files = glob($this->plgDir . '/*.php');
198
+ $page = "";
199
+ foreach ($files as $f) {
200
+ $page .= file_get_contents($f, FILE_IGNORE_NEW_LINES);
201
+ }
202
+ return $page;
203
+ }
204
+
205
+ // Percentage Levenshtein distance
206
+ function levDist(&$s1, &$s2) {
207
+ similar_text($s1, $s2, $p);
208
+ return round($p);
209
+ }
210
+
211
+ // Get the closest existing translation keys, and the recursivley closest in the
212
+ // key set
213
+ function getClose(&$mo, &$POs) {
214
+ foreach ($POs as $n => $po) {
215
+ $s1 = $po->id;
216
+ if (strlen($po->str) == 0) {
217
+ if (!empty($mo)) {
218
+ foreach ($mo as $mn => $mk) {
219
+ $s2 = $mn;
220
+ $result = $this->levDist($s1, $s2);
221
+ if ($result > $po->tranVal) {
222
+ $po->tranVal = $result;
223
+ $po->tranId = $mn;
224
+ $po->str = $mk->translations[0];
225
+ }
226
+ }
227
+ }
228
+ }
229
+ foreach ($POs as $n2 => $po2) {
230
+ if ($n != $n2) {
231
+ $s2 = $po2->id;
232
+ $result = $this->levDist($s1, $s2);
233
+ if ($result > $po2->keyVal) {
234
+ $po->keyVal = $result;
235
+ $po->keyId = $po2->id;
236
+ $po2->keyVal = $result;
237
+ $po2->keyId = $po->id;
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+ // Get the strings that look like translation keys
245
+ function getTranPOs(&$contents, &$mo, $domain, &$POs) {
246
+ $matches = array();
247
+ preg_match_all("#_[_e].*\([\'\"](.+?)[\'\"]\s*,\s*[\'\"]" . $domain . "[\'\"]#", $contents, $matches);
248
+ $keys = array_unique($matches[1]);
249
+ $keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys);
250
+ foreach ($keys as $n => $k) {
251
+ if (!empty($mo[$k])) {
252
+ $v = $mo[$k];
253
+ $t = $v->translations[0];
254
+ }
255
+ else {
256
+ $t = '';
257
+ }
258
+ $po = new PO($k, $t);
259
+ $po->num = $n;
260
+ array_push($POs, $po);
261
+ }
262
+ $this->getClose($mo, $POs);
263
+ }
264
+
265
+ // Make a POT string from ids and msgs
266
+ function mkPot(&$POs, $msg) {
267
+ $time = current_time('mysql');
268
+ $pot = <<<EOF
269
+ # This file was generated by EzTran for {$this->plgName}
270
+ # Your Name: {$msg["name"]}
271
+ # Your Email: {$msg["email"]}
272
+ # Your Website: {$msg["blog"]}
273
+ # Your URL: {$msg["url"]}
274
+ # Your Locale: {$msg["locale"]}
275
+ # Your Language: {$msg["lang"]}
276
+ #, fuzzy
277
+ msgid ""
278
+ msgstr ""
279
+ "Project-Id-Version: {$this->plgName}\\n"
280
+ "PO-Revision-Date: $time\\n"
281
+ "Last-Translator: {$msg['name']} <{$msg['email']}>\\n"
282
+ "MIME-Version: 1.0\\n"
283
+ "Content-Type: text/plain; charset={$msg['charset']}\\n"
284
+ "Content-Transfer-Encoding: 8bit\\n"
285
+
286
+
287
+ EOF;
288
+ foreach ($POs as $po) {
289
+ $pot .= "msgid " . '"' . PO::decorate($po->id, "\n\r\"") . '"' . "\n";
290
+ $t = $msg[$po->num];
291
+ $pot .= "msgstr " . '"' . PO::decorate($t, "\n\r") . '"' . "\n\n";
292
+ }
293
+ return $pot;
294
+ }
295
+
296
+ // Update the PO objects in $POs with the text box stuff
297
+ function updatePot(&$POs, $msg) {
298
+ foreach ($POs as $po) {
299
+ $t = $msg[$po->num];
300
+ $po->str = PO::undecorate($t);
301
+ }
302
+ }
303
+
304
+ // Error messages
305
+ function errMsg($s, $class = "error", $close = true) {
306
+ $e = '';
307
+ if ($class == "error") {
308
+ $e = "<b>Error: </b>";
309
+ }
310
+ $s = '<div class="' . $class . '"><p>' . $e . $s . '</p></div>';
311
+ if ($close) {
312
+ $s .= "\n</div>\n";
313
+ }
314
+ return $s;
315
+ }
316
+
317
+ function handleSubmits() {
318
+ $adminNeeded = false;
319
+ if (empty($_POST)) {
320
+ return $adminNeeded;
321
+ }
322
+ if (isset($_POST['ezt-english'])) {
323
+ global $l10n;
324
+ unset($l10n[$this->domain]);
325
+ $this->adminMsg = "<div class='updated'><p><strong>Ok, in English for now."
326
+ . " <input type='button' value='Switch Back' onClick='location.reload(true)'></strong></p> </div>";
327
+ return $adminNeeded;
328
+ }
329
+ $adminNeeded = true;
330
+ if (isset($_POST['ezt-translate'])) {
331
+ $_POST['eztran'] = 'eztran';
332
+ return $adminNeeded;
333
+ }
334
+ if (!isset($_POST['eztran'])) {
335
+ return $adminNeeded;
336
+ }
337
+ if (!check_admin_referer('ezTranSubmit', 'ezTranNonce')) {
338
+ return $adminNeeded;
339
+ }
340
+ if (isset($_POST['ezt-clear'])) {
341
+ $this->status = '<div class="updated">Reloaded the translations from PHP files and MO.</div> ';
342
+ unset($_SESSION[$this->domain]['ezt-POs']);
343
+ return $adminNeeded;
344
+ }
345
+ if (!empty($_POST['ezt-mailPot'])) {
346
+ $file = $_POST['potFile'];
347
+ $str = stripslashes($_POST['potStr']);
348
+ $str = str_replace("\'", "'", $str);
349
+
350
+ if (!class_exists("phpmailer")) {
351
+ require_once(ABSPATH . 'wp-includes/class-phpmailer.php');
352
+ }
353
+ $mail = new PHPMailer();
354
+ $mail->From = get_bloginfo('admin_email');
355
+ $mail->FromName = get_bloginfo('name');
356
+ $mail->AddAddress('Manoj@Thulasidas.com', "Manoj Thulasidas");
357
+ $mail->CharSet = get_bloginfo('charset');
358
+ $mail->Mailer = 'php';
359
+ $mail->SMTPAuth = false;
360
+ $mail->Subject = $file;
361
+ $mail->AddStringAttachment($str, $file);
362
+ $pos1 = strpos($str, "msgstr");
363
+ $pos2 = strpos($str, "msgid", $pos1);
364
+ $head = substr($str, 0, $pos2);
365
+ $mail->Body = $head;
366
+ if ($mail->Send()) {
367
+ $this->status = '<div class="updated">Pot file: ' . $file . ' was sent.</div> ';
368
+ }
369
+ else {
370
+ $this->error = '<div class="error">Error: ' . $mail->ErrorInfo .
371
+ ' Please save the pot file and <a href="mailto:Manoj@Thulasidas.com">contact the author</a></div>';
372
+ }
373
+ return $adminNeeded;
374
+ }
375
+ return $adminNeeded;
376
+ }
377
+
378
+ // Prints out the admin page
379
+ function printAdminPage() {
380
+ $printed = false;
381
+ if (!$this->handleSubmits()) {
382
+ return $printed;
383
+ }
384
+ if (!isset($_POST['eztran'])) {
385
+ return $printed;
386
+ }
387
+ if (isset($_POST['ezt-english'])) {
388
+ return $printed;
389
+ }
390
+ $printed = true;
391
+ $backButton = "<br /><b>If you are done with translating, <input type='button' value='Go Back to {$this->plgName} Admin' onClick='location.reload(true)'>.<br />You can continue later, and your translation for the session will be remembered until you close the browser window.</b>";
392
+ echo '<div class="wrap" style="width:1000px">';
393
+ echo '<form method="post" action="#">';
394
+ wp_nonce_field('ezTranSubmit', 'ezTranNonce');
395
+ echo "<input type='hidden' name='eztran' value='eztran'>";
396
+ $locale = get_locale();
397
+ $made = isset($_POST['ezt-make']);
398
+ echo "\n<script type='text/javascript' src='{$this->plgURL}/wz_tooltip.js'></script>\n";
399
+ echo "<h2>Translation Interface for {$this->plgName}</h2>";
400
+ $domain = $this->domain;
401
+
402
+ if (isset($_SESSION[$this->domain]['ezt-POs'])) {
403
+ if (empty($this->status)) {
404
+ $this->status = '<div class="updated">Continuing from your last translation session. Click on "Reload Translation" if you would like to start from scratch.</div> ';
405
+ }
406
+ $POs = $_SESSION[$this->domain]['ezt-POs'];
407
+ }
408
+ else {
409
+ global $l10n;
410
+ $mo = array($l10n[$domain]->entries);
411
+ $s = $this->getFileContents();
412
+ $POs = array();
413
+ $this->getTranPOs($s, $mo[0], $domain, $POs);
414
+ // cache the POs
415
+ $_SESSION[$this->domain]['ezt-POs'] = $POs;
416
+ }
417
+
418
+ if ($made) {
419
+ $pot = htmlspecialchars($this->mkPot($POs, $_POST), ENT_QUOTES);
420
+ $this->updatePot($POs, $_POST);
421
+ // cache the updated POs
422
+ $_SESSION[$this->domain]['ezt-POs'] = $POs;
423
+ }
424
+ else {
425
+ global $current_user;
426
+ $pot = '';
427
+ if (count($POs) > 0) {
428
+ get_currentuserinfo();
429
+ $pot .= '<div style="width: 15%; float:left">Your Name:</div>' .
430
+ '<input type="text" style="width: 30%" name="name" value="' .
431
+ $current_user->user_firstname . " " .
432
+ $current_user->user_lastname . '" /><br />' . "\n";
433
+ $pot .= '<div style="width: 15%; float:left">Your Email:</div>' .
434
+ '<input type="text" style="width: 30%" name="email" value="' .
435
+ $current_user->user_email . '" /><br />' . "\n";
436
+ $pot .= '<div style="width: 15%; float:left">Your Website:</div>' .
437
+ '<input type="text" style="width: 30%" name="blog" value="' .
438
+ get_bloginfo('blog') . '" />' . "\n<br />";
439
+ $pot .= '<div style="width: 15%; float:left">Your URL:</div>' .
440
+ '<input type="text" style="width: 30%" name="url" value="' .
441
+ get_bloginfo('url') . '" />' . "\n<br />";
442
+ $pot .= '<div style="width: 15%; float:left">Your Locale:</div>' .
443
+ '<input type="text" style="width: 30%" name="locale" value="' .
444
+ $locale . '" /><br />' . "\n";
445
+ $pot .= '<div style="width: 15%; float:left">Your Language:</div>' .
446
+ '<input type="text" style="width: 30%" name="lang" value="' .
447
+ get_bloginfo('language') . '" /><br />' . "\n";
448
+ $pot .= '<div style="width: 15%; float:left">Character Set:</div>' .
449
+ '<input type="text" style="width: 30%" name="charset" value="' .
450
+ get_bloginfo('charset') . '" />' . "\n<br /><br />";
451
+
452
+ $pot .= '<div style="width:800px;padding:10px;padding-top:25px"></div>';
453
+ $pot .= '<div style="width:38%px;paddling:10px;padding-left:100px;float:left">' .
454
+ '<b>English (en_US)</b></div>';
455
+ $pot .= '<div style="width:48%;paddling:10px;padding-left:10px;float:right">' .
456
+ '<b>Translation</b> (' . $locale . ')</div>';
457
+ $pot .= '<div style="width:100%;padding:15px"></div>';
458
+
459
+ if (!class_exists("PO")) {
460
+ die("Class definition error on PO (on Chrome).");
461
+ }
462
+ foreach ($POs as $po) {
463
+ if (!is_object($po) && gettype($po) == 'object') {
464
+ $po = unserialize(serialize($po));
465
+ } // need this only on Chrome!!
466
+ $pot .= $po->textId() . "\n" . $po->textStr() . "\n\n";
467
+ }
468
+ }
469
+ else {
470
+ $pot .= "<div class='error'>No translatable strings found for the plugin {$this->plgName}. Although the translation interface is ready, the plugin author has not yet internationalized this plugin.</div>";
471
+ }
472
+ }
473
+ $makeStr = '<div class="submit">
474
+ <input type="submit" name="ezt-make" value="Display &amp; Save POT File" title="Make a POT file with the translation strings below and display it" />&nbsp;
475
+ <input type="submit" name="ezt-clear" value="Reload Translation" title="Discard your changes and reload the translation" onclick="return confirm(\'Are you sure you want to discard your changes?\nThe page will take a few minutes to reload because we will be querying Google for translations for each translatable string in the plugin files.\nPlease be patient.\');" />&nbsp;
476
+ </div>' . $this->status . $this->error;
477
+ $saveStr = '<div class="submit">
478
+ <input type="submit" name="ezt-savePot" value="Save POT file" title="Saves the strings shown below to your PC as a POT file" />&nbsp;
479
+ <input type="submit" name="ezt-mailPot" value="Mail POT file" title="Email the translation to the plugin autor" onClick="return confirm(\'Are you sure you want to email the author?\');" />&nbsp;
480
+ <input type="submit" name="ezt-editMore" value="Edit More" title="If you are not happy with the strings, edit it further"/>
481
+ </div>' . $this->status . $this->error;
482
+ if ($made) {
483
+ echo "<div style='background-color:#eef;border: solid 1px #005;padding:5px'>If you are happy with the POT file as below, please save it or email it to the author. If not, edit it further. $backButton</div>";
484
+ $this->status = '<div class="updated">Ready to email to POT file to the author. Click on "Mail POT file" to send it.</div> ';
485
+ echo '<input type="hidden" name="potFile" value="' .
486
+ $domain . "-" . $locale . '.po" />';
487
+ echo '<input type="hidden" name="potStr" value="' . $pot . '" />';
488
+ echo $saveStr;
489
+ echo "\n" . '<pre>' . $pot . '</pre>';
490
+ }
491
+ else {
492
+ echo <<<EOF1
493
+ <div style="background-color:#eef;border: solid 1px #005;padding:5px">
494
+ You are editing the <code>$locale</code> translation for <code>{$this->plgName}</code>.
495
+ Text Domain is <code>{$this->domain}</code>.
496
+ <br />
497
+ Enter the translated strings in the text boxes below and hit the "Display POT File" button.
498
+ $backButton
499
+ </div>
500
+ EOF1;
501
+ echo $makeStr;
502
+ echo $pot;
503
+ }
504
+ echo "</form>\n</div>";
505
+ return $printed;
506
+ }
507
+
508
+ function getInvite() {
509
+ $locale = $this->locale;
510
+ $lo = substr($locale, 0, 2);
511
+ if ($lo == 'en') {
512
+ return "";
513
+ }
514
+ $plgName = $this->plgName;
515
+ if ($this->state == "Not Translated") {
516
+ $tip = htmlentities("It is easy to have <b>$plgName</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>$plgName</b> and presents them (and their existing translations in <b>$locale</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. I will include your translation in the next release.");
517
+ $invite = "<span style='color:red'> Would you like to see <b>$plgName</b> in your langugage (<b>$locale</b>)?&nbsp; <input type='submit' name='ezt-translate' onmouseover=\"Tip('$tip', WIDTH, 350, TITLE, 'How to Translate?', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 0, 5])\" onmouseout=\"UnTip()\" value ='Please help translate ' /></span>";
518
+ }
519
+ else {
520
+ $tip = htmlentities("If you would like to improve this translation, please use the translation interface. It picks up the translatable strings in <b>$plgName</b> and presents them and their existing translations in <b>$locale</b> 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.");
521
+ $invite = "<span style='color:red'> Would you like to improve this translation of <b>$plgName</b> in your langugage (<b>$locale</b>)?  <input type='submit' name='ezt-translate' onmouseover=\'Tip('$tip', WIDTH, 350, TITLE, 'How to Translate?', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 0, 5])\' onmouseout=\'UnTip()\' value='Improve $locale translation' /></span>";
522
+ }
523
+ return $invite;
524
+ }
525
+
526
+ function loadTran($helper = '') {
527
+ $locale = '';
528
+ if (empty($helper)) {
529
+ $moDir = "{$this->plgDir}/lang";
530
+ }
531
+ else {
532
+ $moDir = "{$this->plgDir}/../$helper/lang";
533
+ }
534
+ $moFile = "$moDir/{$this->locale}.mo";
535
+ $lo = substr($this->locale, 0, 2);
536
+ if (file_exists($moFile) && is_readable($moFile)) {
537
+ load_textdomain($this->domain, $moFile);
538
+ $locale = basename(dirname($moFile));
539
+ }
540
+ else {
541
+ // look for any other similar locale with the same first two characters
542
+ $moFiles = glob("$moDir/$lo*.mo");
543
+ if (!empty($moFiles)) {
544
+ $moFile = $moFiles[0];
545
+ load_textdomain($this->domain, $moFile);
546
+ $locale = basename(dirname($moFile));
547
+ }
548
+ }
549
+ return $locale;
550
+ }
551
+
552
+ function setLang() {
553
+ $locale = $this->locale;
554
+ $lo = substr($locale, 0, 2);
555
+ if ($lo != 'en') {
556
+ $locale = $this->loadTran();
557
+ // Append translations in the helpers
558
+ foreach ($this->helpers as $helper) {
559
+ $this->loadTran($helper);
560
+ }
561
+ }
562
+ if (empty($locale)) {
563
+ $this->state = "Not Translated";
564
+ }
565
+ else if ($locale == $this->locale) {
566
+ $this->state = "Translated";
567
+ }
568
+ else {
569
+ $this->state = "Alternate MO";
570
+ }
571
+ return $locale;
572
+ }
573
+
574
+ function renderTranslator() {
575
+ if (strncmp($this->locale, "en", 2) == 0) {
576
+ return;
577
+ }
578
+ echo "<br />\n";
579
+ echo "<br />\n";
580
+ echo '<div style="background-color:#ddd;padding:5px;border: solid 1px;margin:5px;">';
581
+ echo $this->getInvite();
582
+ if ($this->state != "Not Translated") {
583
+ echo "<input type='image' title='Switch to English temporarily' onmouseover = 'Tip(\"If you want to temporarily switch to English, please click here.\",WIDTH, 200)' onmouseout='UnTip()' src='{$this->plgURL}/english.gif' style='float:right;padding:0' name='ezt-english' value='english'>";
584
+ echo '</div>';
585
+ echo $this->adminMsg;
586
+ return;
587
+ }
588
+ echo "<br />";
589
+ $plgName = strtr(' ', '-', str_replace(' pro', '', strtolower($this->plgName)));
590
+ echo "<script type='text/javascript'>
591
+ <!--
592
+ function hideTranslator(id, btn, translator) {
593
+ var e = document.getElementById(id);
594
+ var eBtn = document.getElementById(btn);
595
+ e.style.display = 'none';
596
+ eBtn.innerHTML = 'Show ' + translator;
597
+ }
598
+ function showTranslator(id, btn, translator) {
599
+ var e = document.getElementById(id);
600
+ var eBtn = document.getElementById(btn);
601
+ e.style.display = 'block';
602
+ eBtn.innerHTML = 'Hide ' + translator;
603
+ }
604
+ function toggleVisibility(id, btn, translator) {
605
+ var e = document.getElementById(id);
606
+ if (translator == 'Google') hideTranslator('MicrosoftTranslatorWidget', 'btnMS', 'Microsoft');
607
+ if (translator == 'Microsoft') hideTranslator('GoogleTranslatorWidget', 'btnGG', 'Google');
608
+ if(e.style.display == 'block') {
609
+ hideTranslator(id, btn, translator);
610
+ }
611
+ else {
612
+ showTranslator(id, btn, translator);
613
+ }
614
+ }
615
+ //-->
616
+ </script>";
617
+ $ms = true;
618
+ $google = true;
619
+ if ($ms) {
620
+ $msBtn = " <button type='button' id='btnMS' onclick=\"toggleVisibility('MicrosoftTranslatorWidget', 'btnMS', 'Microsoft');\">Show Microsoft</button>";
621
+ $msLink = "<a target=_blank href='http://www.bing.com/translator'>Microsoft<sup>&reg;</sup></a> ";
622
+ $msJS = "<div id='MicrosoftTranslatorWidget' style='margin-left:auto;margin-right:auto;display:none; width: 200px; min-height: 83px; border-color: #404040; background-color: #A0A0A0;'><noscript><a href='http://www.microsofttranslator.com/bv.aspx?a=http%3a%2f%2fwww.thulasidas.com%2fplugins%2f$plgName'>Translate this page</a><br />Powered by <a href='http://www.bing.com/translator'>Microsoft® Translator</a></noscript></div> <script type='text/javascript'> /* <![CDATA[ */ setTimeout(function() { var s = document.createElement('script'); s.type = 'text/javascript'; s.charset = 'UTF-8'; s.src = ((location && location.href && location.href.indexOf('https') == 0) ? 'https://ssl.microsofttranslator.com' : 'http://www.microsofttranslator.com' ) + '/ajax/v2/widget.aspx?mode=manual&from=en&layout=ts'; var p = document.getElementsByTagName('head')[0] || document.documentElement; p.insertBefore(s, p.firstChild); }, 0); /* ]]> */ </script>";
623
+ }
624
+ else {
625
+ $msBtn = $msJs = $msLink = '';
626
+ }
627
+ if ($google) {
628
+ $ggBtn = " <button type='button' id='btnGG' onclick=\"toggleVisibility('GoogleTranslatorWidget', 'btnGG', 'Google');\">Show Google</button>";
629
+ $ggLink = "<a target=_blank href='https://translate.google.com/'>Google<sup>&reg;</sup></a>";
630
+ $ggJS = "<div id='GoogleTranslatorWidget' style='text-align:center;display:none;'><div id='google_translate_element'></div><script type='text/javascript'>
631
+ function googleTranslateElementInit() {
632
+ new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
633
+ }
634
+ </script><script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script></div>";
635
+ }
636
+ else {
637
+ $ggBtn = $ggJS = $ggLink = '';
638
+ }
639
+ if ($google && $ms) {
640
+ $or = "or";
641
+ }
642
+ echo "See this page in your language (<code>{$this->locale}</code>) using machine translation. $ggLink $or $msLink Translator.";
643
+ echo $ggBtn . $msBtn . $ggJS . $msJS;
644
+ echo '</div>';
645
+ }
646
+
647
+ }
648
+
649
+ }
650
+
admin.php CHANGED
@@ -1,430 +1,313 @@
1
  <?php
2
- /*
3
- Copyright (C) 2008 www.ads-ez.com
4
-
5
- This file is part of the program "Easy AdSense."
6
 
7
- Easy AdSense is free software; you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation; either version 3 of the License, or (at
10
- your option) any later version.
11
 
12
- Easy AdSense is distributed in the hope that it will be useful, but
13
- WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- General Public License for more details.
16
 
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- */
 
20
 
21
- @include(dirname (__FILE__).'/myPlugins.php');
22
- $ezIsPro = false;
 
23
 
24
- echo '<script type="text/javascript" src="'. get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__)) . '/wz_tooltip.js"></script>' ;
25
- if (isset($this->ezTran)) {
26
- echo '<div class="wrap" style="width:900px">' ;
27
- echo '<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">' ;
28
- wp_nonce_field('EzAdsenseSubmit','EzAdsenseNonce');
29
- $this->ezTran->printAdminPage() ;
30
- echo "</form>\n</div>" ;
31
- }
32
- else {
33
- ?>
34
 
 
 
 
 
35
  <div class="wrap" id="wrapper" style="width:1000px">
36
- <h2>Easy AdSense Setup
37
- </h2>
38
-
39
- <form method="post" action="">
40
- <?php
41
- wp_nonce_field('EzAdsenseSubmit','EzAdsenseNonce');
42
- $plgDir = dirname(__FILE__) ;
43
- $plgName = 'easy-adsense' ;
44
- if (empty($this->options['kill_rating']))
45
- renderRating($myPlugins[$plgName], $plgDir) ;
46
- if (empty($this->options['kill_invites']))
47
- renderInvite($myPlugins[$plgName], $plgName) ;
48
  ?>
49
- <table>
50
- <tr><th scope="row"><h3><?php _e('Instructions', 'easy-adsenser') ; ?></h3></th></tr>
51
- </table>
52
-
53
- <table class="form-table" style="width:100%">
54
- <tr style="vertical-align:middle">
55
- <td style="width:40%">
56
-
57
- <ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
58
- <li>
59
- <a href="#" title="<?php _e('Click for help', 'easy-adsenser') ; ?>" onclick="TagToTip('help0',WIDTH, 300, TITLE, '<?php _e('How to Set it up', 'easy-adsenser') ; ?>', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 15, 5])">
60
- <?php
61
- printf(__('A few easy steps to setup %s', 'easy-adsenser'),'<em>Easy AdSense</em>') ;
62
- ?></a><br />
63
- </li>
64
- <li>
65
- <a href="#" title="<?php _e('Click for help', 'easy-adsenser') ; ?>" onclick="TagToTip('help1',WIDTH, 300, TITLE, '<?php _e('How to Control AdSense on Each Post', 'easy-adsenser') ; ?>', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 15, 5])">
66
- <?php _e('Need to control ad blocks on each post?', 'easy-adsenser') ;?></a><br />
67
- </li>
68
- <li>
69
- <a href="#" title="<?php _e('Click for help', 'easy-adsenser') ; ?>" onclick="TagToTip('help1a',WIDTH, 300, TITLE, '<?php _e('All-in-One AdSense Control', 'easy-adsenser') ; ?>', STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 15, 5])">
70
- <?php _e('Sidebar Widgets, Link Units or Google Search', 'easy-adsenser') ;?></a><br />
71
- </li>
72
- </ul>
73
- </td>
74
-
75
- <?php @include (dirname (__FILE__).'/head-text.php'); ?>
76
-
77
- </tr>
78
- </table>
79
-
80
- <br />
81
-
82
- <table>
83
- <tr><th scope="row"><h3><?php printf(__('Options (for the %s theme)', 'easy-adsenser'), get_option('stylesheet')); ?></h3></th></tr>
84
- </table>
85
-
86
- <table style="width:100%">
87
- <tr>
88
- <td style="width:50%;height:50px">
89
-
90
- <table class="form-table">
91
- <tr>
92
- <td style="width:50%;height:40px">
93
- <b><u><?php _e('Ad Blocks in Your Posts', 'easy-adsenser') ; ?></u></b><br />
94
- <?php _e('[Appears in your posts and pages]', 'easy-adsenser') ; ?>
95
- </td>
96
- </tr>
97
- </table>
98
- </td>
99
-
100
- <td style="width:50%;height:50px">
101
- <table class="form-table">
102
- <tr>
103
- <td style="width:50%;height:40px">
104
- <b><u><?php _e('Widgets for Your Sidebars', 'easy-adsenser') ; ?></u></b><br />
105
- <?php _e('[See <a href="widgets.php"> Appearance (or Design) &rarr; Widgets</a>]', 'easy-adsenser') ; ?>
106
- </td>
107
- </tr>
108
- </table>
109
- </td>
110
- </tr>
111
- </table>
112
-
113
- <table style="width:100%">
114
- <tr style="vertical-align:top">
115
- <td style="width:50%">
116
- <table class="form-table">
117
- <tr style="vertical-align:top">
118
- <td style="width:50%;height:220px;vertical-align:middle">
119
- <b><?php _e('Lead-in AdSense Text', 'easy-adsenser') ; ?></b>&nbsp;
120
- <?php _e('(Appears near the beginning of the post)', 'easy-adsenser') ; ?><br />
121
- <textarea cols="50" rows="15" name="ezAdSenseTextLeadin" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_leadin']))) ?></textarea>
122
- <br />
123
- <b><span style="display:inline-block;width:30%"><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b></span>
124
- <span style="display:inline-block;width:40%" 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>
125
- <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>
126
- <br />
127
-
128
- <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()">
129
- <?php _e('Position:', 'easy-adsenser') ; ?>&nbsp;
130
- <select style="width:30%;" id="ezHeaderLeadin" name="ezHeaderLeadin">
131
- <option <?php if ($this->options['header_leadin'] == 'send_headers') { echo('selected="selected"'); }?> value ="send_headers"><?php _e('Above Header', 'easy-adsenser') ?></option>
132
- <option <?php if ($this->options['header_leadin'] == 'the_content') { echo('selected="selected"'); }?> value ="the_content"><?php _e('Below Header', 'easy-adsenser') ?></option>
133
- <option <?php if ($this->options['header_leadin'] == '') { echo('selected="selected"'); }?> value =""><?php _e('Beginning of Post', 'easy-adsenser') ?></option>
134
- </select>
135
- </label>
136
- &nbsp;
137
- <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()">
138
- <?php _e('Show:', 'easy-adsenser') ; ?>&nbsp;
139
- <select style="width:38%;" id="ezAdSenseShowLeadin" name="ezAdSenseShowLeadin">
140
- <option <?php if ($this->options['show_leadin'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Lead-in Ad', 'easy-adsenser') ?></option>
141
- <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>
142
- <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>
143
- <option <?php if ($this->options['show_leadin'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
144
- <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>
145
- <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>
146
- </select>
147
- </label>
148
- <br />
149
- </td>
150
- </tr>
151
- <tr style="vertical-align:top">
152
- <td style="width:50%;height:220px;vertical-align:middle">
153
- <b><?php _e('Mid-Post AdSense Text', 'easy-adsenser') ; ?></b>&nbsp;
154
- <?php _e('(Appears near the middle of the post)', 'easy-adsenser') ; ?><br />
155
- <textarea cols="50" rows="15" name="ezAdSenseTextMidtext" style="width: 95%; height: 130px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_midtext']))) ?></textarea>
156
- <br />
157
- <b><span style="display:inline-block;width:30%"><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b></span>
158
- <span style="display:inline-block;width:40%" 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>
159
- <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>
160
- <br />
161
- <label style="display:inline-block;width:45%" 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()">
162
- <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>
163
- <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()">
164
- <?php _e('Show:', 'easy-adsenser') ; ?>
165
- <select style="width:38%;" id="ezAdSenseShowMidtext" name="ezAdSenseShowMidtext">
166
- <option <?php if ($this->options['show_midtext'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Mid-post Ad', 'easy-adsenser') ?></option>
167
- <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>
168
- <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>
169
- <option <?php if ($this->options['show_midtext'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
170
- <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>
171
- <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>
172
- </select>
173
- </label>
174
-
175
- </td>
176
- </tr>
177
- <tr style="vertical-align:top">
178
- <td style="width:50%;height:200px;vertical-align:middle">
179
- <b><?php _e('Post Lead-out AdSense Text', 'easy-adsenser') ; ?></b>&nbsp;
180
- <?php _e('(Appears near the end of the post)', 'easy-adsenser') ; ?><br />
181
- <textarea cols="50" rows="15" name="ezAdSenseTextLeadout" style="width: 95%; height: 112px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_leadout']))) ?></textarea>
182
- <br />
183
- <b><span style="display:inline-block;width:30%"><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b></span>
184
- <span style="display:inline-block;width:40%" 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>
185
- <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>
186
- <br />
187
-
188
- <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()">
189
- <?php _e('Position:', 'easy-adsenser') ; ?>&nbsp;
190
- <select style="width:30%;" id="ezFooterLeadout" name="ezFooterLeadout">
191
- <option <?php if ($this->options['footer_leadout'] == '') { echo('selected="selected"'); }?> value =""><?php _e('End of Post', 'easy-adsenser') ?></option>
192
- <option <?php if ($this->options['footer_leadout'] == 'loop_end') { echo('selected="selected"'); }?> value ="loop_end"><?php _e('End of Page', 'easy-adsenser') ?></option>
193
- <option <?php if ($this->options['footer_leadout'] == 'get_footer') { echo('selected="selected"'); }?> value ="get_footer"><?php _e('Above Footer', 'easy-adsenser') ?></option>
194
- <option <?php if ($this->options['footer_leadout'] == 'wp_footer') { echo('selected="selected"'); }?> value ="wp_footer"><?php _e('Below Footer', 'easy-adsenser') ?></option>
195
- </select>
196
- </label>
197
- &nbsp;
198
- <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()">
199
- <?php _e('Show:', 'easy-adsenser') ; ?>
200
- <select style="width:38%;" id="ezAdSenseShowLeadout" name="ezAdSenseShowLeadout">
201
- <option <?php if ($this->options['show_leadout'] == 'no') { echo('selected="selected"'); }?> value ="no"><?php _e('Suppress Lead-out Ad', 'easy-adsenser') ?></option>
202
- <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>
203
- <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>
204
- <option <?php if ($this->options['show_leadout'] == 'text-align:center') { echo('selected="selected"'); }?> value ="text-align:center"><?php _e('Center', 'easy-adsenser') ?></option>
205
- <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>
206
- <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>
207
- </select>
208
- </label>
209
- <br />
210
- </td>
211
- </tr>
212
- </table>
213
-
214
- <table class="form-table">
215
- <tr style="vertical-align:top">
216
- <td style="width:50%;height:250px;vertical-align:middle">
217
- <b title="<?php _e('(Google policy allows no more than three ad blocks and three link units per page)', 'easy-adsenser') ; ?>"><?php _e('Option on Google Policy', 'easy-adsenser') ; ?></b>
218
- <br />
219
- <label for="ezAdSenseMax3">
220
- <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 />
221
- <label for="ezAdSenseMax2">
222
- <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>
223
- <label for="ezAdSenseMax1">
224
- <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>
225
- <label for="ezAdSenseMax0">
226
- <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 />
227
- <label for="ezAdSenseMax9">
228
- <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 />
229
-
230
- <?php if (get_bloginfo('version') < 2.8) {_e('Number of Link Units widgets (&le; 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;" />' ;?>
231
-
232
- <b><?php _e('Suppress AdSense Ad Blocks on:', 'easy-adsenser') ; ?></b>&nbsp;&nbsp;
233
- <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 />
234
- <label style="display:inline-block;width:35%" for="ezKillSticky" title="<?php _e('Sticky front page -- if you use a post as a front page', 'easy-adsenser') ; ?>">
235
- <input type="checkbox" id="ezKillSticky" name="ezKillSticky" <?php if ($this->options['kill_sticky']) { echo('checked="checked"'); }?> /> <?php _e('Sticky Front Page', 'easy-adsenser') ; ?></label>
236
- <label style="display:inline-block;width:25%" for="ezKillHome" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
237
- <input type="checkbox" id="ezKillHome" name="ezKillHome" <?php if ($this->options['kill_home']) { echo('checked="checked"'); }?> /> <?php _e('Home Page', 'easy-adsenser') ; ?></label>
238
- <label style="display:inline-block;width:30%" for="ezKillFront" title="<?php _e('Home Page and Front Page are the same for most blogs', 'easy-adsenser') ; ?>">
239
- <input type="checkbox" id="ezKillFront" name="ezKillFront" <?php if ($this->options['kill_front']) { echo('checked="checked"'); }?> /> <?php _e('Front Page', 'easy-adsenser') ; ?></label>
240
- <br />
241
- <label style="display:inline-block;width:35%" for="ezKillCat" title="<?php _e('Pages that come up when you click on category names', 'easy-adsenser') ; ?>">
242
- <input type="checkbox" id="ezKillCat" name="ezKillCat" <?php if ($this->options['kill_cat']) { echo('checked="checked"'); }?> /> <?php _e('Category Pages', 'easy-adsenser') ; ?></label>
243
- <label style="display:inline-block;width:25%" for="ezKillTag" title="<?php _e('Pages that come up when you click on tag names', 'easy-adsenser') ; ?>">
244
- <input type="checkbox" id="ezKillTag" name="ezKillTag" <?php if ($this->options['kill_tag']) { echo('checked="checked"'); }?> /> <?php _e('Tag Pages', 'easy-adsenser') ; ?></label>
245
- <label style="display:inline-block;width:30%" for="ezKillArchive" title="<?php _e('Pages that come up when you click on year/month archives', 'easy-adsenser') ; ?>">
246
- <input type="checkbox" id="ezKillArchive" name="ezKillArchive" <?php if ($this->options['kill_archive']) { echo('checked="checked"'); }?> /> <?php _e('Archive Pages', 'easy-adsenser') ; ?></label>
247
- <label style="display:inline-block;width:35%" for="ezKillSearch" title="<?php _e('Pages showing search results', 'easy-adsenser') ; ?>">
248
- <input type="checkbox" id="ezKillSearch" name="ezKillSearch" <?php if ($this->options['kill_search']) { echo('checked="checked"'); }?> /> <?php _e('Search Results', 'easy-adsenser') ; ?></label>
249
- <label style="display:inline-block;width:25%" for="ezKillSingle" title="<?php _e('Posts (ads will be shown only on other kind of pages as specified in these checkboxes)', 'easy-adsenser') ; ?>">
250
- <input type="checkbox" id="ezKillSingle" name="ezKillSingle" <?php if ($this->options['kill_single']) { echo('checked="checked"'); }?> /> <?php _e('Single Posts', 'easy-adsenser') ; ?></label>
251
- <label style="display:inline-block;width:30%" for="ezKillAttach" title="<?php _e('Pages that show attachments', 'easy-adsenser') ; ?>">
252
- <input type="checkbox" id="ezKillAttach" name="ezKillAttach" <?php if ($this->options['kill_attach']) { echo('checked="checked"'); }?> /> <?php _e('Attachment Page', 'easy-adsenser') ; ?></label>
253
- <br />
254
- <br style="line-height: 15px;" />
255
-
256
- <b><?php _e('Other Options', 'easy-adsenser') ; ?></b><br />
257
- <!-- <label for="ezAllowFeeds">
258
- <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 /> -->
259
- <label for="ezForceWidget">
260
- <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 />
261
-
262
- <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()" >
263
- <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>&nbsp;
264
- <label for="ezBorderWidget" title="<?php _e('Show the same border on the sidebar widget as well?', 'easy-adsenser') ; ?>">
265
- <input type="checkbox" id="ezBorderWidget" name="ezBorderWidget" <?php if ($this->options['border_widget']) { echo('checked="checked"'); }?> /> <?php _e('Widget?', 'easy-adsenser') ; ?></label>&nbsp;&nbsp;
266
- <label for="ezBorderLU" title="<?php _e('Show the same border on the link units too?', 'easy-adsenser') ; ?>">
267
- <input type="checkbox" id="ezBorderLU" name="ezBorderLU" <?php if ($this->options['border_lu']) { echo('checked="checked"'); }?> /> <?php _e('Link Units?', 'easy-adsenser') ; ?></label><br />&nbsp;&nbsp;&nbsp;&nbsp;
268
- Width: <input style="width:25px;text-align:center;" id="ezBorderWidth" name="ezBorderWidth" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_width'])));?>" />px&nbsp;&nbsp;
269
- Colors:&nbsp; Normal:#<input style="width:65px;text-align:center;" id="ezBorderNormal" name="ezBorderNormal" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_normal'])));?>" />&nbsp;&nbsp; Hover:#<input style="width:65px;text-align:center;" id="ezBorderColor" name="ezBorderColor" value="<?php echo(stripslashes(htmlspecialchars($this->options['border_color'])));?>" /><br />
270
-
271
- <label for="ezKillInLine" onmouseover="Tip('<?php _e('All &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s that &lt;em&gt;Easy AdSense&lt;/em&gt; creates have the class attribute &lt;code&gt;adsense&lt;/code&gt;. Furthermore, they have class attributes like &lt;code&gt;adsense-leadin&lt;/code&gt;, &lt;code&gt;adsense-midtext&lt;/code&gt;, &lt;code&gt;adsense-leadout&lt;/code&gt;, &lt;code&gt;adsense-widget&lt;/code&gt; and &lt;code&gt;adsense-lu&lt;/code&gt; depending on the type. You can set the style for these classes in your theme &lt;code&gt;style.css&lt;/code&gt; to control their appearance.&lt;br /&gt;If this is all Greek to you, please leave the option unchecked.', 'easy-adsenser'); ?>',WIDTH, 290, TITLE, 'CSS vs. In-Line')" onmouseout="UnTip()" >
272
- <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><br />
273
-
274
- <label for="ezKillLineBreaks" onmouseover="Tip('<?php _e('If you find that you have extra vertical spaces or if your ad code is messed up with &lt;code&gt;&lt;&lt;/code&gt;&lt;code&gt;p&gt;&lt;/code&gt; or &lt;code&gt;&lt;&lt;/code&gt;&lt;code&gt;br /&gt;&lt;/code&gt; tags, try checking this option.&lt;br /&gt;Under normal cirumstances, this option should be left unchecked.', 'easy-adsenser'); ?>',WIDTH, 290, TITLE, 'Spurious Linebreaks')" onmouseout="UnTip()" >
275
- <input type="checkbox" id="ezKillLineBreaks" name="ezKillLineBreaks" <?php if ($this->options['kill_linebreaks']) { echo('checked="checked"'); }?> /> <?php _e('Prevent spurious line breaks', 'easy-adsenser') ; ?></label><br />
276
-
277
- <label for="ezSuppressBoxes" onmouseover="Tip('<?php _e('If no ad text is entered for a particular slot, Easy AdSense Pro displays a box with red borders to indicate where an would have been placed. If you would like to suppress them, check this option.', 'easy-adsenser'); ?>',WIDTH, 290, TITLE, 'Suppress Red Boxes')" onmouseout="UnTip()" >
278
- <input type="checkbox" id="ezSuppressBoxes" name="ezSuppressBoxes" <?php if ($this->options['suppressBoxes']) { echo('checked="checked"'); }?> /> <?php _e('Suppress Placement Boxes', 'easy-adsenser') ; ?></label>
279
-
280
- </td>
281
- </tr>
282
- </table>
283
-
284
- </td>
285
- <td style="width:50%">
286
-
287
- <table class="form-table">
288
- <tr style="vertical-align:top">
289
- <td style="width:50%;height:220px;vertical-align:middle">
290
- <b><?php _e('AdSense Widget Text', 'easy-adsenser') ; ?></b>&nbsp;
291
- <?php _e('(Appears in the Sidebar as a Widget)', 'easy-adsenser') ; ?><br />
292
- <textarea cols="50" rows="15" name="ezAdSenseTextWidget" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_widget']))) ?></textarea>
293
- <br />
294
- <span style="display:inline-block;width:70%"><b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>&nbsp;<?php _e('(Where to show?)', 'easy-adsenser') ; ?></span>
295
- <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>
296
- <br />
297
- <label for="ezAdSenseShowWidget_left">
298
- <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>&nbsp;
299
- <label for="ezAdSenseShowWidget_center">
300
- <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>&nbsp;
301
- <label for="ezAdSenseShowWidget_right">
302
- <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>&nbsp;
303
- <label for="ezAdSenseShowWidget_no">
304
- <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 />
305
- <label for="ezAdWidgetTitle"><b><?php _e('Widget Title:', 'easy-adsenser') ; ?></b>&nbsp; <input style="width:200px" id="ezAdWidgetTitle" name="ezAdWidgetTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_widget']))) ?>" /></label>&nbsp;
306
- <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>
307
- </td>
308
- </tr>
309
- <tr style="vertical-align:top">
310
- <td style="width:50%;height:220px;vertical-align:middle">
311
- <b><?php _e('AdSense Link-Units Text', 'easy-adsenser') ; ?></b>&nbsp;
312
- <?php _e('(Appears in the Sidebar as Widgets)', 'easy-adsenser') ; ?><br />
313
- <textarea cols="50" rows="15" name="ezAdSenseTextLU" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_lu']))) ?></textarea>
314
- <br />
315
- <span style="display:inline-block;width:70%"><b><?php _e('Ad Alignment', 'easy-adsenser') ; ?></b>&nbsp;<?php _e('(Where to show?)', 'easy-adsenser') ; ?></span>
316
- <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>
317
- <br />
318
- <label for="ezAdSenseShowLU_left">
319
- <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>&nbsp;
320
- <label for="ezAdSenseShowLU_center">
321
- <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>&nbsp;
322
- <label for="ezAdSenseShowLU_right">
323
- <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>&nbsp;
324
- <label for="ezAdSenseShowLU_no">
325
- <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 />
326
- <label for="ezAdLUTitle"><b><?php _e('Link Unit Title:', 'easy-adsenser') ; ?></b>&nbsp; <input style="width: 200px;" id="ezAdLUTitle" name="ezAdLUTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_lu']))) ?>" /></label>
327
- <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>
328
- </td>
329
- </tr>
330
- <tr style="vertical-align:top">
331
- <td style="width:50%;height:250px;vertical-align:middle">
332
- <b><?php _e('Google Search Widget', 'easy-adsenser') ; ?></b>&nbsp;
333
- <?php _e('(Adds a Google Search Box to your sidebar)', 'easy-adsenser') ; ?><br />
334
- <textarea cols="50" rows="15" name="ezAdSenseTextGSearch" style="width: 95%; height: 110px;"><?php echo(stripslashes(htmlspecialchars($this->options['text_gsearch']))) ?></textarea>
335
- <br />
336
- <span style="display:inline-block;width:70%"><b><?php _e('Search Title', 'easy-adsenser') ; ?></b>&nbsp;<?php _e('(Title of the Google Search Widget)', 'easy-adsenser') ; ?></span>
337
- <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>
338
- <br />
339
- <label for="ezAdSenseShowGSearch_dark">
340
- <input type="radio" id="ezAdSenseShowGSearch_dark" name="ezAdSenseShowGSearch" value="dark" <?php if ($this->options['title_gsearch'] == "dark") { echo('checked="checked"'); }?> />&nbsp; <?php echo '<img src=" ' . $this->plugindir . '/google-dark.gif" alt="Google (dark)" style="background:black;vertical-align:-40%;"'; ?> /> </label>&nbsp;
341
- <label for="ezAdSenseShowGSearch_light">
342
- <input type="radio" id="ezAdSenseShowGSearch_light" name="ezAdSenseShowGSearch" value="light" <?php if ($this->options['title_gsearch'] == "light") { echo('checked="checked"'); }?> />&nbsp; <?php echo '<img src=" ' . $this->plugindir . '/google-light.gif" alt="Google (light)" style="background:white;vertical-align:-40%;"'; ?> /> </label>&nbsp;
343
- <label for="ezAdSenseShowGSearch_no">
344
- <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 />
345
- <label for="ezAdSenseShowGSearch_text">
346
- <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>&nbsp;
347
- <label for="ezAdSearchTitle">
348
- <input style="width: 200px;" id="ezAdSearchTitle" name="ezAdSearchTitle" type="text" value= "<?php echo(stripslashes(htmlspecialchars($this->options['title_gsearch']))) ?>" /></label>
349
- <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>
350
- </td>
351
- </tr>
352
- </table>
353
-
354
  <table class="form-table">
355
- <tr style="vertical-align:top">
356
- <td style="width:50%;height:250px;vertical-align:middle;color:#d00;">
357
-
358
- <?php echo '<b>Support Options<br /> ' ; ?></b><br />
359
-
360
- <b><?php _e('Link-backs to', 'easy-adsenser') ; ?> <a href="http://www.Thulasidas.com" target="_blank">Unreal Blog</a></b>
361
- <?php _e('(Consider showing at least one link.)', 'easy-adsenser') ; ?><br />
362
- <label for="ezAdSenseLinkMax99">
363
- <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 />
364
- <label for="ezAdSenseLinkMax1">
365
- <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 />
366
- <label for="ezAdSenseLinkMax-1">
367
- <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 />
368
- <label for="ezAdSenseLinkMax0">
369
- <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>' ?>
370
- <br />
371
- <br style="line-height: 12px;" />
372
- <?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>' ; ?>
373
- </td>
374
- </tr>
375
- </table>
376
-
377
- </td>
378
- </tr>
379
- </table>
380
-
381
- <div class="submit">
382
- <input type="submit" name="update_ezAdSenseSettings" value="<?php _e('Save Changes', 'easy-adsenser') ?>" title="<?php _e('Save the changes as specified above', 'easy-adsenser') ?>" onmouseover="Tip('<?php _e('Save the changes as specified above', 'easy-adsenser') ?>',WIDTH, 240, TITLE, '<?php _e('Save Changes', 'easy-adsenser') ?>')" onmouseout="UnTip()"/>
383
- <input type="submit" name="reset_ezAdSenseSettings" value="<?php _e('Reset Options', 'easy-adsenser') ?>" title="<?php _e('Discard all your changes and load defaults. (Are you quite sure?)', 'easy-adsenser') ?>" onmouseover="TagToTip('help3',WIDTH, 240, TITLE, 'DANGER!', BGCOLOR, '#ffcccc', FONTCOLOR, '#800000',BORDERCOLOR, '#c00000')" onmouseout="UnTip()"/>
384
- <input type="submit" name="clean_db" value="<?php _e('Clean Database', 'easy-adsenser') ?>" onmouseover="TagToTip('help4',WIDTH, 280, TITLE, 'DANGER!', BGCOLOR, '#ffcccc', FONTCOLOR, '#800000',BORDERCOLOR, '#c00000')" onmouseout="UnTip()"/>
385
- <input type="submit" name="kill_me" value="<?php _e('Uninstall', 'easy-adsenser') ?>" onmouseover="TagToTip('help5',WIDTH, 280, TITLE, 'DANGER!', BGCOLOR, '#ffcccc', FONTCOLOR, '#800000',BORDERCOLOR, '#c00000')" onmouseout="UnTip()"/>
386
- <?php echo $this->invite ;
387
- if ($this->locale != "en_US") {?>
388
- &nbsp;&nbsp;&nbsp;&nbsp;<input type="image" title="Switch to English temporarily" src="<?php echo $this->plugindir ;?>/english.gif" style="vertical-align:-15px;" name="english" value="english" />
389
- <?php } ?>
390
- <hr />
391
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  </form>
393
 
394
- <span id="help0">
395
- 1.
396
- <?php
397
- _e('Generate AdSense code (from http://adsense.google.com &rarr; AdSense Setup &rarr; Get Ads).', 'easy-adsenser') ;
398
- ?>
399
- <br />
400
- 2.
401
- <?php
402
- _e('Cut and paste the AdSense code into the boxes below, deleting the existing text.', 'easy-adsenser') ;
403
- ?>
404
- <br />
405
- 3.
406
- <?php
407
- _e('Decide how to align and show the code in your blog posts.', 'easy-adsenser') ;
408
- ?>
409
- <br />
410
- 4. <?php
411
- _e('Take a look at the Google policy option, and other options. The defaults should work.', 'easy-adsenser') ;
412
- ?>
413
- <br />
414
- 5.
415
- <?php
416
- printf(__('If you want to use the widgets, drag and drop them at %s Appearance (or Design) &rarr; Widgets %s', 'easy-adsenser'), '<a href="widgets.php">', '</a>.') ;
417
- ?>
418
- <br />
419
- <b>
420
- <?php
421
- _e('Save the options, and you are done!', 'easy-adsenser') ;
422
- ?>
423
- </b>
424
  </span>
425
 
426
- <span id="help1">
427
- <?php _e('If you want to suppress AdSense in a particular post or page, give the <b><em>comment </em></b> "&lt;!--noadsense--&gt;" somewhere in its text.
428
  <br />
429
  <br />
430
  Or, insert a <b><em>Custom Field</em></b> with a <b>key</b> "adsense" and give it a <b>value</b> "no".<br />
@@ -440,58 +323,44 @@ adsense-search<br />
440
  left,
441
  right,
442
  center,
443
- no', 'easy-adsenser') ;?>
444
  </span>
445
 
446
- <span id="help1a">
447
- <?php _e('<em>Easy AdSense</em> gives you widgets to embelish your sidebars. You can configure them here (on the right hand side of the Options table below) and place them on your page using <a href="widgets.php"> Appearance (or Design) &rarr; Widgets</a>.
448
  <br />
449
  <br />
450
  1. <b>AdSense Widget</b> is an ad block widget that you can place any where on the sidebar. Typically, you would put a skyscraper block (160x600px, for instance) on your sidebar, but you can put anything -- not necessarily AdSense code.<br />
451
  <br />
452
  2. <b>AdSense Link Units</b>, if enabled, give you multiple widgets to put <a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=15817" target="_blank">link units</a> on your sidebars. You can display three of them according to Google AdSense policy, and you can configure the number of widgets you need.<br /><br />
453
- 3. <b>Google Search Widget</b> gives you another widget to place a <a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=17960" target="_blank">custom AdSense search box</a> on your sidebar. You can customize the look of the search box and its title by configuring them on this page.', 'easy-adsenser') ;?>
454
  </span>
455
 
456
- <span id="help3">
457
- <span style="color:red"><?php _e('This <b>Reset Options</b> button discards all your changes and loads the default options. This is your only warning!', 'easy-adsenser') ; ?></span><br />
458
- <b><?php _e('Discard all your changes and load defaults. (Are you quite sure?)', 'easy-adsenser') ?></b></span>
459
-
460
- <span id="help4">
461
- <span style="color:red"><?php _e('The <b>Database Cleanup</b> button discards all your AdSense settings you have saved so far for <b>all</b> the themes, including the current one. Use it only if you know that you won\'t be using these themes. Please be careful with all database operations -- keep a backup.', 'easy-adsenser') ; ?></span><br />
462
- <b><?php _e('Discard all your changes and load defaults. (Are you quite sure?)', 'easy-adsenser') ?></b></span>
463
-
464
- <span id="help5">
465
- <span style="color:red"><?php printf(__('The <b>Uninstall</b> button really kills %s after cleaning up all the options it wrote in your database. This is your only warning! Please be careful with all database operations -- keep a backup.', 'easy-adsenser'), '<em>Easy AdSense</em>') ; ?></span><br />
466
- <b><?php _e('Kill this plugin. (Are you quite sure?)', 'easy-adsenser') ?></b></span>
467
-
468
  <?php
469
- if (!$this->options['kill_invites']) {
470
- echo '<div style="background-color:#cff;padding:5px;border: solid 1px;margin:5px;">' ;
471
- @include (dirname (__FILE__).'/why-pro.php');
472
- echo '</div>' ;
473
  }
474
  ?>
475
 
476
  <div style="background-color:#fcf;padding:5px;border: solid 1px;margin:5px;">
477
- <?php @include (dirname (__FILE__).'/support.php'); ?>
 
 
478
  </div>
479
 
480
- <?php @include (dirname (__FILE__).'/tail-text.php'); ?>
481
 
482
  <table class="form-table" >
483
- <tr><th scope="row"><b><?php _e('Credits', 'easy-adsenser'); ?></b></th></tr>
484
- <tr><td>
485
- <ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
486
- <li>
487
- <?php printf(__('%s uses the excellent Javascript/DHTML tooltips by %s', 'easy-adsenser'), '<b>Easy Adsense</b>', '<a href="http://www.walterzorn.com" target="_blank" title="Javascript, DTML Tooltips"> Walter Zorn</a>.') ;
488
- ?>
489
- </li>
490
- </ul>
491
- </td>
492
- </tr>
493
  </table>
494
 
495
  </div>
496
- <?php
497
- }
1
  <?php
 
 
 
 
2
 
3
+ /*
4
+ Copyright (C) 2008 www.ads-ez.com
 
 
5
 
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License as
8
+ published by the Free Software Foundation; either version 3 of the
9
+ License, or (at your option) any later version.
10
 
11
+ This program is distributed in the hope that they will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ General Public License for more details.
15
 
16
+ You should have received a copy of the GNU General Public License
17
+ along with the programs. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
 
20
+ echo '<script type="text/javascript" src="' . $this->plgURL . '/wz_tooltip.js"></script>';
 
 
 
 
 
 
 
 
 
21
 
22
+ $this->mkEzOptions();
23
+ $this->setOptionValues();
24
+ $this->mkHelpTags();
25
+ echo <<<EOF1
26
  <div class="wrap" id="wrapper" style="width:1000px">
27
+ <h2 title="{$this->options['info']}">Easy AdSense Setup</h2>
28
+ EOF1;
 
 
 
 
 
 
 
 
 
 
29
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  <table class="form-table">
31
+ <tr style="vertical-align:middle">
32
+ <td style="width:40%">
33
+ <h3>
34
+ <?php
35
+ _e('Instructions', 'easy-adsenser');
36
+ echo "</h3>\n<ul style='padding-left:10px;list-style-type:circle; list-style-position:inside;'>\n";
37
+ foreach ($this->helpTags as $help) {
38
+ echo "<li>";
39
+ $help->render();
40
+ echo "</li>\n";
41
+ }
42
+ ?>
43
+ </ul>
44
+ </td>
45
+ <?php
46
+ include ($this->plgDir . '/head-text.php');
47
+ ?>
48
+ </tr></table>
49
+ <form method='post' action='#'>
50
+ <?php
51
+ if (empty($this->options['kill_rating'])) {
52
+ $ez->renderRating();
53
+ }
54
+ if (empty($this->options['kill_invites'])) {
55
+ $ez->renderInvite();
56
+ }
57
+ $this->migrateOptions();
58
+ wp_nonce_field('EzAdsenseSubmit', 'EzAdsenseNonce');
59
+ ?>
60
+ <br />
61
+ <table>
62
+ <tr><td><h3>
63
+ <?php
64
+ printf(__('Options (for the %s theme)', 'easy-adsenser'), get_option('stylesheet'));
65
+ ?>
66
+ </h3></td></tr>
67
+ </table>
68
+ <table style='width:100%'>
69
+ <tr>
70
+ <td style='width:50%;height:50px'>
71
+ <table class='form-table'>
72
+ <tr>
73
+ <td style='width:50%;height:40px'>
74
+ <?php
75
+ echo "<b><u>";
76
+ _e('Ad Blocks in Your Posts', 'easy-adsenser');
77
+ echo "</u></b><br />";
78
+ _e('[Appears in your posts and pages]', 'easy-adsenser');
79
+ ?>
80
+ </td>
81
+ </tr>
82
+ </table>
83
+ </td>
84
+ <td style='width:50%;height:50px'>
85
+ <table class='form-table'>
86
+ <tr>
87
+ <td style='width:50%;height:40px'>
88
+ <?php
89
+ echo "<b><u>";
90
+ _e('Widgets for Your Sidebars', 'easy-adsenser');
91
+ ?>
92
+ </u></b><br />
93
+ <?php
94
+ _e('[See <a href="widgets.php"> Appearance (or Design) &rarr; Widgets</a>]', 'easy-adsenser');
95
+ ?>
96
+ </td>
97
+ </tr>
98
+ </table>
99
+ </td>
100
+ </tr>
101
+ </table>
102
+
103
+ <table style='width:100%'>
104
+ <tr style='vertical-align:top'>
105
+ <td style='width:50%'>
106
+ <table class='form-table'>
107
+ <tr style='vertical-align:top'>
108
+ <td style='width:50%;height:220px;vertical-align:middle'>
109
+ <?php
110
+ $this->ezOptions['text_leadin']->render();
111
+ echo "<b><span style='display:inline-block;width:30%'>";
112
+ _e('Ad Alignment', 'easy-adsenser');
113
+ echo "</span></b>"
114
+ . "<span style='display:inline-block;width:40%'>";
115
+ $this->ezOptions['wc_leadin']->render();
116
+ echo "</span>";
117
+ $this->ezOptions['margin_leadin']->render();
118
+ $this->ezOptions['header_leadin']->render();
119
+ echo "&nbsp;";
120
+ $this->ezOptions['show_leadin']->render();
121
+ ?>
122
+ <br />
123
+ </td>
124
+ </tr>
125
+ <tr style='vertical-align:top'>
126
+ <td style='width:50%;height:220px;vertical-align:middle'>
127
+ <?php
128
+ $this->ezOptions['text_midtext']->render();
129
+ echo "<b><span style='display:inline-block;width:30%'>";
130
+ _e('Ad Alignment', 'easy-adsenser');
131
+ echo "</span></b>"
132
+ . "<span style='display:inline-block;width:40%'>";
133
+ $this->ezOptions['wc_midtext']->render();
134
+ echo "</span>";
135
+ $this->ezOptions['margin_midtext']->render();
136
+ $this->ezOptions['force_midad']->render();
137
+ echo "&nbsp;";
138
+ $this->ezOptions['show_midtext']->render();
139
+ ?>
140
+ <br />
141
+ </td>
142
+ </tr>
143
+ <tr style='vertical-align:top'>
144
+ <td style='width:50%;height:250px;vertical-align:middle'>
145
+ <?php
146
+ $this->ezOptions['text_leadout']->render();
147
+ echo "<b><span style='display:inline-block;width:30%'>";
148
+ _e('Ad Alignment', 'easy-adsenser');
149
+ echo "</span></b>"
150
+ . "<span style='display:inline-block;width:40%'>";
151
+ $this->ezOptions['wc_leadout']->render();
152
+ echo "</span>";
153
+ $this->ezOptions['margin_leadout']->render();
154
+ $this->ezOptions['footer_leadout']->render();
155
+ echo "&nbsp;";
156
+ $this->ezOptions['show_leadout']->render();
157
+ ?>
158
+ </td>
159
+ </tr>
160
+ </table>
161
+
162
+ <table class='form-table'>
163
+ <tr style='vertical-align:top'>
164
+ <td style='width:50%;height:250px;vertical-align:middle'>
165
+ <?php
166
+ $this->ezOptions['max_count']->render();
167
+ echo "<br style='line-height: 5px;' /><b>";
168
+ _e('Suppress AdSense Ad Blocks on:', 'easy-adsenser');
169
+ echo "</b>";
170
+ foreach ($this->kills as $k) {
171
+ $this->ezOptions["kill_$k"]->render();
172
+ }
173
+ ?>
174
+ <br style='line-height: 5px;' />
175
+
176
+ <b><?php _e('Other Options', 'easy-adsenser'); ?></b><br />
177
+
178
+ <?php
179
+ $this->ezOptions['force_widget']->render();
180
+ $this->ezOptions['show_borders']->render();
181
+ $this->ezOptions['border_widget']->render();
182
+ $this->ezOptions['border_lu']->render();
183
+ echo "<span style='display:inline-block;width:20px'> </span>";
184
+ $this->ezOptions['border_width']->render();
185
+ $this->ezOptions['border_normal']->render();
186
+ $this->ezOptions['border_color']->render();
187
+ $this->ezOptions['kill_inline']->render();
188
+ $this->ezOptions['kill_linebreaks']->render();
189
+ ?>
190
+ </td>
191
+ </tr>
192
+ </table>
193
+
194
+ </td>
195
+ <td style='width:50%'>
196
+
197
+ <table class='form-table'>
198
+ <tr style='vertical-align:top'>
199
+ <td style='width:50%;height:220px;vertical-align:middle'>
200
+ <?php
201
+ $this->ezOptions['text_widget']->render();
202
+ ?>
203
+ <span style='display:inline-block;width:70%'><b><?php _e('Ad Alignment', 'easy-adsenser'); ?></b>&nbsp;<?php _e('(Where to show?)', 'easy-adsenser'); ?></span>
204
+ <?php
205
+ $this->ezOptions['margin_widget']->render();
206
+ $this->ezOptions['show_widget']->render();
207
+ $this->ezOptions['title_widget']->render();
208
+ $this->ezOptions['kill_widget_title']->render();
209
+ ?>
210
+ </td>
211
+ </tr>
212
+ <tr style='vertical-align:top'>
213
+ <td style='width:50%;height:220px;vertical-align:middle'>
214
+ <?php
215
+ $this->ezOptions['text_lu']->render();
216
+ ?>
217
+ <span style='display:inline-block;width:70%'><b><?php _e('Ad Alignment', 'easy-adsenser'); ?></b>&nbsp;<?php _e('(Where to show?)', 'easy-adsenser'); ?></span>
218
+ <?php
219
+ $this->ezOptions['margin_lu']->render();
220
+ $this->ezOptions['show_lu']->render();
221
+ $this->ezOptions['title_lu']->render();
222
+ $this->ezOptions['kill_lu_title']->render();
223
+ ?>
224
+ </td>
225
+ </tr>
226
+ <tr style='vertical-align:top'>
227
+ <td style='width:50%;height:250px;vertical-align:middle'>
228
+ <?php
229
+ $this->ezOptions['text_gsearch']->render();
230
+ ?>
231
+ <span style='display:inline-block;width:70%'><b><?php _e('Search Title', 'easy-adsenser'); ?></b>&nbsp;<?php _e('(Title of the Google Search Widget)', 'easy-adsenser'); ?></span>
232
+ <?php
233
+ $this->ezOptions['margin_gsearch']->render();
234
+ $this->ezOptions['title_gsearch']->render();
235
+ $this->ezOptions['title_gsearch_custom']->render();
236
+ $this->ezOptions['kill_gsearch_title']->render();
237
+ ?>
238
+ </td>
239
+ </tr>
240
+ </table>
241
+
242
+ <table class='form-table'>
243
+ <tr style='vertical-align:top'>
244
+ <td style='width:50%;height:250px;vertical-align:middle'>
245
+ <br style='line-height: 12px;' />
246
+ <?php
247
+ $this->ezOptions['max_link']->render();
248
+ $this->ezOptions['kill_author']->render();
249
+ $this->ezOptions['suppressBoxes']->render();
250
+ $ez->renderWhyPro($short = true);
251
+ ?>
252
+ </td>
253
+ </tr>
254
+ </table>
255
+
256
+ </td>
257
+ </tr>
258
+ </table>
259
+
260
+ <div class="submit">
261
+ <?php
262
+ $update = new EzSubmit('saveChanges');
263
+ $update->desc = __('Save Changes', 'easy-adsenser');
264
+ $update->title = __('Save the changes as specified above', 'easy-adsenser');
265
+ $update->tipTitle = $update->desc;
266
+
267
+ $reset = new EzSubmit('resetOptions');
268
+ $reset->desc = __('Reset Options', 'easy-adsenser');
269
+ $reset->title = __('This <b>Reset Options</b> button discards all your changes and loads the default options. This is your only warning!', 'easy-adsenser');
270
+ $reset->tipWarning = true;
271
+
272
+ $cleanDB = new EzSubmit('cleanDB');
273
+ $cleanDB->desc = __('Clean Database', 'easy-adsenser');
274
+ $cleanDB->title = __('The <b>Database Cleanup</b> button discards all your AdSense settings you have saved so far for <b>all</b> the themes, including the current one. Use it only if you know that you will not be using these themes. Please be careful with all database operations -- keep a backup.', 'easy-adsenser');
275
+ $cleanDB->tipWarning = true;
276
+
277
+ $uninstall = new EzSubmit('uninstall');
278
+ $uninstall->desc = __('Uninstall', 'easy-adsenser');
279
+ $uninstall->title = __('The <b>Uninstall</b> button really kills %s after cleaning up all the options it wrote in your database. This is your only warning! Please be careful with all database operations -- keep a backup.', 'easy-adsenser');
280
+ $uninstall->tipWarning = true;
281
+
282
+ $update->render();
283
+ $reset->render();
284
+ $cleanDB->render();
285
+ $uninstall->render();
286
+ $this->ezTran->renderTranslator();
287
+ ?>
288
+ </div>
289
  </form>
290
 
291
+ <span id="help0" style='display:none'>
292
+ <?php
293
+ echo "1. ";
294
+ _e('Generate AdSense code (from http://adsense.google.com &rarr; AdSense Setup &rarr; Get Ads).', 'easy-adsenser');
295
+ echo "<br />\n2. ";
296
+ _e('Cut and paste the AdSense code into the boxes below, deleting the existing text.', 'easy-adsenser');
297
+ echo "<br />\n3. ";
298
+ _e('Decide how to align and show the code in your blog posts.', 'easy-adsenser');
299
+ echo "<br />\n4. ";
300
+ _e('Take a look at the Google policy option, and other options. The defaults should work.', 'easy-adsenser');
301
+ echo "<br />\n5. ";
302
+ printf(__('If you want to use the widgets, drag and drop them at %s Appearance (or Design) &rarr; Widgets %s', 'easy-adsenser'), '<a href="widgets.php">', '</a>.');
303
+ echo "<br />\n<b>";
304
+ _e('Save the options, and you are done!', 'easy-adsenser');
305
+ echo "</b>";
306
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  </span>
308
 
309
+ <span id="help1" style='display:none'>
310
+ <?php _e('If you want to suppress AdSense in a particular post or page, give the <b><em>comment </em></b> "&lt;!--noadsense--&gt;" somewhere in its text.
311
  <br />
312
  <br />
313
  Or, insert a <b><em>Custom Field</em></b> with a <b>key</b> "adsense" and give it a <b>value</b> "no".<br />
323
  left,
324
  right,
325
  center,
326
+ no', 'easy-adsenser'); ?>
327
  </span>
328
 
329
+ <span id="help2" style='display:none'>
330
+ <?php _e('<em>Easy AdSense</em> gives you widgets to embelish your sidebars. You can configure them here (on the right hand side of the Options table below) and place them on your page using <a href="widgets.php"> Appearance (or Design) &rarr; Widgets</a>.
331
  <br />
332
  <br />
333
  1. <b>AdSense Widget</b> is an ad block widget that you can place any where on the sidebar. Typically, you would put a skyscraper block (160x600px, for instance) on your sidebar, but you can put anything -- not necessarily AdSense code.<br />
334
  <br />
335
  2. <b>AdSense Link Units</b>, if enabled, give you multiple widgets to put <a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=15817" target="_blank">link units</a> on your sidebars. You can display three of them according to Google AdSense policy, and you can configure the number of widgets you need.<br /><br />
336
+ 3. <b>Google Search Widget</b> gives you another widget to place a <a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&amp;answer=17960" target="_blank">custom AdSense search box</a> on your sidebar. You can customize the look of the search box and its title by configuring them on this page.', 'easy-adsenser'); ?>
337
  </span>
338
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  <?php
340
+ if (!$this->isPro) {
341
+ $ez->renderWhyPro();
 
 
342
  }
343
  ?>
344
 
345
  <div style="background-color:#fcf;padding:5px;border: solid 1px;margin:5px;">
346
+ <?php
347
+ $ez->renderSupport();
348
+ ?>
349
  </div>
350
 
351
+ <?php include ($this->plgDir . '/tail-text.php'); ?>
352
 
353
  <table class="form-table" >
354
+ <tr><th scope="row"><b><?php _e('Credits', 'easy-adsenser'); ?></b></th></tr>
355
+ <tr><td>
356
+ <ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
357
+ <li>
358
+ <?php printf(__('%s uses the excellent Javascript/DHTML tooltips by %s', 'easy-adsenser'), '<b>Easy Adsense</b>', '<a href="http://www.walterzorn.com" target="_blank" title="Javascript, DTML Tooltips"> Walter Zorn</a>.');
359
+ ?>
360
+ </li>
361
+ </ul>
362
+ </td>
363
+ </tr>
364
  </table>
365
 
366
  </div>
 
 
defaults.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- $defaults = array ('defaultText' => 'Please generate and paste your ad code here. If left empty, the ad location will be highlighted on your blog pages with a reminder to enter your code.');
 
 
easy-adsense-lite.php CHANGED
@@ -1,269 +1,544 @@
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 &rarr; Easy AdSense</a>.
6
- Version: 6.51
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->plugindir = get_option('siteurl') . '/' . PLUGINDIR .
51
- '/' . basename(dirname(__FILE__)) ;
52
  // Counts and limis
53
- $this->ezMax = 99 ;
54
- $this->urMax = 99 ;
55
- $this->luMax = 4 ;
56
- $this->urCount = 0 ;
57
- $this->ezCount = 0 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
- function session_start(){
61
- if (!session_id()) @session_start() ;
 
 
 
62
  }
63
 
64
  function handleSubmits() {
65
  if (empty($_POST)) {
66
- return ;
67
- }
68
- if (!check_admin_referer('EzAdsenseSubmit','EzAdsenseNonce')) {
69
- return ;
70
- }
71
- if ((isset($_POST['ezAds-translate']) && !empty($_POST['ezAds-translate'])) ||
72
- (isset($_POST['ezAds-make']) && !empty($_POST['ezAds-make'])) ||
73
- (isset($_POST['ezAds-clear']) && !empty($_POST['ezAds-clear'])) ||
74
- (isset($_POST['ezAds-savePot']) && !empty($_POST['ezAds-savePot'])) ||
75
- (isset($_POST['ezAds-mailPot']) && !empty($_POST['ezAds-mailPot'])) ||
76
- (isset($_POST['ezAds-editMore']) && !empty($_POST['ezAds-editMore']))) {
77
- if (file_exists (dirname (__FILE__).'/lang/easy-translator.php')){
78
- include (dirname (__FILE__).'/lang/easy-translator.php');
79
- $this->ezTran = new ezTran ;
80
- }
81
- }
82
- if (isset($_POST['update_ezAdSenseSettings'])) {
83
- if (isset($_POST['ezAdSenseShowLeadin']))
84
- $this->options['show_leadin'] = $_POST['ezAdSenseShowLeadin'];
85
- if (isset($_POST['ezAdSenseTextLeadin']))
86
- $this->options['text_leadin'] = $_POST['ezAdSenseTextLeadin'];
87
- if (isset($_POST['ezLeadInMargin']))
88
- $this->options['margin_leadin'] = $_POST['ezLeadInMargin'];
89
- if (isset($_POST['ezLeadInWC']))
90
- $this->options['wc_leadin'] = $_POST['ezLeadInWC'];
91
- if (isset($_POST['ezHeaderLeadin']))
92
- $this->options['header_leadin'] = $_POST['ezHeaderLeadin'];
93
-
94
- if (isset($_POST['ezAdSenseShowMidtext']))
95
- $this->options['show_midtext'] = $_POST['ezAdSenseShowMidtext'];
96
- if (isset($_POST['ezAdSenseTextMidtext']))
97
- $this->options['text_midtext'] = $_POST['ezAdSenseTextMidtext'];
98
- if (isset($_POST['ezMidTextWC']))
99
- $this->options['wc_midtext'] = $_POST['ezMidTextWC'];
100
- if (isset($_POST['ezMidTextMargin']))
101
- $this->options['margin_midtext'] = $_POST['ezMidTextMargin'];
102
-
103
- if (isset($_POST['ezAdSenseShowLeadout']))
104
- $this->options['show_leadout'] = $_POST['ezAdSenseShowLeadout'];
105
- if (isset($_POST['ezAdSenseTextLeadout']))
106
- $this->options['text_leadout'] = $_POST['ezAdSenseTextLeadout'];
107
- if (isset($_POST['ezLeadOutWC']))
108
- $this->options['wc_leadout'] = $_POST['ezLeadOutWC'];
109
- if (isset($_POST['ezLeadOutMargin']))
110
- $this->options['margin_leadout'] = $_POST['ezLeadOutMargin'];
111
- if (isset($_POST['ezFooterLeadout']))
112
- $this->options['footer_leadout'] = $_POST['ezFooterLeadout'];
113
-
114
- if (isset($_POST['ezAdSenseShowWidget']))
115
- $this->options['show_widget'] = $_POST['ezAdSenseShowWidget'];
116
- if (isset($_POST['ezAdWidgetTitle']))
117
- $this->options['title_widget'] = $_POST['ezAdWidgetTitle'];
118
- if (isset($_POST['ezAdSenseTextWidget']))
119
- $this->options['text_widget'] = $_POST['ezAdSenseTextWidget'];
120
- $this->options['kill_widget_title'] = isset($_POST['ezAdKillWidgetTitle']);
121
- if (isset($_POST['ezWidgetMargin']))
122
- $this->options['margin_widget'] = $_POST['ezWidgetMargin'];
123
-
124
- if (isset($_POST['ezAdSenseShowLU']))
125
- $this->options['show_lu'] = $_POST['ezAdSenseShowLU'];
126
- if (isset($_POST['ezAdLUTitle']))
127
- $this->options['title_lu'] = $_POST['ezAdLUTitle'];
128
- if (isset($_POST['ezAdSenseTextLU']))
129
- $this->options['text_lu'] = $_POST['ezAdSenseTextLU'];
130
- $this->options['kill_lu_title'] = isset($_POST['ezAdKillLUTitle']);
131
- if (isset($_POST['ezLUMargin']))
132
- $this->options['margin_lu'] = $_POST['ezLUMargin'];
133
-
134
- if (isset($_POST['ezAdSenseShowGSearch'])) {
135
- $title = $_POST['ezAdSenseShowGSearch']; ;
136
- if ($title != 'dark' && $title != 'light' && $title != 'no')
137
- $title = $_POST['ezAdSearchTitle'];
138
- $this->options['title_gsearch'] = $title;
139
- }
140
- if (isset($_POST['killInvites']))
141
- $this->options['kill_invites'] = $_POST['killInvites'];
142
- if (isset($_POST['killRating']))
143
- $this->options['kill_rating'] = $_POST['killRating'];
144
- $this->options['kill_gsearch_title'] = isset($_POST['ezAdKillSearchTitle']);
145
- if (isset($_POST['ezAdSenseTextGSearch']))
146
- $this->options['text_gsearch'] = $_POST['ezAdSenseTextGSearch'];
147
- if (isset($_POST['ezSearchMargin']))
148
- $this->options['margin_gsearch'] = $_POST['ezSearchMargin'];
149
-
150
- if (isset($_POST['ezAdSenseMax']))
151
- $this->options['max_count'] = $_POST['ezAdSenseMax'];
152
- if (isset($_POST['ezAdSenseLinkMax']))
153
- $this->options['max_link'] = $_POST['ezAdSenseLinkMax'];
154
-
155
- $this->options['force_midad'] = isset($_POST['ezForceMidAd']);
156
- $this->options['force_widget'] = isset($_POST['ezForceWidget']);
157
- $this->options['allow_feeds'] = isset($_POST['ezAllowFeeds']);
158
- $this->options['kill_pages'] = isset($_POST['ezKillPages']);
159
- $this->options['kill_home'] = isset($_POST['ezKillHome']);
160
- $this->options['kill_attach'] = isset($_POST['ezKillAttach']);
161
- $this->options['kill_front'] = isset($_POST['ezKillFront']);
162
- $this->options['kill_cat'] = isset($_POST['ezKillCat']);
163
- $this->options['kill_tag'] = isset($_POST['ezKillTag']);
164
- $this->options['kill_archive'] = isset($_POST['ezKillArchive']);
165
- $this->options['kill_inline'] = isset($_POST['ezKillInLine']);
166
- $this->options['kill_linebreaks'] = isset($_POST['ezKillLineBreaks']);
167
- $this->options['suppressBoxes'] = isset($_POST['ezSuppressBoxes']);
168
- $this->options['kill_single'] = isset($_POST['ezKillSingle']);
169
- $this->options['kill_search'] = isset($_POST['ezKillSearch']);
170
- $this->options['kill_sticky'] = isset($_POST['ezKillSticky']);
171
-
172
- $this->options['show_borders'] = isset($_POST['ezShowBorders']);
173
- if (isset($_POST['ezBorderWidth']))
174
- $this->options['border_width'] = intval($_POST['ezBorderWidth']) ;
175
- if (isset($_POST['ezBorderNormal']))
176
- $this->options['border_normal'] = strval($_POST['ezBorderNormal']) ;
177
- if (isset($_POST['ezBorderColor']))
178
- $this->options['border_color'] = strval($_POST['ezBorderColor']) ;
179
- if (isset($_POST['ezBorderWidget']))
180
- $this->options['border_widget'] = $_POST['ezBorderWidget'];
181
- if (isset($_POST['ezBorderLU']))
182
- $this->options['border_lu'] = $_POST['ezBorderLU'];
183
-
184
- if (isset($_POST['ezLimitLU'])) {
185
- $limit = min(intval($_POST['ezLimitLU']), 3) ;
186
- $this->options['limit_lu'] = $limit ;
187
  }
 
188
  update_option($this->optionName, $this->options);
189
- $this->adminMsg = '<div class="updated"><p><strong>' .
190
- __("Settings Updated.", "easy-adsenser") .
191
- '</strong></p> </div>' ;
 
192
  }
193
- else if (isset($_POST['reset_ezAdSenseSettings'])) {
194
  $this->resetOptions();
195
- $this->adminMsg = '<div class="updated"><p><strong>' .
196
- __("Ok, all your settings have been discarded!", "easy-adsenser") .
197
- '</strong></p> </div>' ;
198
- }
199
- else if (isset($_POST['english'])) {
200
- $this->locale = "en_US" ;
201
- $moFile = dirname(__FILE__) . '/lang/easy-adsenser.mo';
202
- global $l10n;
203
- $version = (float)get_bloginfo('version') ;
204
- if ($version < 2.80)
205
- $l10n['easy-adsenser']->cache_translations = array() ;
206
- else
207
- unset($l10n['easy-adsenser']) ;
208
- load_textdomain('easy-adsenser', $moFile);
209
- $this->adminMsg = '<div class="updated"><p><strong>Ok, in English for now. ' .
210
- '<a href="options-general.php?page=easy-adsense-lite.php">Switch back</a>. ' .
211
- '</strong></p> </div>' ;
212
- }
213
- else if (isset($_POST['clean_db']) || isset($_POST['kill_me'])) {
214
  $this->resetOptions();
215
  $this->cleanDB('ezAdSense');
216
- $this->adminMsg = '<div class="updated"><p><strong>' .
217
- __("Database has been cleaned. All your options for this plugin (for all themes) have been removed.", "easy-adsenser") .
218
- '</strong></p> </div>' ;
219
 
220
- if (isset($_POST['kill_me'])) {
221
  remove_action('admin_menu', 'ezAdSense_ap');
222
- $me = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
223
- $this->adminMsg = '<div class="updated"><p><strong>' .
224
- __("This plugin can be deactivated now. ", "easy-adsenser") .
225
- '<a href="plugins.php">' .
226
- __("Go to Plugins", "easy-adsenser") .
227
- '</a>.</strong></p></div>' ;
228
  }
229
  }
230
  }
231
 
232
- function setLang() {
233
- $locale = get_locale() ;
234
- $locale = str_replace('-','_', $locale);
235
- $this->locale = $locale ;
236
-
237
- $name = 'easy-adsenser' ;
238
-
239
- if(!empty($this->locale) && $this->locale != 'en_US') {
240
- $this->invite = '<hr /><font color="red"> Would you like to improve this translation of <b>Easy Adsense</b> in your langugage (<b>' . $locale .
241
- "</b>)?&nbsp; <input type='submit' name='ezAds-translate' onmouseover=\"Tip('If you would like to improve this translation, please use the translation interface. It picks up the translatable strings in &lt;b&gt;Easy AdSense&lt;/b&gt; and presents them and their existing translations in &lt;b&gt;" . $locale .
242
- "&lt;/b&gt; 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='Improve " . $locale . " translation' /></font>" ;
 
 
 
 
 
 
 
 
243
 
244
- $moFile = dirname(__FILE__) . '/lang/' . $this->locale . '/' . $name . '.mo';
245
- if(@file_exists($moFile) && is_readable($moFile))
246
- load_textdomain($name, $moFile);
247
- else {
248
- // look for any other similar locale with the same first three characters
249
- $foo = glob(dirname(__FILE__) . '/lang/' . substr($this->locale, 0, 2) .
250
- '*/easy-adsenser.mo') ;
251
- if (!empty($foo)>0) {
252
- $moFile = $foo[0] ;
253
- load_textdomain($name, $moFile);
254
- $this->locale = basename(dirname($moFile)) ;
255
- }
256
- $this->invite = '<hr /><font color="red"> Would you like to see ' .
257
- '<b>Easy Adsense</b> in your langugage (<b>' . $locale .
258
- "</b>)?&nbsp; <input type='submit' name='ezAds-translate' onmouseover=\"Tip('It is easy to have &lt;b&gt;Easy AdSense&lt;/b&gt; in your language. All you have to do is to translate some strings, and email the file to the author.&lt;br /&gt;&lt;br /&gt;If you would like to help, please use the translation interface. It picks up the translatable strings in &lt;b&gt;Easy AdSense&lt;/b&gt; and presents them (and their existing translations in &lt;b&gt;" . $this->locale .
259
- "&lt;/b&gt;, 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>" ;
260
- }
261
  }
262
  }
263
 
264
- function mkDefaultOptions(){
265
- $defaultOptions =
266
- array('info' => "<!-- Easy AdSense Lite -->",
 
 
 
267
  'show_leadin' => 'float:right',
268
  'wc_leadin' => 0,
269
  'margin_leadin' => 12,
@@ -285,6 +560,7 @@ if (!class_exists("EzAdSense")) {
285
  'margin_lu' => 12,
286
  'text_lu' => $this->defaults['defaultText'],
287
  'title_gsearch' => '',
 
288
  'kill_gsearch_title' => '',
289
  'margin_gsearch' => 0,
290
  'text_gsearch' => $this->defaults['defaultText'],
@@ -292,23 +568,19 @@ if (!class_exists("EzAdSense")) {
292
  'max_link' => 0,
293
  'force_midad' => false,
294
  'force_widget' => false,
295
- 'allow_feeds' => false,
296
- 'kill_pages' => false,
297
  'show_borders' => false,
298
  'border_width' => 1,
299
  'border_normal' => '00FFFF',
300
  'border_color' => 'FF0000',
301
  'border_widget' => false,
302
  'border_lu' => false,
303
- 'limit_lu' => 1,
304
  'title_lu' => '',
305
  'kill_lu_title' => false,
306
- 'kill_invites' => false,
307
- 'kill_rating' => false,
308
- 'kill_attach' => false,
309
  'kill_home' => false,
310
- 'kill_front' => false,
311
- 'kill_cat' => false,
312
  'kill_tag' => false,
313
  'kill_archive' => false,
314
  'kill_inline' => false,
@@ -317,569 +589,658 @@ if (!class_exists("EzAdSense")) {
317
  'kill_single' => false,
318
  'kill_search' => true,
319
  'kill_sticky' => false,
320
- 'suppressBoxes' => false,
321
- 'title_widget' => '');
322
- return $defaultOptions ;
323
  }
324
 
325
  // Reset all options to defaults
326
  function resetOptions() {
327
- $defaultOptions = $this->mkDefaultOptions() ;
328
  update_option($this->optionName, $defaultOptions);
329
- $this->options = $defaultOptions ;
 
330
  }
331
 
332
  function handleDefaultText($text, $key = '300x250') {
333
- $ret = $text ;
334
  if ($ret == $this->defaults['defaultText'] || strlen(trim($ret)) == 0) {
335
  if ($this->options['suppressBoxes']) {
336
  $ret = '';
337
  }
338
  else {
339
- $x = strpos($key, 'x') ;
340
  $w = substr($key, 0, $x);
341
- $h = substr($key, $x+1);
342
- $p = (int)(min($w,$h)/6) ;
343
- $ret = '<div style="width:'.$w.'px;height:'.$h.'px;border:1px solid red;"><div style="padding:'.$p.'px;text-align:center;font-family:arial;font-size:8pt;"><p>Your ads will be inserted here by</p><p><b>Easy AdSense</b>.</p><p>Please go to the plugin admin page to<br /><u title="Generate your ad code from your provider and paste it in the text box for this ad slot">Paste your ad code</u> OR<br /> <u title="Use the dropdown under the text box for this ad slot to suppress it">Suppress this ad slot</u> OR<br /><u title="Use the option to suppress placement boxes">Suppress Placement Boxes</u>.</p></div></div>' ;
344
  }
345
  }
346
- return $ret ;
347
  }
348
 
349
  function handleDefaults() {
350
- $texts = array('text_leadin', 'text_midtext', 'text_leadout') ;
351
  foreach ($texts as $t) {
352
- $text = $this->options[$t] ;
353
- $this->options[$t] = $this->handleDefaultText($text) ;
354
  }
355
  }
356
 
357
  // Prints out the admin page
358
  function printAdminPage() {
 
 
 
 
 
359
  // if the defaults are not loaded, send error message
360
- if (empty($this->defaults)) return ;
361
- if (file_exists (dirname (__FILE__).'/admin.php')) {
362
- $this->handleSubmits() ;
363
- echo $this->adminMsg ;
364
- include (dirname (__FILE__).'/admin.php');
 
365
  }
366
  else {
367
- echo '<font size="+1" color="red">' ;
368
- _e("Error locating the admin page!\nEnsure admin.php exists, or reinstall the plugin.",
369
- 'easy-adsenser') ;
370
- echo '</font>' ;
371
  }
372
  }
373
 
374
- function info($hide=true) {
375
- if ( ! function_exists( 'get_plugin_data' ) )
376
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
377
- $plugin_data = get_plugin_data( __FILE__ );
 
378
  $version = $plugin_data['Version'];
379
- $str = "Easy AdSense (WP) V$version" ;
380
- if ($hide)
381
  $str = "<!-- $str -->";
382
- return $str ;
 
383
  }
384
 
385
- function cleanDB($prefix){
386
- global $wpdb ;
387
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '$prefix%'") ;
388
  }
389
 
390
  function plugin_action($links, $file) {
391
- if ($file == plugin_basename(dirname(__FILE__).'/easy-adsense-lite.php')) {
392
  $settings_link = "<a href='options-general.php?page=easy-adsense-lite.php'>" .
393
- __('Settings', 'easy-adsenser') . "</a>";
394
- array_unshift( $links, $settings_link );
395
  }
396
  return $links;
397
  }
398
 
399
  function getMetaOptions() {
 
 
 
400
  global $post;
401
  $lookup = array('adsense' => 'adsense',
402
- 'adsense-top' =>'show_leadin',
403
- 'adsense-middle' => 'show_midtext',
404
- 'adsense-bottom' => 'show_leadout',
405
- 'adsense-widget' => 'show_widget',
406
- 'adsense-search' => 'title_gsearch',
407
- 'adsense-linkunits' => 'show_lu') ;
408
- $metaOptions = array() ;
409
  foreach ($lookup as $metaKey => $optKey) {
410
- if (!empty($this->options[$optKey])) $metaOptions[$optKey] = $this->options[$optKey] ;
411
- else $metaOptions[$optKey] = '' ;
 
 
 
 
412
  $customStyle = get_post_custom_values($metaKey, $post->ID, true);
413
- if (is_array($customStyle))
414
- $metaStyle = strtolower($customStyle[0]) ;
415
- else
416
- $metaStyle = strtolower($customStyle) ;
417
- $style = '' ;
418
- if ($metaStyle == 'left')
419
- $style = 'float:left;display:block;' ;
420
- else if ($metaStyle == 'right')
421
- $style = 'float:right;display:block;' ;
422
- else if ($metaStyle == 'center')
423
- $style = 'text-align:center;display:block;' ;
424
- else $style = $metaStyle ;
425
- if (!empty($style)) $metaOptions[$optKey] = $style ;
426
- }
427
- return $metaOptions ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
429
 
430
- function ezAdSense_content($content) {
431
- if (!in_the_loop()) return $content ;
432
- if (!$this->options['allow_feeds'] && is_feed()) return $content ;
433
- if ($this->options['kill_pages'] && is_page()) return $content ;
434
- if ($this->options['kill_attach'] && is_attachment()) return $content ;
435
- if ($this->options['kill_home'] && is_home()) return $content ;
436
- if ($this->options['kill_front'] && is_front_page()) return $content ;
437
- if ($this->options['kill_cat'] && is_category()) return $content ;
438
- if ($this->options['kill_tag'] && is_tag()) return $content ;
439
- if ($this->options['kill_archive'] && is_archive()) return $content ;
440
- if ($this->options['kill_single'] && is_single()) return $content ;
441
- if ($this->options['kill_search'] && is_search()) return $content ;
442
- if ($this->options['kill_sticky'] && is_sticky()) return $content ;
443
- $this->ezMax = $this->options['max_count'] ;
444
- if ($this->options['force_widget']) $this->ezMax-- ;
445
- $this->urMax = $this->options['max_link'] ;
446
- if ($this->ezCount >= $this->ezMax) return $content ;
447
- if(strpos($content, "<!--noadsense-->") !== false) return $content;
448
- $metaOptions = $this->getMetaOptions() ;
449
- if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no')
450
  return $content;
451
- $this->handleDefaults() ;
452
- $this->options['info'] = $this->info() ;
453
-
454
- if ($this->options['kill_linebreaks']) $linebreak = "" ;
455
- else $linebreak = "\n" ;
456
-
457
- $wc = str_word_count($content) ;
458
- $unreal = '' ;
459
- if ((is_single() || is_page()) && $this->urCount < $this->urMax)
460
- $unreal = '<div align="center"><font size="-3">' .
461
- '<a href="http://www.thulasidas.com/adsense/" ' .
462
- 'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
463
- 'Easy AdSense</a> by <a href="http://www.Thulasidas.com/" ' .
464
- 'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
465
- 'Unreal</a></font></div>';
466
-
467
- $border = '' ;
468
- if ($this->options['show_borders']) {
469
- $border='border:#' . $this->options['border_normal'] .
470
- ' solid ' . $this->options['border_width'] . 'px;" ' .
471
- ' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
472
- ' solid ' . $this->options['border_width'] . 'px\'" ' .
473
- 'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
474
- ' solid ' . $this->options['border_width'] . 'px\'"' ;
475
- // $border="border:#{$this->options['border_normal']} solid {$this->options['border_width']}px;\" onmouseover=\"this.style.border='#{$this->options['border_color']} solid {$this->options['border_width']}px'\" onmouseout=\"this.style.border='#{$this->options['border_normal']} solid {$this->options['border_width']}px'" ;
476
  }
477
- $show_leadin = $metaOptions['show_leadin'] ;
478
- $leadin = '' ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
480
  if ($this->ezCount < $this->ezMax) {
 
481
  $this->ezCount++;
482
- $margin = $this->options['margin_leadin'] ;
483
- if ($this->options['kill_inline'])
484
- $inline = '' ;
485
- else
486
- $inline = 'style="' . $show_leadin .
487
- ';margin:' . $margin . 'px;' . $border. '"' ;
488
- $leadin =
489
- stripslashes($this->options['info'] .
490
- "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
491
- '<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
492
- $this->options['text_leadin'] .
493
- ($this->urCount++ < $this->urMax ? $unreal : '') .
494
- "</div>$linebreak" . $this->options['info'] . "$linebreak") ;
495
- }
496
- }
497
-
498
- $show_midtext = $metaOptions['show_midtext'] ;
 
499
  if ($show_midtext != 'no' && $wc > $this->options['wc_midtext']) {
500
  if ($this->ezCount < $this->ezMax) {
501
- $poses = array();
502
- $lastpos = -1;
503
- $repchar = "<p";
504
- if(strpos($content, "<p") === false)
505
- $repchar = "<br";
506
-
507
- while(strpos($content, $repchar, $lastpos+1) !== false){
508
- $lastpos = strpos($content, $repchar, $lastpos+1);
509
- $poses[] = $lastpos;
510
  }
511
- $half = sizeof($poses);
512
- while(sizeof($poses) > $half)
513
- array_pop($poses);
514
- $pickme = 0 ;
515
- if (!empty($poses)) $pickme = $poses[floor(sizeof($poses)/2)];
516
  if ($this->options['force_midad'] || $half > 10) {
517
  $this->ezCount++;
518
- $margin = $this->options['margin_midtext'] ;
519
- if ($this->options['kill_inline'])
520
- $inline = '' ;
521
- else
522
- $inline = 'style="' . $show_midtext .
523
- ';margin:' . $margin . 'px;' . $border. '"' ;
524
- $midtext =
525
- stripslashes($this->options['info'] .
526
- "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
527
- '<div class="ezAdsense adsense adsense-midtext" ' . $inline . '>' .
528
- $this->options['text_midtext'] .
529
- ($this->urCount++ < $this->urMax ? $unreal : '') .
530
- "</div>$linebreak" . $this->options['info'] . "$linebreak") ;
531
- $content = substr_replace($content, $midtext.$repchar, $pickme, 2);
 
532
  }
533
  }
534
  }
535
 
536
- $show_leadout = $metaOptions['show_leadout'] ;
537
- $leadout = '' ;
538
  if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
539
  if ($this->ezCount < $this->ezMax) {
540
  $this->ezCount++;
541
- $margin = $this->options['margin_leadout'] ;
542
- if ($this->options['kill_inline'])
543
- $inline = '' ;
544
- else
545
- $inline = 'style="' . $show_leadout .
546
- ';margin:' . $margin . 'px;' . $border. '"' ;
547
- $leadout =
548
- stripslashes($this->options['info'] .
549
- "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
550
- '<div class="ezAdsense adsense adsense-leadout" ' . $inline . '>' .
551
- $this->options['text_leadout'] .
552
- ($this->urCount++ < $this->urMax ? $unreal : '') .
553
- "</div>$linebreak" . $this->options['info'] . "$linebreak") ;
 
 
 
 
 
 
 
 
 
554
  }
555
  }
556
  if ($this->options['header_leadin']) {
557
- $this->leadin = $leadin ;
558
- $leadin = '' ;
559
  }
560
  if ($this->options['footer_leadout']) {
561
- $this->leadout = $leadout ;
562
- $leadout = '' ;
 
 
 
 
 
 
563
  }
564
- return $leadin . $content . $leadout ;
565
  }
566
 
567
- function footer_action(){
568
- $unreal = '<div align="center"><font size="-3">' .
569
- '<a href="http://thulasidas.com/adsense" ' .
570
- 'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
571
- 'Easy AdSense</a> by <a href="http://www.Thulasidas.com/" ' .
572
- 'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
573
- 'Unreal</a></font></div>';
574
- echo $unreal ;
575
  }
576
 
577
  function header_leadin() {
578
- if (is_admin()) return ;
 
 
 
579
  // is_feed() is not ready, because the WP query hasn't been run yet.
580
- if (strpos($_SERVER['REQUEST_URI'], 'feed') !== false) return ;
581
- // This is sad: Need to pre-construct $this->leadin
582
- $unreal = '' ;
583
- $border = '' ;
584
- if ($this->options['show_borders'])
585
- $border='border:#' . $this->options['border_normal'] .
586
- ' solid ' . $this->options['border_width'] . 'px;" ' .
587
- ' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
588
- ' solid ' . $this->options['border_width'] . 'px\'" ' .
589
- 'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
590
- ' solid ' . $this->options['border_width'] . 'px\'"' ;
591
- $show_leadin = $this->options['show_leadin'] ;
592
-
593
- if ($this->options['kill_linebreaks']) $linebreak = "" ;
594
- else $linebreak = "\n" ;
595
-
596
- if ($show_leadin != 'no') {
597
- $margin = $this->options['margin_leadin'] ;
598
- if ($this->options['kill_inline'])
599
- $inline = '' ;
600
- else
601
- $inline = 'style="' . $show_leadin .
602
- ';margin:' . $margin . 'px;' . $border. '"' ;
603
- $this->ezCount++ ;
604
- $this->leadin =
605
- stripslashes($this->options['info'] .
606
- "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
607
- '<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
608
- $this->options['text_leadin'] .
609
- ($this->urCount++ < $this->urMax ? $unreal : '') .
610
- "</div>$linebreak" . $this->options['info'] . "$linebreak") ;
611
- echo $this->leadin ;
612
  }
613
- }
614
-
615
- function footer_leadout(){
616
- if (is_admin()) return ;
617
- echo $this->leadout ;
618
- }
619
-
620
- // ===== widget functions =====
621
- function widget_ezAd_ads($args) {
622
- extract($args);
623
- $this->options['text_widget'] =
624
- $this->handleDefaultText($this->options['text_widget'], '160x600') ;
625
- $this->options['info'] = $this->info() ;
626
- $metaOptions = $this->getMetaOptions() ;
627
- if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
628
- $show_widget = $metaOptions['show_widget'] ;
629
- if ($show_widget == 'no') return ;
630
- $this->ezMax = $this->options['max_count'] ;
631
- $this->urMax = $this->options['max_link'] ;
632
- if (!$this->options['force_widget']) {
633
- if ($this->ezCount >= $this->ezMax) return ;
634
- $this->ezCount++;
635
  }
636
-
637
- if ($this->options['kill_linebreaks']) $linebreak = "" ;
638
- else $linebreak = "\n" ;
639
-
640
- $title = empty($this->options['title_widget']) ?
641
- __('Sponsored Links', 'easy-adsenser') :
642
- stripslashes(htmlspecialchars($this->options['title_widget'])) ;
643
- $border = '' ;
644
- if ($this->options['show_borders'] && $this->options['border_widget'] )
645
- $border='border:#' . $this->options['border_normal'] .
646
- ' solid ' . $this->options['border_width'] . 'px ;"' .
647
- ' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
648
- ' solid ' . $this->options['border_width'] . 'px\'" ' .
649
- 'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
650
- ' solid ' . $this->options['border_width'] . 'px\'"' ;
651
- $unreal = '<div align="center"><font size="-3">' .
652
- '<a href="http://thulasidas.com/adsense" ' .
653
- 'target="_blank" title="The simplest way to put AdSense to work for you!"> ' .
654
- 'Easy AdSense</a> by <a href="http://www.Thulasidas.com/" ' .
655
- 'target="_blank" title="Unreal Blog proudly brings you Easy AdSense">' .
656
- 'Unreal</a></font></div>';
657
- echo $before_widget;
658
- if (!$this->options['kill_widget_title'])
659
- echo $before_title . $title . $after_title;
660
- $margin = $this->options['margin_widget'] ;
661
- if ($this->options['kill_inline'])
662
- $inline = '' ;
663
- else
664
- $inline = 'style="' . $show_widget .
665
- ';margin:' . $margin . 'px;' . $border. '"' ;
666
- echo stripslashes($this->options['info'] .
667
- "$linebreak<!-- Widg[count: " . $this->ezCount . "] -->$linebreak" .
668
- '<div class="ezAdsense adsense adsense-widget"><div ' . $inline. '>' .
669
- $this->options['text_widget'] .
670
- ($this->urCount++ < $this->urMax ? $unreal : '') .
671
- "</div></div>$linebreak" . $this->options['info'] . "$linebreak") ;
672
- echo $after_widget;
673
- }
674
-
675
- function widget_ezAd_lu($args) {
676
- extract($args);
677
- $this->options['text_lu'] =
678
- $this->handleDefaultText($this->options['text_lu'], '160x160') ;
679
- $title = empty($this->options['title_lu']) ? '' :
680
- $before_title . stripslashes(htmlspecialchars($this->options['title_lu'])) . $after_title ;
681
- $metaOptions = $this->getMetaOptions() ;
682
- if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
683
- $show_lu = $metaOptions['show_lu'] ;
684
-
685
- if ($this->options['kill_linebreaks']) $linebreak = "" ;
686
- else $linebreak = "\n" ;
687
-
688
- $border = '' ;
689
- if ($this->options['show_borders'] && $this->options['border_lu'] )
690
- $border='border:#' . $this->options['border_normal'] .
691
- ' solid ' . $this->options['border_width'] . 'px;" ' .
692
- ' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
693
- ' solid ' . $this->options['border_width'] . 'px\'" ' .
694
- 'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
695
- ' solid ' . $this->options['border_width'] . 'px\'"' ;
696
- if ($show_lu != 'no') {
697
- echo $before_widget ;
698
- if (!$this->options['kill_widget_title']) echo $title ;
699
- $margin = $this->options['margin_lu'] ;
700
- if ($this->options['kill_inline'])
701
- $inline = '' ;
702
- else
703
- $inline = 'style="' . $show_widget .
704
- ';margin:' . $margin . 'px;' . $border. '"' ;
705
- echo stripslashes('<div class="ezAdsense adsense adsense-lu"><div ' .
706
- $inline. '>' . "$linebreak" .
707
- $this->options['text_lu'] . "$linebreak" .
708
- '</div></div>') ;
709
- echo $after_widget ;
710
  }
711
  }
712
 
713
- function widget_ezAd_search($args) {
714
- extract($args);
715
- $this->options['text_gsearch'] =
716
- $this->handleDefaultText($this->options['text_gsearch'], '160x160') ;
717
- $metaOptions = $this->getMetaOptions() ;
718
- if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') return ;
719
- $title_gsearch = $metaOptions['title_gsearch'] ;
720
-
721
- if ($this->options['kill_linebreaks']) $linebreak = "" ;
722
- else $linebreak = "\n" ;
723
-
724
- if ($title_gsearch != 'no') {
725
- $title = $before_title . $title_gsearch . $after_title ;
726
- if ($title_gsearch == 'dark')
727
- $title = '<img src=" ' . $this->plugindir . '/google-dark.gif" ' .
728
- ' border="0" alt="[Google]" align="middle" />' ;
729
- if ($title_gsearch == 'light')
730
- $title = '<img src=" ' . $this->plugindir . '/google-light.gif" ' .
731
- ' border="0" alt="[Google]" align="middle" />' ;
732
- echo $before_widget ;
733
- if (!$this->options['kill_gsearch_title']) echo $title ;
734
- $margin = $this->options['margin_gsearch'] ;
735
- if ($this->options['kill_inline'])
736
- $inline = '' ;
737
- else
738
- $inline = 'style="margin:' . $margin . 'px; "' ;
739
- echo stripslashes('<div class="ezAdsense adsense adsense-search"><div ' .
740
- $inline . '>' . "$linebreak" .
741
- $this->options['text_gsearch'] . "$linebreak" .
742
- '</div></div>') ;
743
- echo $after_widget ;
744
  }
 
745
  }
746
 
747
- function widget_ezAd_control() {
748
- echo '<p>Configure it at <br />' ;
749
- echo '<a href="options-general.php?page=easy-adsense-lite.php"> ';
750
- echo 'Settings &rarr; Easy AdSense</a>' ;
751
- echo '</p>' ;
752
- }
753
-
754
- function widget_ezAd_lu_control($widget_args = 1) {
755
- echo '<p>Configure it at <br />' ;
756
- echo '<a href="options-general.php?page=easy-adsense-lite.php"> ';
757
- echo 'Settings &rarr; Easy AdSense</a>' ;
758
- echo '</p>' ;
759
- }
760
  }
761
- } //End Class ezAdSense
 
762
 
763
  if (class_exists("EzAdSense")) {
764
  $ezAdSense = new EzAdSense();
765
  if (isset($ezAdSense) && !empty($ezAdSense->defaults)) {
766
  if (!function_exists("ezAdSense_ap")) {
 
767
  function ezAdSense_ap() {
768
- global $ezAdSense ;
769
  if (function_exists('add_options_page')) {
770
- add_options_page('Easy AdSense', 'Easy AdSense', 'activate_plugins',
771
- basename(__FILE__), array($ezAdSense, 'printAdminPage'));
772
  }
773
  }
 
774
  }
775
 
776
  // sidebar AdSense Widget (skyscraper)
777
- class ezAdsWidget extends WP_Widget {
778
- function ezAdsWidget() {
779
- $widget_ops =
780
- array('classname' => 'ezAdsWidget',
781
  'description' =>
782
- __('Show a Google AdSense block in your sidebar as a widget',
783
- 'easy-adsenser') );
784
- $this->WP_Widget('ezAdsWidget', 'Easy AdSense: Google Ads',
785
- $widget_ops);
786
  }
 
787
  function widget($args, $instance) {
788
  // outputs the content of the widget
789
- global $ezAdSense ;
790
- $ezAdSense->widget_ezAd_ads($args) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
791
  }
792
 
793
  function update($new_instance, $old_instance) {
794
  // processes widget options to be saved
795
- return $new_instance ;
796
  }
797
 
798
  function form($instance) {
799
  // outputs the options form on admin
800
- global $ezAdSense ;
801
- $ezAdSense->widget_ezAd_control() ;
 
 
802
  }
 
803
  }
804
- add_action('widgets_init',
805
- create_function('', 'return register_widget("ezAdsWidget");'));
806
 
807
  // sidebar Search Widget
808
- class ezAdsSearch extends WP_Widget {
809
- function ezAdsSearch() {
810
- $widget_ops =
811
- array('classname' => 'ezAdsSearch',
812
  'description' =>
813
- __('Show a Google Search Box in your sidebar as a widget',
814
- 'easy-adsenser') );
815
- $this->WP_Widget('ezAdsSearch', 'Easy AdSense: Google Search',
816
- $widget_ops);
817
  }
 
818
  function widget($args, $instance) {
819
  // outputs the content of the widget
820
- global $ezAdSense ;
821
- $ezAdSense->widget_ezAd_search($args) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
822
  }
823
 
824
  function update($new_instance, $old_instance) {
825
  // processes widget options to be saved
826
- return $new_instance ;
827
  }
828
 
829
  function form($instance) {
830
  // outputs the options form on admin
831
- global $ezAdSense ;
832
- $ezAdSense->widget_ezAd_control() ;
 
 
833
  }
 
834
  }
835
- add_action('widgets_init',
836
- create_function('', 'return register_widget("ezAdsSearch");'));
837
 
838
  // sidebar Link Units
839
- class ezAdsLU extends WP_Widget {
840
- function ezAdsLU() {
841
- $widget_ops =
842
- array('classname' => 'ezAdsLU',
843
  'description' =>
844
- __('Show a Google Links Unit in your sidebar as a widget',
845
- 'easy-adsenser') );
846
- $this->WP_Widget('ezAdsLU', 'Easy AdSense: Google Link Unit',
847
- $widget_ops);
848
  }
 
849
  function widget($args, $instance) {
850
  // outputs the content of the widget
851
- global $ezAdSense ;
852
- $ezAdSense->widget_ezAd_lu($args) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  }
854
 
855
  function update($new_instance, $old_instance) {
856
  // processes widget options to be saved
857
- return $new_instance ;
858
  }
859
 
860
  function form($instance) {
861
  // outputs the options form on admin
862
- global $ezAdSense ;
863
- $ezAdSense->widget_ezAd_control() ;
 
 
864
  }
 
865
  }
866
- add_action('widgets_init',
867
- create_function('', 'return register_widget("ezAdsLU");'));
868
 
869
- add_filter('the_content', array($ezAdSense, 'ezAdSense_content'));
870
- $ezAdSense->luMax = $ezAdSense->options['limit_lu'] ;
871
  add_action('admin_menu', 'ezAdSense_ap');
872
- add_action('init', array($ezAdSense, 'session_start')) ;
873
  add_filter('plugin_action_links', array($ezAdSense, 'plugin_action'), -10, 2);
874
- if ($ezAdSense->options['max_link'] == -1)
875
- add_action('wp_footer', array($ezAdSense, 'footer_action'));
876
- else
 
877
  remove_action('wp_footer', array($ezAdSense, 'footer_action'));
 
878
 
879
- if ($ezAdSense->options['header_leadin'])
880
  add_action($ezAdSense->options['header_leadin'], array($ezAdSense, 'header_leadin'));
 
881
 
882
- if ($ezAdSense->options['footer_leadout'])
883
  add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
 
884
  }
885
  }
 
1
  <?php
2
+
3
  /*
4
  Plugin Name: Easy AdSense
5
  Plugin URI: http://www.thulasidas.com/adsense
6
  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 &rarr; Easy AdSense</a>.
7
+ Version: 7.00
8
  Author: Manoj Thulasidas
9
  Author URI: http://www.thulasidas.com
10
+ */
11
 
12
  /*
13
+ Copyright (C) 2008 www.ads-ez.com
14
 
15
+ This program is free software; you can redistribute it and/or
16
+ modify it under the terms of the GNU General Public License as
17
+ published by the Free Software Foundation; either version 3 of the
18
+ License, or (at your option) any later version.
19
 
20
+ This program is distributed in the hope that it will be useful, but
21
+ WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
+ General Public License for more details.
24
 
25
  You should have received a copy of the GNU General Public License
26
  along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ if (class_exists("EzAdSensePro")) {
30
+ $msg = sprintf(__("<strong><em>%s Pro</em></strong> seems to be active.<br />Please use the Pro version, or deactivate it before activating <strong><em>%s</em></strong>.", "easy-adsenser"), "Easy AdSense", "Easy AdSense");
31
+ die($msg);
32
+ }
33
 
34
  if (!class_exists("EzAdSense")) {
35
+
36
+ require_once('EzOptions.php');
37
+
38
+ class EzAdSense extends EzBasePlugin {
39
+
40
+ var $invite, $locale, $defaults, $helpTags,
41
+ $leadin, $leadout, $options, $optionName, $metaOptions;
42
+ var $ezMax, $urMax, $urCount, $ezCount;
43
+ var $adminMsg;
44
+ var $kills = array('page', 'sticky', 'home', 'front_page', 'category',
45
+ 'tag', 'archive', 'search', 'single', 'attachment');
46
+ var $ezOptions = array();
47
 
48
  function EzAdSense() {
49
+ parent::__construct("easy-adsense", "Easy AdSense", __FILE__);
50
+ $this->adminMsg = '';
51
+ $this->defaults = array('defaultText' => 'Please generate and paste your ad code here. If left empty, the ad location will be highlighted on your blog pages with a reminder to enter your code.');
52
+ $defaultOptions = $this->mkDefaultOptions();
53
+ $this->optionName = "ezAdSense" . get_option('stylesheet');
54
+ $this->options = get_option($this->optionName);
 
 
 
 
55
  if (empty($this->options)) {
56
+ $this->options = $defaultOptions;
57
+ }
58
+ else {
59
+ $this->options = array_merge($defaultOptions, $this->options);
60
  }
 
 
 
61
  // Counts and limis
62
+ $this->ezMax = 99;
63
+ $this->urMax = 99;
64
+ $this->urCount = 0;
65
+ $this->ezCount = 0;
66
+ $this->metaOptions = array();
67
+ }
68
+
69
+ function session_start() {
70
+ if (!session_id()) {
71
+ @session_start();
72
+ }
73
+ }
74
+
75
+ static function showUnreal($print = false) {
76
+ $unreal = "<div style='text-align:center;margin-left:auto;margin-right:auto;font-size:0.6em'><a href='http://www.thulasidas.com/adsense/' target='_blank' title='The simplest way to put AdSense to work for you!'> Easy AdSense</a> by <a href='http://www.Thulasidas.com/' target='_blank' title='Unreal Blog proudly brings you Easy AdSense'>Unreal</a></div>";
77
+ if ($print) {
78
+ echo $unreal;
79
+ }
80
+ else {
81
+ return $unreal;
82
+ }
83
+ }
84
+
85
+ function mkHelpTags() {
86
+ $this->helpTags = array();
87
+ $o = new EzHelpTag('help0');
88
+ $o->title = __('Click for help', 'easy-adsenser');
89
+ $o->tipTitle = __('How to Set it up', 'easy-adsenser');
90
+ $o->desc = sprintf(__('A few easy steps to setup %s', 'easy-adsenser'), "<em>Easy AdSense</em>");
91
+ $this->helpTags[] = $o;
92
+
93
+ $o = new EzHelpTag('help1');
94
+ $o->title = __('Click for help', 'easy-adsenser');
95
+ $o->tipTitle = __('How to Control AdSense on Each Post', 'easy-adsenser');
96
+ $o->desc = __('Need to control ad blocks on each post?', 'easy-adsenser');
97
+ $this->helpTags[] = $o;
98
+
99
+ $o = new EzHelpTag('help2');
100
+ $o->title = __('Click for help', 'easy-adsenser');
101
+ $o->tipTitle = __('All-in-One AdSense Control', 'easy-adsenser');
102
+ $o->desc = __('Sidebar Widgets, Link Units or Google Search', 'easy-adsenser');
103
+ $this->helpTags[] = $o;
104
+
105
+ $o = new EzHelpPopUp('http://wordpress.org/extend/plugins/easy-adsense-lite/');
106
+ $o->title = __('Click for help', 'easy-adsenser');
107
+ $o->desc = __('Check out the FAQ and rate this plugin.', 'easy-adsenser');
108
+ $this->helpTags[] = $o;
109
+ }
110
+
111
+ function mkEzOptions() {
112
+ if (!empty($this->ezOptions)) {
113
+ return;
114
+ }
115
+
116
+ $this->ezOptions['info'] = new EzBaseOption('', 'info');
117
+ $this->ezOptions['policy'] = new EzBaseOption('', 'policy');
118
+ $this->ezOptions['kill_invites'] = new EzBaseOption('', 'kill_invites');
119
+ $this->ezOptions['kill_rating'] = new EzBaseOption('', 'kill_rating');
120
+
121
+ $o = new EzTextArea('text_leadin');
122
+ $o->before = "<b>" . __('Lead-in AdSense Text', 'easy-adsenser') .
123
+ "</b>&nbsp;";
124
+ $o->desc = __('(Appears near the beginning of the post)', 'easy-adsenser')
125
+ . '<br />';
126
+ $o->style = "width: 95%; height: 130px;";
127
+ $o->width = "50";
128
+ $o->height = "15";
129
+ $o->after = "<br />";
130
+ $this->ezOptions['text_leadin'] = clone $o;
131
+ $o->name = 'text_midtext';
132
+ $o->before = "<b>" . __('Mid-Post AdSense Text', 'easy-adsenser') .
133
+ "</b>&nbsp;";
134
+ $o->desc = __('(Appears near the middle of the post)', 'easy-adsenser')
135
+ . '<br />';
136
+ $this->ezOptions['text_midtext'] = clone $o;
137
+ $o->name = 'text_leadout';
138
+ $o->before = "<b>" . __('Post Lead-out AdSense Text', 'easy-adsenser') .
139
+ "</b>&nbsp;";
140
+ $o->desc = __('(Appears near the end of the post)', 'easy-adsenser')
141
+ . '<br />';
142
+ $this->ezOptions['text_leadout'] = clone $o;
143
+ $o->name = 'text_widget';
144
+ $o->before = "<b>" . __('AdSense Widget Text', 'easy-adsenser') .
145
+ "</b>&nbsp;";
146
+ $o->desc = __('(Appears in the Sidebar as a Widget)', 'easy-adsenser')
147
+ . '<br />';
148
+ $o->style = "width: 95%; height: 110px;";
149
+ $this->ezOptions['text_widget'] = clone $o;
150
+ $o->name = 'text_lu';
151
+ $o->before = "<b>" . __('AdSense Link-Units Text', 'easy-adsenser') .
152
+ "</b>&nbsp;";
153
+ $o->desc = __('(Appears in the Sidebar as a Widget)', 'easy-adsenser')
154
+ . '<br />';
155
+ $this->ezOptions['text_lu'] = clone $o;
156
+ $o->name = 'text_gsearch';
157
+ $o->before = "<b>" . __('Google Search Widget', 'easy-adsenser') .
158
+ "</b>&nbsp;";
159
+ $o->desc = __('(Adds a Google Search Box to your sidebar)', 'easy-adsenser')
160
+ . '<br />';
161
+ $this->ezOptions['text_gsearch'] = clone $o;
162
+
163
+ $o = new EzText('wc_leadin');
164
+ $o->title = __('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');
165
+ $o->desc = __('Min. Word Count', 'easy-adsenser') . ':';
166
+ $o->style = "width:40px;text-align:center;";
167
+ $this->ezOptions['wc_leadin'] = clone $o;
168
+ $o->name = 'wc_midtext';
169
+ $this->ezOptions['wc_midtext'] = clone $o;
170
+ $o->name = 'wc_leadout';
171
+ $this->ezOptions['wc_leadout'] = clone $o;
172
+
173
+ $o = new EzText('margin_leadin');
174
+ $o->title = __('Use the margin setting to trim margins. Decreasing the margin moves the ad block left and up. Margin can be negative.', 'easy-adsenser');
175
+ $o->desc = __('Margin:', 'easy-adsenser');
176
+ $o->style = "width:30px;text-align:center;";
177
+ $o->after = ' px<br />';
178
+ $this->ezOptions['margin_leadin'] = clone $o;
179
+ $o->name = 'margin_midtext';
180
+ $this->ezOptions['margin_midtext'] = clone $o;
181
+ $o->name = 'margin_leadout';
182
+ $this->ezOptions['margin_leadout'] = clone $o;
183
+ $o->name = 'margin_widget';
184
+ $this->ezOptions['margin_widget'] = clone $o;
185
+ $o->name = 'margin_lu';
186
+ $this->ezOptions['margin_lu'] = clone $o;
187
+ $o->name = 'margin_gsearch';
188
+ $this->ezOptions['margin_gsearch'] = clone $o;
189
+
190
+ $o = new EzCheckBox('force_midad');
191
+ $o->title = __('Force mid-text ad (if enabled) even in short posts.', 'easy-adsenser');
192
+ $o->desc = __('Force Mid-post Ad', 'easy-adsenser');
193
+ $o->labelWidth = "43%";
194
+ $this->ezOptions['force_midad'] = clone $o;
195
+
196
+ $o = new EzSelect('header_leadin');
197
+ $o->title = __('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') . __('<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.' . 'easy-adsenser');
198
+ $o->desc = __('Position:', 'easy-adsenser');
199
+ $o->style = "width:30%;";
200
+ $o->addChoice('send_headers', 'send_headers', __('Above Header', 'easy-adsenser'));
201
+ $o->addChoice('the_content', 'the_content', __('Below Header', 'easy-adsenser'));
202
+ $o->addChoice('default', '', __('Beginning of Post', 'easy-adsenser'));
203
+ $this->ezOptions['header_leadin'] = clone $o;
204
+
205
+ $o = new EzSelect('show_leadin');
206
+ $o->title = __('Decide whether to show this AdSense block, and specify how to align it.', 'easy-adsenser');
207
+ $o->desc = __('Show:', 'easy-adsenser');
208
+ $o->style = "width:38%;";
209
+ $o->addChoice('no', 'no', __('Suppress Lead-in Ad', 'easy-adsenser'));
210
+ $o->addChoice('float:left', 'float:left', __('Align Left', 'easy-adsenser') . ', ' .
211
+ __('Text-wrapped', 'easy-adsenser'));
212
+ $o->addChoice('text-align:left', 'text-align:left', __('Align Left', 'easy-adsenser') . ', ' .
213
+ __('No wrap', 'easy-adsenser'));
214
+ $o->addChoice('text-align:center', 'text-align:center', __('Center', 'easy-adsenser'));
215
+ $o->addChoice('float:right', 'float:right', __('Align Right', 'easy-adsenser') . ', ' .
216
+ __('Text-wrapped', 'easy-adsenser'));
217
+ $o->addChoice('text-align:right', 'text-align:right', __('Align Right', 'easy-adsenser') . ', ' .
218
+ __('No wrap', 'easy-adsenser'));
219
+ $this->ezOptions['show_leadin'] = clone $o;
220
+
221
+ $o->name = 'show_midtext';
222
+ $o->addChoice('no', 'no', __('Suppress Mid-post Ad', 'easy-adsenser'));
223
+ $choice = array_pop($o->choices);
224
+ array_shift($o->choices);
225
+ array_unshift($o->choices, $choice);
226
+ $this->ezOptions['show_midtext'] = clone $o;
227
+
228
+ $o->name = 'show_leadout';
229
+ $o->addChoice('no', 'no', __('Suppress Lead-out Ad', 'easy-adsenser'));
230
+ $choice = array_pop($o->choices);
231
+ array_shift($o->choices);
232
+ array_unshift($o->choices, $choice);
233
+ $this->ezOptions['show_leadout'] = clone $o;
234
+
235
+ $o = new EzSelect('footer_leadout');
236
+ $o->title = __('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') . __('<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.' . 'easy-adsenser');
237
+ $o->desc = __('Position:', 'easy-adsenser');
238
+ $o->style = "width:30%;";
239
+ $o->addChoice('default', '', __('End of Post', 'easy-adsenser'));
240
+ $o->addChoice('loop_end', 'loop_end', __('End of Page', 'easy-adsenser'));
241
+ $o->addChoice('get_footer', 'get_footer', __('Above Footer', 'easy-adsenser'));
242
+ $o->addChoice('wp_footer', 'wp_footer', __('Below Footer', 'easy-adsenser'));
243
+ $this->ezOptions['footer_leadout'] = clone $o;
244
+
245
+ $o = new EzRadioBox('max_count');
246
+ $o->desc = "<b>" . __('Option on Google Policy', 'easy-adsenser') . "</b>";
247
+ $o->title = __('Google policy allows no more than three ad blocks and three link units per page', 'easy-adsenser');
248
+ $o->addChoice('3', '3', __('Three ad blocks (including the side bar widget, if enabled).', 'easy-adsenser'))->after = "<br />";
249
+ $o->addChoice('2', '2', __('Two ad blocks.', 'easy-adsenser'));
250
+ $o->addChoice('1', '1', __('One ad block.', 'easy-adsenser'));
251
+ $o->addChoice('0', '0', __('No ad blocks in posts.', 'easy-adsenser'))->after = "<br />";
252
+ $o->addChoice('99', '99', __('Any number of ad blocks (At your own risk!)', 'easy-adsenser'));
253
+ $o->after = "<br />";
254
+ $this->ezOptions['max_count'] = clone $o;
255
+
256
+ $o = new EzCheckBox('kill_page');
257
+ $o->title = __('Do not show ads on pages. Ad will appear on posts. Please see the differece at http://support.wordpress.com/post-vs-page/', 'easy-adsenser');
258
+ $o->desc = __('Pages (Ads only on Posts)', 'easy-adsenser');
259
+ $o->before = "&nbsp;";
260
+ $o->after = "<br />";
261
+ $this->ezOptions['kill_page'] = clone $o;
262
+
263
+ $o = new EzCheckBox('kill_sticky');
264
+ $o->title = __('Suppress ads on sticky front page. Sticky front page is a post used as the front page of the blog.', 'easy-adsenser');
265
+ $o->desc = __('Sticky Front Page', 'easy-adsenser');
266
+ $o->labelWidth = "35%";
267
+ $this->ezOptions['kill_sticky'] = clone $o;
268
+
269
+ $o = new EzCheckBox('kill_home');
270
+ $o->title = __('Home Page and Front Page are the same for most blogs', 'easy-adsenser');
271
+ $o->desc = __('Home Page', 'easy-adsenser');
272
+ $o->labelWidth = "25%";
273
+ $this->ezOptions['kill_home'] = clone $o;
274
+
275
+ $o = new EzCheckBox('kill_front_page');
276
+ $o->title = __('Home Page and Front Page are the same for most blogs', 'easy-adsenser');
277
+ $o->desc = __('Front Page', 'easy-adsenser');
278
+ $o->labelWidth = "30%";
279
+ $o->after = "<br />";
280
+ $this->ezOptions['kill_front_page'] = clone $o;
281
+
282
+ $o = new EzCheckBox('kill_category');
283
+ $o->title = __('Pages that come up when you click on category names', 'easy-adsenser');
284
+ $o->desc = __('Category Pages', 'easy-adsenser');
285
+ $o->labelWidth = "35%";
286
+ $this->ezOptions['kill_category'] = clone $o;
287
+
288
+ $o = new EzCheckBox('kill_tag');
289
+ $o->title = __('Pages that come up when you click on tag names', 'easy-adsenser');
290
+ $o->desc = __('Tag Pages', 'easy-adsenser');
291
+ $o->labelWidth = "25%";
292
+ $this->ezOptions['kill_tag'] = clone $o;
293
+
294
+ $o = new EzCheckBox('kill_archive');
295
+ $o->title = __('Pages that come up when you click on year/month archives', 'easy-adsenser');
296
+ $o->desc = __('Archive Pages', 'easy-adsenser');
297
+ $o->labelWidth = "30%";
298
+ $o->after = "<br />";
299
+ $this->ezOptions['kill_archive'] = clone $o;
300
+
301
+ $o = new EzCheckBox('kill_search');
302
+ $o->title = __('Pages showing search results', 'easy-adsenser');
303
+ $o->desc = __('Search Results', 'easy-adsenser');
304
+ $o->labelWidth = "35%";
305
+ $this->ezOptions['kill_search'] = clone $o;
306
+
307
+ $o = new EzCheckBox('kill_single');
308
+ $o->title = __('Posts (ads will be shown only on other kind of pages as specified in these checkboxes)', 'easy-adsenser');
309
+ $o->desc = __('Single Posts', 'easy-adsenser');
310
+ $o->labelWidth = "25%";
311
+ $this->ezOptions['kill_single'] = clone $o;
312
+
313
+ $o = new EzCheckBox('kill_attachment');
314
+ $o->title = __('Pages that show attachments', 'easy-adsenser');
315
+ $o->desc = __('Attachment Page', 'easy-adsenser');
316
+ $o->labelWidth = "30%";
317
+ $o->after = "<br />";
318
+ $this->ezOptions['kill_attachment'] = clone $o;
319
+
320
+ $o = new EzCheckBox('force_widget');
321
+ $o->title = __('If the sidebar widget is enabled, it will be displayed in preference to the ad blocks in the text. If this option is not checked, it may happen that the number of ad blocks you selected above may get used up by the ones in the post body.', 'easy-adsenser');
322
+ $o->desc = __('Prioritize sidebar widget. (Always shows the widget, if enabled.)', 'easy-adsenser');
323
+ $o->after = "<br />";
324
+ $this->ezOptions['force_widget'] = clone $o;
325
+
326
+ $o = new EzCheckBox('show_borders');
327
+ $o->title = __('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');
328
+ $o->desc = __('Show a border around the ads?', 'easy-adsenser');
329
+ $o->after = "&nbsp;";
330
+ $this->ezOptions['show_borders'] = clone $o;
331
+
332
+ $o = new EzCheckBox('border_widget');
333
+ $o->title = __('Show the same border on the sidebar widget as well?', 'easy-adsenser');
334
+ $o->desc = __('Widget?', 'easy-adsenser');
335
+ $o->before = "&nbsp;";
336
+ $o->after = "&nbsp;";
337
+ $this->ezOptions['border_widget'] = clone $o;
338
+
339
+ $o = new EzCheckBox('border_lu');
340
+ $o->title = __('Show the same border on the link units too?', 'easy-adsenser');
341
+ $o->desc = __('Link Units?', 'easy-adsenser');
342
+ $o->before = "&nbsp;";
343
+ $o->after = "<br />";
344
+ $this->ezOptions['border_lu'] = clone $o;
345
+
346
+ $o = new EzText('border_width');
347
+ $o->title = __('Specify the border width.', 'easy-adsenser');
348
+ $o->desc = __('Width', 'easy-adsenser') . ':&nbsp;';
349
+ $o->style = "width:25px;text-align:center;";
350
+ $this->ezOptions['border_width'] = clone $o;
351
+
352
+ $o = new EzText('border_normal');
353
+ $o->title = __('Specify the border colors.', 'easy-adsenser');
354
+ $o->desc = __('Colors:&nbsp; Normal', 'easy-adsenser') . ':#';
355
+ $o->style = "width:65px;text-align:center;";
356
+ $o->after = "&nbsp;";
357
+ $this->ezOptions['border_normal'] = clone $o;
358
+
359
+ $o = new EzText('border_color');
360
+ $o->title = __('Specify the border colors.', 'easy-adsenser');
361
+ $o->desc = __('Hover', 'easy-adsenser') . ':#';
362
+ $o->style = "width:65px;text-align:center;";
363
+ $o->after = "<br />";
364
+ $this->ezOptions['border_color'] = clone $o;
365
+
366
+ $o = new EzCheckBox('kill_inline');
367
+ $o->title = __('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');
368
+ $o->desc = __('Suppress in-line styles (Control ad-blocks using style.css)', 'easy-adsenser');
369
+ $o->after = "<br />";
370
+ $o->tipWidth = 350;
371
+ $this->ezOptions['kill_inline'] = clone $o;
372
+
373
+ $o = new EzCheckBox('kill_linebreaks');
374
+ $o->title = __('If you find that you have extra vertical spaces or if your ad code is messed up with <code><</code><code>p></code> or <code><</code><code>br /></code> tags, try checking this option.<br />Under normal cirumstances, this option should be left unchecked.', 'easy-adsenser');
375
+ $o->desc = __('Prevent spurious line breaks', 'easy-adsenser');
376
+ $o->after = "<br />";
377
+ $this->ezOptions['kill_linebreaks'] = clone $o;
378
+
379
+ $o = new EzRadioBox('show_widget');
380
+ $o->title = __('Decide where (or whether) to show this widget and how to align it.', 'easy-adsenser');
381
+ $o->addChoice('text-align:left', 'text-align:left', __('Align Left', 'easy-adsenser'));
382
+ $o->addChoice('text-align:center', 'text-align:center', __('Center', 'easy-adsenser'));
383
+ $o->addChoice('text-align:right', 'text-align:right', __('Align Right', 'easy-adsenser'));
384
+ $o->addChoice('no', 'no', __('Suppress Widget', 'easy-adsenser'));
385
+ $o->after = "<br />";
386
+ $this->ezOptions['show_widget'] = clone $o;
387
+
388
+ $o = new EzRadioBox('show_lu');
389
+ $o->title = __('Decide where (or whether) to show this widget and how to align it.', 'easy-adsenser');
390
+ $o->addChoice('text-align:left', 'text-align:left', __('Align Left', 'easy-adsenser'));
391
+ $o->addChoice('text-align:center', 'text-align:center', __('Center', 'easy-adsenser'));
392
+ $o->addChoice('text-align:right', 'text-align:right', __('Align Right', 'easy-adsenser'));
393
+ $o->addChoice('no', 'no', __('Suppress Widget', 'easy-adsenser'));
394
+ $o->after = "<br />";
395
+ $this->ezOptions['show_lu'] = clone $o;
396
+
397
+ $o = new EzText('title_widget');
398
+ $o->title = __('Give a title to your widget -- something like Sponsored Links or Advertisements would be good. You can also suppress the title by checking the box to the right.', 'easy-adsenser');
399
+ $o->desc = __('Widget Title:', 'easy-adsenser') . "&nbsp;";
400
+ $o->style = "width:220px";
401
+ $o->after = "&nbsp;";
402
+ $this->ezOptions['title_widget'] = clone $o;
403
+ $o->name = 'title_lu';
404
+ $this->ezOptions['title_lu'] = clone $o;
405
+
406
+ $o = new EzCheckBox('kill_widget_title');
407
+ $o->title = __('Check this box to suppress the title for this widget.', 'easy-adsenser');
408
+ $o->desc = __('Hide Title', 'easy-adsenser');
409
+ $o->after = "<br />";
410
+ $this->ezOptions['kill_widget_title'] = clone $o;
411
+ $o->name = 'kill_lu_title';
412
+ $this->ezOptions['kill_lu_title'] = clone $o;
413
+ $o->name = 'kill_gsearch_title';
414
+ $this->ezOptions['kill_gsearch_title'] = clone $o;
415
+
416
+ $o = new EzRadioBox('title_gsearch');
417
+ $o->title = __('Choose a title for your Google Search Widget. Depending on your theme background, you can choose a dark or light image, or a custom text title. You can also suppress the widget altogether.', 'easy-adsenser');
418
+ $o->addChoice('dark', 'dark', "<img src='{$this->plgURL}/google-dark.gif' alt='Google (dark)' style='background:black;vertical-align:-40%;' />")->after = "&nbsp;";
419
+ $o->addChoice('light', 'light', "<img src='{$this->plgURL}/google-light.gif' alt='Google (light)' style='background:white;vertical-align:-40%;' />")->after = "&nbsp;";
420
+ $o->addChoice('no', 'no', __('Suppress Search Box', 'easy-adsenser'))->after = "<br />";
421
+ $o->addChoice('customized', 'customized', __('Custom Title:', 'easy-adsenser'));
422
+ $this->ezOptions['title_gsearch'] = clone $o;
423
+
424
+ $o = new EzText('title_gsearch_custom');
425
+ $o->title = __('Enter a custom title for your Google Search Widget. Remember to include styling tags (such as <code>&lt;h3&gt;</code> etc.) as needed.', 'easy-adsenser');
426
+ $this->ezOptions['title_gsearch_custom'] = clone $o;
427
+
428
+ $o = new EzRadioBox('max_link');
429
+ $o->before = "<b>" . __('Link-backs to', 'easy-adsenser') . " <a href='http://www.Thulasidas.com' target='_blank'>Unreal Blog</a></b>";
430
+ $o->desc = __('(Consider showing at least one link.)', 'easy-adsenser') . "<br />";
431
+ $o->title = __('If you would like to show a discreet link to the developer site, customize it here.', 'easy-adsenser');
432
+ $o->addChoice('99', '99', __('Show a link under every ad block.', 'easy-adsenser'))->after = "<br />";
433
+ $o->addChoice('1', '1', __('Show the link only under the first ad block.', 'easy-adsenser'))->after = "<br />";
434
+ $o->addChoice('-1', '-1', __('Show the link at the bottom of your blog page.', 'easy-adsenser'))->after = "<br />";
435
+ $o->addChoice('0', '0', __('Suppress links', 'easy-adsenser'))->after = "<br />";
436
+ $this->ezOptions['max_link'] = clone $o;
437
+
438
+ $o = new EzCheckBox('kill_author');
439
+ $o->title = __('If you find the author links and ads on the plugin admin page distracting or annoying, you can suppress them by checking this box. Please remember to save your options after checking.', 'easy-adsenser');
440
+ $o->desc = __('Kill author links on the admin page?', 'easy-adsenser');
441
+ $o->before = "<br />";
442
+ $o->after = "<br />";
443
+ $this->ezOptions['kill_author'] = clone $o;
444
+
445
+ $o = new EzCheckBox('suppressBoxes');
446
+ $o->title = __('Easy AdSense displays a box with red borders to indicate where an ad would have been placed, but has been suppressed by one of the filters above. If you would like to suppress the boxes, check this option.', 'easy-adsenser');
447
+ $o->desc = __('Suppress Placement Boxes?', 'easy-adsenser');
448
+ $o->between = "&nbsp;";
449
+ $o->after = "<br /><br />";
450
+ $this->ezOptions['suppressBoxes'] = clone $o;
451
  }
452
 
453
+ function setOptionValues() {
454
+ $error = EzBaseOption::setValues($this->options, $this->ezOptions);
455
+ if (WP_DEBUG && !empty($error)) {
456
+ echo "<div class='error'>$error</div>";
457
+ }
458
  }
459
 
460
  function handleSubmits() {
461
  if (empty($_POST)) {
462
+ return;
463
+ }
464
+ if (!check_admin_referer('EzAdsenseSubmit', 'EzAdsenseNonce')) {
465
+ return;
466
+ }
467
+ if (isset($_POST['saveChanges'])) {
468
+ $this->mkEzOptions();
469
+ $this->setOptionValues();
470
+
471
+ foreach ($this->ezOptions as $k => $o) {
472
+ if (isset($this->options[$k])) {
473
+ $this->options[$k] = $o->get();
474
+ }
475
+ else {
476
+ if (WP_DEBUG) {
477
+ echo "<div class='error'>Warning: <code>option[$k]</code> is not defined, but <code>ezOption[$k]</code> exists!</div>";
478
+ }
479
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
  }
481
+
482
  update_option($this->optionName, $this->options);
483
+
484
+ $this->adminMsg = "<div class='updated'><p><strong>" .
485
+ __('Settings Updated.', 'easy-adsenser') .
486
+ "</strong></p> </div>";
487
  }
488
+ else if (isset($_POST['resetOptions'])) {
489
  $this->resetOptions();
490
+ $this->adminMsg = "<div class='updated'><p><strong>" .
491
+ __('Ok, all your settings have been discarded!', 'easy-adsenser') .
492
+ "</strong></p> </div>";
493
+ }
494
+ else if (isset($_POST['cleanDB']) || isset($_POST['uninstall'])) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  $this->resetOptions();
496
  $this->cleanDB('ezAdSense');
497
+ $this->adminMsg = "<div class='updated'><p><strong>" .
498
+ __('Database has been cleaned. All your options for this plugin (for all themes) have been removed.', 'easy-adsenser') .
499
+ "</strong></p> </div>";
500
 
501
+ if (isset($_POST['uninstall'])) {
502
  remove_action('admin_menu', 'ezAdSense_ap');
503
+ $this->adminMsg = "<div class='updated'><p><strong>" .
504
+ __('This plugin can be deactivated now. ', 'easy-adsenser') .
505
+ "<a href='plugins.php'>" .
506
+ __('Go to Plugins', 'easy-adsenser') .
507
+ "</a>.</strong></p></div>";
 
508
  }
509
  }
510
  }
511
 
512
+ function migrateOptions() { // temporary
513
+ if (isset($this->options['kill_pages']) || isset($this->options['kill_attach']) || isset($this->options['kill_front'])) {
514
+ echo "<div style='color:red;border:2px solid red;padding:5px;font-weight:bold;text-align:center'>Your options need to be updated. Please migrate them."
515
+ . "&nbsp;<input style='color:red' type='submit' name='migrate' value='Migrate Options' />"
516
+ . "</div>";
517
+ }
518
+ if (!empty($_POST['migrate'])) {
519
+ unset($this->options['limit_lu']);
520
+ unset($this->options['allow_exitjunction']);
521
+
522
+ $this->options['kill_page'] = $this->options['kill_pages'];
523
+ unset($this->options['kill_pages']);
524
+ $this->options['kill_attachment'] = $this->options['kill_attach'];
525
+ unset($this->options['kill_attach']);
526
+ $this->options['kill_front_page'] = $this->options['kill_front'];
527
+ unset($this->options['kill_front']);
528
+ $this->options['kill_category'] = $this->options['kill_cat'];
529
+ unset($this->options['kill_cat']);
530
+ update_option($this->optionName, $this->options);
531
 
532
+ echo "<div class='updated'>Your options have been migrated.</div>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
  }
534
  }
535
 
536
+ function mkDefaultOptions() { // TODO: Merge this with mkEzOptions
537
+ $defaultOptions = array('info' => $this->info(),
538
+ 'kill_invites' => false,
539
+ 'kill_rating' => false,
540
+ 'kill_author' => false,
541
+ 'policy' => 'unknown',
542
  'show_leadin' => 'float:right',
543
  'wc_leadin' => 0,
544
  'margin_leadin' => 12,
560
  'margin_lu' => 12,
561
  'text_lu' => $this->defaults['defaultText'],
562
  'title_gsearch' => '',
563
+ 'title_gsearch_custom' => '',
564
  'kill_gsearch_title' => '',
565
  'margin_gsearch' => 0,
566
  'text_gsearch' => $this->defaults['defaultText'],
568
  'max_link' => 0,
569
  'force_midad' => false,
570
  'force_widget' => false,
571
+ 'kill_page' => false,
 
572
  'show_borders' => false,
573
  'border_width' => 1,
574
  'border_normal' => '00FFFF',
575
  'border_color' => 'FF0000',
576
  'border_widget' => false,
577
  'border_lu' => false,
 
578
  'title_lu' => '',
579
  'kill_lu_title' => false,
580
+ 'kill_attachment' => false,
 
 
581
  'kill_home' => false,
582
+ 'kill_front_page' => false,
583
+ 'kill_category' => false,
584
  'kill_tag' => false,
585
  'kill_archive' => false,
586
  'kill_inline' => false,
589
  'kill_single' => false,
590
  'kill_search' => true,
591
  'kill_sticky' => false,
592
+ 'title_widget' => '',
593
+ 'suppressBoxes' => false);
594
+ return $defaultOptions;
595
  }
596
 
597
  // Reset all options to defaults
598
  function resetOptions() {
599
+ $defaultOptions = $this->mkDefaultOptions();
600
  update_option($this->optionName, $defaultOptions);
601
+ $this->options = $defaultOptions;
602
+ unset($_POST);
603
  }
604
 
605
  function handleDefaultText($text, $key = '300x250') {
606
+ $ret = $text;
607
  if ($ret == $this->defaults['defaultText'] || strlen(trim($ret)) == 0) {
608
  if ($this->options['suppressBoxes']) {
609
  $ret = '';
610
  }
611
  else {
612
+ $x = strpos($key, 'x');
613
  $w = substr($key, 0, $x);
614
+ $h = substr($key, $x + 1);
615
+ $p = (int) (min($w, $h) / 6);
616
+ $ret = '<div style="width:' . $w . 'px;height:' . $h . 'px;border:1px solid red;"><div style="padding:' . $p . 'px;text-align:center;font-family:arial;font-size:8pt;"><p>Your ads will be inserted here by</p><p><b>Easy AdSense</b>.</p><p>Please go to the plugin admin page to<br /><u title="Generate your ad code from your provider and paste it in the text box for this ad slot">Paste your ad code</u> OR<br /> <u title="Use the dropdown under the text box for this ad slot to suppress it">Suppress this ad slot</u>.</p></div></div>';
617
  }
618
  }
619
+ return $ret;
620
  }
621
 
622
  function handleDefaults() {
623
+ $texts = array('text_leadin', 'text_midtext', 'text_leadout');
624
  foreach ($texts as $t) {
625
+ $text = $this->options[$t];
626
+ $this->options[$t] = $this->handleDefaultText($text);
627
  }
628
  }
629
 
630
  // Prints out the admin page
631
  function printAdminPage() {
632
+ $ez = parent::printAdminPage();
633
+ if (empty($ez)) {
634
+ return;
635
+ }
636
+ $this->handleSubmits();
637
  // if the defaults are not loaded, send error message
638
+ if (empty($this->defaults)) {
639
+ return;
640
+ }
641
+ if (file_exists($this->plgDir . '/admin.php')) {
642
+ echo $this->adminMsg;
643
+ include ($this->plgDir . '/admin.php');
644
  }
645
  else {
646
+ echo '<font size="+1" color="red">';
647
+ _e("Error locating the admin page!\nEnsure admin.php exists, or reinstall the plugin.", 'easy-adsenser');
648
+ echo '</font>';
 
649
  }
650
  }
651
 
652
+ function info($hide = true) {
653
+ if (!function_exists('get_plugin_data')) {
654
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
655
+ }
656
+ $plugin_data = get_plugin_data(__FILE__);
657
  $version = $plugin_data['Version'];
658
+ $str = "Easy AdSense (WP) V$version";
659
+ if ($hide) {
660
  $str = "<!-- $str -->";
661
+ }
662
+ return $str;
663
  }
664
 
665
+ function cleanDB($prefix) {
666
+ global $wpdb;
667
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '$prefix%'");
668
  }
669
 
670
  function plugin_action($links, $file) {
671
+ if ($file == plugin_basename(__FILE__)) {
672
  $settings_link = "<a href='options-general.php?page=easy-adsense-lite.php'>" .
673
+ __('Settings', 'easy-adsenser') . "</a>";
674
+ array_unshift($links, $settings_link);
675
  }
676
  return $links;
677
  }
678
 
679
  function getMetaOptions() {
680
+ if (!empty($this->metaOptions)) {
681
+ return $this->metaOptions;
682
+ }
683
  global $post;
684
  $lookup = array('adsense' => 'adsense',
685
+ 'adsense-top' => 'show_leadin',
686
+ 'adsense-middle' => 'show_midtext',
687
+ 'adsense-bottom' => 'show_leadout',
688
+ 'adsense-widget' => 'show_widget',
689
+ 'adsense-search' => 'title_gsearch',
690
+ 'adsense-linkunits' => 'show_lu');
691
+ $metaOptions = array();
692
  foreach ($lookup as $metaKey => $optKey) {
693
+ if (!empty($this->options[$optKey])) {
694
+ $metaOptions[$optKey] = $this->options[$optKey];
695
+ }
696
+ else {
697
+ $metaOptions[$optKey] = '';
698
+ }
699
  $customStyle = get_post_custom_values($metaKey, $post->ID, true);
700
+ if (is_array($customStyle)) {
701
+ $metaStyle = strtolower($customStyle[0]);
702
+ }
703
+ else {
704
+ $metaStyle = strtolower($customStyle);
705
+ }
706
+ $style = '';
707
+ if ($metaStyle == 'left') {
708
+ $style = 'float:left;display:block;';
709
+ }
710
+ else if ($metaStyle == 'right') {
711
+ $style = 'float:right;display:block;';
712
+ }
713
+ else if ($metaStyle == 'center') {
714
+ $style = 'text-align:center;display:block;';
715
+ }
716
+ else {
717
+ $style = $metaStyle;
718
+ }
719
+ if (!empty($style)) {
720
+ $metaOptions[$optKey] = $style;
721
+ }
722
+ }
723
+ return $metaOptions;
724
+ }
725
+
726
+ function findParas($content) {
727
+ $content = strtolower($content); // not using stripos() for PHP4 compatibility
728
+ $paras = array();
729
+ $lastpos = -1;
730
+ $paraMarker = "<p";
731
+ if (strpos($content, "<p") === false) {
732
+ $paraMarker = "<br";
733
+ }
734
+
735
+ while (strpos($content, $paraMarker, $lastpos + 1) !== false) {
736
+ $lastpos = strpos($content, $paraMarker, $lastpos + 1);
737
+ $paras[] = $lastpos;
738
+ }
739
+ return $paras;
740
+ }
741
+
742
+ function mayBeExcerpt() {
743
+ return is_home() || is_category() || is_tag() || is_archive();
744
  }
745
 
746
+ function filterContent($content, $force = false) {
747
+ if (!$force && $this->mayBeExcerpt()) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  return $content;
749
+ }
750
+ foreach ($this->kills as $k) {
751
+ $fn = "is_$k";
752
+ if ($this->options["kill_$k"] && $fn()) {
753
+ return $content;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  }
755
+ }
756
+ $this->ezMax = $this->options['max_count'];
757
+ $adsServed = 0;
758
+ if ($this->options['force_widget']) {
759
+ $this->ezMax--;
760
+ }
761
+ $this->urMax = $this->options['max_link'];
762
+ if ($this->ezCount >= $this->ezMax) {
763
+ return "$content <!-- Easy AdSense Unfiltered [count: {$this->ezCount} "
764
+ . "is not less than {$this->ezMax}] -->";
765
+ }
766
+ if (strpos($content, "<!--noadsense-->") !== false) {
767
+ return $content;
768
+ }
769
+ $metaOptions = $this->getMetaOptions();
770
+ if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
771
+ return $content;
772
+ }
773
+
774
+ $timeout = 60;
775
+ $commentArgs = array('status' => 'approve');
776
+ $commentArgs['post_id'] = get_the_ID();
777
+ $comments = get_comments($commentArgs);
778
+ $ezContent = '';
779
+ foreach ($comments as $comment) {
780
+ $ezContent .= $comment->comment_content;
781
+ }
782
+ $ezContent .= $content;
783
+ set_transient('ezContent', $ezContent, $timeout);
784
+ if (!in_the_loop()) {
785
+ return $content;
786
+ }
787
+ $this->handleDefaults();
788
+
789
+ if ($this->options['kill_linebreaks']) {
790
+ $linebreak = "";
791
+ }
792
+ else {
793
+ $linebreak = "\n";
794
+ }
795
+ $wc = str_word_count($content);
796
+ if ((is_single() || is_page()) && $this->urCount < $this->urMax) {
797
+ $unreal = self::showUnreal();
798
+ }
799
+ else {
800
+ $unreal = '';
801
+ }
802
+ $border = '';
803
+ if ($this->options['show_borders']) {
804
+ $border = "border:#{$this->options['border_normal']} solid {$this->options['border_width']}px;' onmouseover='this.style.border=\"#{$this->options['border_color']} solid {$this->options['border_width']}px\"' onmouseout='this.style.border=\"#{$this->options['border_normal']} solid {$this->options['border_width']}px\"";
805
+ }
806
+
807
+ $show_leadin = $metaOptions['show_leadin'];
808
+ $leadin = '';
809
  if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
810
  if ($this->ezCount < $this->ezMax) {
811
+ $adsServed++;
812
  $this->ezCount++;
813
+ $margin = $this->options['margin_leadin'];
814
+ if ($this->options['kill_inline']) {
815
+ $inline = '';
816
+ }
817
+ else {
818
+ $inline = 'style="' . $show_leadin . ';margin:' .
819
+ $margin . 'px;' . $border . '"';
820
+ }
821
+ $leadin = stripslashes($this->options['info'] .
822
+ "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
823
+ '<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
824
+ $this->options['text_leadin'] .
825
+ ($this->urCount++ < $this->urMax ? $unreal : '') .
826
+ "</div>$linebreak" . $this->options['info'] . "$linebreak");
827
+ }
828
+ }
829
+
830
+ $show_midtext = $metaOptions['show_midtext'];
831
  if ($show_midtext != 'no' && $wc > $this->options['wc_midtext']) {
832
  if ($this->ezCount < $this->ezMax) {
833
+ $paras = $this->findParas($content);
834
+
835
+ $half = sizeof($paras);
836
+ while (sizeof($paras) > $half) {
837
+ array_pop($paras);
838
+ }
839
+ $split = 0;
840
+ if (!empty($paras)) {
841
+ $split = $paras[floor(sizeof($paras) / 2)];
842
  }
 
 
 
 
 
843
  if ($this->options['force_midad'] || $half > 10) {
844
  $this->ezCount++;
845
+ $adsServed++;
846
+ $margin = $this->options['margin_midtext'];
847
+ if ($this->options['kill_inline']) {
848
+ $inline = '';
849
+ }
850
+ else {
851
+ $inline = 'style="' . $show_midtext . ';margin:' . $margin . 'px;' . $border . '"';
852
+ }
853
+ $midtext = stripslashes($this->options['info'] .
854
+ "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
855
+ '<div class="ezAdsense adsense adsense-midtext" ' . $inline . '>' .
856
+ $this->options['text_midtext'] .
857
+ ($this->urCount++ < $this->urMax ? $unreal : '') .
858
+ "</div>$linebreak" . $this->options['info'] . "$linebreak");
859
+ $content = substr($content, 0, $split) . $midtext . substr($content, $split);
860
  }
861
  }
862
  }
863
 
864
+ $show_leadout = $metaOptions['show_leadout'];
865
+ $leadout = '';
866
  if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
867
  if ($this->ezCount < $this->ezMax) {
868
  $this->ezCount++;
869
+ $adsServed++;
870
+ $margin = $this->options['margin_leadout'];
871
+ if ($this->options['kill_inline']) {
872
+ $inline = '';
873
+ }
874
+ else {
875
+ $inline = 'style="' . $show_leadout . ';margin:' . $margin . 'px;' . $border . '"';
876
+ }
877
+ if (strpos($inline, "float") !== false) {
878
+ $paras = $this->findParas($content);
879
+ $split = array_pop($paras);
880
+ if (!empty($split)) {
881
+ $content1 = substr($content, 0, $split);
882
+ $content2 = substr($content, $split);
883
+ }
884
+ }
885
+ $leadout = stripslashes($this->options['info'] .
886
+ "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
887
+ '<div class="ezAdsense adsense adsense-leadout" ' . $inline . '>' .
888
+ $this->options['text_leadout'] .
889
+ ($this->urCount++ < $this->urMax ? $unreal : '') .
890
+ "</div>$linebreak" . $this->options['info'] . "$linebreak");
891
  }
892
  }
893
  if ($this->options['header_leadin']) {
894
+ $this->leadin = $leadin;
895
+ $leadin = '';
896
  }
897
  if ($this->options['footer_leadout']) {
898
+ $this->leadout = $leadout;
899
+ $leadout = '';
900
+ }
901
+ if (empty($content1)) {
902
+ $content = $leadin . $content . $leadout;
903
+ }
904
+ else {
905
+ $content = $leadin . $content1 . $leadout . $content2;
906
  }
907
+ return $content;
908
  }
909
 
910
+ function footer_action() {
911
+ self::showUnreal(true);
 
 
 
 
 
 
912
  }
913
 
914
  function header_leadin() {
915
+ // if it is an admin page, don't show ads
916
+ if (is_admin()) {
917
+ return;
918
+ }
919
  // is_feed() is not ready, because the WP query hasn't been run yet.
920
+ if (strpos($_SERVER['REQUEST_URI'], 'feed') !== false) {
921
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
922
  }
923
+ $border = '';
924
+ if ($this->options['show_borders']) {
925
+ $border = 'border:#' . $this->options['border_normal'] .
926
+ ' solid ' . $this->options['border_width'] . 'px;" ' .
927
+ ' onmouseover="this.style.border=\'#' . $this->options['border_color'] .
928
+ ' solid ' . $this->options['border_width'] . 'px\'" ' .
929
+ 'onmouseout="this.style.border=\'#' . $this->options['border_normal'] .
930
+ ' solid ' . $this->options['border_width'] . 'px\'"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
931
  }
932
+ $show_leadin = $this->options['show_leadin'];
933
+ if ($show_leadin != 'no') {
934
+ $margin = $this->options['margin_leadin'];
935
+ if ($this->options['kill_inline']) {
936
+ $inline = '';
937
+ }
938
+ else {
939
+ $inline = 'style="' . $show_leadin . ';margin:' .
940
+ $margin . 'px;' . $border . '"';
941
+ }
942
+ $this->ezCount++;
943
+ $unreal = self::showUnreal();
944
+ if ($this->options['kill_linebreaks']) {
945
+ $linebreak = "";
946
+ }
947
+ else {
948
+ $linebreak = "\n";
949
+ }
950
+ $this->leadin = stripslashes($this->options['info'] .
951
+ "$linebreak<!-- Post[count: " . $this->ezCount . "] -->$linebreak" .
952
+ '<div class="ezAdsense adsense adsense-leadin" ' . $inline . '>' .
953
+ $this->options['text_leadin'] .
954
+ ($this->urCount++ < $this->urMax ? $unreal : '') .
955
+ "</div>$linebreak" . $this->options['info'] . "$linebreak");
956
+ echo $this->leadin;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  }
958
  }
959
 
960
+ function footer_leadout() {
961
+ if (is_admin()) {
962
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  }
964
+ echo $this->leadout;
965
  }
966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
967
  }
968
+
969
+ } //End Class EzAdSense
970
 
971
  if (class_exists("EzAdSense")) {
972
  $ezAdSense = new EzAdSense();
973
  if (isset($ezAdSense) && !empty($ezAdSense->defaults)) {
974
  if (!function_exists("ezAdSense_ap")) {
975
+
976
  function ezAdSense_ap() {
977
+ global $ezAdSense;
978
  if (function_exists('add_options_page')) {
979
+ $mName = 'Easy AdSense';
980
+ add_options_page($mName, $mName, 'activate_plugins', basename(__FILE__), array($ezAdSense, 'printAdminPage'));
981
  }
982
  }
983
+
984
  }
985
 
986
  // sidebar AdSense Widget (skyscraper)
987
+ class EzAdsWidget extends WP_Widget {
988
+
989
+ function EzAdsWidget() {
990
+ $widget_ops = array('classname' => 'EzAdsWidget',
991
  'description' =>
992
+ __('Show a Google AdSense block in your sidebar as a widget', 'easy-adsenser'));
993
+ $this->WP_Widget('EzAdsWidget', 'Easy AdSense: Google Ads', $widget_ops);
 
 
994
  }
995
+
996
  function widget($args, $instance) {
997
  // outputs the content of the widget
998
+ global $ezAdSense;
999
+ extract($args);
1000
+ $ezAdSense->options['text_widget'] = $ezAdSense->handleDefaultText($ezAdSense->options['text_widget'], '160x600');
1001
+ $metaOptions = $ezAdSense->getMetaOptions();
1002
+ if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
1003
+ return;
1004
+ }
1005
+ $show_widget = $metaOptions['show_widget'];
1006
+ if ($show_widget == 'no') {
1007
+ return;
1008
+ }
1009
+ $ezAdSense->ezMax = $ezAdSense->options['max_count'];
1010
+ $ezAdSense->urMax = $ezAdSense->options['max_link'];
1011
+ if (!$ezAdSense->options['force_widget']) {
1012
+ if ($ezAdSense->ezCount >= $ezAdSense->ezMax) {
1013
+ return;
1014
+ }
1015
+ $ezAdSense->ezCount++;
1016
+ }
1017
+ $unreal = EzAdSense::showUnreal();
1018
+ if ($ezAdSense->options['kill_linebreaks']) {
1019
+ $linebreak = "";
1020
+ }
1021
+ else {
1022
+ $linebreak = "\n";
1023
+ }
1024
+
1025
+ $title = empty($ezAdSense->options['title_widget']) ?
1026
+ __('Sponsored Links', 'easy-adsenser') :
1027
+ stripslashes(htmlspecialchars($ezAdSense->options['title_widget']));
1028
+ $border = '';
1029
+ if ($ezAdSense->options['show_borders'] && $ezAdSense->options['border_widget']) {
1030
+ $border = 'border:#' . $ezAdSense->options['border_normal'] .
1031
+ ' solid ' . $ezAdSense->options['border_width'] . 'px ;"' .
1032
+ ' onmouseover="this.style.border=\'#' . $ezAdSense->options['border_color'] .
1033
+ ' solid ' . $ezAdSense->options['border_width'] . 'px\'" ' .
1034
+ 'onmouseout="this.style.border=\'#' . $ezAdSense->options['border_normal'] .
1035
+ ' solid ' . $ezAdSense->options['border_width'] . 'px\'"';
1036
+ }
1037
+ echo $before_widget;
1038
+ if (!$ezAdSense->options['kill_widget_title']) {
1039
+ echo $before_title . $title . $after_title;
1040
+ }
1041
+ $margin = $ezAdSense->options['margin_widget'];
1042
+ if ($ezAdSense->options['kill_inline']) {
1043
+ $inline = '';
1044
+ }
1045
+ else {
1046
+ $inline = 'style="' . $show_widget . ';margin:' .
1047
+ $margin . 'px;' . $border . '"';
1048
+ }
1049
+ echo stripslashes($ezAdSense->options['info'] .
1050
+ "$linebreak<!-- Widg[count: " . $ezAdSense->ezCount . "] -->$linebreak" .
1051
+ '<div class="ezAdsense adsense adsense-widget"><div ' . $inline . '>' .
1052
+ $ezAdSense->options['text_widget']) .
1053
+ ($ezAdSense->urCount++ < $ezAdSense->urMax ? $unreal : '') .
1054
+ "</div></div>$linebreak" . $ezAdSense->options['info'] . "$linebreak";
1055
+ echo $after_widget;
1056
  }
1057
 
1058
  function update($new_instance, $old_instance) {
1059
  // processes widget options to be saved
1060
+ return $new_instance;
1061
  }
1062
 
1063
  function form($instance) {
1064
  // outputs the options form on admin
1065
+ echo '<p>Configure it at <br />';
1066
+ echo '<a href="options-general.php?page=easy-adsense.php"> ';
1067
+ echo 'Settings &rarr; Easy AdSense</a>';
1068
+ echo '</p>';
1069
  }
1070
+
1071
  }
1072
+
1073
+ add_action('widgets_init', create_function('', 'return register_widget("EzAdsWidget");'));
1074
 
1075
  // sidebar Search Widget
1076
+ class EzAdsSearch extends WP_Widget {
1077
+
1078
+ function EzAdsSearch() {
1079
+ $widget_ops = array('classname' => 'EzAdsSearch',
1080
  'description' =>
1081
+ __('Show a Google Search Box in your sidebar as a widget', 'easy-adsenser'));
1082
+ $this->WP_Widget('EzAdsSearch', 'Easy AdSense: Google Search', $widget_ops);
 
 
1083
  }
1084
+
1085
  function widget($args, $instance) {
1086
  // outputs the content of the widget
1087
+ global $ezAdSense;
1088
+ extract($args);
1089
+ $ezAdSense->options['text_gsearch'] = $ezAdSense->handleDefaultText($ezAdSense->options['text_gsearch'], '160x160');
1090
+ $metaOptions = $ezAdSense->getMetaOptions();
1091
+ if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
1092
+ return;
1093
+ }
1094
+ $title_gsearch = $metaOptions['title_gsearch'];
1095
+ if ($title_gsearch != 'no') {
1096
+ if ($ezAdSense->options['kill_linebreaks']) {
1097
+ $linebreak = "";
1098
+ }
1099
+ else {
1100
+ $linebreak = "\n";
1101
+ }
1102
+ $title = $before_title . $title_gsearch . $after_title;
1103
+ if ($title_gsearch == 'dark') {
1104
+ $title = '<img src=" ' . $ezAdSense->plgURL . '/google-dark.gif" ' .
1105
+ ' border="0" alt="[Google]" align="middle" />';
1106
+ }
1107
+ else if ($title_gsearch == 'light') {
1108
+ $title = '<img src=" ' . $ezAdSense->plgURL . '/google-light.gif" ' .
1109
+ ' border="0" alt="[Google]" align="middle" />';
1110
+ }
1111
+ else if ($title_gsearch == 'customized') {
1112
+ $title = $ezAdSense->options['title_gsearch_custom'];
1113
+ }
1114
+ echo $before_widget;
1115
+ if (!$ezAdSense->options['kill_gsearch_title']) {
1116
+ echo $title;
1117
+ }
1118
+ $margin = $ezAdSense->options['margin_gsearch'];
1119
+ if ($ezAdSense->options['kill_inline']) {
1120
+ $inline = '';
1121
+ }
1122
+ else {
1123
+ $inline = 'style="margin:' . $margin . 'px; "';
1124
+ }
1125
+ echo stripslashes('<div class="ezAdsense adsense adsense-search"><div '
1126
+ . $inline . '>' . "$linebreak" .
1127
+ $ezAdSense->options['text_gsearch'] . "$linebreak" .
1128
+ '</div></div>');
1129
+ echo $after_widget;
1130
+ }
1131
  }
1132
 
1133
  function update($new_instance, $old_instance) {
1134
  // processes widget options to be saved
1135
+ return $new_instance;
1136
  }
1137
 
1138
  function form($instance) {
1139
  // outputs the options form on admin
1140
+ echo '<p>Configure it at <br />';
1141
+ echo '<a href="options-general.php?page=easy-adsense.php"> ';
1142
+ echo 'Settings &rarr; Easy AdSense</a>';
1143
+ echo '</p>';
1144
  }
1145
+
1146
  }
1147
+
1148
+ add_action('widgets_init', create_function('', 'return register_widget("EzAdsSearch");'));
1149
 
1150
  // sidebar Link Units
1151
+ class EzAdsLU extends WP_Widget {
1152
+
1153
+ function EzAdsLU() {
1154
+ $widget_ops = array('classname' => 'EzAdsLU',
1155
  'description' =>
1156
+ __('Show a Google Links Unit in your sidebar as a widget', 'easy-adsenser'));
1157
+ $this->WP_Widget('EzAdsLU', 'Easy AdSense: Google Link Unit', $widget_ops);
 
 
1158
  }
1159
+
1160
  function widget($args, $instance) {
1161
  // outputs the content of the widget
1162
+ global $ezAdSense;
1163
+ extract($args);
1164
+ $ezAdSense->options['text_lu'] = $ezAdSense->handleDefaultText($ezAdSense->options['text_lu'], '160x160');
1165
+ $title = empty($ezAdSense->options['title_lu']) ? '' :
1166
+ $before_title .
1167
+ stripslashes(htmlspecialchars($ezAdSense->options['title_lu'])) .
1168
+ $after_title;
1169
+ $metaOptions = $ezAdSense->getMetaOptions();
1170
+ if (isset($metaOptions['adsense']) && $metaOptions['adsense'] == 'no') {
1171
+ return;
1172
+ }
1173
+ $show_lu = $metaOptions['show_lu'];
1174
+ $border = '';
1175
+ if ($ezAdSense->options['show_borders'] && $ezAdSense->options['border_lu']) {
1176
+ $border = 'border:#' . $ezAdSense->options['border_normal'] .
1177
+ ' solid ' . $ezAdSense->options['border_width'] . 'px;" ' .
1178
+ ' onmouseover="this.style.border=\'#' . $ezAdSense->options['border_color'] .
1179
+ ' solid ' . $ezAdSense->options['border_width'] . 'px\'" ' .
1180
+ 'onmouseout="this.style.border=\'#' . $ezAdSense->options['border_normal'] .
1181
+ ' solid ' . $ezAdSense->options['border_width'] . 'px\'"';
1182
+ }
1183
+ if ($show_lu != 'no') {
1184
+ if ($ezAdSense->options['kill_linebreaks']) {
1185
+ $linebreak = "";
1186
+ }
1187
+ else {
1188
+ $linebreak = "\n";
1189
+ }
1190
+ echo $before_widget;
1191
+ if (!$ezAdSense->options['kill_widget_title']) {
1192
+ echo $title;
1193
+ }
1194
+ $margin = $ezAdSense->options['margin_lu'];
1195
+ if ($ezAdSense->options['kill_inline']) {
1196
+ $inline = '';
1197
+ }
1198
+ else {
1199
+ $inline = 'style="' . $show_lu . ';margin:' .
1200
+ $margin . 'px;' . $border . '"';
1201
+ }
1202
+ echo stripslashes('<div class="ezAdsense adsense adsense-lu"><div ' .
1203
+ $inline . '>' . "$linebreak" .
1204
+ $ezAdSense->options['text_lu'] . "$linebreak" .
1205
+ '</div></div>');
1206
+ echo $after_widget;
1207
+ }
1208
  }
1209
 
1210
  function update($new_instance, $old_instance) {
1211
  // processes widget options to be saved
1212
+ return $new_instance;
1213
  }
1214
 
1215
  function form($instance) {
1216
  // outputs the options form on admin
1217
+ echo '<p>Configure it at <br />';
1218
+ echo '<a href="options-general.php?page=easy-adsense.php"> ';
1219
+ echo 'Settings &rarr; Easy AdSense</a>';
1220
+ echo '</p>';
1221
  }
1222
+
1223
  }
 
 
1224
 
1225
+ add_action('widgets_init', create_function('', 'return register_widget("EzAdsLU");'));
1226
+ add_filter('the_content', array($ezAdSense, 'filterContent'));
1227
  add_action('admin_menu', 'ezAdSense_ap');
1228
+ add_action('init', array($ezAdSense, 'session_start'));
1229
  add_filter('plugin_action_links', array($ezAdSense, 'plugin_action'), -10, 2);
1230
+ if ($ezAdSense->options['max_link'] === -1) {
1231
+ add_action('wp_footer', array($ezAdSense, 'footer_action', 1));
1232
+ }
1233
+ else {
1234
  remove_action('wp_footer', array($ezAdSense, 'footer_action'));
1235
+ }
1236
 
1237
+ if ($ezAdSense->options['header_leadin']) {
1238
  add_action($ezAdSense->options['header_leadin'], array($ezAdSense, 'header_leadin'));
1239
+ }
1240
 
1241
+ if ($ezAdSense->options['footer_leadout']) {
1242
  add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
1243
+ }
1244
  }
1245
  }
1246
+
english.gif CHANGED
Binary file
head-text.php CHANGED
@@ -1,195 +1,35 @@
1
  <?php
2
 
3
  /*
4
- Copyright (C) 2008 www.thulasidas.com
5
 
6
- This file is part of the programs "Easy AdSense", "AdSense Now!",
7
- "Theme Tweaker", "Easy LaTeX", "More Money" and "Easy Translator".
8
-
9
- These programs are free software; you can redistribute them and/or
10
  modify it under the terms of the GNU General Public License as
11
  published by the Free Software Foundation; either version 3 of the
12
  License, or (at your option) any later version.
13
 
14
- These programs are distributed in the hope that they will be useful,
15
- but WITHOUT ANY WARRANTY; without even the implied warranty of
16
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
  General Public License for more details.
18
 
19
  You should have received a copy of the GNU General Public License
20
- along with the programs. If not, see <http://www.gnu.org/licenses/>.
21
  */
22
 
23
- function renderHeadText($name, $plg) {
24
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
25
- $value = '<em><strong>' . $plg['value'] . '</strong></em>';
26
- $toolTip = $plg['title'];
27
- $price = $plg['price'];
28
- $moreInfo = "<b><a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of {$plg['value']} for \$$price. Instant download link.' onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\">Pro Version</a></b>";
29
- $toolTip .= addslashes('<br />' . $moreInfo);
30
- $why = addslashes($plg['pro']);
31
- $version = 'Lite';
32
- echo "<b>Get Pro Version!</b>
33
- <a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of the $name plugin. Instant download link.' onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\"><img src='$plugindir/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright'/></a>
34
- <br />
35
- You are using the $version version of $value, which is also available as in a Pro version.
36
- <ul><li>
37
- $moreInfo
38
- </li>
39
- <li>$why And it costs only \$$price!</li>
40
- </ul>";
41
- }
42
-
43
- function renderProText($name, $plg) {
44
- $value = '<em><strong>' . $plg['value'] . '</strong></em>';
45
- $filter = '';
46
- if (stripos($name, 'adsense') !== FALSE) {
47
- $filter = " (e.g., a filter to ensure AdSense policy compliance) ";
48
- }
49
- $toolTip = $plg['title'];
50
- $price = $plg['price'];
51
- $popup = "onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\"";
52
- $moreInfo = "&nbsp; <a href='http://buy.thulasidas.com/lite/$name.zip' title='Download the Lite version of $value'>Lite Version </a>&nbsp; <a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of $value for \$$price' $popup>Pro Version</a>";
53
- $toolTip .= addslashes('<br />' . $moreInfo);
54
- echo "<div style='background-color:#ffcccc;padding:5px;border: solid 1px;text-align:center;'>
55
- <span style='font-size:14px;color:#a48;font-variant: small-caps;text-decoration:underline;text-align:center;' $popup onmouseover=\"TagToTip('pro', WIDTH, 300, TITLE, 'Buy the Pro Version',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b>The Pro Version</b></span><br />";
56
-
57
- $value .= '<b><i> Lite</i></b>';
58
- echo "Thank you for using $value. The \"Pro\" version gives you more options$filter. Consider <a href='http://buy.thulasidas.com/$name' title='Pro version of this plugin. Instant download link.' $popup>buying it</a>. It costs only \$$price.";
59
-
60
- echo "<div id='pro' style='display:none'>";
61
- renderHeadText($name, $plg);
62
- echo "</div></div>";
63
- }
64
-
65
- function renderAffiliate() {
66
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
67
- echo "<div style='padding:0px;border:none; width:300px' id='support' onmouseover=\"Tip('<b>ezAffiliates</b>: The most affiliate-centric revenue sharing model on the Web. Finally, you can make some serious returns on your web presence.<br /><b>Generous 50% Commission</b>: perhaps the highest rate of revenue sharing on the web. With just a couple of sales of this plugin, you will have recovered your purchase price!<br /><b>$10 Minimum Payout</b> so that you will not be waiting forever before you qualify for payment.<br /><b>Lifetime Tracking</b>: ezAffiliates uses cookie-less tracking technology to attribute every purchase of your lead to your account. Whatever your leads buy from us, whenever they do, will earn you commission. No cookie expiry!<br /><b>High Quality Products</b> such as this plugin, and other premium plugins and PHP packages.<br /><b>Diverse Markets</b>: Bloggers who blog about plugins, PayPal integration, affiliate marketing, MacOS apps and even eBooks will find ezAffiliates attractive and more effective that their current ad campaigns.', WIDTH, 295, TITLE, 'ezAffiliates', FIX, [this, 0, 0])\" onmouseout=\"UnTip()\" ><a href='http://affiliates.thulasidas.com'><img src='$plugindir/invite.gif' alt='ezAffiliates' onclick=\"popupwindow('http://affiliates.thulasidas.com/','50-50 Revenue Share', 1024, 768);return false;\"/></a></div>";
68
- }
69
-
70
- function renderSupportText($name, $plg, $long = true) {
71
- $value = '<em><strong>' . $plg['value'] . '</strong></em>';
72
- $supportText = "<div style=\"background-color:#cff;padding:5px;border: solid 1px\" id=\"support\"><b>Support $value. <a href=\"http://buy.thulasidas.com/$name\" title=\"Pro version of this plugin. Instant download link.\" onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\">Go Pro!</a></b>";
73
- if ($long) {
74
- $longText = "How about ";
75
- }
76
- else {
77
- $longText = '';
78
- }
79
- $supportText .= "<br />$longText<span onmouseover=\"TagToTip('dropbox', WIDTH, 440, TITLE, 'What is DropBox?',STICKY, 1, CLOSEBTN, true, FIX, [this, -150, 2])\"><a href='http://db.tt/qsogWB1' title='Sign up for Dropbox -- free 2GB online storage on the cloud!' target='_blank'>2GB of <em>free</em> online storage</a></span>?";
80
- if ($long) {
81
- $longText = "WordPress Hosting for ";
82
- }
83
- else {
84
- $longText = 'Hosting for ';
85
- }
86
- $supportText .= "<br />$longText<span onmouseover=\"TagToTip('arvixe', WIDTH, 300, TITLE, 'Arvixe - My favorite provider!',STICKY, 1, CLOSEBTN, true, FIX, [this, -200, 2])\"><a href='http://www.arvixe.com/1933.html' target='_blank'>just $4/month</a></span>. ";
87
- if ($long) {
88
- $longText = "My books on ";
89
- }
90
- else {
91
- $longText = 'Books: ';
92
- }
93
- $supportText .= "<br />$longText<span style=\"text-decoration:underline\" onmouseover=\"TagToTip('unreal', WIDTH, 205, TITLE, 'Buy &lt;em&gt;The Unreal Universe&lt;/em&gt;',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/unreal' target='_blank'>Physics &amp; Philosophy</a></b></span> or ";
94
- $supportText .= "<span style=\"text-decoration:underline\" onmouseover=\"TagToTip('pqd', WIDTH, 205, TITLE, '&lt;em&gt;Principles of Quant. Devel.&lt;/em&gt;',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/pqd' target='_blank'>Money &amp; Finance</a></b></span>.</div>";
95
- echo $supportText;
96
- }
97
-
98
- function renderTipDivs($name) {
99
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
100
- echo <<<ENDDIVS
101
- <div id="arvixe" style='display:none;'>
102
- <a href="http://www.arvixe.com/1933-27-1-310.html" target="_blank">Arvixe</a> is my favorite hosting provider. Friendly service, extremely competitive rates, and of course a great affiliate program.
103
- </div>
104
-
105
- <span id="dropbox" style='display:none;'>
106
- Dropbox! gives you 2GB of network (cloud) storage for free, which I find quite adequate for any normal user. (That sounds like the famous last words by Bill Gates, doesn’t it? “64KB of memory should be enough for anyone!”) And, you can get 250MB extra for every successful referral you make. That brings me to my ulterior motive – please use this link to sign up. When you do, I get 250MB extra. Don’t worry, you get 250MB extra as well. So I can grow my online storage up to 8GB, which should keep me happy for a long time. Thank you!
107
- </span>
108
-
109
- <div id="unreal" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
110
- <div style="text-align:center;width:200px;padding:1px;background:#aad;margin:2px;">
111
- <div style="text-align:center;width:192px;height:180px;padding:2px;border:solid 1px #000;background:#ccf;margin:1px;">
112
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook, $15.95 for paperback). It will change the way you view life and reality!">
113
- <span style="font-size:14px;font-family:arial;color:#a48;font-variant: small-caps;"><b>The Unreal Universe</b></span><br />
114
- <small style="font-size:12px;font-family:arial;color:#000;">
115
- A Book on Physics and Philosophy
116
- </small>
117
- </a>
118
- <hr />
119
- <table style="border-width:0;padding:2px;width:100%;margin-left:auto;margin-right:auto;border-spacing:0;border-collapse:collapse;">
120
- <tr><td style="width:65%">
121
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook or Kindle, $15.95 for paperback). It will change the way you view life and reality!">
122
- <small style="font-size:10px;font-family:arial;color:#000;">
123
- Pages: 292<br />
124
- (282 in eBook)<br />
125
- Trimsize: 6" x 9" <br />
126
- Illustrations: 34<br />
127
- (9 in color in eBook)<br />
128
- Tables: 8 <br />
129
- Bibliography: Yes<br />
130
- Index: Yes<br />
131
- ISBN: 9789810575946&nbsp;<br />
132
- <span style="font-color=#ff0000;"><b>Only $1.49!</b></span>
133
- </small>
134
- </a>
135
- </td>
136
- <td>
137
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/unreal-universe" title="Find out more about The Unreal Universe and buy it ($1.49 for eBook or Kindle, $15.95 for paperback). It will change the way you view life and reality!">
138
- <img class="alignright" src="$plugindir/unreal.gif" alt="TheUnrealUniverse" title="Read more about The Unreal Universe" />
139
- </a>
140
- </td>
141
- </tr>
142
- </table>
143
- </div>
144
- </div>
145
- </div>
146
-
147
- <div id="pqd" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
148
- <div style="text-align:center;width:200px;padding:1px;background:#000;margin:2px;">
149
- <div style="text-align:center;width:190px;height:185px;padding:2px;padding-top:1px;padding-left:4px;border:solid 1px #fff;background:#411;margin:1px;">
150
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
151
- <span style="font-size:14px;font-family:arial;color:#fff;font-variant: small-caps;">A Remarkable Book from Wiley-Finance</span>
152
- </a>
153
- <hr />
154
- <table style="border-width:0;padding:2px;width:100%;margin-left:auto;margin-right:auto;border-spacing:0;border-collapse:collapse;">
155
- <tr><td style="padding:0px">
156
- <div style="border:solid 1px #faa;height:126px;width:82px;">
157
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
158
- <img src="$plugindir/pqd-82x126.gif" alt="PQD" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)" />
159
- </a>
160
- </div>
161
- </td>
162
- <td style="padding:3px">
163
- <a style="text-decoration:none;" href="http://buy.thulasidas.com/pqd" title="Buy the companion eBook to Principles of Quantitative Development from the author (only $5.49)">
164
- <em style="font-size:14px;font-family:arial;color:#fff;">"An excellent book!"</em><br />
165
- <small style="font-size:13px;font-family:arial;color:#faa;">&nbsp;&nbsp;&#8212; Paul Wilmott</small>
166
- <br />
167
- <small style="font-size:11px;font-family:arial;color:#fff;">
168
- Want to break into the lucrative world of trading and quantitative finance? You <b>need </b> this book!
169
- </small>
170
- </a>
171
- </td>
172
- </tr>
173
- </table>
174
- </div>
175
- </div>
176
- </div>
177
- ENDDIVS;
178
- }
179
-
180
  echo '<td style="width:30%">';
181
 
182
- if (rand(0, 2) % 2 || $plgName == "easy-ads" || $plgName == "google-adsense") {
183
- renderSupportText($plgName, $myPlugins[$plgName], $myPlugins[$plgName]['long']);
184
- renderTipDivs($name);
185
  }
186
  else {
187
- renderAffiliate();
188
  }
189
 
190
  echo '</td>';
191
  echo '<td style="width:30%">';
192
 
193
- renderProText($plgName, $myPlugins[$plgName]);
194
 
195
  echo '</td>';
1
  <?php
2
 
3
  /*
4
+ Copyright (C) 2008 www.ads-ez.com
5
 
6
+ This program is free software; you can redistribute it and/or
 
 
 
7
  modify it under the terms of the GNU General Public License as
8
  published by the Free Software Foundation; either version 3 of the
9
  License, or (at your option) any later version.
10
 
11
+ This program is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
  General Public License for more details.
15
 
16
  You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  echo '<td style="width:30%">';
21
 
22
+ if (rand(0, 2) % 2 || $this->slug == "easy-ads" || $this->slug == "google-adsense") {
23
+ $ez->renderSupportText();
24
+ $ez->renderTipDivs();
25
  }
26
  else {
27
+ $ez->renderAffiliate();
28
  }
29
 
30
  echo '</td>';
31
  echo '<td style="width:30%">';
32
 
33
+ $ez->renderProText();
34
 
35
  echo '</td>';
lang/{ar_MA/easy-adsenser.mo → ar_MA.mo} RENAMED
File without changes
lang/{ar_MA/easy-adsenser.po → ar_MA.po} RENAMED
File without changes
lang/{by_BY/easy-adsenser.mo → by_BY.mo} RENAMED
File without changes
lang/{by_BY/easy-adsenser.po → by_BY.po} RENAMED
File without changes
lang/{da_DK/easy-adsenser.mo → da_DK.mo} RENAMED
File without changes
lang/{da_DK/easy-adsenser.po → da_DK.po} RENAMED
File without changes
lang/{de_DE/easy-adsenser.mo → de_DE.mo} RENAMED
File without changes
lang/{de_DE/easy-adsenser.po → de_DE.po} RENAMED
File without changes
lang/easy-translator.php DELETED
@@ -1,375 +0,0 @@
1
- <?php
2
- /*
3
- Copyright (C) 2008 www.thulasidas.com
4
-
5
- This file is part of the program "Easy AdSense."
6
-
7
- Easy AdSense is free software; you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation; either version 3 of the License, or (at
10
- your option) any later version.
11
-
12
- Easy AdSense is distributed in the hope that it will be useful, but
13
- WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see <http://www.gnu.org/licenses/>.
19
-
20
- Easy AdSense is supported by ad space sharing. Unless you configure
21
- the program (following the instructions on its admin page) and
22
- explicitly turn off the sharing, you agree to run its developer's ads
23
- on your site(s). By using the program, you are agreeing to this
24
- condition, and confirming that your sites abide by Google's policies
25
- and terms of service.
26
- */
27
-
28
- define('MINMATCH', 89) ;
29
-
30
- if (!class_exists("ezTran") && !class_exists("PO")) {
31
- class PO { // an id-str pair with attributes
32
- var $num, $id, $str, $tranId, $tranVal, $keyId, $keyVal ;
33
-
34
- function PO($id, $str) {
35
- $this->id = (string) $id ;
36
- $this->str = (string) $str ;
37
- $this->tranVal = MINMATCH ;
38
- $this->keyVal = MINMATCH ;
39
- }
40
-
41
- // Returns a properly escaped string
42
- static function decorate($str, $esc) {
43
- if (!get_magic_quotes_gpc()) $str = addcslashes($str, $esc) ;
44
- return $str ;
45
- }
46
- static function undecorate($str) {
47
- if (!get_magic_quotes_gpc()) $str = stripslashes($str) ;
48
- return $str ;
49
- }
50
-
51
- // Returns a text-area string of the Id
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: ' .
59
- htmlspecialchars('<br /><em><b>' . $this->keyId .
60
- '</b></em><br /> ', ENT_QUOTES) .
61
- 'exists. Please alert the author.\',WIDTH, 300)" ' .
62
- 'onmouseout="UnTip()"';
63
- }
64
- $s = '<textarea cols="50" rows="15" name="k' . $this->num .
65
- '" style="width: 45%;height:' . $ht . 'px;' . $col . '" ' .
66
- $tit . ' readonly="readonly">';
67
- $s .= htmlspecialchars($this->id, ENT_QUOTES) ;
68
- $s .= '</textarea>&nbsp;&nbsp;' ;
69
- return $s ;
70
- }
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: ' .
78
- htmlspecialchars('<br /><em><b>' . $this->tranId .
79
- '</b></em><br />', ENT_QUOTES) .
80
- 'Please check carefully.\',WIDTH, 300)" ' .
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 />' ;
88
- return $s ;
89
- }
90
- }
91
-
92
- class ezTran {
93
- var $status, $error ;
94
- function ezTran()
95
- {
96
- $this->status = '' ;
97
- $this->error = '' ;
98
- if (!empty($_POST['ezAds-savePot'])) {
99
- $file = $_POST['potFile'] ;
100
- $str = $_POST['potStr'] ;
101
- header('Content-Disposition: attachment; filename="' . $file .'"');
102
- header("Content-Transfer-Encoding: ascii");
103
- header('Expires: 0');
104
- header('Pragma: no-cache');
105
- ob_start() ;
106
- print htmlspecialchars_decode($str, ENT_QUOTES) ;
107
- ob_end_flush() ;
108
- $this->status = '<div class="updated">Pot file: ' . $file . ' was saved.</div> ' ;
109
- exit(0) ;
110
- }
111
- if (!empty($_POST['ezAds-clear'])) {
112
- $this->status =
113
- '<div class="updated">Reloaded the translations from PHP files and MO.</div> ' ;
114
- unset($_SESSION['ezAds-POs']) ;
115
- }
116
- if (!empty($_POST['ezAds-mailPot'])) {
117
- $file = $_POST['potFile'] ;
118
- $str = stripslashes($_POST['potStr']) ;
119
- $str = str_replace("\'", "'", $str) ;
120
-
121
- if (!class_exists("phpmailer")) {
122
- require_once(ABSPATH.'wp-includes/class-phpmailer.php');
123
- }
124
- $mail = new PHPMailer();
125
- $mail->From = get_bloginfo('admin_email') ;
126
- $mail->FromName = get_bloginfo('name') ;
127
- $mail->AddAddress('Manoj@Thulasidas.com', "Manoj Thulasidas") ;
128
- $mail->CharSet = get_bloginfo('charset');
129
- $mail->Mailer = 'php';
130
- $mail->SMTPAuth = false;
131
- $mail->Subject = $file;
132
- $mail->AddStringAttachment($str,$file) ;
133
- $pos1 = strpos($str, "msgstr") ;
134
- $pos2 = strpos($str, "msgid", $pos1) ;
135
- $head = substr($str, 0, $pos2) ;
136
- $mail->Body = $head ;
137
- if ($mail->Send())
138
- $this->status = '<div class="updated">Pot file: ' . $file . ' was sent.</div> ' ;
139
- else
140
- $this->error = '<div class="error">Error: ' . $mail->ErrorInfo .
141
- ' Please save the pot file and <a href="http://manoj.thulasidas.com/mail.shtml" target=_blank>contact the author</a></div>' ;
142
- }
143
- }
144
-
145
- // Return the contents of all PHP files in the dir specified
146
- function getFileContents($dir="") {
147
- if ($dir == "") $dir = dirname(__FILE__) ;
148
- $files = glob($dir . '/*.php') ;
149
- $page = "" ;
150
- foreach ($files as $f) {
151
- $page .= file_get_contents($f, FILE_IGNORE_NEW_LINES) ;
152
- }
153
- return $page ;
154
- }
155
-
156
- // Percentage Levenshtein distance
157
- function levDist(&$s1, &$s2) {
158
- similar_text($s1, $s2, $p) ;
159
- return round($p) ;
160
- }
161
-
162
- // Get the closest existing translation keys, and the recursivley closest in the
163
- // key set
164
- function getClose(&$mo, &$POs){
165
- foreach ($POs as $n => $po){
166
- $s1 = $po->id ;
167
- $l1 = strlen($s1);
168
- if (strlen($po->str) == 0) {
169
- if (!empty($mo)) foreach ($mo as $mn => $mk) {
170
- $s2 = $mn ;
171
- $result = $this->levDist($s1, $s2) ;
172
- if ($result > $po->tranVal) {
173
- $po->tranVal = $result ;
174
- $po->tranId = $mn ;
175
- $po->str = $mk->translations[0] ;
176
- }
177
- }
178
- }
179
- foreach ($POs as $n2 => $po2){
180
- if ($n != $n2){
181
- $s2 = $po2->id ;
182
- $result = $this->levDist($s1, $s2) ;
183
- if ($result > $po2->keyVal) {
184
- $po->keyVal = $result ;
185
- $po->keyId = $po2->id ;
186
- $po2->keyVal = $result ;
187
- $po2->keyId = $po->id ;
188
- }
189
- }
190
- }
191
- }
192
- }
193
-
194
- // Get the strings that look like translation keys
195
- function getTranPOs(&$contents, &$mo, $domain, &$POs) {
196
- preg_match_all("#_[_e].*\([\'\"](.+)[\'\"]\s*,\s*[\'\"]" . $domain ."[\'\"]#",
197
- $contents, $matches) ;
198
- $keys = array_unique($matches[1]) ;
199
- $keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys) ;
200
- foreach ($keys as $n => $k) {
201
- if (!empty($mo[$k])) {
202
- $v = $mo[$k] ;
203
- $t = $v->translations[0] ;
204
- }
205
- else {
206
- $t = '' ;
207
- }
208
- $po = new PO($k, $t) ;
209
- $po->num = $n ;
210
- array_push($POs, $po) ;
211
- }
212
- $this->getClose($mo, $POs) ;
213
- }
214
-
215
- // Make a POT string from ids and msgs
216
- function mkPot(&$POs, $msg){
217
- $pot = '' ;
218
- $pot .=
219
- '# This file was generated by Easy Translator for Easy AdSense -- a WordPress plugin translator
220
- # Your Name: ' . $msg["name"] . '
221
- # Your Email: ' . $msg["email"] . '
222
- # Your Website: ' . $msg["blog"] . '
223
- # Your URL: ' . $msg["url"] . '
224
- # Your Locale: ' . $msg["locale"] . '
225
- # Your Language: ' . $msg["lang"] . '
226
- #, fuzzy
227
- msgid ""
228
- msgstr ""
229
- "Project-Id-Version: Easy AdSenser\n"
230
- "PO-Revision-Date: ' . current_time('mysql') . '\n"
231
- "Last-Translator: ' . $msg['name'] . ' <' . $msg['email'] . '>\n"
232
- "MIME-Version: 1.0\n"
233
- "Content-Type: text/plain; charset=' . $msg['charset'] . '\n"
234
- "Content-Transfer-Encoding: 8bit\n"
235
-
236
- ' ;
237
- foreach ($POs as $n => $po) {
238
- $pot .= "msgid " . '"' . PO::decorate($po->id, "\n\r\"") . '"' . "\n" ;
239
- $t = $msg[$po->num] ;
240
- $pot .= "msgstr " . '"' . PO::decorate($t, "\n\r") . '"' . "\n\n" ;
241
- }
242
- return $pot ;
243
- }
244
-
245
- // Update the PO objects in $POs with the text box stuff
246
- function updatePot(&$POs, $msg){
247
- foreach ($POs as $n => $po) {
248
- $t = $msg[$po->num] ;
249
- $po->str = PO::undecorate($t) ;
250
- }
251
- }
252
-
253
- // Prints out the admin page
254
- function printAdminPage() {
255
- $locale = get_locale();
256
- $made = isset($_POST['ezAds-make']) ;
257
- $saving = isset($_POST['ezAds-savePot']) ;
258
-
259
- ?>
260
- <h2>Easy Translator</h2>
261
- <p>
262
- <strong><a href="options-general.php?page=easy-adsense.php"><em>Easy AdSense</em></a> Translation Interface</strong>
263
- </p>
264
- <?php
265
-
266
- $domain = 'easy-adsenser' ;
267
- $version = (float)get_bloginfo('version') ;
268
- if ($version < 2.80) {
269
- echo '<div class="error"><p><b>Error</b>:' .
270
- 'Sorry, Easy Translator works only on WP2.8+</p></div>' ;
271
- return ;
272
- }
273
-
274
- if (isset($_SESSION['ezAds-POs'])){
275
- $POs = $_SESSION['ezAds-POs'];
276
- }
277
- else {
278
- global $l10n;
279
- $mo = array($l10n[$domain]->entries) ;
280
-
281
- $s = $this->getFileContents() ;
282
- $parent = dirname(__FILE__) . '/..' ;
283
- $s .= $this->getFileContents($parent) ;
284
-
285
- $POs = array() ;
286
-
287
- $this->getTranPOs($s, $mo[0], $domain, $POs) ;
288
- }
289
-
290
- if ($made) {
291
- $pot = htmlspecialchars($this->mkPot($POs, $_POST), ENT_QUOTES) ;
292
- $this->updatePot($POs, $_POST) ;
293
- $_SESSION['ezAds-POs'] = $POs ;
294
- }
295
- else {
296
- global $current_user;
297
- get_currentuserinfo();
298
- $pot = '' ;
299
- $pot .= '<div style="width: 15%; float:left">Your Name:</div>' .
300
- '<input type="text" style="width: 30%" name="name" value="' .
301
- $current_user->user_firstname . " " .
302
- $current_user->user_lastname . '" /><br />' . "\n" ;
303
- $pot .= '<div style="width: 15%; float:left">Your Email:</div>' .
304
- '<input type="text" style="width: 30%" name="email" value="' .
305
- $current_user->user_email . '" /><br />' . "\n" ;
306
- $pot .= '<div style="width: 15%; float:left">Your Website:</div>' .
307
- '<input type="text" style="width: 30%" name="blog" value="' .
308
- get_bloginfo('blog') . '" />' . "\n<br />" ;
309
- $pot .= '<div style="width: 15%; float:left">Your URL:</div>' .
310
- '<input type="text" style="width: 30%" name="url" value="' .
311
- get_bloginfo('url') . '" />' . "\n<br />" ;
312
- $pot .= '<div style="width: 15%; float:left">Your Locale:</div>' .
313
- '<input type="text" style="width: 30%" name="locale" value="' .
314
- $locale . '" /><br />' . "\n" ;
315
- $pot .= '<div style="width: 15%; float:left">Your Language:</div>' .
316
- '<input type="text" style="width: 30%" name="lang" value="' .
317
- get_bloginfo('language') . '" /><br />' . "\n" ;
318
- $pot .= '<div style="width: 15%; float:left">Character Set:</div>' .
319
- '<input type="text" style="width: 30%" name="charset" value="' .
320
- get_bloginfo('charset') . '" />' . "\n<br /><br />" ;
321
-
322
- $pot .= '<div style="width:800px;padding:10px;padding-top:25px"></div>' ;
323
- $pot .= '<div style="width:38%px;paddling:10px;padding-left:100px;float:left">' .
324
- '<b>English (en_US)</b></div>' ;
325
- $pot .= '<div style="width:38%;paddling:10px;padding-left:80px;float:right">' .
326
- '<b>Your Language (' . $locale . ')</b></div>' ;
327
- $pot .= '<div style="width:100%;padding:15px"></div>' ;
328
-
329
- foreach ($POs as $n => $po) {
330
- if (!is_object ($po) && gettype ($po) == 'object')
331
- $po = unserialize (serialize ($po)); // need this only on Chrome!!
332
- $pot .= $po->textId() . "\n" . $po->textStr() . "\n\n" ;
333
- }
334
- }
335
- $makeStr =
336
- '<div class="submit">
337
- <input type="submit" name="ezAds-make" value="Display &amp; Save POT File" title="Make a POT file with the translation strings below and display it" />&nbsp;
338
- <input type="submit" name="ezAds-clear" value="Reload Translation" title="Discard your changes and reload the translation" onClick="return confirm(\'Are you sure you want to discard your changes?\');" />&nbsp;
339
- </div>' . $this->status . $this->error ;
340
- $saveStr =
341
- '<div class="submit">
342
- <input type="submit" name="ezAds-savePot" value="Save POT file" title="Saves the strings shown below to your PC as a POT file" />&nbsp;
343
- <input type="submit" name="ezAds-mailPot" value="Mail POT file" title="Email the translation to the plugin autor" onClick="return confirm(\'Are you sure you want to email the author?\');" />&nbsp;
344
- <input type="submit" name="ezAds-editMore" value="Edit More" title="If you are not happy with the strings, edit it further"/>
345
- </div>' . $this->status . $this->error ;
346
- if ($made) {
347
- ?>
348
- <div style="background-color:#eef;border: solid 1px #005;padding:5px">
349
- If you are happy with the POT file as below, please save it or email it to the author.
350
- If not, edit it further.
351
- </div>
352
- <?php
353
- echo '<input type="hidden" name="potFile" value="' .
354
- $domain . "-" . $locale . '.po" />' ;
355
- echo '<input type="hidden" name="potStr" value="' . $pot . '" />' ;
356
- echo $saveStr ;
357
- echo "\n" . '<pre>' . $pot . '</pre>' ;
358
- }
359
- else
360
- {
361
- ?>
362
- <div style="background-color:#eef;border: solid 1px #005;padding:5px">
363
- Add or modify translation for your language <b><?php echo $locale ?></b>.
364
- <br />
365
- Enter the translated strings in the text boxes below and hit the "Display POT File" button.
366
- </div>
367
- <?php
368
- echo $makeStr ;
369
- echo $pot ;
370
- }
371
- } // End function printAdminPage()
372
- }
373
- } // End Class ezTran
374
-
375
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/{es_ES/easy-adsenser.mo → es_ES.mo} RENAMED
File without changes
lang/{es_ES/easy-adsenser.po → es_ES.po} RENAMED
File without changes
lang/{fa_IR/easy-adsenser.mo → fa_IR.mo} RENAMED
File without changes
lang/{fa_IR/easy-adsenser.po → fa_IR.po} RENAMED
File without changes
lang/{fr_FR/easy-adsenser.mo → fr_FR.mo} RENAMED
File without changes
lang/{fr_FR/easy-adsenser.po → fr_FR.po} RENAMED
File without changes
lang/{id_ID/easy-adsenser.mo → id_ID.mo} RENAMED
File without changes
lang/{id_ID/easy-adsenser.po → id_ID.po} RENAMED
File without changes
lang/{it_IT/easy-adsenser.mo → it_IT.mo} RENAMED
File without changes
lang/{it_IT/easy-adsenser.po → it_IT.po} RENAMED
File without changes
lang/{ko_KR/easy-adsenser.mo → ko_KR.mo} RENAMED
File without changes
lang/{ko_KR/easy-adsenser.po → ko_KR.po} RENAMED
File without changes
lang/{nb_NO/easy-adsenser.mo → nb_NO.mo} RENAMED
File without changes
lang/{nb_NO/easy-adsenser.po → nb_NO.po} RENAMED
File without changes
lang/{nl_NL/easy-adsenser.mo → nl_NL.mo} RENAMED
File without changes
lang/{nl_NL/easy-adsenser.po → nl_NL.po} RENAMED
File without changes
lang/{pl_PL/easy-adsenser.mo → pl_PL.mo} RENAMED
File without changes
lang/{pl_PL/easy-adsenser.po → pl_PL.po} RENAMED
File without changes
lang/{pt_BR/easy-adsenser.mo → pt_BR.mo} RENAMED
File without changes
lang/{pt_BR/easy-adsenser.po → pt_BR.po} RENAMED
File without changes
lang/{pt_PT/easy-adsenser.mo → pt_PT.mo} RENAMED
File without changes
lang/{pt_PT/easy-adsenser.po → pt_PT.po} RENAMED
File without changes
lang/{ro_RO/easy-adsenser.mo → ro_RO.mo} RENAMED
File without changes
lang/{ro_RO/easy-adsenser.po → ro_RO.po} RENAMED
File without changes
lang/{ru_RU/easy-adsenser.mo → ru_RU.mo} RENAMED
File without changes
lang/{ru_RU/easy-adsenser.po → ru_RU.po} RENAMED
File without changes
lang/{th_TH/easy-adsenser.mo → th_TH.mo} RENAMED
File without changes
lang/{th_TH/easy-adsenser.po → th_TH.po} RENAMED
File without changes
lang/{tr_TR/easy-adsenser.mo → tr_TR.mo} RENAMED
File without changes
lang/{tr_TR/easy-adsenser.po → tr_TR.po} RENAMED
File without changes
lang/{uk_UE/easy-adsenser.mo → uk_UE.mo} RENAMED
File without changes
lang/{uk_UE/easy-adsenser.po → uk_UE.po} RENAMED
File without changes
lang/{zh_CN/easy-adsenser.mo → zh_CN.mo} RENAMED
File without changes
lang/{zh_CN/easy-adsenser.po → zh_CN.po} RENAMED
File without changes
lang/{zh_TW/easy-adsenser.mo → zh_TW.mo} RENAMED
File without changes
lang/{zh_TW/easy-adsenser.po → zh_TW.po} RENAMED
File without changes
myPlugins.php CHANGED
@@ -1,5 +1,22 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  $myPlugins = array();
4
 
5
  $needPHP5 = ' <br /> <span style="font-color:#c00;">Note that this plugin requires PHPv5.0+. Please use the Lite version first to ensure that it works before buying the Pro version. If it does not work on your web host, consider the amazing <a href="http://buy.thulasidas.com/easy-adsense/" title="The most popular plugin to insert AdSense on your blog"><em><strong>Easy AdSense Pro</strong></em></a> for all your advertising needs. It can insert non-AdSense blocks as well.</span>';
@@ -117,13 +134,13 @@ $myPlugins['easy-latex'] = array('value' => 'Easy WP LaTeX',
117
  'pro' => 'The Lite version of the plugin is fully functional. The Pro version gives you options to cache the equation images so that your pages load faster.');
118
 
119
  $myPlugins['easy-translator'] = array('value' => 'Easy Translator',
120
- 'price' => '1.95',
121
  'share' => false,
122
  'long' => true,
123
  'blurb' => '<em><strong>Easy Translator</strong></em> ',
124
- 'desc' => 'is a plugin translation tool for authors and translators. (Not a blog page translator!)',
125
- 'title' => '<em><strong>Easy Translator</strong></em> is a plugin to translate other plugins. It picks up translatable strings (in _[_e]() functions) and presents them and their existing translations (from the MO object of the current text-domain, if loaded) in a user editable form. It can generate a valid PO file that can be emailed to the plugin author directly from the its window, streamlining your work.',
126
- 'pro' => 'The Lite version of Easy Translator is fully functional. The Pro version adds the ability to email the generated PO file directly, without having to save it and attach it to a mail message.');
127
 
128
  $myPlugins['unreal-universe'] = array('value' => 'The Unreal Universe - eBook',
129
  'url' => 'http://www.theunrealuniverse.com',
@@ -181,84 +198,4 @@ $myPlugins['ezpaypal'] = array('value' => 'ezPayPal',
181
  <li><em>Upgradeable Products</em>: You can define products that are upgradeable. For instance, you can sell a short eBook at an introductory price. If your buyer likes it, he has the option of buying the full book by paying the difference.</li>
182
  ');
183
 
184
- if (!function_exists('renderInvite')) {
185
-
186
- function renderInvite($plg, $plgName) {
187
- $plgLongName = $plg['value'];
188
- $plgPrice = $plg['price'];
189
- $benefits = $plg['benefits'];
190
- $yesTip = sprintf(__('Buy %s Pro for $%s. PayPal payment. Instant download.', 'easy-adsenser'), $plgLongName, $plgPrice);
191
- $yesTitle = __('Get the Pro version now!', 'easy-adsenser');
192
- $noTip = __('Continue using the Lite version, and hide this message. After clicking this button, please remember to save your options to hide this box for good.', 'easy-adsenser');
193
- $noTitle = __('Stay Lite', 'easy-adsenser');
194
- if (empty($benefits)) {
195
- return;
196
- }
197
- echo <<<ENDINVITE
198
- <input type="hidden" id="killInvites" name="killInvites" value="" />
199
- <div class="updated" id="tnc">
200
- <p><h3>Want More Features? <a href="#" onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" onclick = "buttonwhich('Yes')">Go Pro!</a></h3>
201
- The Pro version of this plugin gives you more features and benefits. For instance,
202
- <ol>
203
- $benefits
204
- </ol>
205
- And much more. New features and bug fixes will first appear in the Pro version before being ported to this freely distributed Lite edition. <br />
206
- <input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "Go Pro!" onclick = "buttonwhich('Yes')" />
207
- <input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "No thanks" onclick = "buttonwhich('No')" />
208
- <script type = "text/javascript">
209
- function hideInvite() {
210
- document.getElementById("tnc").style.display = 'none';
211
- }
212
- function buttonwhich(message) {
213
- document.getElementById("ybutton").style.display = 'none';
214
- document.getElementById("nbutton").disabled = 'true';
215
- document.getElementById("killInvites").value = 'true' ;
216
- setTimeout('hideInvite()', 5000);
217
- if (message == 'Yes') popupwindow('http://buy.thulasidas.com/$plgName','Get {$plg['value']}', 1024, 768) ;
218
- if (message == 'No') document.getElementById("nbutton").value = 'Thank you for using $plgLongName! Please save options to hide this box forever';
219
- }
220
- </script>
221
- </div>
222
- ENDINVITE;
223
- }
224
-
225
- }
226
- if (!function_exists('renderRating')) {
227
-
228
- function renderRating($plg, $plgDir, $killable = true) {
229
- $plgCTime = filemtime($plgDir);
230
- $plgLongName = $plg['value'];
231
- $hideTip = __('Click the link to hide this box. After clicking this link, please remember to save your options to hide this box for good.', 'easy-adsenser');
232
- if (time() > $plgCTime + (60 * 60 * 24 * 30)) {
233
- $msg = "You've installed this plugin over a month ago.";
234
- }
235
- else {
236
- $msg = "You will find it feature-rich and robust.";
237
- }
238
- $plgKey = basename($plgDir);
239
- $display = '';
240
- if (!$killable) {
241
- $display = "style='display:none'";
242
- }
243
- echo <<<ENDRATING
244
- <div class='updated' id='rating'>
245
- <p>Thanks for using <i><b>$plgLongName</b></i>! $msg <br />
246
- If you are satisfied with how well it works, why not <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','Rate it', 1024, 768);return false;">rate it</a>
247
- and <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','Rate it', 1024, 768);return false;">recommend it</a> to others? :-)
248
- <small style='font-weight:normal;'><a id='hideRating' $display href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLICKCLOSE, true, TITLE, 'Hide this Box')" onmouseout="UnTip()" onclick = "hideme()">
249
- Don't show this anymore</a></small></p></div>
250
- <input type="hidden" id="killRating" name="killRating" value="" />
251
- <script type = "text/javascript">
252
- function hideRating() {
253
- document.getElementById("rating").style.display = 'none';
254
- }
255
- function hideme() {
256
- document.getElementById("killRating").value = 'true' ;
257
- document.getElementById("hideRating").innerHTML = 'Please hit the "Save Changes" button below to hide this box forever';
258
- setTimeout('hideRating()', 4000);
259
- }
260
- </script>
261
- ENDRATING;
262
- }
263
-
264
- }
1
  <?php
2
 
3
+ /*
4
+ Copyright (C) 2008 www.ads-ez.com
5
+
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License as
8
+ published by the Free Software Foundation; either version 3 of the
9
+ License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful, but
12
+ WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
20
  $myPlugins = array();
21
 
22
  $needPHP5 = ' <br /> <span style="font-color:#c00;">Note that this plugin requires PHPv5.0+. Please use the Lite version first to ensure that it works before buying the Pro version. If it does not work on your web host, consider the amazing <a href="http://buy.thulasidas.com/easy-adsense/" title="The most popular plugin to insert AdSense on your blog"><em><strong>Easy AdSense Pro</strong></em></a> for all your advertising needs. It can insert non-AdSense blocks as well.</span>';
134
  'pro' => 'The Lite version of the plugin is fully functional. The Pro version gives you options to cache the equation images so that your pages load faster.');
135
 
136
  $myPlugins['easy-translator'] = array('value' => 'Easy Translator',
137
+ 'price' => '3.95',
138
  'share' => false,
139
  'long' => true,
140
  'blurb' => '<em><strong>Easy Translator</strong></em> ',
141
+ 'desc' => 'is a blog post translator and a plugin translation tool for authors and translators.',
142
+ 'title' => '<em><strong>Easy Translator</strong></em> is a plugin to translate other plugins as well as blog posts. For blog posts and pages, it provides a customizable widget to enable machine translation (from Google or Microsoft). For plugins, it picks up translatable strings (in _[_e]() functions) and presents them and their existing translations (from the MO object of the current text-domain, if loaded) in a user editable form. It can generate a valid PO file that can be emailed to the plugin author directly from the its window, streamlining your work.',
143
+ 'pro' => 'The Lite version of Easy Translator is fully functional. The Pro version adds machine translation help from Google, the ability to email the generated PO file directly, without having to save it and attach it to a mail message, and color pickers to match the widget colors to your blog theme.');
144
 
145
  $myPlugins['unreal-universe'] = array('value' => 'The Unreal Universe - eBook',
146
  'url' => 'http://www.theunrealuniverse.com',
198
  <li><em>Upgradeable Products</em>: You can define products that are upgradeable. For instance, you can sell a short eBook at an introductory price. If your buyer likes it, he has the option of buying the full book by paying the difference.</li>
199
  ');
200
 
201
+ $this->myPlugins = $myPlugins;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,8 @@ 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.8
7
- Stable tag: 6.51
 
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
 
@@ -39,15 +40,9 @@ Easy AdSense is the freely distributed version of a premium plugin. The [Pro ver
39
  5. Mobile support: Ability to suppress ads on mobile devices.
40
  6. Ability to show a configurable number of ads on Excerpts (which make up the home page in some themes).
41
 
42
- = New in this Release =
43
-
44
- Adding options to suppress ads on sticky front page or search pages.
45
-
46
  == Upgrade Notice ==
47
 
48
- = 6.51 =
49
-
50
- Adding options to suppress ads on sticky front page or search pages.
51
 
52
  == Screenshots ==
53
 
@@ -67,9 +62,23 @@ Although the Easy AdSense plugin is designed to handle Google AdSense efficientl
67
 
68
  == Frequently Asked Questions ==
69
 
70
- = Why do I get a "Plugin does not have valid header" error? =
 
 
 
 
 
 
 
 
71
 
72
- This seems to be a problem with some WordPress installations. I have never been able to reproduce this error on any of my installations. I have found [this on the web](http://webdesign.anmari.com/2312/activation-error-plugin-does-not-have-valid-header-still-activates/ "This may give you some ideas") though.
 
 
 
 
 
 
73
 
74
  = What are the different versions of the plugin? =
75
 
@@ -77,7 +86,7 @@ Easy AdSense is the freely distributed version of a premium plugin. The [Pro ver
77
 
78
  = How can I contact the plugin author if I need help? =
79
 
80
- This plugin uses a paid support model in order to manage the support load. Each [support ticket](http://support.thulasidas.com "Ask a support question") will be charged at $0.95 for the Lite version (and for the Pro version after a short free support period). The support ticket is valid for 48 hours, and further follow-up questions will call for a new support ticket.
81
 
82
  = I still don't get it. Porn and site block - that you already have during Asdense ad setup? =
83
 
@@ -115,12 +124,6 @@ Yes! Now, in V2.1+, you have more options (using [Custom Fields](http://codex.wo
115
 
116
  If you feel that the features of Easy AdSense are a bit too much, consider my lean and mean AdSense plugin [AdSense Now!](http://www.thulasidas.com/plugins/adsense-now/ "The simplest possible way to AdSense enable your blog")
117
 
118
- = I just activated the plugin. How come I don't see any ads in my blog? =
119
-
120
- Note that you have to generate your adsense code from Google, and paste the *entire* code in the text boxes, replacing the existing text. There are three main text boxes corresponding to three ad locations - Lead-in, Mid-text and Lead-out. If you don't want to use a particular location, please suppress it by selecting the appropriate option. Otherwise, the plugin will show a red box indicating where you ad would be shown.
121
-
122
- If you just created the new Google AdSense code, it may not be active yet. Google takes about ten minutes or so before serving ads. Please try again later.
123
-
124
  = I am having a difficult time getting the middle of post ads to show. They show in some posts, but not all of them. Any possible recommendations? =
125
 
126
  The middle ads are designed to show up only on long posts (of more than 20 paragraphs). Use the option to force the mid-text ads (in v1.82+) to override this length check.
@@ -131,6 +134,7 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
131
 
132
  == Change Log ==
133
 
 
134
  * V6.51: Adding options to suppress ads on sticky front page or search pages. [Jan 7, 2014]
135
  * V6.50: Compatibility checks for WordPress V3.8. Admin page updates [Dec 17, 2013]
136
  * V6.40: Compatibility checks for WordPress V3.7. Translation updates. [Nov 11, 2013]
4
  Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
5
  Requires at least: 2.6
6
  Tested up to: 3.8
7
+ Stable tag: 7.00
8
+ License: GPL2 or later
9
 
10
  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!
11
 
40
  5. Mobile support: Ability to suppress ads on mobile devices.
41
  6. Ability to show a configurable number of ads on Excerpts (which make up the home page in some themes).
42
 
 
 
 
 
43
  == Upgrade Notice ==
44
 
45
+ Major changes to the options data model and the translation interface. If you notice anything not working as expected, please leave a note.
 
 
46
 
47
  == Screenshots ==
48
 
62
 
63
  == Frequently Asked Questions ==
64
 
65
+ = I just activated the plugin. How come I don't see any ads in my blog? =
66
+
67
+ Note that you have to generate your adsense code from Google, and paste the *entire* code in the text boxes, replacing the existing text. There are three main text boxes corresponding to three ad locations - Lead-in, Mid-text and Lead-out. If you don't want to use a particular location, please suppress it by selecting the appropriate option. Otherwise, the plugin will show a red box indicating where you ad would be shown.
68
+
69
+ If you just created the new Google AdSense code, it may not be active yet. Google takes about ten minutes or so before serving ads. Please try again later.
70
+
71
+ = I activated the plugin, and I see a lot of red boxes on my blog posts your ads will be inserted here. How do I get rid of them? =
72
+
73
+ Easy AdSense shows the spots on your blog where the ads would be shown if you entered the ad code on its admin page by drawing a red box. This is meant to serve as a reminder for you to go to the admin page and enter the ad code. If you would like to suppress them, check the option "Suppress Placement Boxes" near the bottom of the admin page. The right thing to do, however, would be to enter your ad codes in the text boxes for each ad slot, or suppress the ad slot by selecting the corresponding "Show" option under the ad slot text box.
74
 
75
+ = The admin page is cluttered with links and information about the author. Any way to suppress them? =
76
+
77
+ Please check the option "Kill author links on the admin page" near the bottom of the admin page if you find the links and info annoying.
78
+
79
+ = I cannot figure out how to suppress a particular ad slot. Do I have to display all three ad slots all the time? =
80
+
81
+ Of course not. The option to suppress the ad slots is in the "Show" drop-down menu below the corresponding text boxes. The first option in the menu is to suppress the ad slot.
82
 
83
  = What are the different versions of the plugin? =
84
 
86
 
87
  = How can I contact the plugin author if I need help? =
88
 
89
+ This plugin uses a paid support model in order to manage the support load. Each [support ticket](http://support.thulasidas.com "Ask a support question") will be charged at $0.95 for the Lite version (and for the Pro version after a short free support period). The support ticket is valid for 72 hours, and further follow-up questions will call for a new support ticket.
90
 
91
  = I still don't get it. Porn and site block - that you already have during Asdense ad setup? =
92
 
124
 
125
  If you feel that the features of Easy AdSense are a bit too much, consider my lean and mean AdSense plugin [AdSense Now!](http://www.thulasidas.com/plugins/adsense-now/ "The simplest possible way to AdSense enable your blog")
126
 
 
 
 
 
 
 
127
  = I am having a difficult time getting the middle of post ads to show. They show in some posts, but not all of them. Any possible recommendations? =
128
 
129
  The middle ads are designed to show up only on long posts (of more than 20 paragraphs). Use the option to force the mid-text ads (in v1.82+) to override this length check.
134
 
135
  == Change Log ==
136
 
137
+ * V7.00: Major changes to the options data model and the translation interface. [Mar 21, 2014]
138
  * V6.51: Adding options to suppress ads on sticky front page or search pages. [Jan 7, 2014]
139
  * V6.50: Compatibility checks for WordPress V3.8. Admin page updates [Dec 17, 2013]
140
  * V6.40: Compatibility checks for WordPress V3.7. Translation updates. [Nov 11, 2013]
support.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- function ezPluginInfo() {
4
- $me = basename(dirname(__FILE__));
5
- $plugins = get_plugins();
6
- $ret = array('Version' => '', 'Info' => '');
7
- $break = '';
8
- foreach ($plugins as $k => $p) {
9
- $baseDir = dirname($k);
10
- if ($baseDir == $me) {
11
- $version = $p['Version'];
12
- if (!empty($_SERVER['HTTP_REFERER'])) {
13
- $referer = $_SERVER['HTTP_REFERER'];
14
- }
15
- else {
16
- $referer = 'Unknown';
17
- }
18
- $info = "$break{$p['Title']} V{$p['Version']} (Referer: $referer)";
19
- $ret[] = array('Version' => $version, 'Info' => $info);
20
- }
21
- }
22
- return $ret;
23
- }
24
-
25
- function renderSupport($name, $plg) {
26
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
27
- $value = $plg['value'];
28
- $url = 'http://www.thulasidas.com/plugins/' . $name . '#faq';
29
- $link = '<a href="' . $url . '" target="_blank">' . $value . '</a>';
30
- echo "&nbsp;<a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport for $value', 1024, 768);return false;\" title='";
31
- _e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-adsenser');
32
- echo "'><img src='$plugindir/ezsupport.png' class='alignright' alt='ezSupport Portal'/></a>";
33
- printf(__("If you need help with %s, please read the FAQ section on the $link page. It may answer all your questions.", 'easy-adsenser'), $value, $link);
34
- echo "<br style='line-height: 20px;'/>";
35
- _e("Or, if you still need help, you can raise a support ticket.", 'easy-adsenser');
36
- echo "&nbsp;<a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport for $value', 1024, 768);return false;\" title='";
37
- _e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-adsenser');
38
- echo "'>";
39
- _e("[Request Paid Support]", 'easy-adsenser');
40
- $info = ezPluginInfo();
41
- echo "</a>&nbsp;<small><em>[";
42
- _e('Using our ezSupport Ticket System.', 'easy-adsenser');
43
- echo "]</em></small>";
44
- echo "<small style='float:right'><em>[";
45
- printf(__('You are using %s (V%s)', 'easy-adsenser'), $value, $info[0]['Version']);
46
- echo "]</em></small>";
47
- $_SESSION['ezSupport'] = $info[0]['Info'];
48
- }
49
-
50
- function renderTranslator($plgName) {
51
- $locale = get_locale();
52
- if (strncmp($locale, "en", 2) == 0) {
53
- return;
54
- }
55
- if ($plgName == 'adsense-now' ||
56
- $plgName == 'easy-adsense' ||
57
- $plgName == 'easy-translator') {
58
- return;
59
- }
60
- echo '<div style="background-color:#ddd;padding:5px;border: solid 1px;margin:5px;">';
61
- echo "<script type='text/javascript'>
62
- <!--
63
- function hideTranslator(id, btn, translator) {
64
- var e = document.getElementById(id);
65
- var eBtn = document.getElementById(btn);
66
- e.style.display = 'none';
67
- eBtn.innerHTML = 'Show ' + translator;
68
- }
69
- function showTranslator(id, btn, translator) {
70
- var e = document.getElementById(id);
71
- var eBtn = document.getElementById(btn);
72
- e.style.display = 'block';
73
- eBtn.innerHTML = 'Hide ' + translator;
74
- }
75
- function toggleVisibility(id, btn, translator) {
76
- var e = document.getElementById(id);
77
- if (translator == 'Google') hideTranslator('MicrosoftTranslatorWidget', 'btnMS', 'Microsoft');
78
- if (translator == 'Microsoft') hideTranslator('GoogleTranslatorWidget', 'btnGG', 'Google');
79
- if(e.style.display == 'block') {
80
- hideTranslator(id, btn, translator);
81
- }
82
- else {
83
- showTranslator(id, btn, translator);
84
- }
85
- }
86
- //-->
87
- </script>";
88
- $ms = true;
89
- $google = true;
90
- if ($ms) {
91
- $msBtn = " <button id='btnMS' onclick=\"toggleVisibility('MicrosoftTranslatorWidget', 'btnMS', 'Microsoft');\">Show Microsoft</button>";
92
- $msLink = "<a target=_blank href='http://www.bing.com/translator'>Microsoft<sup>&reg;</sup></a> ";
93
- $msJS = "<div id='MicrosoftTranslatorWidget' style='margin-left:auto;margin-right:auto;display:none; width: 200px; min-height: 83px; border-color: #404040; background-color: #A0A0A0;'><noscript><a href='http://www.microsofttranslator.com/bv.aspx?a=http%3a%2f%2fwww.thulasidas.com%2fplugins%2f$plgName'>Translate this page</a><br />Powered by <a href='http://www.bing.com/translator'>Microsoft® Translator</a></noscript></div> <script type='text/javascript'> /* <![CDATA[ */ setTimeout(function() { var s = document.createElement('script'); s.type = 'text/javascript'; s.charset = 'UTF-8'; s.src = ((location && location.href && location.href.indexOf('https') == 0) ? 'https://ssl.microsofttranslator.com' : 'http://www.microsofttranslator.com' ) + '/ajax/v2/widget.aspx?mode=manual&from=en&layout=ts'; var p = document.getElementsByTagName('head')[0] || document.documentElement; p.insertBefore(s, p.firstChild); }, 0); /* ]]> */ </script>";
94
- }
95
- else {
96
- $msBtn = $msJs = $msLink = '';
97
- }
98
- if ($google) {
99
- $ggBtn = " <button id='btnGG' onclick=\"toggleVisibility('GoogleTranslatorWidget', 'btnGG', 'Google');\">Show Google</button>";
100
- $ggLink = "<a target=_blank href='https://translate.google.com/'>Google<sup>&reg;</sup></a>";
101
- $ggJS = "<div id='GoogleTranslatorWidget' style='text-align:center;display:none;'><div id='google_translate_element'></div><script type='text/javascript'>
102
- function googleTranslateElementInit() {
103
- new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
104
- }
105
- </script><script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script></div>";
106
- }
107
- else {
108
- $ggBtn = $ggJS = $ggLink = '';
109
- }
110
- if ($google && $ms) {
111
- $or = "or";
112
- }
113
- echo "See this page in your language (<code>$locale</code>) using machine translation. $ggLink $or $msLink Translator.";
114
- echo $ggBtn . $msBtn . $ggJS . $msJS;
115
- echo '</div>';
116
- }
117
-
118
- renderTranslator($plgName);
119
-
120
- renderSupport($plgName, $myPlugins[$plgName]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tail-text.php CHANGED
@@ -1,166 +1,76 @@
1
  <?php
2
  /*
3
- Copyright (C) 2008 www.thulasidas.com
4
 
5
- This file is part of the programs "Easy AdSense", "AdSense Now!",
6
- "Theme Tweaker", "Easy LaTeX", "More Money" and "Easy Translator".
 
 
7
 
8
- These programs are free software; you can redistribute them and/or
9
- modify it under the terms of the GNU General Public License as
10
- published by the Free Software Foundation; either version 3 of the
11
- License, or (at your option) any later version.
12
-
13
- These programs are distributed in the hope that they will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
  General Public License for more details.
17
 
18
  You should have received a copy of the GNU General Public License
19
- along with the programs. If not, see <http://www.gnu.org/licenses/>.
20
  */
21
 
22
- function makeTextWithTooltip($text, $tip, $title = '', $width = '') {
23
- if (!empty($title)) {
24
- $titleText = "TITLE, '$title',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true,";
25
- }
26
- if (!empty($width)) {
27
- $widthText = "WIDTH, $width,";
28
- }
29
- $return = "<span style='text-decoration:none' " .
30
- "onmouseover=\"Tip('" . htmlspecialchars($tip) . "', " .
31
- "$widthText $titleText FIX, [this, 5, 5])\" " .
32
- "onmouseout=\"UnTip()\">$text</span>";
33
- return $return;
34
- }
35
-
36
- function makeTextWithTooltipTag($plg, $text, $tip, $title = '', $width = '') {
37
- if (!empty($title)) {
38
- $titleText = "TITLE, '$title',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true,";
39
- }
40
- if (!empty($width)) {
41
- $widthText = "WIDTH, $width,";
42
- }
43
- $return = "<span style='text-decoration:none' " .
44
- "onmouseover=\"TagToTip('" . $plg . "', " .
45
- "$widthText $titleText FIX, [this, 5, 5])\" " .
46
- "onmouseout=\"UnTip()\">$text</span>";
47
- return $return;
48
- }
49
-
50
- function renderPlg($name, $plg) {
51
- if (!empty($plg['hide']) && $plg['hide']) {
52
- return;
53
- }
54
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
55
- if (!empty($plg['kind']) && $plg['kind'] != 'plugin') {
56
- return;
57
- }
58
- $value = '<em><strong>' . $plg['value'] . '</strong></em>';
59
- $desc = $plg['desc'];
60
- $title = $plg['title'];
61
- $url = 'http://www.thulasidas.com/plugins/' . $name;
62
- $link = '<b><a href="' . $url . '" target="_blank">' . $value . '</a></b>&nbsp; ';
63
- $text = $link . $desc;
64
- $price = $plg['price'];
65
- $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\"";
66
- $moreInfo = "&nbsp;&nbsp;<a href='http://www.thulasidas.com/plugins/$name' title='More info about $value at Unreal Blog'>More Info</a> ";
67
- $liteVersion = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/lite/$name.zip' title='Download the Lite version of $value'>Get Lite Version</a> ";
68
- $proVersion = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of $value for \$$price' $onclick>Get Pro Version</a><br />";
69
- $why = "<a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of the $name plugin' $onclick><img src='$plugindir/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright' /></a>
70
- <br />" . $plg['pro'];
71
- echo "<li>" . makeTextWithTooltip($text, $title, $value, 350) .
72
- "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
73
- makeTextWithTooltip($moreInfo, "Read more about $value at its own page.<br />" . $title, "More Information about $value", 300) .
74
- makeTextWithTooltip($liteVersion, $title, "Download $value - the Lite version", 300) .
75
- makeTextWithTooltipTag($name, $proVersion, $why, "Get $value Pro!", 300) .
76
- "<span id=$name> $why </span>" .
77
- "</li>\n";
78
- }
79
-
80
- function renderBook($name, $plg) {
81
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
82
- if (empty($plg['kind']) || $plg['kind'] != 'book') {
83
- return;
84
- }
85
- $value = '<em><strong>' . $plg['value'] . '</strong></em>';
86
- $desc = $plg['desc'];
87
- $title = $plg['title'];
88
- $url = $plg['url'];
89
- $link = '<b><a href="' . $url . '" target="_blank">' . $value . '</a></b>&nbsp; ';
90
- $text = $link . $desc;
91
- $price = $plg['price'];
92
- $onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get {$plg['value']}', 1024, 768);return false;\"";
93
- $moreInfo = "&nbsp;&nbsp; <a href='$url' title='More info about $value' target=_blank>More Info</a> ";
94
- $amazon = $plg['amazon'];
95
- if (!empty($amazon)) {
96
- $buyAmazon = "&nbsp;&nbsp; <a href='$amazon' title='Get $value from Amazon.com' target=_blank>Get it at Amazon</a> ";
97
- }
98
- $buyNow = "&nbsp;&nbsp; <a href='http://buy.thulasidas.com/$name' title='Buy and download $value for \$$price' target=_blank $onclick>Buy and Download now!</a><br />";
99
- $why = "<a href='http://buy.thulasidas.com/$name' title='$name' $onclick><img src='$plugindir/ezpaypal.png' alt='ezPayPal -- Instant PayPal Shop.' class='alignright' /></a>
100
- <br />" . $title . $desc . " $value costs only \$$price -- direct from the author.";
101
- echo "<li>" . makeTextWithTooltip($text, $title, $value, 350) .
102
- "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" .
103
- makeTextWithTooltip($moreInfo, "Read all about $value at its own site.<br />", "$value", 300) .
104
- makeTextWithTooltip($buyAmazon, $title, "Buy $value from Amazon", 350) .
105
- makeTextWithTooltipTag("$name-book", $buyNow, $why, "Buy $value!", 300) .
106
- "<span id=$name-book> $why </span>" .
107
- "</li>\n";
108
- }
109
- ?>
110
 
111
- <table class="form-table" >
112
- <tr>
113
- <td>
114
- <ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
115
- <li>
116
  <?php _e('Check out my other plugin and PHP efforts:', 'easy-adsenser'); ?>
117
- <script type = "text/javascript">
118
- function popupwindow(url, title, w, h) {
119
- var left = (screen.width / 2) - (w / 2);
120
- var top = (screen.height / 2) - (h / 2);
121
- return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
122
- }
123
- </script>
124
- <ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
125
-
126
- <?php
127
- $myPluginsU = array_unique($myPlugins, SORT_REGULAR);
128
- unset($myPluginsU[$plgName]);
129
- foreach ($myPluginsU as $k => $p) {
130
- if (isset($p['hide']) || isset($p['kind'])) {
131
- unset($myPluginsU[$k]);
132
- }
133
- }
134
- $keys = array_rand($myPluginsU, 3);
135
- foreach ($keys as $name) {
136
- if ($name != $plgName) {
137
- renderPlg($name, $myPluginsU[$name]);
138
- }
139
- }
140
- ?>
141
-
142
- </ul>
143
- </li>
144
-
145
- <li>
146
- <?php _e('My Books -- on Physics, Philosophy, making Money etc:', 'easy-adsenser'); ?>
147
-
148
- <ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
149
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  <?php
151
- foreach ($myPlugins as $name => $plg) {
152
- renderBook($name, $plg);
153
- }
154
- ?>
155
-
156
- </ul>
157
- </li>
158
-
159
- </ul>
160
-
161
- </td>
162
- </tr>
163
-
164
- <?php
165
- echo '</table>';
166
-
1
  <?php
2
  /*
3
+ Copyright (C) 2008 www.ads-ez.com
4
 
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 3 of the License, or (at
8
+ your option) any later version.
9
 
10
+ This program is distributed in the hope that it will be useful, but
11
+ WITHOUT ANY WARRANTY; without even the implied warranty of
 
 
 
 
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
  General Public License for more details.
14
 
15
  You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
  */
18
 
19
+ if (!$this->options['kill_author']) {
20
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
+ <table class="form-table" >
23
+ <tr>
24
+ <td>
25
+ <ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
26
+ <li>
27
  <?php _e('Check out my other plugin and PHP efforts:', 'easy-adsenser'); ?>
28
+ <script type = "text/javascript">
29
+ function popupwindow(url, title, w, h) {
30
+ var left = (screen.width / 2) - (w / 2);
31
+ var top = (screen.height / 2) - (h / 2);
32
+ return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
33
+ }
34
+ </script>
35
+ <ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
36
+
37
+ <?php
38
+ $myPluginsU = array_unique($this->myPlugins, SORT_REGULAR);
39
+ unset($myPluginsU[$this->slug]);
40
+ foreach ($myPluginsU as $k => $p) {
41
+ if (isset($p['hide']) || isset($p['kind'])) {
42
+ unset($myPluginsU[$k]);
43
+ }
44
+ }
45
+ $keys = array_rand($myPluginsU, 3);
46
+ foreach ($keys as $name) {
47
+ if ($name != $this->slug) {
48
+ $ez->renderPlg($name, $myPluginsU[$name]);
49
+ }
50
+ }
51
+ ?>
52
+
53
+ </ul>
54
+ </li>
55
+
56
+ <li>
57
+ <?php _e('My Books -- on Physics, Philosophy, making Money etc:', 'easy-adsenser'); ?>
58
+
59
+ <ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
60
+
61
+ <?php
62
+ foreach ($this->myPlugins as $name => $plg) {
63
+ $ez->renderBook($name, $plg);
64
+ }
65
+ ?>
66
+
67
+ </ul>
68
+ </li>
69
+
70
+ </ul>
71
+
72
+ </td>
73
+ </tr>
74
+ </table>
75
  <?php
76
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
why-pro.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- function renderWhyPro($name, $plg) {
4
- $plugindir = get_option('siteurl') . '/' . PLUGINDIR . '/' . basename(dirname(__FILE__));
5
- $value = $plg['value'];
6
- $toolTip = $plg['title'];
7
- $price = $plg['price'];
8
- $moreInfo = " &nbsp; &nbsp; <a href='http://www.thulasidas.com/plugins/$name' title='More info about $value'> More Info </a>&nbsp; <a href='http://buy.thulasidas.com/$name' onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get $value', 1024, 768);return false;\" title='Buy the Pro version of $value for \$$price'>Get Pro Version</a>";
9
- $toolTip .= addslashes('<br />' . $moreInfo);
10
- $why = addslashes($plg['pro']);
11
- echo "<b>Get Pro Version!</b>
12
- <a href='http://buy.thulasidas.com/$name' title='Buy the Pro version of the $value plugin for \$$price'><img src='$plugindir/ezpaypal.png' alt='ezPayPal -- Your Instant PayPal Shop.' class='alignright' onclick=\"popupwindow('http://buy.thulasidas.com/$name','Get $value', 1024, 768);return false;\"/></a>
13
- <br />
14
- You are using the Lite version of $value, which is available in two versions: <b>Lite</b> and <b>Pro</b>.
15
- <ul><li>
16
- $moreInfo
17
- <li>$why</li>
18
- </ul>";
19
- }
20
-
21
- renderWhyPro($plgName, $myPlugins[$plgName]);