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 | ![]() |
Version | 7.00 |
Comparing to | |
See all releases |
Code changes from version 6.51 to 7.00
- EzAdmin.php +480 -0
- EzOptions.php +598 -0
- EzTran.php +650 -0
- admin.php +316 -447
- defaults.php +0 -2
- easy-adsense-lite.php +1002 -641
- english.gif +0 -0
- head-text.php +10 -170
- lang/{ar_MA/easy-adsenser.mo → ar_MA.mo} +0 -0
- lang/{ar_MA/easy-adsenser.po → ar_MA.po} +0 -0
- lang/{by_BY/easy-adsenser.mo → by_BY.mo} +0 -0
- lang/{by_BY/easy-adsenser.po → by_BY.po} +0 -0
- lang/{da_DK/easy-adsenser.mo → da_DK.mo} +0 -0
- lang/{da_DK/easy-adsenser.po → da_DK.po} +0 -0
- lang/{de_DE/easy-adsenser.mo → de_DE.mo} +0 -0
- lang/{de_DE/easy-adsenser.po → de_DE.po} +0 -0
- lang/easy-translator.php +0 -375
- lang/{es_ES/easy-adsenser.mo → es_ES.mo} +0 -0
- lang/{es_ES/easy-adsenser.po → es_ES.po} +0 -0
- lang/{fa_IR/easy-adsenser.mo → fa_IR.mo} +0 -0
- lang/{fa_IR/easy-adsenser.po → fa_IR.po} +0 -0
- lang/{fr_FR/easy-adsenser.mo → fr_FR.mo} +0 -0
- lang/{fr_FR/easy-adsenser.po → fr_FR.po} +0 -0
- lang/{id_ID/easy-adsenser.mo → id_ID.mo} +0 -0
- lang/{id_ID/easy-adsenser.po → id_ID.po} +0 -0
- lang/{it_IT/easy-adsenser.mo → it_IT.mo} +0 -0
- lang/{it_IT/easy-adsenser.po → it_IT.po} +0 -0
- lang/{ko_KR/easy-adsenser.mo → ko_KR.mo} +0 -0
- lang/{ko_KR/easy-adsenser.po → ko_KR.po} +0 -0
- lang/{nb_NO/easy-adsenser.mo → nb_NO.mo} +0 -0
- lang/{nb_NO/easy-adsenser.po → nb_NO.po} +0 -0
- lang/{nl_NL/easy-adsenser.mo → nl_NL.mo} +0 -0
- lang/{nl_NL/easy-adsenser.po → nl_NL.po} +0 -0
- lang/{pl_PL/easy-adsenser.mo → pl_PL.mo} +0 -0
- lang/{pl_PL/easy-adsenser.po → pl_PL.po} +0 -0
- lang/{pt_BR/easy-adsenser.mo → pt_BR.mo} +0 -0
- lang/{pt_BR/easy-adsenser.po → pt_BR.po} +0 -0
- lang/{pt_PT/easy-adsenser.mo → pt_PT.mo} +0 -0
- lang/{pt_PT/easy-adsenser.po → pt_PT.po} +0 -0
- lang/{ro_RO/easy-adsenser.mo → ro_RO.mo} +0 -0
- lang/{ro_RO/easy-adsenser.po → ro_RO.po} +0 -0
- lang/{ru_RU/easy-adsenser.mo → ru_RU.mo} +0 -0
- lang/{ru_RU/easy-adsenser.po → ru_RU.po} +0 -0
- lang/{th_TH/easy-adsenser.mo → th_TH.mo} +0 -0
- lang/{th_TH/easy-adsenser.po → th_TH.po} +0 -0
- lang/{tr_TR/easy-adsenser.mo → tr_TR.mo} +0 -0
- lang/{tr_TR/easy-adsenser.po → tr_TR.po} +0 -0
- lang/{uk_UE/easy-adsenser.mo → uk_UE.mo} +0 -0
- lang/{uk_UE/easy-adsenser.po → uk_UE.po} +0 -0
- lang/{zh_CN/easy-adsenser.mo → zh_CN.mo} +0 -0
- lang/{zh_CN/easy-adsenser.po → zh_CN.po} +0 -0
- lang/{zh_TW/easy-adsenser.mo → zh_TW.mo} +0 -0
- lang/{zh_TW/easy-adsenser.po → zh_TW.po} +0 -0
- myPlugins.php +22 -85
- readme.txt +21 -17
- support.php +0 -120
- tail-text.php +63 -153
- why-pro.php +0 -21
EzAdmin.php
ADDED
@@ -0,0 +1,480 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 = " <a href='http://buy.thulasidas.com/lite/$slug.zip' title='Download the Lite version of $value'>Lite Version </a> <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 <em>The Unreal Universe</em>',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/unreal' target='_blank'>Physics & Philosophy</a></b></span> or ";
|
217 |
+
$supportText .= "<span style=\"text-decoration:underline\" onmouseover=\"TagToTip('pqd', WIDTH, 205, TITLE, '<em>Principles of Quant. Devel.</em>',STICKY, 1, CLOSEBTN, true, FIX, [this, 5, 2])\"><b><a href='http://buy.thulasidas.com/pqd' target='_blank'>Money & 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 <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;"> — 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> ';
|
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 = " <a href='http://www.thulasidas.com/plugins/$slug' title='More info about $value at Unreal Blog'>More Info</a> ";
|
351 |
+
$liteVersion = " <a href='http://buy.thulasidas.com/lite/$slug.zip' title='Download the Lite version of $value'>Get Lite Version</a> ";
|
352 |
+
$proVersion = " <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 /> " .
|
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> ';
|
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 = " <a href='$url' title='More info about $value' target=_blank>More Info</a> ";
|
381 |
+
$amazon = $plg['amazon'];
|
382 |
+
if (!empty($amazon)) {
|
383 |
+
$buyAmazon = " <a href='$amazon' title='Get $value from Amazon.com' target=_blank>Get it at Amazon</a> ";
|
384 |
+
}
|
385 |
+
$buyNow = " <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 /> " .
|
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 " <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 " <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> <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 = " <a href='$buyURL' title='More info about $value'> More Info </a> <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> 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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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 " <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->ez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