Version Description
- Bug Fix - Fix the Quicktag Buttons display error on the HTML Edit Post SubPanel, make it compatible with WP 3.1 onward.
- Date: 31-Mar-2011
Download this release
Release Info
Developer | philipze |
Plugin | Quick Adsense |
Version | 1.8.4 |
Comparing to | |
See all releases |
Code changes from version 1.8.3 to 1.8.4
- quick-adsense.php +34 -5
- readme.txt +6 -2
quick-adsense.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
Plugin URI: http://techmilieu.com/quick-adsense
|
6 |
Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
7 |
Author: Philip Ze
|
8 |
-
Version: 1.8.
|
9 |
Author URI: http://techmilieu.com/
|
10 |
*/
|
11 |
|
@@ -34,7 +34,7 @@ global $QData;
|
|
34 |
$QData['AdsWid'] = 10; /* Ads on Widget */
|
35 |
$QData['Ads'] = 10; /* Ads on Post body */
|
36 |
$QData['Name'] = 'Quick Adsense';
|
37 |
-
$QData['Version'] = '1.8.
|
38 |
$QData['URI'] = 'http://techmilieu.com/quick-adsense';
|
39 |
$QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
|
40 |
$QData['Default'] = array(
|
@@ -106,31 +106,60 @@ function plugin_activated() {
|
|
106 |
register_activation_hook( __FILE__, 'plugin_activated' );
|
107 |
|
108 |
|
|
|
109 |
function ads_head_java() {
|
110 |
global $QData;
|
|
|
111 |
if (get_option('QckTags')) { ?>
|
112 |
<script type="text/javascript">
|
|
|
|
|
|
|
113 |
if(typeof(edButtons)!='undefined') {
|
|
|
114 |
var dynads={"all":[
|
115 |
<?php for ($i=1;$i<=$QData['Ads'];$i++) { if(get_option('AdsCode'.$i)!=''){echo('"1",');}else{echo('"0",');}; } ?>
|
116 |
"0"]};
|
117 |
for(i=1;i<=<?php echo($QData['Ads']) ?>;i++) {
|
118 |
if(dynads.all[i-1]=="1") {
|
119 |
edButtons[edButtons.length]=new edButton("ads"+i.toString(),"Ads"+i.toString(),"\n<!--Ads"+i.toString()+"-->\n","","",-1);
|
|
|
|
|
120 |
}
|
121 |
}
|
122 |
<?php if(!get_option('QckRnds')){ ?>
|
123 |
edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
|
|
|
|
|
|
|
124 |
<?php } ?>
|
125 |
<?php if(!get_option('QckOffs')){ ?>
|
126 |
edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
|
|
129 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
</script>
|
131 |
<?php }
|
132 |
}
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
|
136 |
$ShownAds = 0;
|
5 |
Plugin URI: http://techmilieu.com/quick-adsense
|
6 |
Description: Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
7 |
Author: Philip Ze
|
8 |
+
Version: 1.8.4
|
9 |
Author URI: http://techmilieu.com/
|
10 |
*/
|
11 |
|
34 |
$QData['AdsWid'] = 10; /* Ads on Widget */
|
35 |
$QData['Ads'] = 10; /* Ads on Post body */
|
36 |
$QData['Name'] = 'Quick Adsense';
|
37 |
+
$QData['Version'] = '1.8.4';
|
38 |
$QData['URI'] = 'http://techmilieu.com/quick-adsense';
|
39 |
$QData['AdsWidName'] = 'AdsWidget%d (Quick Adsense)';
|
40 |
$QData['Default'] = array(
|
106 |
register_activation_hook( __FILE__, 'plugin_activated' );
|
107 |
|
108 |
|
109 |
+
$wpvcomp = (bool)(version_compare($wp_version, '3.1', '>='));
|
110 |
function ads_head_java() {
|
111 |
global $QData;
|
112 |
+
global $wpvcomp;
|
113 |
if (get_option('QckTags')) { ?>
|
114 |
<script type="text/javascript">
|
115 |
+
wpvcomp = <?php echo(($wpvcomp==1)?"true":"false"); ?>;
|
116 |
+
edaddID = new Array();
|
117 |
+
edaddNm = new Array();
|
118 |
if(typeof(edButtons)!='undefined') {
|
119 |
+
edadd = edButtons.length;
|
120 |
var dynads={"all":[
|
121 |
<?php for ($i=1;$i<=$QData['Ads'];$i++) { if(get_option('AdsCode'.$i)!=''){echo('"1",');}else{echo('"0",');}; } ?>
|
122 |
"0"]};
|
123 |
for(i=1;i<=<?php echo($QData['Ads']) ?>;i++) {
|
124 |
if(dynads.all[i-1]=="1") {
|
125 |
edButtons[edButtons.length]=new edButton("ads"+i.toString(),"Ads"+i.toString(),"\n<!--Ads"+i.toString()+"-->\n","","",-1);
|
126 |
+
edaddID[edaddID.length] = "ads"+i.toString();
|
127 |
+
edaddNm[edaddNm.length] = "Ads"+i.toString();
|
128 |
}
|
129 |
}
|
130 |
<?php if(!get_option('QckRnds')){ ?>
|
131 |
edButtons[edButtons.length]=new edButton("random_ads","RndAds","\n<!--RndAds-->\n","","",-1);
|
132 |
+
edaddID[edaddID.length] = "random_ads";
|
133 |
+
edaddNm[edaddNm.length] = "RndAds";
|
134 |
+
|
135 |
<?php } ?>
|
136 |
<?php if(!get_option('QckOffs')){ ?>
|
137 |
edButtons[edButtons.length]=new edButton("no_ads","NoAds","\n<!--NoAds-->\n","","",-1);
|
138 |
+
edaddID[edaddID.length] = "no_ads";
|
139 |
+
edaddNm[edaddNm.length] = "NoAds";
|
140 |
+
edButtons[edButtons.length]=new edButton("off_def","OffDef","\n<!--OffDef-->\n","","",-1);
|
141 |
+
edaddID[edaddID.length] = "off_def";
|
142 |
+
edaddNm[edaddNm.length] = "OffDef";
|
143 |
+
<?php } ?>
|
144 |
};
|
145 |
+
(function(){
|
146 |
+
if(typeof(edButtons)!='undefined' && typeof(jQuery)!='undefined' && wpvcomp){
|
147 |
+
jQuery(document).ready(function(){
|
148 |
+
for(i=0;i<edaddID.length;i++) {
|
149 |
+
jQuery("#ed_toolbar").append('<input type="button" value="' + edaddNm[i] +'" id="' + edaddID[i] +'" class="ed_button" onclick="edInsertTag(edCanvas, ' + (edadd+i) + ');" title="' + edaddNm[i] +'" />');
|
150 |
+
}
|
151 |
+
});
|
152 |
+
}
|
153 |
+
}());
|
154 |
</script>
|
155 |
<?php }
|
156 |
}
|
157 |
+
if ($wpvcomp) {
|
158 |
+
add_action('edit_form_advanced', 'ads_head_java');
|
159 |
+
add_action('edit_page_form', 'ads_head_java');
|
160 |
+
}else{
|
161 |
+
add_action('admin_head', 'ads_head_java');
|
162 |
+
}
|
163 |
|
164 |
|
165 |
$ShownAds = 0;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Philip Ze
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8609041
|
4 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
5 |
Requires at least: 2.5
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.8.
|
8 |
|
9 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
10 |
|
@@ -49,6 +49,10 @@ Please feedback to [http://techmilieu.com/quick-adsense](http://techmilieu.com/q
|
|
49 |
|
50 |
== Change Log ==
|
51 |
|
|
|
|
|
|
|
|
|
52 |
= 1.8.3 =
|
53 |
* Bug Fix - Remove the ads from Feed, Ads shouldn't be there in the first place.
|
54 |
* Date: 16-Jan-2011
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8609041
|
4 |
Tags: WordPress Plugin, adsense, google adsense, random adsense, random ads, advertising, adsense insertion, ad manager, ad, yahoo, google, ads, text insertion, widget, sidebar, admin, posts, plugin
|
5 |
Requires at least: 2.5
|
6 |
+
Tested up to: 3.1
|
7 |
+
Stable tag: 1.8.4
|
8 |
|
9 |
Quick Adsense offers a quicker & flexible way to insert Google Adsense or any Ads code into a blog post.
|
10 |
|
49 |
|
50 |
== Change Log ==
|
51 |
|
52 |
+
= 1.8.4 =
|
53 |
+
* Bug Fix - Fix the Quicktag Buttons display error on the HTML Edit Post SubPanel, make it compatible with WP 3.1 onward.
|
54 |
+
* Date: 31-Mar-2011
|
55 |
+
|
56 |
= 1.8.3 =
|
57 |
* Bug Fix - Remove the ads from Feed, Ads shouldn't be there in the first place.
|
58 |
* Date: 16-Jan-2011
|