Version Description
Auto migrating options to current version if needed.
Download this release
Release Info
Developer | manojtd |
Plugin | Easy Plugin for AdSense |
Version | 7.12 |
Comparing to | |
See all releases |
Code changes from version 7.10 to 7.12
- EzAdmin.php +110 -45
- EzOptions.php +7 -2
- EzTran.php +144 -85
- admin.php +0 -1
- easy-adsense-lite.php +23 -28
- readme.txt +4 -2
- tail-text.php +2 -2
EzAdmin.php
CHANGED
@@ -50,24 +50,39 @@ if (!class_exists('EzAdmin')) {
|
|
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-
|
54 |
-
$yesTitle = __('Get the Pro version now!', 'easy-
|
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-
|
56 |
-
$noTitle = __('Stay Lite', 'easy-
|
|
|
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
|
64 |
-
|
65 |
<ol>
|
66 |
$benefits
|
67 |
</ol>
|
68 |
-
|
69 |
-
<input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "
|
70 |
-
<input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "
|
|
|
|
|
71 |
<script type = "text/javascript">
|
72 |
function hideInvite() {
|
73 |
document.getElementById("tnc").style.display = 'none';
|
@@ -77,14 +92,28 @@ function buttonwhich(message) {
|
|
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','
|
81 |
-
if (message == 'No')
|
|
|
|
|
|
|
82 |
}
|
83 |
</script>
|
84 |
</div>
|
85 |
ENDINVITE;
|
86 |
}
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
function renderRating($killable = true) {
|
89 |
if ($this->killAuthor) {
|
90 |
return;
|
@@ -93,25 +122,32 @@ ENDINVITE;
|
|
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-
|
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 =
|
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 |
-
|
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 |
-
|
115 |
<input type="hidden" id="kill_rating" name="kill_rating" value="" />
|
116 |
<script type = "text/javascript">
|
117 |
function hideRating() {
|
@@ -119,7 +155,7 @@ function hideRating() {
|
|
119 |
}
|
120 |
function hideme() {
|
121 |
document.getElementById("kill_rating").value = 'true' ;
|
122 |
-
document.getElementById("hideRating").innerHTML = '
|
123 |
setTimeout('hideRating()', 4000);
|
124 |
}
|
125 |
</script>
|
@@ -133,19 +169,28 @@ ENDRATING;
|
|
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
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
138 |
$toolTip .= addslashes('<br />' . $moreInfo);
|
139 |
$why = addslashes($plg['pro']);
|
140 |
$version = 'Lite';
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
143 |
<br />
|
144 |
-
|
145 |
<ul><li>
|
146 |
$moreInfo
|
147 |
</li>
|
148 |
-
<li>$why
|
149 |
</ul>";
|
150 |
}
|
151 |
|
@@ -161,18 +206,29 @@ $moreInfo
|
|
161 |
$value = '<em><strong>' . $plg['value'] . '</strong></em>';
|
162 |
$filter = '';
|
163 |
if (stripos($slug, 'adsense') !== FALSE) {
|
164 |
-
$filter = "
|
165 |
}
|
166 |
$toolTip = $plg['title'];
|
167 |
$price = $plg['price'];
|
168 |
-
$onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, '
|
173 |
|
|
|
|
|
174 |
$value .= '<b><i> Lite</i></b>';
|
175 |
-
|
|
|
|
|
176 |
echo "</div>";
|
177 |
}
|
178 |
|
@@ -226,7 +282,7 @@ $moreInfo
|
|
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
|
230 |
</span>
|
231 |
|
232 |
<div id="unreal" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
|
@@ -424,21 +480,21 @@ ENDDIVS;
|
|
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-
|
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
|
430 |
echo "<br style='line-height: 20px;'/>";
|
431 |
-
_e("Or, if you still need help, you can raise a support ticket.", 'easy-
|
432 |
-
echo " <a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport
|
433 |
-
_e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-
|
434 |
echo "'>";
|
435 |
-
_e("[Request Paid Support]", 'easy-
|
436 |
$info = $this->getPlgInfo();
|
437 |
echo "</a> <small><em>[";
|
438 |
-
_e('Using our ezSupport Ticket System.', 'easy-
|
439 |
echo "]</em></small>";
|
440 |
echo "<small style='float:right'><em>[";
|
441 |
-
printf(__('You are using %s (V%s)', 'easy-
|
442 |
echo "]</em></small>";
|
443 |
$_SESSION['ezSupport'] = $info[0]['Info'];
|
444 |
}
|
@@ -454,19 +510,28 @@ ENDDIVS;
|
|
454 |
$toolTip = $plg['title'];
|
455 |
$price = $plg['price'];
|
456 |
$buyURL = "http://buy.thulasidas.com/$slug";
|
457 |
-
$
|
458 |
-
$
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
|
|
|
|
|
|
464 |
}
|
465 |
else {
|
|
|
466 |
echo "<b>Get Pro Version!</b>
|
467 |
-
<a href='http://buy.thulasidas.com/$slug' title='
|
468 |
<br />
|
469 |
-
|
470 |
<ul><li>
|
471 |
$moreInfo
|
472 |
<li>$why</li>
|
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-common'), $plgLongName, $plgPrice);
|
54 |
+
$yesTitle = __('Get the Pro version now!', 'easy-common');
|
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-common');
|
56 |
+
$noTitle = __('Stay Lite', 'easy-common');
|
57 |
+
$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-common');
|
58 |
if (empty($benefits)) {
|
59 |
return;
|
60 |
}
|
61 |
+
|
62 |
+
$s1 = __("Want More Features?", 'easy-common');
|
63 |
+
$s2 = __("The Pro version of this plugin gives you more features and benefits.", 'easy-common');
|
64 |
+
$s3 = __("For instance", 'easy-common');
|
65 |
+
$s4 = __("And much more.", 'easy-common');
|
66 |
+
$s5 = __("New features and bug fixes will first appear in the Pro version before being ported to this freely distributed Lite edition.", 'easy-common');
|
67 |
+
$s6 = __("Go Pro!", 'easy-common');
|
68 |
+
$s7 = __("No thanks", 'easy-common');
|
69 |
+
$s8 = __("Do not show this anymore", 'easy-common');
|
70 |
+
$s9 = sprintf(__("Thank you for using %s!", 'easy-common'), $plgLongName);
|
71 |
+
$s10 = __("Please Save Options to hide this box forever", 'easy-common');
|
72 |
+
|
73 |
echo <<<ENDINVITE
|
74 |
<input type="hidden" id="kill_invites" name="kill_invites" value="" />
|
75 |
<div class="updated" id="tnc">
|
76 |
+
<p><h3>$s1 <a href="#" onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" onclick = "buttonwhich('Yes')">Go Pro!</a></h3>
|
77 |
+
$s2 $s3,
|
78 |
<ol>
|
79 |
$benefits
|
80 |
</ol>
|
81 |
+
$s4 $s5<br />
|
82 |
+
<input onmouseover="Tip('$yesTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$yesTitle')" onmouseout="UnTip()" type = "button" id = "ybutton" value = "$s6" onclick = "buttonwhich('Yes')" />
|
83 |
+
<input onmouseover="Tip('$noTip', WIDTH, 200, CLICKCLOSE, true, TITLE, '$noTitle')" onmouseout="UnTip()" type = "button" id = "nbutton" value = "$s7" onclick = "buttonwhich('No')" />
|
84 |
+
<small style='font-weight:normal;'><a id='hideInvite' href='#' style='float:right; display:block; border:none;' onmouseover="Tip('$hideTip', WIDTH, 200, CLICKCLOSE, true, TITLE, 'Hide this Box')" onmouseout="UnTip()" onclick = "buttonwhich('No')">
|
85 |
+
$s8</a></small>
|
86 |
<script type = "text/javascript">
|
87 |
function hideInvite() {
|
88 |
document.getElementById("tnc").style.display = 'none';
|
92 |
document.getElementById("nbutton").disabled = 'true';
|
93 |
document.getElementById("kill_invites").value = 'true' ;
|
94 |
setTimeout('hideInvite()', 5000);
|
95 |
+
if (message == 'Yes') popupwindow('http://buy.thulasidas.com/$slug', '$s6', 1024, 768) ;
|
96 |
+
if (message == 'No') {
|
97 |
+
document.getElementById("nbutton").value = '$s9 $s10';
|
98 |
+
document.getElementById("hideInvite").innerHTML = '$s10';
|
99 |
+
}
|
100 |
}
|
101 |
</script>
|
102 |
</div>
|
103 |
ENDINVITE;
|
104 |
}
|
105 |
|
106 |
+
function getPlgKey() {
|
107 |
+
$plgKey = basename($this->plgFile, '.php');
|
108 |
+
if (in_array($plgKey, array('easy-ads', 'google-adsense', 'theme-tweaker'))) {
|
109 |
+
$plgKey .= '-lite';
|
110 |
+
}
|
111 |
+
if ($plgKey == 'easy-paypal-lite') {
|
112 |
+
$plgKey = 'easy-paypal-lte';
|
113 |
+
}
|
114 |
+
return $plgKey;
|
115 |
+
}
|
116 |
+
|
117 |
function renderRating($killable = true) {
|
118 |
if ($this->killAuthor) {
|
119 |
return;
|
122 |
$plg = $this->plg;
|
123 |
$plgCTime = filemtime($plgFile);
|
124 |
$plgLongName = $plg['value'];
|
125 |
+
$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-common');
|
126 |
if (time() > $plgCTime + (60 * 60 * 24 * 30)) {
|
127 |
+
$msg = __("You've installed this plugin over a month ago.", 'easy-common');
|
128 |
+
;
|
129 |
}
|
130 |
else {
|
131 |
+
$msg = __("You will find it feature-rich and robust.", 'easy-common');
|
132 |
+
;
|
133 |
}
|
134 |
+
$plgKey = $this->getPlgKey();
|
135 |
$display = '';
|
136 |
if (!$killable) {
|
137 |
$display = "style='display:none'";
|
138 |
}
|
139 |
+
|
140 |
+
$s1 = __("If you are satisfied with how well it works, why not rate it and recommend it to others?", 'easy-common');
|
141 |
+
$s2 = __("Click here", 'easy-common');
|
142 |
+
$s3 = __("Do not show this anymore", 'easy-common');
|
143 |
+
$s4 = __("Please Save Options to hide this box forever", 'easy-common');
|
144 |
+
|
145 |
echo <<<ENDRATING
|
146 |
<div class='updated' id='rating'>
|
147 |
<p>Thanks for using <i><b>$plgLongName</b></i>! $msg <br />
|
148 |
+
$s1 <a href='http://wordpress.org/extend/plugins/$plgKey/' onclick="popupwindow('http://wordpress.org/extend/plugins/$plgKey/','$s2', 1024, 768);return false;">$s2</a>
|
|
|
149 |
<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()">
|
150 |
+
$s3</a></small></p></div>
|
151 |
<input type="hidden" id="kill_rating" name="kill_rating" value="" />
|
152 |
<script type = "text/javascript">
|
153 |
function hideRating() {
|
155 |
}
|
156 |
function hideme() {
|
157 |
document.getElementById("kill_rating").value = 'true' ;
|
158 |
+
document.getElementById("hideRating").innerHTML = '$s4';
|
159 |
setTimeout('hideRating()', 4000);
|
160 |
}
|
161 |
</script>
|
169 |
$value = '<em><strong>' . $plg['value'] . '</strong></em>';
|
170 |
$toolTip = $plg['title'];
|
171 |
$price = $plg['price'];
|
172 |
+
$onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get Pro}', 1024, 768);return false;\"";
|
173 |
+
|
174 |
+
$s2 = __('Lite Version', 'easy-common');
|
175 |
+
$s3 = sprintf(__('Buy the Pro version of %s for $%.2f', 'easy-common'), $plg['value'], $price);
|
176 |
+
$s4 = __('Instant download link.', 'easy-common');
|
177 |
+
$s5 = __('Pro Version', 'easy-common');
|
178 |
+
$moreInfo = "$s2 and <b><a href='http://buy.thulasidas.com/$slug' title='$s3. $s4' $onclick>$s5</a></b>";
|
179 |
$toolTip .= addslashes('<br />' . $moreInfo);
|
180 |
$why = addslashes($plg['pro']);
|
181 |
$version = 'Lite';
|
182 |
+
|
183 |
+
$s6 = sprintf(__('You are using the %s version of %s, which is available in two versions:', 'easy-common'), $version, $value);
|
184 |
+
$s7 = sprintf(__('And it costs only $%.2f!', 'easy-common'), $price);
|
185 |
+
$s8 = __('Get the Pro version now!', 'easy-common');
|
186 |
+
echo "<b>$s8</b>
|
187 |
+
<a href='http://buy.thulasidas.com/$slug' title='$s3. $s4' $onclick><img src='$plgURL/ezpaypal.png' alt='ezPayPal' class='alignright'/></a>
|
188 |
<br />
|
189 |
+
$s6
|
190 |
<ul><li>
|
191 |
$moreInfo
|
192 |
</li>
|
193 |
+
<li>$why $s7</li>
|
194 |
</ul>";
|
195 |
}
|
196 |
|
206 |
$value = '<em><strong>' . $plg['value'] . '</strong></em>';
|
207 |
$filter = '';
|
208 |
if (stripos($slug, 'adsense') !== FALSE) {
|
209 |
+
$filter = __("e.g., a filter to ensure AdSense policy compliance.", 'easy-common');
|
210 |
}
|
211 |
$toolTip = $plg['title'];
|
212 |
$price = $plg['price'];
|
213 |
+
$onclick = "onclick=\"popupwindow('http://buy.thulasidas.com/$slug','Get Pro', 1024, 768);return false;\"";
|
214 |
+
|
215 |
+
$s1 = sprintf(__('Download the Lite version of %s', 'easy-common'), $plg['value']);
|
216 |
+
$s2 = __('Lite Version', 'easy-common');
|
217 |
+
$s3 = sprintf(__('Buy the Pro version of %s for $%.2f', 'easy-common'), $plg['value'], $price);
|
218 |
+
$s4 = __('Pro Version', 'easy-common');
|
219 |
+
$s5 = __('Buy the Pro Version', 'easy-common');
|
220 |
+
|
221 |
+
$moreInfo = " <a href='http://buy.thulasidas.com/lite/$slug.zip' title='$s1'>$s2 </a> <a href='http://buy.thulasidas.com/$slug' title='$s3' $onclick>$s4</a>";
|
222 |
$toolTip .= addslashes('<br />' . $moreInfo);
|
223 |
echo "<div style='background-color:#ffcccc;padding:5px;border: solid 1px;text-align:center;'>
|
224 |
+
<span style='font-size:14px;color:#a48;font-variant: small-caps;text-decoration:underline;text-align:center;' $onclick onmouseover=\"TagToTip('pro', WIDTH, 300, TITLE, '$s5',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b>$s4</b></span><br />";
|
225 |
|
226 |
+
$s8 = sprintf(__('It costs only $%.2f!', 'easy-common'), $price);
|
227 |
+
$s9 = __('Instant download link.', 'easy-common');
|
228 |
$value .= '<b><i> Lite</i></b>';
|
229 |
+
$s10 = sprintf(__('Thank you for using %s. The \"Pro\" version gives you more options.', 'easy-common'), $value);
|
230 |
+
$s11 = __("Consider buying it.", 'easy-common');
|
231 |
+
echo "$s10 $filter $s11 <a href='http://buy.thulasidas.com/$slug' title='$s3. $s9'>$s8</a>";
|
232 |
echo "</div>";
|
233 |
}
|
234 |
|
282 |
</div>
|
283 |
|
284 |
<span id="dropbox" style='display:none;'>
|
285 |
+
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 500MB extra. Don’t worry, you get 500MB extra as well. So I can grow my online storage up to 18GB, which should keep me happy for a long time. Thank you!
|
286 |
</span>
|
287 |
|
288 |
<div id="unreal" style="margin-left:auto;margin-right:auto;width:200px;display:none;">
|
480 |
$url = 'http://www.thulasidas.com/plugins/' . $slug . '#faq';
|
481 |
$link = '<a href="' . $url . '" target="_blank">' . $value . '</a>';
|
482 |
echo " <a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport for $value', 1024, 768);return false;\" title='";
|
483 |
+
_e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-common');
|
484 |
echo "'><img src='$plgURL/ezsupport.png' class='alignright' alt='ezSupport Portal'/></a>";
|
485 |
+
printf(__("If you need help with %s, please read the FAQ section on the %s page. It may answer all your questions.", 'easy-common'), $value, $link);
|
486 |
echo "<br style='line-height: 20px;'/>";
|
487 |
+
_e("Or, if you still need help, you can raise a support ticket.", 'easy-common');
|
488 |
+
echo " <a href='http://support.thulasidas.com' onclick=\"popupwindow('http://support.thulasidas.com','ezSupport', 1024, 768);return false;\" title='";
|
489 |
+
_e('Ask a support question (in English or French only) via ezSupport @ $0.95', 'easy-common');
|
490 |
echo "'>";
|
491 |
+
_e("[Request Paid Support]", 'easy-common');
|
492 |
$info = $this->getPlgInfo();
|
493 |
echo "</a> <small><em>[";
|
494 |
+
_e('Using our ezSupport Ticket System.', 'easy-common');
|
495 |
echo "]</em></small>";
|
496 |
echo "<small style='float:right'><em>[";
|
497 |
+
printf(__('You are using %s (V%s)', 'easy-common'), $value, $info[0]['Version']);
|
498 |
echo "]</em></small>";
|
499 |
$_SESSION['ezSupport'] = $info[0]['Info'];
|
500 |
}
|
510 |
$toolTip = $plg['title'];
|
511 |
$price = $plg['price'];
|
512 |
$buyURL = "http://buy.thulasidas.com/$slug";
|
513 |
+
$s1 = sprintf(__('Get %s', 'easy-common'), $value);
|
514 |
+
$s2 = sprintf(__('More info about %s', 'easy-common'), $value);
|
515 |
+
$s3 = sprintf(__('Buy the Pro version of %s for $%.2f', 'easy-common'), $value, $price);
|
516 |
+
$s4 = __('More Info', 'easy-common');
|
517 |
+
|
518 |
+
$onclick = "onclick=\"popupwindow('$buyURL','$s1', 1024, 768);return false;\"";
|
519 |
+
$moreInfo = " <a href='$buyURL' title='$s2'> $s4 </a> <a href='$buyURL' $onclick title='$s3'>Get Pro Version</a>";
|
520 |
$toolTip .= addslashes('<br />' . $moreInfo);
|
521 |
$why = addslashes($plg['pro']);
|
522 |
+
echo '<div style="background-color:#cff;padding:5px;border: solid 1px;margin:5px;padding-bottom:15px;">';
|
523 |
if ($short) {
|
524 |
+
$s5 = __('Buy the Pro Version', 'easy-common');
|
525 |
+
$s6 = __('More features, more power!', 'easy-common');
|
526 |
+
|
527 |
+
echo "<span onmouseover=\"TagToTip('pro', WIDTH, 350, TITLE, 'Buy the Pro Version',STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true, FIX, [this, 5, 5])\"><b><a href='$buyURL' $onclick target='_blank'>$s5</a></b> $s6</span>";
|
528 |
}
|
529 |
else {
|
530 |
+
$s7 = sprintf(__('You are using the Lite version of %s, which is available in two versions: <b>Lite</b> and <b>Pro</b>.', 'easy-common'), $value);
|
531 |
echo "<b>Get Pro Version!</b>
|
532 |
+
<a href='http://buy.thulasidas.com/$slug' title='$s3'><img src='$plgURL/ezpaypal.png' alt='ezPayPal' class='alignright' $onclick /></a>
|
533 |
<br />
|
534 |
+
$s7
|
535 |
<ul><li>
|
536 |
$moreInfo
|
537 |
<li>$why</li>
|
EzOptions.php
CHANGED
@@ -384,6 +384,8 @@ if (!class_exists("EzBaseOption")) {
|
|
384 |
|
385 |
class EzSubmit extends EzBaseOption {
|
386 |
|
|
|
|
|
387 |
function EzSubmit($name) {
|
388 |
parent::EzBaseOption('submit', $name);
|
389 |
$this->value = $this->desc;
|
@@ -395,6 +397,9 @@ if (!class_exists("EzBaseOption")) {
|
|
395 |
if (!empty($this->style)) {
|
396 |
echo " style='{$this->style}'";
|
397 |
}
|
|
|
|
|
|
|
398 |
echo " value='{$this->desc}' />\n";
|
399 |
$this->postRender();
|
400 |
}
|
@@ -525,7 +530,7 @@ if (!class_exists("EzBasePlugin")) {
|
|
525 |
var $slug, $domain, $name, $plgDir, $plgURL, $plgFile;
|
526 |
var $ezTran, $ezAdmin, $myPlugins;
|
527 |
var $isPro, $strPro;
|
528 |
-
var $options;
|
529 |
|
530 |
function __construct($slug, $name, $file) {
|
531 |
$this->slug = $slug;
|
@@ -581,7 +586,7 @@ if (!class_exists("EzBasePlugin")) {
|
|
581 |
require_once($this->plgDir . '/EzAdmin.php');
|
582 |
$this->ezAdmin = new EzAdmin($plg, $slug, $plgURL);
|
583 |
}
|
584 |
-
if ($this->options['kill_author']) {
|
585 |
$this->ezAdmin->killAuthor = true;
|
586 |
}
|
587 |
$this->ezAdmin->domain = $this->domain;
|
384 |
|
385 |
class EzSubmit extends EzBaseOption {
|
386 |
|
387 |
+
var $onclick = '';
|
388 |
+
|
389 |
function EzSubmit($name) {
|
390 |
parent::EzBaseOption('submit', $name);
|
391 |
$this->value = $this->desc;
|
397 |
if (!empty($this->style)) {
|
398 |
echo " style='{$this->style}'";
|
399 |
}
|
400 |
+
if (!empty($this->onclick)) {
|
401 |
+
echo " onclick=\"{$this->onclick}\"";
|
402 |
+
}
|
403 |
echo " value='{$this->desc}' />\n";
|
404 |
$this->postRender();
|
405 |
}
|
530 |
var $slug, $domain, $name, $plgDir, $plgURL, $plgFile;
|
531 |
var $ezTran, $ezAdmin, $myPlugins;
|
532 |
var $isPro, $strPro;
|
533 |
+
var $options = array(), $ezOptions = array();
|
534 |
|
535 |
function __construct($slug, $name, $file) {
|
536 |
$this->slug = $slug;
|
586 |
require_once($this->plgDir . '/EzAdmin.php');
|
587 |
$this->ezAdmin = new EzAdmin($plg, $slug, $plgURL);
|
588 |
}
|
589 |
+
if (!empty($this->options['kill_author'])) {
|
590 |
$this->ezAdmin->killAuthor = true;
|
591 |
}
|
592 |
$this->ezAdmin->domain = $this->domain;
|
EzTran.php
CHANGED
@@ -21,7 +21,7 @@ if (!class_exists("PO")) {
|
|
21 |
|
22 |
class PO { // an id-str pair with attributes
|
23 |
|
24 |
-
var $num, $id, $str, $tranId, $tranVal, $keyId, $keyVal, $tl = '';
|
25 |
|
26 |
const MINMATCH = 89;
|
27 |
|
@@ -55,7 +55,7 @@ if (!class_exists("PO")) {
|
|
55 |
}
|
56 |
|
57 |
// Returns a text-area string of the Id
|
58 |
-
function
|
59 |
$ht = round(strlen($this->id) / 52 + 1) * 25;
|
60 |
$col = 'background-color:#f5f5f5;';
|
61 |
$tit = '';
|
@@ -75,7 +75,7 @@ if (!class_exists("PO")) {
|
|
75 |
return $s;
|
76 |
}
|
77 |
|
78 |
-
function
|
79 |
$ht = round(strlen($this->id) / 52 + 1) * 25;
|
80 |
$col = '';
|
81 |
$tit = '';
|
@@ -141,10 +141,6 @@ if (!class_exists("PO")) {
|
|
141 |
return trim($ret);
|
142 |
}
|
143 |
|
144 |
-
function setTl($tl) {
|
145 |
-
$this->tl = $tl;
|
146 |
-
}
|
147 |
-
|
148 |
}
|
149 |
|
150 |
}
|
@@ -156,24 +152,29 @@ if (!class_exists("EzTran")) {
|
|
156 |
var $status, $error, $plgName, $plgDir, $plgURL, $domain, $locale, $state,
|
157 |
$isEmbedded = true, $isPro = false;
|
158 |
var $adminMsg;
|
159 |
-
var $helpers;
|
160 |
|
161 |
function __construct($plgFile, $plgName, $domain = '') {
|
162 |
-
$this->helpers = array('easy-adsense');
|
163 |
if (!empty($_POST['ezt-savePot'])) {
|
164 |
// saving cannot be done from handleSubmits
|
165 |
// because it would be too late for the headers.
|
166 |
-
$
|
167 |
-
$
|
|
|
168 |
header('Content-Description: File Transfer');
|
169 |
header('Content-Disposition: attachment; filename="' . $file . '"');
|
170 |
header("Content-Transfer-Encoding: ascii");
|
171 |
header('Expires: 0');
|
172 |
header('Pragma: no-cache');
|
173 |
ob_start();
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
175 |
ob_end_flush();
|
176 |
-
$this->status
|
177 |
exit(0);
|
178 |
}
|
179 |
$this->status = '';
|
@@ -202,7 +203,7 @@ if (!class_exists("EzTran")) {
|
|
202 |
|
203 |
function EzTran($plgFile, $plgName = '', $domain = '') {
|
204 |
if (version_compare(PHP_VERSION, "5.0.0", "<")) {
|
205 |
-
$this->__construct($plgName, $domain);
|
206 |
register_shutdown_function(array($this, "__destruct"));
|
207 |
}
|
208 |
}
|
@@ -217,6 +218,7 @@ if (!class_exists("EzTran")) {
|
|
217 |
foreach ($files as $f) {
|
218 |
$page .= file_get_contents($f, FILE_IGNORE_NEW_LINES);
|
219 |
}
|
|
|
220 |
return $page;
|
221 |
}
|
222 |
|
@@ -228,7 +230,7 @@ if (!class_exists("EzTran")) {
|
|
228 |
|
229 |
// Get the closest existing translation keys, and the recursivley closest in the
|
230 |
// key set
|
231 |
-
function
|
232 |
foreach ($POs as $n => $po) {
|
233 |
$s1 = $po->id;
|
234 |
if (strlen($po->str) == 0) {
|
@@ -259,13 +261,38 @@ if (!class_exists("EzTran")) {
|
|
259 |
}
|
260 |
}
|
261 |
|
262 |
-
// Get
|
263 |
-
function
|
264 |
$matches = array();
|
265 |
-
|
|
|
|
|
266 |
$keys = array_unique($matches[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
$keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
foreach ($keys as $n => $k) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
if (!empty($mo[$k])) {
|
270 |
$v = $mo[$k];
|
271 |
$t = $v->translations[0];
|
@@ -276,18 +303,19 @@ if (!class_exists("EzTran")) {
|
|
276 |
$po = new PO($k, $t);
|
277 |
$po->num = $n;
|
278 |
if ($this->isEmbedded || $this->isPro) {
|
279 |
-
$tl =
|
280 |
-
$po->setTl($tl);
|
281 |
}
|
|
|
282 |
array_push($POs, $po);
|
283 |
}
|
284 |
-
$this->
|
|
|
285 |
}
|
286 |
|
287 |
// Make a POT string from ids and msgs
|
288 |
-
function
|
289 |
$time = current_time('mysql');
|
290 |
-
$
|
291 |
# This file was generated by EzTran for {$this->plgName}
|
292 |
# Your Name: {$msg["name"]}
|
293 |
# Your Email: {$msg["email"]}
|
@@ -307,10 +335,14 @@ msgstr ""
|
|
307 |
|
308 |
|
309 |
EOF;
|
|
|
310 |
foreach ($POs as $po) {
|
311 |
-
|
|
|
|
|
|
|
312 |
$t = $msg[$po->num];
|
313 |
-
$pot .= "msgstr " . '"' . PO::decorate($t, "\n\r") . '"' . "\n\n";
|
314 |
}
|
315 |
return $pot;
|
316 |
}
|
@@ -349,13 +381,15 @@ EOF;
|
|
349 |
if (isset($_POST['ezt-clear'])) {
|
350 |
$this->status = '<div class="updated">Reloaded the translations from PHP files and MO.</div> ';
|
351 |
unset($_SESSION[$this->domain]['ezt-POs']);
|
|
|
352 |
return $adminNeeded;
|
353 |
}
|
354 |
if (!empty($_POST['ezt-mailPot'])) {
|
355 |
if ($this->isEmbedded || $this->isPro) {
|
356 |
-
|
357 |
-
$
|
358 |
-
$
|
|
|
359 |
|
360 |
if (!class_exists("phpmailer")) {
|
361 |
require_once(ABSPATH . 'wp-includes/class-phpmailer.php');
|
@@ -376,7 +410,11 @@ EOF;
|
|
376 |
$mail->Mailer = 'php';
|
377 |
$mail->SMTPAuth = false;
|
378 |
$mail->Subject = $file;
|
379 |
-
|
|
|
|
|
|
|
|
|
380 |
$pos1 = strpos($str, "msgstr");
|
381 |
$pos2 = strpos($str, "msgid", $pos1);
|
382 |
$head = substr($str, 0, $pos2);
|
@@ -400,6 +438,9 @@ EOF;
|
|
400 |
function printAdminPage() {
|
401 |
echo '<script type="text/javascript">window.onload = function() {jQuery("#loading").fadeOut("slow");};</script>';
|
402 |
echo "<div id='loading'><p><img src='{$this->plgURL}/loading.gif' alt='loading'/> Please Wait. Loading...</p></div>";
|
|
|
|
|
|
|
403 |
$printed = false;
|
404 |
if (!$this->handleSubmits()) {
|
405 |
return $printed;
|
@@ -431,7 +472,6 @@ EOF;
|
|
431 |
else {
|
432 |
echo "<h2>Translating {$this->plgName} using Easy Translator</h2>";
|
433 |
}
|
434 |
-
$domain = $this->domain;
|
435 |
|
436 |
if (isset($_SESSION[$this->domain]['ezt-POs'])) {
|
437 |
if (empty($this->status)) {
|
@@ -440,17 +480,19 @@ EOF;
|
|
440 |
$POs = $_SESSION[$this->domain]['ezt-POs'];
|
441 |
}
|
442 |
else {
|
443 |
-
global $l10n;
|
444 |
-
$mo = array($l10n[$domain]->entries);
|
445 |
$s = $this->getFileContents();
|
446 |
-
$POs =
|
447 |
-
|
448 |
// cache the POs
|
449 |
$_SESSION[$this->domain]['ezt-POs'] = $POs;
|
450 |
}
|
451 |
|
452 |
if ($made) {
|
453 |
-
$
|
|
|
|
|
|
|
|
|
454 |
$this->updatePot($POs, $_POST);
|
455 |
// cache the updated POs
|
456 |
$_SESSION[$this->domain]['ezt-POs'] = $POs;
|
@@ -497,7 +539,7 @@ EOF;
|
|
497 |
if (!is_object($po) && gettype($po) == 'object') {
|
498 |
$po = unserialize(serialize($po));
|
499 |
} // need this only on Chrome!!
|
500 |
-
$pot .= $po->
|
501 |
}
|
502 |
}
|
503 |
else {
|
@@ -515,10 +557,10 @@ EOF;
|
|
515 |
</div>' . $this->status . $this->error;
|
516 |
if ($made) {
|
517 |
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>";
|
518 |
-
$this->status = '<div class="updated">Ready to email
|
519 |
-
|
520 |
-
|
521 |
-
echo '<input type="hidden" name="
|
522 |
if (!$this->isEmbedded) {
|
523 |
$mail = "<br /><span style='width:15%;float:left;'>Plugin Author:</span><input type='text' style='width: 30%' name='ezt-author' value='' /><br />\n";
|
524 |
$mail .= "<span style='width:15%;float:left'>Author's Email:</span><input type='text' style='width: 30%' name='ezt-authormail' value='' />\n<br />";
|
@@ -546,16 +588,16 @@ EOF1;
|
|
546 |
|
547 |
function getInvite() {
|
548 |
$locale = $this->locale;
|
549 |
-
$lo = substr($locale, 0, 2);
|
550 |
-
if ($lo == 'en') {
|
551 |
-
return "";
|
552 |
-
}
|
553 |
$plgName = $this->plgName;
|
554 |
$patience = "I will include your translation in the next release.<br /><br /><span style=\"color:red;font-weight:bold\">Please note that the page may take a while to load because the plugin will query Google Translator for each string. Please be patient!</span>";
|
555 |
if ($this->state == "Not Translated") {
|
556 |
$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. $patience");
|
557 |
$invite = "<span style='color:red'> Would you like to see <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 ='Please help translate ' /></span>";
|
558 |
}
|
|
|
|
|
|
|
|
|
559 |
else {
|
560 |
$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? $patience");
|
561 |
$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>";
|
@@ -563,7 +605,7 @@ EOF1;
|
|
563 |
return $invite;
|
564 |
}
|
565 |
|
566 |
-
function loadTran($helper = '') {
|
567 |
$locale = '';
|
568 |
if (empty($helper)) {
|
569 |
$moDir = "{$this->plgDir}/lang";
|
@@ -571,18 +613,25 @@ EOF1;
|
|
571 |
else {
|
572 |
$moDir = "{$this->plgDir}/../$helper/lang";
|
573 |
}
|
574 |
-
$
|
575 |
-
|
|
|
|
|
|
|
|
|
|
|
576 |
if (file_exists($moFile) && is_readable($moFile)) {
|
577 |
-
load_textdomain($
|
578 |
$locale = basename(dirname($moFile));
|
579 |
}
|
580 |
else {
|
581 |
// look for any other similar locale with the same first two characters
|
582 |
-
$
|
|
|
|
|
583 |
if (!empty($moFiles)) {
|
584 |
$moFile = $moFiles[0];
|
585 |
-
load_textdomain($
|
586 |
$locale = basename(dirname($moFile));
|
587 |
}
|
588 |
}
|
@@ -591,43 +640,49 @@ EOF1;
|
|
591 |
|
592 |
function setLang() {
|
593 |
$locale = $this->locale;
|
|
|
594 |
$lo = substr($locale, 0, 2);
|
595 |
if ($lo != 'en') {
|
596 |
$locale = $this->loadTran();
|
597 |
// Append translations in the helpers
|
598 |
-
foreach ($this->helpers as $helper) {
|
599 |
-
$this->loadTran($helper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
600 |
}
|
601 |
-
}
|
602 |
-
if (empty($locale)) {
|
603 |
-
$this->state = "Not Translated";
|
604 |
-
}
|
605 |
-
else if ($locale == $this->locale) {
|
606 |
-
$this->state = "Translated";
|
607 |
}
|
608 |
else {
|
609 |
-
|
|
|
610 |
}
|
611 |
return $locale;
|
612 |
}
|
613 |
|
614 |
function renderTranslator() {
|
615 |
-
if (
|
616 |
return;
|
617 |
}
|
618 |
echo "<br />\n";
|
619 |
echo "<br />\n";
|
620 |
echo '<div style="background-color:#ddd;padding:5px;border: solid 1px;margin:5px;">';
|
621 |
echo $this->getInvite();
|
622 |
-
if ($this->state != "Not Translated") {
|
623 |
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'>";
|
624 |
echo '</div>';
|
625 |
echo $this->adminMsg;
|
626 |
return;
|
627 |
}
|
628 |
-
|
629 |
-
|
630 |
-
|
|
|
631 |
<!--
|
632 |
function hideTranslator(id, btn, translator) {
|
633 |
var e = document.getElementById(id);
|
@@ -654,34 +709,38 @@ function toggleVisibility(id, btn, translator) {
|
|
654 |
}
|
655 |
//-->
|
656 |
</script>";
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
function googleTranslateElementInit() {
|
672 |
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
|
673 |
}
|
674 |
</script><script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script></div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
}
|
676 |
else {
|
677 |
-
|
678 |
-
}
|
679 |
-
if ($google && $ms) {
|
680 |
-
$or = "or";
|
681 |
}
|
682 |
-
echo "See this page in your language (<code>{$this->locale}</code>) using machine translation. $ggLink $or $msLink Translator.";
|
683 |
-
echo $ggBtn . $msBtn . $ggJS . $msJS;
|
684 |
-
echo '</div>';
|
685 |
}
|
686 |
|
687 |
}
|
21 |
|
22 |
class PO { // an id-str pair with attributes
|
23 |
|
24 |
+
var $num, $id, $str, $tranId, $tranVal, $keyId, $keyVal, $tl = '', $domain;
|
25 |
|
26 |
const MINMATCH = 89;
|
27 |
|
55 |
}
|
56 |
|
57 |
// Returns a text-area string of the Id
|
58 |
+
function getId() {
|
59 |
$ht = round(strlen($this->id) / 52 + 1) * 25;
|
60 |
$col = 'background-color:#f5f5f5;';
|
61 |
$tit = '';
|
75 |
return $s;
|
76 |
}
|
77 |
|
78 |
+
function getStr() {
|
79 |
$ht = round(strlen($this->id) / 52 + 1) * 25;
|
80 |
$col = '';
|
81 |
$tit = '';
|
141 |
return trim($ret);
|
142 |
}
|
143 |
|
|
|
|
|
|
|
|
|
144 |
}
|
145 |
|
146 |
}
|
152 |
var $status, $error, $plgName, $plgDir, $plgURL, $domain, $locale, $state,
|
153 |
$isEmbedded = true, $isPro = false;
|
154 |
var $adminMsg;
|
155 |
+
var $helpers = array();
|
156 |
|
157 |
function __construct($plgFile, $plgName, $domain = '') {
|
|
|
158 |
if (!empty($_POST['ezt-savePot'])) {
|
159 |
// saving cannot be done from handleSubmits
|
160 |
// because it would be too late for the headers.
|
161 |
+
$locale = $_POST['locale'];
|
162 |
+
$file = "{$locale}.po";
|
163 |
+
$potArray = unserialize(gzinflate(base64_decode($_POST['potArray'])));
|
164 |
header('Content-Description: File Transfer');
|
165 |
header('Content-Disposition: attachment; filename="' . $file . '"');
|
166 |
header("Content-Transfer-Encoding: ascii");
|
167 |
header('Expires: 0');
|
168 |
header('Pragma: no-cache');
|
169 |
ob_start();
|
170 |
+
foreach ($potArray as $domain => $str) {
|
171 |
+
$filePO = "{$locale}_$domain.po";
|
172 |
+
echo "\n# Begin $filePO\n";
|
173 |
+
print htmlspecialchars_decode($str, ENT_QUOTES);
|
174 |
+
echo "# End $filePO\n\n";
|
175 |
+
}
|
176 |
ob_end_flush();
|
177 |
+
$this->status .= '<div class="updated">Pot file: ' . $file . ' was saved.</div> ';
|
178 |
exit(0);
|
179 |
}
|
180 |
$this->status = '';
|
203 |
|
204 |
function EzTran($plgFile, $plgName = '', $domain = '') {
|
205 |
if (version_compare(PHP_VERSION, "5.0.0", "<")) {
|
206 |
+
$this->__construct($plgFile, $plgName, $domain);
|
207 |
register_shutdown_function(array($this, "__destruct"));
|
208 |
}
|
209 |
}
|
218 |
foreach ($files as $f) {
|
219 |
$page .= file_get_contents($f, FILE_IGNORE_NEW_LINES);
|
220 |
}
|
221 |
+
// $page = str_replace(array_values($this->helpers), $this->domain, $page);
|
222 |
return $page;
|
223 |
}
|
224 |
|
230 |
|
231 |
// Get the closest existing translation keys, and the recursivley closest in the
|
232 |
// key set
|
233 |
+
function getClosest(&$mo, &$POs) {
|
234 |
foreach ($POs as $n => $po) {
|
235 |
$s1 = $po->id;
|
236 |
if (strlen($po->str) == 0) {
|
261 |
}
|
262 |
}
|
263 |
|
264 |
+
// Get translatable strings (keys) and text-domains from content
|
265 |
+
static function getStrings($contents, &$keys, &$domains) {
|
266 |
$matches = array();
|
267 |
+
$regExp = "#_[_e]\s*\([\'\"](.*)[\'\"]\s*(,\s*[\'\"](.+)[\'\"]|)\s*\)#U";
|
268 |
+
// $regExp = "#_[_e]\s*\(\'([^\'\"]*\'|\"[^\'\"])\"s*(,\s*[\'\"](.+)[\'\"]|)\s*\)#U";
|
269 |
+
preg_match_all($regExp, $contents, $matches);
|
270 |
$keys = array_unique($matches[1]);
|
271 |
+
$domains = $matches[3];
|
272 |
+
foreach ($domains as $k => $d) {
|
273 |
+
if (strtr($d, '",\'', ' ') != $d) {
|
274 |
+
unset($domains[$k]);
|
275 |
+
unset($keys[$k]);
|
276 |
+
}
|
277 |
+
}
|
278 |
$keys = str_replace(array("\'", '\"', '\n'), array("'", '"', "\n"), $keys);
|
279 |
+
}
|
280 |
+
|
281 |
+
// Get the strings that look like translation keys
|
282 |
+
function getTranPOs(&$contents) {
|
283 |
+
$keys = $domains = array();
|
284 |
+
self::getStrings($contents, $keys, $domains);
|
285 |
+
$tl = substr($this->locale, 0, 2);
|
286 |
+
global $l10n;
|
287 |
+
$POs = array();
|
288 |
foreach ($keys as $n => $k) {
|
289 |
+
if (!$this->isEmbedded && $domains[$n] != $this->domain) {
|
290 |
+
// consider only the specified domain
|
291 |
+
continue;
|
292 |
+
}
|
293 |
+
if (!empty($l10n[$domains[$n]])) {
|
294 |
+
$mo = $l10n[$domains[$n]]->entries;
|
295 |
+
}
|
296 |
if (!empty($mo[$k])) {
|
297 |
$v = $mo[$k];
|
298 |
$t = $v->translations[0];
|
303 |
$po = new PO($k, $t);
|
304 |
$po->num = $n;
|
305 |
if ($this->isEmbedded || $this->isPro) {
|
306 |
+
$po->tl = $tl;
|
|
|
307 |
}
|
308 |
+
$po->domain = $domains[$n];
|
309 |
array_push($POs, $po);
|
310 |
}
|
311 |
+
$this->getClosest($mo, $POs);
|
312 |
+
return $POs;
|
313 |
}
|
314 |
|
315 |
// Make a POT string from ids and msgs
|
316 |
+
function mkPotStr(&$POs, $msg) {
|
317 |
$time = current_time('mysql');
|
318 |
+
$potHead = <<<EOF
|
319 |
# This file was generated by EzTran for {$this->plgName}
|
320 |
# Your Name: {$msg["name"]}
|
321 |
# Your Email: {$msg["email"]}
|
335 |
|
336 |
|
337 |
EOF;
|
338 |
+
$pot = array();
|
339 |
foreach ($POs as $po) {
|
340 |
+
if (empty($pot[$po->domain])) {
|
341 |
+
$pot[$po->domain] = $potHead;
|
342 |
+
}
|
343 |
+
$pot[$po->domain] .= "msgid " . '"' . PO::decorate($po->id, "\n\r\"") . '"' . "\n";
|
344 |
$t = $msg[$po->num];
|
345 |
+
$pot[$po->domain] .= "msgstr " . '"' . PO::decorate($t, "\n\r") . '"' . "\n\n";
|
346 |
}
|
347 |
return $pot;
|
348 |
}
|
381 |
if (isset($_POST['ezt-clear'])) {
|
382 |
$this->status = '<div class="updated">Reloaded the translations from PHP files and MO.</div> ';
|
383 |
unset($_SESSION[$this->domain]['ezt-POs']);
|
384 |
+
$this->setLang();
|
385 |
return $adminNeeded;
|
386 |
}
|
387 |
if (!empty($_POST['ezt-mailPot'])) {
|
388 |
if ($this->isEmbedded || $this->isPro) {
|
389 |
+
|
390 |
+
$locale = $_POST['locale'];
|
391 |
+
$file = "{$locale}.po";
|
392 |
+
$potArray = unserialize(gzinflate(base64_decode($_POST['potArray'])));
|
393 |
|
394 |
if (!class_exists("phpmailer")) {
|
395 |
require_once(ABSPATH . 'wp-includes/class-phpmailer.php');
|
410 |
$mail->Mailer = 'php';
|
411 |
$mail->SMTPAuth = false;
|
412 |
$mail->Subject = $file;
|
413 |
+
foreach ($potArray as $domain => $str) {
|
414 |
+
$filePO = "{$locale}_$domain.po";
|
415 |
+
$mail->AddStringAttachment($str, $filePO);
|
416 |
+
}
|
417 |
+
|
418 |
$pos1 = strpos($str, "msgstr");
|
419 |
$pos2 = strpos($str, "msgid", $pos1);
|
420 |
$head = substr($str, 0, $pos2);
|
438 |
function printAdminPage() {
|
439 |
echo '<script type="text/javascript">window.onload = function() {jQuery("#loading").fadeOut("slow");};</script>';
|
440 |
echo "<div id='loading'><p><img src='{$this->plgURL}/loading.gif' alt='loading'/> Please Wait. Loading...</p></div>";
|
441 |
+
if ($this->isEmbedded) {
|
442 |
+
$this->helpers = array('' => 'easy-common', 'easy-adsense' => 'easy-common');
|
443 |
+
}
|
444 |
$printed = false;
|
445 |
if (!$this->handleSubmits()) {
|
446 |
return $printed;
|
472 |
else {
|
473 |
echo "<h2>Translating {$this->plgName} using Easy Translator</h2>";
|
474 |
}
|
|
|
475 |
|
476 |
if (isset($_SESSION[$this->domain]['ezt-POs'])) {
|
477 |
if (empty($this->status)) {
|
480 |
$POs = $_SESSION[$this->domain]['ezt-POs'];
|
481 |
}
|
482 |
else {
|
|
|
|
|
483 |
$s = $this->getFileContents();
|
484 |
+
$POs = $this->getTranPOs($s);
|
485 |
+
|
486 |
// cache the POs
|
487 |
$_SESSION[$this->domain]['ezt-POs'] = $POs;
|
488 |
}
|
489 |
|
490 |
if ($made) {
|
491 |
+
$potArray = $this->mkPotStr($POs, $_POST);
|
492 |
+
$pot = '';
|
493 |
+
foreach ($potArray as $p) {
|
494 |
+
$pot .= htmlspecialchars($p, ENT_QUOTES);
|
495 |
+
}
|
496 |
$this->updatePot($POs, $_POST);
|
497 |
// cache the updated POs
|
498 |
$_SESSION[$this->domain]['ezt-POs'] = $POs;
|
539 |
if (!is_object($po) && gettype($po) == 'object') {
|
540 |
$po = unserialize(serialize($po));
|
541 |
} // need this only on Chrome!!
|
542 |
+
$pot .= $po->getId() . "\n" . $po->getStr() . "\n\n";
|
543 |
}
|
544 |
}
|
545 |
else {
|
557 |
</div>' . $this->status . $this->error;
|
558 |
if ($made) {
|
559 |
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>";
|
560 |
+
$this->status = '<div class="updated">Ready to email the POT file to the author. Click on "Mail POT file" to send it.</div> ';
|
561 |
+
$b64 = base64_encode(gzdeflate(serialize($potArray)));
|
562 |
+
echo '<input type="hidden" name="potArray" value="' . $b64 . '" />';
|
563 |
+
echo '<input type="hidden" name="locale" value="' . $this->locale . '" />';
|
564 |
if (!$this->isEmbedded) {
|
565 |
$mail = "<br /><span style='width:15%;float:left;'>Plugin Author:</span><input type='text' style='width: 30%' name='ezt-author' value='' /><br />\n";
|
566 |
$mail .= "<span style='width:15%;float:left'>Author's Email:</span><input type='text' style='width: 30%' name='ezt-authormail' value='' />\n<br />";
|
588 |
|
589 |
function getInvite() {
|
590 |
$locale = $this->locale;
|
|
|
|
|
|
|
|
|
591 |
$plgName = $this->plgName;
|
592 |
$patience = "I will include your translation in the next release.<br /><br /><span style=\"color:red;font-weight:bold\">Please note that the page may take a while to load because the plugin will query Google Translator for each string. Please be patient!</span>";
|
593 |
if ($this->state == "Not Translated") {
|
594 |
$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. $patience");
|
595 |
$invite = "<span style='color:red'> Would you like to see <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 ='Please help translate ' /></span>";
|
596 |
}
|
597 |
+
else if ($this->state == "English") {
|
598 |
+
$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? $patience");
|
599 |
+
$invite = "If you speak another language, please help translate this plugin. Select a language: <select id='><option value=af>Afrikaans</option><option value=sq>Albanian</option><option value=ar>Arabic</option><option value=hy>Armenian</option><option value=az>Azerbaijani</option><option value=eu>Basque</option><option value=be>Belarusian</option><option value=bn>Bengali</option><option value=bs>Bosnian</option><option value=bg>Bulgarian</option><option value=ca>Catalan</option><option value=ceb>Cebuano</option><option value=zh-CN>Chinese</option><option value=hr>Croatian</option><option value=cs>Czech</option><option value=da>Danish</option><option value=nl>Dutch</option><option SELECTED value=en>English</option><option value=eo>Esperanto</option><option value=et>Estonian</option><option value=tl>Filipino</option><option value=fi>Finnish</option><option value=fr>French</option><option value=gl>Galician</option><option value=ka>Georgian</option><option value=de>German</option><option value=el>Greek</option><option value=gu>Gujarati</option><option value=ht>Haitian Creole</option><option value=ha>Hausa</option><option value=iw>Hebrew</option><option value=hi>Hindi</option><option value=hmn>Hmong</option><option value=hu>Hungarian</option><option value=is>Icelandic</option><option value=ig>Igbo</option><option value=id>Indonesian</option><option value=ga>Irish</option><option value=it>Italian</option><option value=ja>Japanese</option><option value=jw>Javanese</option><option value=kn>Kannada</option><option value=km>Khmer</option><option value=ko>Korean</option><option value=lo>Lao</option><option value=la>Latin</option><option value=lv>Latvian</option><option value=lt>Lithuanian</option><option value=mk>Macedonian</option><option value=ms>Malay</option><option value=mt>Maltese</option><option value=mi>Maori</option><option value=mr>Marathi</option><option value=mn>Mongolian</option><option value=ne>Nepali</option><option value=no>Norwegian</option><option value=fa>Persian</option><option value=pl>Polish</option><option value=pt>Portuguese</option><option value=pa>Punjabi</option><option value=ro>Romanian</option><option value=ru>Russian</option><option value=sr>Serbian</option><option value=sk>Slovak</option><option value=sl>Slovenian</option><option value=so>Somali</option><option value=es>Spanish</option><option value=sw>Swahili</option><option value=sv>Swedish</option><option value=ta>Tamil</option><option value=te>Telugu</option><option value=th>Thai</option><option value=tr>Turkish</option><option value=uk>Ukrainian</option><option value=ur>Urdu</option><option value=vi>Vietnamese</option><option value=cy>Welsh</option><option value=yi>Yiddish</option><option value=yo>Yoruba</option><option value=zu>Zulu</option></select>";
|
600 |
+
}
|
601 |
else {
|
602 |
$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? $patience");
|
603 |
$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>";
|
605 |
return $invite;
|
606 |
}
|
607 |
|
608 |
+
function loadTran($helper = '', $domain = '') {
|
609 |
$locale = '';
|
610 |
if (empty($helper)) {
|
611 |
$moDir = "{$this->plgDir}/lang";
|
613 |
else {
|
614 |
$moDir = "{$this->plgDir}/../$helper/lang";
|
615 |
}
|
616 |
+
if (empty($domain)) {
|
617 |
+
$domain = $this->domain;
|
618 |
+
$moFile = "$moDir/{$this->locale}.mo";
|
619 |
+
}
|
620 |
+
else {
|
621 |
+
$moFile = "$moDir/{$this->locale}_{$domain}.mo";
|
622 |
+
}
|
623 |
if (file_exists($moFile) && is_readable($moFile)) {
|
624 |
+
load_textdomain($domain, $moFile);
|
625 |
$locale = basename(dirname($moFile));
|
626 |
}
|
627 |
else {
|
628 |
// look for any other similar locale with the same first two characters
|
629 |
+
$lo = substr($this->locale, 0, 2);
|
630 |
+
$pattern = str_replace($this->locale, "$lo*", $moFile);
|
631 |
+
$moFiles = glob($pattern);
|
632 |
if (!empty($moFiles)) {
|
633 |
$moFile = $moFiles[0];
|
634 |
+
load_textdomain($domain, $moFile);
|
635 |
$locale = basename(dirname($moFile));
|
636 |
}
|
637 |
}
|
640 |
|
641 |
function setLang() {
|
642 |
$locale = $this->locale;
|
643 |
+
$this->helpers = array('' => 'easy-common', 'easy-adsense' => 'easy-common');
|
644 |
$lo = substr($locale, 0, 2);
|
645 |
if ($lo != 'en') {
|
646 |
$locale = $this->loadTran();
|
647 |
// Append translations in the helpers
|
648 |
+
foreach ($this->helpers as $helper => $domain) {
|
649 |
+
$this->loadTran($helper, $domain);
|
650 |
+
}
|
651 |
+
if (empty($locale)) {
|
652 |
+
$this->state = "Not Translated";
|
653 |
+
}
|
654 |
+
else if ($locale == $this->locale) {
|
655 |
+
$this->state = "Translated";
|
656 |
+
}
|
657 |
+
else {
|
658 |
+
$this->state = "Alternate MO";
|
659 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
}
|
661 |
else {
|
662 |
+
// TODO: Ask English speakers to help translate to their second lang
|
663 |
+
$this->state = "English";
|
664 |
}
|
665 |
return $locale;
|
666 |
}
|
667 |
|
668 |
function renderTranslator() {
|
669 |
+
if ($this->state == "English") {
|
670 |
return;
|
671 |
}
|
672 |
echo "<br />\n";
|
673 |
echo "<br />\n";
|
674 |
echo '<div style="background-color:#ddd;padding:5px;border: solid 1px;margin:5px;">';
|
675 |
echo $this->getInvite();
|
676 |
+
if ($this->state != "Not Translated" && $this->state != "English") {
|
677 |
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'>";
|
678 |
echo '</div>';
|
679 |
echo $this->adminMsg;
|
680 |
return;
|
681 |
}
|
682 |
+
else if ($this->state != "English") {
|
683 |
+
echo "<br />";
|
684 |
+
$plgName = strtr(' ', '-', str_replace(' pro', '', strtolower($this->plgName)));
|
685 |
+
echo "<script type='text/javascript'>
|
686 |
<!--
|
687 |
function hideTranslator(id, btn, translator) {
|
688 |
var e = document.getElementById(id);
|
709 |
}
|
710 |
//-->
|
711 |
</script>";
|
712 |
+
$ms = true;
|
713 |
+
$google = true;
|
714 |
+
if ($ms) {
|
715 |
+
$msBtn = " <button type='button' id='btnMS' onclick=\"toggleVisibility('MicrosoftTranslatorWidget', 'btnMS', 'Microsoft');\">Show Microsoft</button>";
|
716 |
+
$msLink = "<a target=_blank href='http://www.bing.com/translator'>Microsoft<sup>®</sup></a> ";
|
717 |
+
$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>";
|
718 |
+
}
|
719 |
+
else {
|
720 |
+
$msBtn = $msJs = $msLink = '';
|
721 |
+
}
|
722 |
+
if ($google) {
|
723 |
+
$ggBtn = " <button type='button' id='btnGG' onclick=\"toggleVisibility('GoogleTranslatorWidget', 'btnGG', 'Google');\">Show Google</button>";
|
724 |
+
$ggLink = "<a target=_blank href='https://translate.google.com/'>Google<sup>®</sup></a>";
|
725 |
+
$ggJS = "<div id='GoogleTranslatorWidget' style='text-align:center;display:none;'><div id='google_translate_element'></div><script type='text/javascript'>
|
726 |
function googleTranslateElementInit() {
|
727 |
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
|
728 |
}
|
729 |
</script><script type='text/javascript' src='//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit'></script></div>";
|
730 |
+
}
|
731 |
+
else {
|
732 |
+
$ggBtn = $ggJS = $ggLink = '';
|
733 |
+
}
|
734 |
+
if ($google && $ms) {
|
735 |
+
$or = "or";
|
736 |
+
}
|
737 |
+
echo "See this page in your language (<code>{$this->locale}</code>) using machine translation. $ggLink $or $msLink Translator.";
|
738 |
+
echo $ggBtn . $msBtn . $ggJS . $msJS;
|
739 |
+
echo '</div>';
|
740 |
}
|
741 |
else {
|
742 |
+
echo '</div>';
|
|
|
|
|
|
|
743 |
}
|
|
|
|
|
|
|
744 |
}
|
745 |
|
746 |
}
|
admin.php
CHANGED
@@ -54,7 +54,6 @@ EOF1;
|
|
54 |
if (empty($this->options['kill_invites'])) {
|
55 |
$ez->renderInvite();
|
56 |
}
|
57 |
-
$this->migrateOptions();
|
58 |
wp_nonce_field('EzAdsenseSubmit', 'EzAdsenseNonce');
|
59 |
?>
|
60 |
<br />
|
54 |
if (empty($this->options['kill_invites'])) {
|
55 |
$ez->renderInvite();
|
56 |
}
|
|
|
57 |
wp_nonce_field('EzAdsenseSubmit', 'EzAdsenseNonce');
|
58 |
?>
|
59 |
<br />
|
easy-adsense-lite.php
CHANGED
@@ -4,7 +4,7 @@
|
|
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 → Easy AdSense</a>.
|
7 |
-
Version: 7.
|
8 |
Author: Manoj Thulasidas
|
9 |
Author URI: http://www.thulasidas.com
|
10 |
*/
|
@@ -505,27 +505,25 @@ if (!class_exists("EzAdSense")) {
|
|
505 |
}
|
506 |
}
|
507 |
|
508 |
-
function migrateOptions() {
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
update_option($this->optionName, $this->options);
|
527 |
-
|
528 |
-
echo "<div class='updated'>Your options have been migrated.</div>";
|
529 |
}
|
530 |
}
|
531 |
|
@@ -790,7 +788,6 @@ if (!class_exists("EzAdSense")) {
|
|
790 |
return $content;
|
791 |
}
|
792 |
$this->ezMax = $this->options['max_count'];
|
793 |
-
$adsServed = 0;
|
794 |
if ($this->options['force_widget']) {
|
795 |
$this->ezMax--;
|
796 |
}
|
@@ -818,7 +815,6 @@ if (!class_exists("EzAdSense")) {
|
|
818 |
$leadin = '';
|
819 |
if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
|
820 |
if ($this->ezCount < $this->ezMax) {
|
821 |
-
$adsServed++;
|
822 |
$this->ezCount++;
|
823 |
$leadin = $this->mkAdBlock("leadin");
|
824 |
}
|
@@ -839,7 +835,6 @@ if (!class_exists("EzAdSense")) {
|
|
839 |
}
|
840 |
if ($this->options['force_midad'] || $half > 10) {
|
841 |
$this->ezCount++;
|
842 |
-
$adsServed++;
|
843 |
$midtext = $this->mkAdBlock("midtext");
|
844 |
$content = substr($content, 0, $split) . $midtext . substr($content, $split);
|
845 |
}
|
@@ -851,7 +846,6 @@ if (!class_exists("EzAdSense")) {
|
|
851 |
if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
|
852 |
if ($this->ezCount < $this->ezMax) {
|
853 |
$this->ezCount++;
|
854 |
-
$adsServed++;
|
855 |
if (strpos($show_leadout, "float") !== false) {
|
856 |
$paras = $this->findParas($content);
|
857 |
$split = array_pop($paras);
|
@@ -993,7 +987,7 @@ if (class_exists("EzAdSense")) {
|
|
993 |
function form($instance) {
|
994 |
// outputs the options form on admin
|
995 |
echo '<p>Configure it at <br />';
|
996 |
-
echo '<a href="options-general.php?page=easy-adsense.php"> ';
|
997 |
echo 'Settings → Easy AdSense</a>';
|
998 |
echo '</p>';
|
999 |
}
|
@@ -1068,7 +1062,7 @@ if (class_exists("EzAdSense")) {
|
|
1068 |
function form($instance) {
|
1069 |
// outputs the options form on admin
|
1070 |
echo '<p>Configure it at <br />';
|
1071 |
-
echo '<a href="options-general.php?page=easy-adsense.php"> ';
|
1072 |
echo 'Settings → Easy AdSense</a>';
|
1073 |
echo '</p>';
|
1074 |
}
|
@@ -1122,7 +1116,7 @@ if (class_exists("EzAdSense")) {
|
|
1122 |
function form($instance) {
|
1123 |
// outputs the options form on admin
|
1124 |
echo '<p>Configure it at <br />';
|
1125 |
-
echo '<a href="options-general.php?page=easy-adsense.php"> ';
|
1126 |
echo 'Settings → Easy AdSense</a>';
|
1127 |
echo '</p>';
|
1128 |
}
|
@@ -1148,6 +1142,7 @@ if (class_exists("EzAdSense")) {
|
|
1148 |
if ($ezAdSense->options['footer_leadout']) {
|
1149 |
add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
|
1150 |
}
|
|
|
1151 |
}
|
1152 |
}
|
1153 |
|
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 → Easy AdSense</a>.
|
7 |
+
Version: 7.12
|
8 |
Author: Manoj Thulasidas
|
9 |
Author URI: http://www.thulasidas.com
|
10 |
*/
|
505 |
}
|
506 |
}
|
507 |
|
508 |
+
function migrateOptions() {
|
509 |
+
$update = false;
|
510 |
+
$lookup = array('limit_lu' => '',
|
511 |
+
'allow_exitjunction' => '',
|
512 |
+
'kill_pages' => 'kill_page',
|
513 |
+
'kill_attach' => 'kill_attachment',
|
514 |
+
'kill_front' => 'kill_front_page',
|
515 |
+
'kill_cat' => 'kill_category');
|
516 |
+
foreach ($lookup as $k => $v) {
|
517 |
+
if (isset($this->options[$k])) {
|
518 |
+
if (!empty($v)) {
|
519 |
+
$this->options[$v] = $this->options[$k];
|
520 |
+
}
|
521 |
+
unset($this->options[$k]);
|
522 |
+
$update = true;
|
523 |
+
}
|
524 |
+
}
|
525 |
+
if ($update) {
|
526 |
update_option($this->optionName, $this->options);
|
|
|
|
|
527 |
}
|
528 |
}
|
529 |
|
788 |
return $content;
|
789 |
}
|
790 |
$this->ezMax = $this->options['max_count'];
|
|
|
791 |
if ($this->options['force_widget']) {
|
792 |
$this->ezMax--;
|
793 |
}
|
815 |
$leadin = '';
|
816 |
if ($show_leadin != 'no' && $wc > $this->options['wc_leadin']) {
|
817 |
if ($this->ezCount < $this->ezMax) {
|
|
|
818 |
$this->ezCount++;
|
819 |
$leadin = $this->mkAdBlock("leadin");
|
820 |
}
|
835 |
}
|
836 |
if ($this->options['force_midad'] || $half > 10) {
|
837 |
$this->ezCount++;
|
|
|
838 |
$midtext = $this->mkAdBlock("midtext");
|
839 |
$content = substr($content, 0, $split) . $midtext . substr($content, $split);
|
840 |
}
|
846 |
if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) {
|
847 |
if ($this->ezCount < $this->ezMax) {
|
848 |
$this->ezCount++;
|
|
|
849 |
if (strpos($show_leadout, "float") !== false) {
|
850 |
$paras = $this->findParas($content);
|
851 |
$split = array_pop($paras);
|
987 |
function form($instance) {
|
988 |
// outputs the options form on admin
|
989 |
echo '<p>Configure it at <br />';
|
990 |
+
echo '<a href="options-general.php?page=easy-adsense-lite.php"> ';
|
991 |
echo 'Settings → Easy AdSense</a>';
|
992 |
echo '</p>';
|
993 |
}
|
1062 |
function form($instance) {
|
1063 |
// outputs the options form on admin
|
1064 |
echo '<p>Configure it at <br />';
|
1065 |
+
echo '<a href="options-general.php?page=easy-adsense-lite.php"> ';
|
1066 |
echo 'Settings → Easy AdSense</a>';
|
1067 |
echo '</p>';
|
1068 |
}
|
1116 |
function form($instance) {
|
1117 |
// outputs the options form on admin
|
1118 |
echo '<p>Configure it at <br />';
|
1119 |
+
echo '<a href="options-general.php?page=easy-adsense-lite.php"> ';
|
1120 |
echo 'Settings → Easy AdSense</a>';
|
1121 |
echo '</p>';
|
1122 |
}
|
1142 |
if ($ezAdSense->options['footer_leadout']) {
|
1143 |
add_action($ezAdSense->options['footer_leadout'], array($ezAdSense, 'footer_leadout'));
|
1144 |
}
|
1145 |
+
register_activation_hook(__FILE__, array($ezAdSense, 'migrateOptions'));
|
1146 |
}
|
1147 |
}
|
1148 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://buy.thulasidas.com/easy-adsense
|
|
4 |
Tags: adsense, google adsense, ads, advertising, easy adsense, google, adsense plugin
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 7.
|
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!
|
@@ -42,7 +42,7 @@ Easy AdSense is the freely distributed version of a premium plugin. The [Pro ver
|
|
42 |
|
43 |
== Upgrade Notice ==
|
44 |
|
45 |
-
|
46 |
|
47 |
== Screenshots ==
|
48 |
|
@@ -140,6 +140,8 @@ A big "Thank You" to all my translators. Easy AdSense V2.6+ sports an *Easy Tran
|
|
140 |
|
141 |
== Change Log ==
|
142 |
|
|
|
|
|
143 |
* V7.10: Coding improvements. [Apr 2, 2014]
|
144 |
* V7.02: Fixing a bug related to showing borders around ad blocks. [Apr 1, 2014]
|
145 |
* V7.01: Changes to show ads on home/front pages made up of full posts. Translation interface improvements. [Mar 29, 2014]
|
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.12
|
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!
|
42 |
|
43 |
== Upgrade Notice ==
|
44 |
|
45 |
+
Auto migrating options to current version if needed.
|
46 |
|
47 |
== Screenshots ==
|
48 |
|
140 |
|
141 |
== Change Log ==
|
142 |
|
143 |
+
* V7.12: Auto migrating options to current version if needed. [Apr 2, 2014]
|
144 |
+
* V7.11: Minor fixes to the links on the widgets page. [Apr 2, 2014]
|
145 |
* V7.10: Coding improvements. [Apr 2, 2014]
|
146 |
* V7.02: Fixing a bug related to showing borders around ad blocks. [Apr 1, 2014]
|
147 |
* V7.01: Changes to show ads on home/front pages made up of full posts. Translation interface improvements. [Mar 29, 2014]
|
tail-text.php
CHANGED
@@ -23,7 +23,7 @@ if (!$ez->killAuthor) {
|
|
23 |
<td>
|
24 |
<ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
|
25 |
<li>
|
26 |
-
<?php _e('Check out my other plugin and PHP efforts:', 'easy-
|
27 |
<script type = "text/javascript">
|
28 |
function popupwindow(url, title, w, h) {
|
29 |
var left = (screen.width / 2) - (w / 2);
|
@@ -53,7 +53,7 @@ if (!$ez->killAuthor) {
|
|
53 |
</li>
|
54 |
|
55 |
<li>
|
56 |
-
<?php _e('My Books -- on Physics, Philosophy, making Money etc:', 'easy-
|
57 |
|
58 |
<ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
|
59 |
|
23 |
<td>
|
24 |
<ul style="padding-left:10px;list-style-type:circle; list-style-position:inside;" >
|
25 |
<li>
|
26 |
+
<?php _e('Check out my other plugin and PHP efforts:', 'easy-common'); ?>
|
27 |
<script type = "text/javascript">
|
28 |
function popupwindow(url, title, w, h) {
|
29 |
var left = (screen.width / 2) - (w / 2);
|
53 |
</li>
|
54 |
|
55 |
<li>
|
56 |
+
<?php _e('My Books -- on Physics, Philosophy, making Money etc:', 'easy-common'); ?>
|
57 |
|
58 |
<ul style="margin-left:0px; padding-left:30px;list-style-type:square; list-style-position:inside;" >
|
59 |
|