Version Description
Download this release
Release Info
Developer | india-web-developer |
Plugin | Custom Share Buttons with Floating Sidebar |
Version | 1.1 |
Comparing to | |
See all releases |
Version 1.1
- csbwfs-class.php +258 -0
- css/csbwfs.css +58 -0
- custom-share-buttons-with-floating-sidebar.php +230 -0
- images/fb.png +0 -0
- images/gp.png +0 -0
- images/hide.png +0 -0
- images/in.png +0 -0
- images/ml.png +0 -0
- images/pinit.png +0 -0
- images/raghu.jpg +0 -0
- images/show.png +0 -0
- images/tw.png +0 -0
- readme.txt +61 -0
csbwfs-class.php
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Define all the function
|
4 |
+
* Custom Share Buttons With Floating Sidebar
|
5 |
+
*
|
6 |
+
* */
|
7 |
+
// get all options value for "Custom Share Buttons with Floating Sidebar"
|
8 |
+
function get_csbwf_sidebar_options() {
|
9 |
+
global $wpdb;
|
10 |
+
$ctOptions = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'csbwfs_%'");
|
11 |
+
|
12 |
+
foreach ($ctOptions as $option) {
|
13 |
+
$ctOptions[$option->option_name] = $option->option_value;
|
14 |
+
}
|
15 |
+
|
16 |
+
return $ctOptions;
|
17 |
+
}
|
18 |
+
|
19 |
+
// Get plugin options
|
20 |
+
$pluginOptionsVal=get_csbwf_sidebar_options();
|
21 |
+
//check plugin in enable or not
|
22 |
+
if($pluginOptionsVal['csbwfs_active']==1){
|
23 |
+
add_action('wp_footer','get_csbwf_sidebar_content');
|
24 |
+
add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
|
25 |
+
add_action('wp_footer','csbwf_sidebar_load_inline_js');
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
//register style and scrip files
|
30 |
+
function csbwf_sidebar_scripts() {
|
31 |
+
wp_enqueue_script( 'jquery' ); // wordpress jQuery
|
32 |
+
wp_register_style( 'csbwf_sidebar_style', plugins_url( 'css/csbwfs.css',__FILE__ ) );
|
33 |
+
wp_enqueue_style( 'csbwf_sidebar_style' );
|
34 |
+
}
|
35 |
+
|
36 |
+
/*
|
37 |
+
-----------------------------------------------------------------------------------------------
|
38 |
+
"Add the jQuery code in head section using hooks"
|
39 |
+
-----------------------------------------------------------------------------------------------
|
40 |
+
*/
|
41 |
+
|
42 |
+
|
43 |
+
function csbwf_sidebar_load_inline_js()
|
44 |
+
{
|
45 |
+
$pluginOptionsVal=get_csbwf_sidebar_options();
|
46 |
+
$jscnt='<script>jQuery(document).ready(function()
|
47 |
+
{ ';
|
48 |
+
|
49 |
+
if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
|
50 |
+
$jscnt.='jQuery("div#tw a").hover(function(){
|
51 |
+
jQuery("div#tw a").animate({width:"60px"});
|
52 |
+
},function(){
|
53 |
+
jQuery("div#tw a").stop( true, true ).animate({width:"45px"});
|
54 |
+
});';
|
55 |
+
endif;
|
56 |
+
|
57 |
+
if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
|
58 |
+
$jscnt.='jQuery("div#fb a").hover(function(){
|
59 |
+
jQuery("div#fb a").animate({width:"60px"});
|
60 |
+
},function(){
|
61 |
+
jQuery("div#fb a").stop( true, true ).animate({width:"45px"});
|
62 |
+
});';
|
63 |
+
endif;
|
64 |
+
|
65 |
+
if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
|
66 |
+
$jscnt.='jQuery("div#ml a").hover(function(){
|
67 |
+
jQuery("div#ml a").animate({width:"60px"});
|
68 |
+
},function(){
|
69 |
+
jQuery("div#ml a").stop( true, true ).animate({width:"45px"});
|
70 |
+
});';
|
71 |
+
endif;
|
72 |
+
|
73 |
+
if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):
|
74 |
+
$jscnt.='jQuery("div#gp a").hover(function(){
|
75 |
+
jQuery("div#gp a").animate({width:"60px"});
|
76 |
+
},function(){
|
77 |
+
jQuery("div#gp a").stop( true, true ).animate({width:"45px"});
|
78 |
+
});';
|
79 |
+
endif;
|
80 |
+
|
81 |
+
if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
|
82 |
+
$jscnt.='jQuery("div#li a").hover(function(){
|
83 |
+
jQuery("div#li a").animate({width:"60px"});
|
84 |
+
},function(){
|
85 |
+
jQuery("div#li a").stop( true, true ).animate({width:"45px"});
|
86 |
+
});';
|
87 |
+
endif;
|
88 |
+
|
89 |
+
if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
|
90 |
+
$jscnt.='jQuery("div#pin a").hover(function(){
|
91 |
+
jQuery("div#pin a").animate({width:"60px"});
|
92 |
+
},function(){
|
93 |
+
jQuery("div#pin a").stop( true, true ).animate({width:"45px"});
|
94 |
+
});';
|
95 |
+
endif;
|
96 |
+
|
97 |
+
$jscnt.='jQuery("div.show").hide();
|
98 |
+
jQuery("div.show a").click(function(){
|
99 |
+
jQuery("div#social-inner").show(500);
|
100 |
+
jQuery("div.show").hide(500);
|
101 |
+
jQuery("div.hide").show(500);
|
102 |
+
});
|
103 |
+
|
104 |
+
jQuery("div.hide a").click(function(){
|
105 |
+
jQuery("div.show").show(500);
|
106 |
+
jQuery("div.hide").hide(500);
|
107 |
+
jQuery("div#social-inner").hide(500);
|
108 |
+
});
|
109 |
+
|
110 |
+
});</script>';
|
111 |
+
|
112 |
+
echo $jscnt;
|
113 |
+
}
|
114 |
+
|
115 |
+
/*
|
116 |
+
-----------------------------------------------------------------------------------------------
|
117 |
+
"Custom Share Buttons with Floating Sidebar" HTML
|
118 |
+
-----------------------------------------------------------------------------------------------
|
119 |
+
*/
|
120 |
+
|
121 |
+
|
122 |
+
function get_csbwf_sidebar_content() {
|
123 |
+
global $post;
|
124 |
+
$pluginOptionsVal=get_csbwf_sidebar_options();
|
125 |
+
|
126 |
+
if(is_category())
|
127 |
+
{
|
128 |
+
$category_id = get_query_var('cat');
|
129 |
+
$shareurl =get_category_link( $category_id );
|
130 |
+
$cats = get_the_category();
|
131 |
+
$ShareTitle=$cats[0]->name;
|
132 |
+
}elseif(is_page() || is_single())
|
133 |
+
{
|
134 |
+
$shareurl=get_permalink($post->ID);
|
135 |
+
$ShareTitle=$post->post_title;
|
136 |
+
}
|
137 |
+
else
|
138 |
+
{
|
139 |
+
$shareurl =home_url('/');
|
140 |
+
$ShareTitle=get_bloginfo('name');
|
141 |
+
}
|
142 |
+
|
143 |
+
/* Get All buttons Image */
|
144 |
+
|
145 |
+
//get facebook button image
|
146 |
+
if($pluginOptionsVal['csbwfs_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_fb_image'];}
|
147 |
+
else{$fImg=plugins_url('images/fb.png',__FILE__);}
|
148 |
+
//get twitter button image
|
149 |
+
if($pluginOptionsVal['csbwfs_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_tw_image'];}
|
150 |
+
else{$tImg=plugins_url('images/tw.png',__FILE__);}
|
151 |
+
//get linkdin button image
|
152 |
+
if($pluginOptionsVal['csbwfs_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_li_image'];}
|
153 |
+
else{$lImg=plugins_url('images/in.png',__FILE__);}
|
154 |
+
//get mail button image
|
155 |
+
if($pluginOptionsVal['csbwfs_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_mail_image'];}
|
156 |
+
else{$mImg=plugins_url('images/ml.png',__FILE__);}
|
157 |
+
//get google plus button image
|
158 |
+
if($pluginOptionsVal['csbwfs_gp_image']!=''){ $gImg=$pluginOptionsVal['csbwfs_gp_image'];}
|
159 |
+
else{$gImg=plugins_url('images/gp.png',__FILE__);}
|
160 |
+
//get pinterest button image
|
161 |
+
if($pluginOptionsVal['csbwfs_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_pin_image'];}
|
162 |
+
else{$pImg=plugins_url('images/pinit.png',__FILE__);}
|
163 |
+
//get email message
|
164 |
+
if(is_page() || is_single() || is_category() || is_archive()){
|
165 |
+
|
166 |
+
if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
|
167 |
+
$mailMsg='?subject='.get_the_title().'&body='.get_the_permalink();}
|
168 |
+
}else
|
169 |
+
{
|
170 |
+
$mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
// Top Margin
|
175 |
+
if($pluginOptionsVal['csbwfs_top_margin']!=''){
|
176 |
+
$margin=$pluginOptionsVal['csbwfs_top_margin'];
|
177 |
+
}else
|
178 |
+
{
|
179 |
+
$margin='25%';
|
180 |
+
}
|
181 |
+
|
182 |
+
//Sidebar Position
|
183 |
+
if($pluginOptionsVal['csbwfs_position']=='right'){
|
184 |
+
$style=' style="top:'.$margin.';right:-5px;"';
|
185 |
+
$idName=' id="csbwfs-right"';
|
186 |
+
$showImg='hide.png';
|
187 |
+
$hideImg='show.png';
|
188 |
+
|
189 |
+
}else
|
190 |
+
{
|
191 |
+
$idName=' id="csbwfs-left"';
|
192 |
+
$style=' style="top:'.$margin.';left:0;"';
|
193 |
+
$showImg='show.png';
|
194 |
+
$hideImg='hide.png';
|
195 |
+
}
|
196 |
+
?>
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
<div class='social-widget' <?php echo $idName;?> title="Share This With Your Friends" <?php echo $style;?> >
|
201 |
+
|
202 |
+
<div class="show"><a href="javascript:" alt="Email" id="show"><img src="<?php echo plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$showImg);?>" title="Show Buttons"></a></div>
|
203 |
+
|
204 |
+
<div id="social-inner">
|
205 |
+
<?php if(get_csbwf_sidebar_options('csbwfs_fpublishBtn')!=''):?>
|
206 |
+
<!-- Facebook -->
|
207 |
+
<div class="sbutton">
|
208 |
+
<div id="fb">
|
209 |
+
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"
|
210 |
+
target="_blank" alt="Share on Facebook"> <img src="<?php echo $fImg;?>"></a></div>
|
211 |
+
</div>
|
212 |
+
<?php endif;?>
|
213 |
+
<?php if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):?>
|
214 |
+
<!-- Twitter -->
|
215 |
+
<div class="sbutton">
|
216 |
+
<div id="tw"><a href="javascript:" onclick="window.open('https://twitter.com/?status=<?php echo $ShareTitle;?> <?php echo $shareurl;?>', '_blank', 'width=800,height=300')" alt="Twitter"><img src="<?php echo $tImg;?>"></a></div>
|
217 |
+
</div>
|
218 |
+
<?php endif;?>
|
219 |
+
<?php if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):?>
|
220 |
+
<!-- Google plus -->
|
221 |
+
<div class="sbutton">
|
222 |
+
|
223 |
+
<div id="gp"><a href="https://plus.google.com/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,
|
224 |
+
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Google Plus">
|
225 |
+
<img src="<?php echo $gImg;?>"></a></div>
|
226 |
+
</div>
|
227 |
+
<?php endif;?>
|
228 |
+
<?php if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):?>
|
229 |
+
<!-- Linkdin -->
|
230 |
+
<div class="sbutton">
|
231 |
+
|
232 |
+
<div id="li">
|
233 |
+
<a href="https://www.linkedin.com/cws/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,
|
234 |
+
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Google Plus">
|
235 |
+
<img src="<?php echo $lImg;?>"></a></div>
|
236 |
+
</div>
|
237 |
+
<?php endif;?>
|
238 |
+
<?php if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):?>
|
239 |
+
<!-- Pinterest -->
|
240 |
+
<div class="sbutton">
|
241 |
+
|
242 |
+
<div id="pin"><a onclick="window.open('http://pinterest.com/pin/create/button/?url=<?php echo $shareurl;?>&media=http://myrevsource.pbodev.info/Projects/newrevsite/img/logo.png&description=<?php echo $ShareTitle;?> :<?php echo $shareurl;?>','pinIt','toolbar=0,status=0,width=620,height=500');" href="javascript:void(0);" style="width: 45px;"><img src="<?php echo $pImg;?>"></a></div>
|
243 |
+
</div>
|
244 |
+
<?php endif;?>
|
245 |
+
<?php if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):?>
|
246 |
+
<!-- Mail-->
|
247 |
+
<div class="sbutton">
|
248 |
+
<div id="ml"><a href="mailto:<?php echo $mailMsg;?>" alt="Email"><img src="<?php echo $mImg;?>"></a></div>
|
249 |
+
</div>
|
250 |
+
<?php endif;?>
|
251 |
+
</div>
|
252 |
+
|
253 |
+
<div class="hide"><a href="javascript:" alt="Email" id="hide"><img src="<?php echo plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$hideImg);?>" title="Hide Buttons"></a></div>
|
254 |
+
|
255 |
+
</div>
|
256 |
+
<?php
|
257 |
+
}
|
258 |
+
?>
|
css/csbwfs.css
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.social-widget {
|
2 |
+
position:fixed;
|
3 |
+
z-index:998;
|
4 |
+
width:auto;
|
5 |
+
}
|
6 |
+
.social-widget .sbutton {
|
7 |
+
margin: 0px;
|
8 |
+
}
|
9 |
+
.sbutton img{padding:5px;}
|
10 |
+
|
11 |
+
#tw a{background:none repeat scroll 0 0 #2CA8D2; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1)}
|
12 |
+
|
13 |
+
#fb a{background:none repeat scroll 0 0 #305891; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1);outline:none;}
|
14 |
+
|
15 |
+
#ml a{background:none repeat scroll 0 0 #738A8D; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1);outline:none;}
|
16 |
+
|
17 |
+
#gp a{background:none repeat scroll 0 0 #DD4C39; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1); outline:none;}
|
18 |
+
|
19 |
+
#li a{background:none repeat scroll 0 0 #007BB6; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1); outline:none;}
|
20 |
+
|
21 |
+
#pin a{background:none repeat scroll 0 0 #ca2027; text-align:center; display:block; width:45px; height:40px; border-bottom:1px solid rgba(255, 255, 255, 0.1); outline:none;}
|
22 |
+
#csbwfs-right #fb a {
|
23 |
+
position: absolute;
|
24 |
+
right: 0;
|
25 |
+
top:20px;
|
26 |
+
}
|
27 |
+
#csbwfs-right #tw a {
|
28 |
+
position: absolute;
|
29 |
+
right: 0;
|
30 |
+
top:61px;
|
31 |
+
}
|
32 |
+
#csbwfs-right #gp a {
|
33 |
+
position: absolute;
|
34 |
+
right: 0;
|
35 |
+
top:102px;
|
36 |
+
}
|
37 |
+
|
38 |
+
#csbwfs-right #li a {
|
39 |
+
position: absolute;
|
40 |
+
right: 0;
|
41 |
+
top:143px;
|
42 |
+
}
|
43 |
+
#csbwfs-right #pin a {
|
44 |
+
position: absolute;
|
45 |
+
right: 0;
|
46 |
+
top:184px;
|
47 |
+
}
|
48 |
+
#csbwfs-right #ml a {
|
49 |
+
position: absolute;
|
50 |
+
right: 0;
|
51 |
+
top:225px;
|
52 |
+
}
|
53 |
+
|
54 |
+
#csbwfs-right a#hide {padding-right:33px;}
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
custom-share-buttons-with-floating-sidebar.php
ADDED
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Custom Share Buttons with Floating Sidebar
|
4 |
+
Plugin URI: http://www.mrwebsolution.in/
|
5 |
+
Description: "custom-share-buttons-with-floating-sidebar" is the very simple plugin for add to social share buttons with float sidebar. Even you can change the share buttons images if you wish
|
6 |
+
Author: Raghunath
|
7 |
+
Author URI: http://raghunathgurjar.wordpress.com
|
8 |
+
Version: 1.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
/* Copyright YEAR PLUGIN_AUTHOR_NAME (email : raghunath.0087@gmail.com)
|
12 |
+
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License, version 2, as
|
15 |
+
published by the Free Software Foundation.
|
16 |
+
|
17 |
+
This program is distributed in the hope that it will be useful,
|
18 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
GNU General Public License for more details.
|
21 |
+
|
22 |
+
You should have received a copy of the GNU General Public License
|
23 |
+
along with this program; if not, write to the Free Software
|
24 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
+
*/
|
26 |
+
|
27 |
+
//Admin "Custom Share Buttons with Floating Sidebar" Menu Item
|
28 |
+
add_action('admin_menu','csbwf_sidebar_menu');
|
29 |
+
|
30 |
+
function csbwf_sidebar_menu(){
|
31 |
+
|
32 |
+
add_options_page('Custom Share Buttons With Floating Sidebar','Custom Share Buttons With Floating Sidebar','manage_options','csbwfs-settings','csbwf_sidebar_admin_option_page');
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
//Define Action for register "Custom Share Buttons with Floating Sidebar" Options
|
37 |
+
add_action('admin_init','csbwf_sidebar_init');
|
38 |
+
|
39 |
+
|
40 |
+
//Register "Custom Share Buttons with Floating Sidebar" options
|
41 |
+
function csbwf_sidebar_init(){
|
42 |
+
|
43 |
+
register_setting('csbwf_sidebar_options','csbwfs_active');
|
44 |
+
register_setting('csbwf_sidebar_options','csbwfs_position');
|
45 |
+
register_setting('csbwf_sidebar_options','csbwfs_fb_image');
|
46 |
+
register_setting('csbwf_sidebar_options','csbwfs_tw_image');
|
47 |
+
register_setting('csbwf_sidebar_options','csbwfs_li_image');
|
48 |
+
register_setting('csbwf_sidebar_options','csbwfs_mail_image');
|
49 |
+
register_setting('csbwf_sidebar_options','csbwfs_gp_image');
|
50 |
+
register_setting('csbwf_sidebar_options','csbwfs_pin_image');
|
51 |
+
register_setting('csbwf_sidebar_options','csbwfs_fpublishBtn');
|
52 |
+
register_setting('csbwf_sidebar_options','csbwfs_tpublishBtn');
|
53 |
+
register_setting('csbwf_sidebar_options','csbwfs_gpublishBtn');
|
54 |
+
register_setting('csbwf_sidebar_options','csbwfs_ppublishBtn');
|
55 |
+
register_setting('csbwf_sidebar_options','csbwfs_lpublishBtn');
|
56 |
+
register_setting('csbwf_sidebar_options','csbwfs_mpublishBtn');
|
57 |
+
register_setting('csbwf_sidebar_options','csbwfs_mailMessage');
|
58 |
+
register_setting('csbwf_sidebar_options','csbwfs_top_margin');
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
// Add settings link to plugin list page in admin
|
64 |
+
function csbwfs_add_settings_link( $links ) {
|
65 |
+
$settings_link = '<a href="options-general.php?page=csbwfs-settings">' . __( 'Settings', 'csbwfs' ) . '</a>';
|
66 |
+
array_unshift( $links, $settings_link );
|
67 |
+
return $links;
|
68 |
+
}
|
69 |
+
|
70 |
+
$plugin = plugin_basename( __FILE__ );
|
71 |
+
add_filter( "plugin_action_links_$plugin", 'csbwfs_add_settings_link' );
|
72 |
+
|
73 |
+
/** Display the Options form for CSBWFS */
|
74 |
+
|
75 |
+
function csbwf_sidebar_admin_option_page(){ ?>
|
76 |
+
|
77 |
+
<div style="width: 80%; padding: 10px; margin: 10px;">
|
78 |
+
|
79 |
+
<h2>Custom Share Buttons With Floating Sidebar Settings</h2>
|
80 |
+
|
81 |
+
<p style="padding-bottom: 2%;">Please fill all options value.</p>
|
82 |
+
|
83 |
+
<!-- Start Options Form -->
|
84 |
+
|
85 |
+
<form action="options.php" method="post" id="csbwf-sidebar-admin-form">
|
86 |
+
<table class="cssfw">
|
87 |
+
<tr>
|
88 |
+
<th><?php echo 'Enable Plugin:';?></th>
|
89 |
+
<td>
|
90 |
+
<input type="checkbox" id="csbwfs_active" name="csbwfs_active" value='1' <?php if(get_option('csbwfs_active')!=''){ echo ' checked="checked"'; }?>/>
|
91 |
+
</td>
|
92 |
+
<td rowspan="17" valign="top" style="padding-left: 20px;border-left:1px solid #ccc;">
|
93 |
+
<h2>Plugin Author:</h2>
|
94 |
+
<div style="font-size: 14px;">
|
95 |
+
<img src="<?php echo plugins_url( 'images/raghu.jpg' , __FILE__ );?>" width="100" height="100"><br><a href="http://raghunathgurjar.wordpress.com" target="_blank">Raghunath Gurjar</a><br><br>Author Blog <a href="http://raghunathgurjar.wordpress.com" target="_blank">http://raghunathgurjar.wordpress.com</a>
|
96 |
+
<br><br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4" target="_blank" style="font-size: 17px; font-weight: bold;">Donate for this plugin</a><br><br>
|
97 |
+
Other Plugins:<br>
|
98 |
+
<ul>
|
99 |
+
<li><a href="https://wordpress.org/plugins/simple-testimonial-rutator/" target="_blank">Simple Testimonial Rutator(Responsive)</a></li>
|
100 |
+
</ul>
|
101 |
+
</div></td>
|
102 |
+
</tr>
|
103 |
+
<tr>
|
104 |
+
<th nowrap><?php echo 'Siderbar Position:';?></th>
|
105 |
+
<td>
|
106 |
+
<select id="csbwfs_position" name="csbwfs_position" >
|
107 |
+
<option value="left" <?php if(get_option('csbwfs_position')=='left'){echo 'selected="selected"';}?>>Left</option>
|
108 |
+
<option value="right" <?php if(get_option('csbwfs_position')=='right'){echo 'selected="selected"';}?>>Right</option>
|
109 |
+
</select>
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
<tr><td colspan="2"> </td></tr>
|
113 |
+
<tr><td colspan="2"><h2 style="width: 80%; border-bottom: 1px solid #666; padding-top: 10px; padding-bottom: 10px;"><strong>Social Share Button Images (Size:36X34)</strong></h2></td></tr>
|
114 |
+
<tr>
|
115 |
+
<th><?php echo 'Facebook:';?></th>
|
116 |
+
<td>
|
117 |
+
|
118 |
+
<input type="textbox" id="csbwfs_fb_image" name="csbwfs_fb_image" value="<?php echo get_option('csbwfs_fb_image'); ?>" placeholder="Insert facebook button image path" size="40"/>
|
119 |
+
</td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<th><?php echo 'Twitter:';?></th>
|
123 |
+
<td>
|
124 |
+
|
125 |
+
<input type="textbox" id="csbwfs_tw_image" name="csbwfs_tw_image" value="<?php echo get_option('csbwfs_tw_image'); ?>" placeholder="Insert twitter button image path" size="40"/>
|
126 |
+
</td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<th><?php echo 'Linkdin:';?></th>
|
130 |
+
<td>
|
131 |
+
|
132 |
+
<input type="textbox" id="csbwfs_li_image" name="csbwfs_li_image" value="<?php echo get_option('csbwfs_li_image'); ?>" placeholder="Insert linkdin button image path" size="40"/>
|
133 |
+
</td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<th><?php echo 'Pintrest:';?></th>
|
137 |
+
<td>
|
138 |
+
|
139 |
+
<input type="textbox" id="csbwfs_pin_image" name="csbwfs_pin_image" value="<?php echo get_option('csbwfs_pin_image'); ?>" placeholder="Insert pinterest button image path" size="40"/>
|
140 |
+
</td>
|
141 |
+
</tr>
|
142 |
+
<tr>
|
143 |
+
<th><?php echo 'Google:';?></th>
|
144 |
+
<td>
|
145 |
+
|
146 |
+
<input type="textbox" id="csbwfs_gp_image" name="csbwfs_gp_image" value="<?php echo get_option('csbwfs_gp_image'); ?>" placeholder="Insert google button image path" size="40"/>
|
147 |
+
</td>
|
148 |
+
</tr>
|
149 |
+
<tr>
|
150 |
+
<th><?php echo 'Mail:';?></th>
|
151 |
+
<td>
|
152 |
+
|
153 |
+
<input type="textbox" id="csbwfs_mail_image" name="csbwfs_mail_image" value="<?php echo get_option('csbwfs_mail_image'); ?>" placeholder="Insert mail button image path" size="40"/>
|
154 |
+
</td>
|
155 |
+
</tr>
|
156 |
+
<tr><td colspan="2"><h2 style="width: 80%; border-bottom: 1px solid #666; padding-top: 10px; padding-bottom: 10px;"><strong>Style(Optional):</strong></h2></td></tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<th><?php echo 'Top Margin:';?></th>
|
160 |
+
<td>
|
161 |
+
|
162 |
+
<input type="textbox" id="csbwfs_top_margin" name="csbwfs_top_margin" value="<?php echo get_option('csbwfs_top_margin'); ?>" placeholder="10% OR 10px" size="10"/>
|
163 |
+
</td>
|
164 |
+
</tr>
|
165 |
+
|
166 |
+
<tr><td colspan="2"><h2 style="width: 90%; border-bottom: 1px solid #666; padding-top: 10px; padding-bottom: 10px;"><strong>Social Share Button Publish Options</strong></h2></td></tr>
|
167 |
+
<tr>
|
168 |
+
<th valign="top"><?php echo 'Publish Buttons:';?></th>
|
169 |
+
<td valign="top"><input type="checkbox" id="publish1" value="yes" name="csbwfs_fpublishBtn" <?php if(get_option('csbwfs_fpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Facebook Button</b><br>
|
170 |
+
<input type="checkbox" id="publish2" name="csbwfs_tpublishBtn" value="yes" <?php if(get_option('csbwfs_tpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Twitter Button</b><br>
|
171 |
+
<input type="checkbox" id="publish3" name="csbwfs_gpublishBtn" value="yes" <?php if(get_option('csbwfs_gpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Google Button</b><br>
|
172 |
+
<input type="checkbox" id="publish4" name="csbwfs_lpublishBtn" value="yes" <?php if(get_option('csbwfs_lpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Linkdin Button</b><br>
|
173 |
+
<input type="checkbox" id="publish6" name="csbwfs_ppublishBtn" value="yes" <?php if(get_option('csbwfs_ppublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Pinterest Button</b><br>
|
174 |
+
<input type="checkbox" id="publish5" name="csbwfs_mpublishBtn" value="yes" <?php if(get_option('csbwfs_mpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Mailbox Button</b>
|
175 |
+
<?php if(get_option('csbwfs_mpublishBtn')=='yes'){?>
|
176 |
+
<br><input type="text" name="csbwfs_mailMessage" id="csbwfs_mailMessage" value="<?php echo get_option('csbwfs_mailMessage');?>" placeholder="raghunath.0087@gmail.com" size="40" class="regular-text ltr"><br>Note:add the mail message like this format <b>your@email.com?subject=Your Subject</b>
|
177 |
+
<?php } ?>
|
178 |
+
</td>
|
179 |
+
</tr>
|
180 |
+
<tr><td colspan="2"> </td></tr>
|
181 |
+
<tr>
|
182 |
+
<th> </th>
|
183 |
+
<td><?php echo get_submit_button('Save Settings','button-primary','submit','','');?></td>
|
184 |
+
</tr>
|
185 |
+
<tr><td colspan="2"> </td></tr>
|
186 |
+
</table>
|
187 |
+
<?php settings_fields('csbwf_sidebar_options'); ?>
|
188 |
+
|
189 |
+
</form>
|
190 |
+
|
191 |
+
<!-- End Options Form -->
|
192 |
+
</div>
|
193 |
+
|
194 |
+
<?php
|
195 |
+
}
|
196 |
+
|
197 |
+
require dirname(__FILE__).'/csbwfs-class.php';
|
198 |
+
|
199 |
+
/*
|
200 |
+
|
201 |
+
*Delete the options during disable the plugins
|
202 |
+
|
203 |
+
*/
|
204 |
+
|
205 |
+
if( function_exists('register_uninstall_hook') )
|
206 |
+
|
207 |
+
register_uninstall_hook(__FILE__,'csbwf_sidebar_uninstall');
|
208 |
+
|
209 |
+
//Delete all Custom Tweets options after delete the plugin from admin
|
210 |
+
function csbwf_sidebar_uninstall(){
|
211 |
+
|
212 |
+
delete_option('csbwfs_active');
|
213 |
+
delete_option('csbwfs_position');
|
214 |
+
delete_option('csbwfs_fb_image');
|
215 |
+
delete_option('csbwfs_tw_image');
|
216 |
+
delete_option('csbwfs_li_image');
|
217 |
+
delete_option('csbwfs_mail_image');
|
218 |
+
delete_option('csbwfs_gp_image');
|
219 |
+
delete_option('csbwfs_pin_image');
|
220 |
+
delete_option('csbwfs_fpublishBtn');
|
221 |
+
delete_option('csbwfs_tpublishBtn');
|
222 |
+
delete_option('csbwfs_gpublishBtn');
|
223 |
+
delete_option('csbwfs_ppublishBtn');
|
224 |
+
delete_option('csbwfs_lpublishBtn');
|
225 |
+
delete_option('csbwfs_mpublishBtn');
|
226 |
+
delete_option('csbwfs_mailMessage');
|
227 |
+
delete_option('csbwfs_top_margin');
|
228 |
+
|
229 |
+
}
|
230 |
+
?>
|
images/fb.png
ADDED
Binary file
|
images/gp.png
ADDED
Binary file
|
images/hide.png
ADDED
Binary file
|
images/in.png
ADDED
Binary file
|
images/ml.png
ADDED
Binary file
|
images/pinit.png
ADDED
Binary file
|
images/raghu.jpg
ADDED
Binary file
|
images/show.png
ADDED
Binary file
|
images/tw.png
ADDED
Binary file
|
readme.txt
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Custom Share Buttons with Floating Sidebar ===
|
2 |
+
Contributors:india-web-developer
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4
|
4 |
+
Tags: social share buttons,custom share buttons,facebook, twitter, google+, share, share links,linkedin, pinterest,floating sidebar,float,floating share buttons,float share buttons
|
5 |
+
Requires at least: 2.7
|
6 |
+
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.1
|
8 |
+
|
9 |
+
Add Social Share Buttons Using Floating Sidebar On Your Site (Facebook,Twitter,Linkedin,Google+,Pinterest,Mail)
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
"custom-share-buttons-with-floating-sidebar" is the very simple plugin for add to floating social share buttons on your site.Even you can change the share buttons images if you wish!.
|
14 |
+
|
15 |
+
It's very simple plugin for share your site with your firends on Facebook,Twitter,Linkedin,Pinterest,Google+.
|
16 |
+
There are not added any external JS files in this plugin so it's does not effect on your site speed as well.
|
17 |
+
|
18 |
+
Live [demo](http://www.mrwebsolution.in/)
|
19 |
+
|
20 |
+
|
21 |
+
== Installation ==
|
22 |
+
|
23 |
+
Step 1. Upload "custom-share-buttons-with-floating-sidebar" folder to the `/wp-content/plugins/` directory
|
24 |
+
|
25 |
+
Step 2. Activate the plugin through the Plugins menu in WordPress
|
26 |
+
|
27 |
+
Step 3. Go to Settings/"Custom Share Buttons with Floating Sidebar" and configure the plugin settings.
|
28 |
+
|
29 |
+
== Frequently Asked Questions ==
|
30 |
+
1.How add floating share buttons on my website?
|
31 |
+
|
32 |
+
After active the plugin you have must need to enable this plugin and cheked the checkbox other settings as well.
|
33 |
+
|
34 |
+
2.Can i change the custom share buttons images from admin?
|
35 |
+
|
36 |
+
Yes,You can changes all social share custom buttons images if you wish, For do that you have only need to define the buttons images path through the plugins settings.
|
37 |
+
|
38 |
+
3.Is there any demo site where your plugins have been used?
|
39 |
+
|
40 |
+
Yes, Please visit on this [site](http://www.mrwebsolution.in/) for check live demo
|
41 |
+
|
42 |
+
|
43 |
+
== Screenshots ==
|
44 |
+
|
45 |
+
1. screenshot-1.png
|
46 |
+
|
47 |
+
2. screenshot-2.png
|
48 |
+
|
49 |
+
3. screenshot-3.png
|
50 |
+
|
51 |
+
|
52 |
+
== Changelog ==
|
53 |
+
|
54 |
+
= 1.0 =
|
55 |
+
* First stable release
|
56 |
+
|
57 |
+
= 1.1 =
|
58 |
+
* Fixed the right float sidebar issue
|
59 |
+
* Added new option for define the margin from TOP
|
60 |
+
* Added the show/hide buttons
|
61 |
+
* On Mail buttons :by default set current page title as a mail subject-line and page link in mail-body
|