Custom Share Buttons with Floating Sidebar - Version 1.2

Version Description

Download this release

Release Info

Developer india-web-developer
Plugin Icon 128x128 Custom Share Buttons with Floating Sidebar
Version 1.2
Comparing to
See all releases

Version 1.2

csbwfs-class.php ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // get all options value for "Custom Share Buttons with Floating Sidebar"
3
+ function get_csbwf_sidebar_options() {
4
+ global $wpdb;
5
+ $ctOptions = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'csbwfs_%'");
6
+
7
+ foreach ($ctOptions as $option) {
8
+ $ctOptions[$option->option_name] = $option->option_value;
9
+ }
10
+
11
+ return $ctOptions;
12
+ }
13
+
14
+ // Get plugin options
15
+ $pluginOptionsVal=get_csbwf_sidebar_options();
16
+ //check plugin in enable or not
17
+ if($pluginOptionsVal['csbwfs_active']==1){
18
+ add_action('wp_footer','get_csbwf_sidebar_content');
19
+ add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
20
+ add_action('wp_footer','csbwf_sidebar_load_inline_js');
21
+ }
22
+
23
+
24
+ //register style and scrip files
25
+ function csbwf_sidebar_scripts() {
26
+ wp_enqueue_script( 'jquery' ); // wordpress jQuery
27
+ wp_register_style( 'csbwf_sidebar_style', plugins_url( 'css/csbwfs.css',__FILE__ ) );
28
+ wp_enqueue_style( 'csbwf_sidebar_style' );
29
+ }
30
+
31
+ /*
32
+ -----------------------------------------------------------------------------------------------
33
+ "Add the jQuery code in head section using hooks"
34
+ -----------------------------------------------------------------------------------------------
35
+ */
36
+
37
+
38
+ function csbwf_sidebar_load_inline_js()
39
+ {
40
+ $pluginOptionsVal=get_csbwf_sidebar_options();
41
+ $jscnt='<script>jQuery(document).ready(function()
42
+ { ';
43
+
44
+
45
+ if($pluginOptionsVal['csbwfs_delayTimeBtn']!='0'):
46
+ $jscnt.='jQuery("#delaydiv").hide();
47
+ setTimeout(function(){
48
+ jQuery("#delaydiv").fadeIn();}, '.$pluginOptionsVal['csbwfs_delayTimeBtn'].');';
49
+ endif;
50
+
51
+ if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
52
+ $jscnt.='jQuery("div#tw a").hover(function(){
53
+ jQuery("div#tw a").animate({width:"60px"});
54
+ },function(){
55
+ jQuery("div#tw a").stop( true, true ).animate({width:"45px"});
56
+ });';
57
+ endif;
58
+
59
+ if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
60
+ $jscnt.='jQuery("div#fb a").hover(function(){
61
+ jQuery("div#fb a").animate({width:"60px"});
62
+ },function(){
63
+ jQuery("div#fb a").stop( true, true ).animate({width:"45px"});
64
+ });';
65
+ endif;
66
+
67
+ if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
68
+ $jscnt.='jQuery("div#ml a").hover(function(){
69
+ jQuery("div#ml a").animate({width:"60px"});
70
+ },function(){
71
+ jQuery("div#ml a").stop( true, true ).animate({width:"45px"});
72
+ });';
73
+ endif;
74
+
75
+ if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):
76
+ $jscnt.='jQuery("div#gp a").hover(function(){
77
+ jQuery("div#gp a").animate({width:"60px"});
78
+ },function(){
79
+ jQuery("div#gp a").stop( true, true ).animate({width:"45px"});
80
+ });';
81
+ endif;
82
+
83
+ if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
84
+ $jscnt.='jQuery("div#li a").hover(function(){
85
+ jQuery("div#li a").animate({width:"60px"});
86
+ },function(){
87
+ jQuery("div#li a").stop( true, true ).animate({width:"45px"});
88
+ });';
89
+ endif;
90
+
91
+ if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
92
+ $jscnt.='jQuery("div#pin a").hover(function(){
93
+ jQuery("div#pin a").animate({width:"60px"});
94
+ },function(){
95
+ jQuery("div#pin a").stop( true, true ).animate({width:"45px"});
96
+ });';
97
+ endif;
98
+
99
+ $jscnt.='jQuery("div.show").hide();
100
+ jQuery("div.show a").click(function(){
101
+ jQuery("div#social-inner").show(500);
102
+ jQuery("div.show").hide(500);
103
+ jQuery("div.hide").show(500);
104
+ });
105
+
106
+ jQuery("div.hide a").click(function(){
107
+ jQuery("div.show").show(500);
108
+ jQuery("div.hide").hide(500);
109
+ jQuery("div#social-inner").hide(500);
110
+ });';
111
+
112
+ $jscnt.='});</script>';
113
+
114
+ echo $jscnt;
115
+ }
116
+
117
+ /*
118
+ -----------------------------------------------------------------------------------------------
119
+ "Custom Share Buttons with Floating Sidebar" HTML
120
+ -----------------------------------------------------------------------------------------------
121
+ */
122
+
123
+
124
+ function get_csbwf_sidebar_content() {
125
+ global $post;
126
+ $pluginOptionsVal=get_csbwf_sidebar_options();
127
+
128
+ if(is_category())
129
+ {
130
+ $category_id = get_query_var('cat');
131
+ $shareurl =get_category_link( $category_id );
132
+ $cats = get_the_category();
133
+ $ShareTitle=$cats[0]->name;
134
+ }elseif(is_page() || is_single())
135
+ {
136
+ $shareurl=get_permalink($post->ID);
137
+ $ShareTitle=$post->post_title;
138
+ }
139
+ else
140
+ {
141
+ $shareurl =home_url('/');
142
+ $ShareTitle=get_bloginfo('name');
143
+ }
144
+
145
+ /* Get All buttons Image */
146
+
147
+ //get facebook button image
148
+ if($pluginOptionsVal['csbwfs_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_fb_image'];}
149
+ else{$fImg=plugins_url('images/fb.png',__FILE__);}
150
+ //get twitter button image
151
+ if($pluginOptionsVal['csbwfs_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_tw_image'];}
152
+ else{$tImg=plugins_url('images/tw.png',__FILE__);}
153
+ //get linkdin button image
154
+ if($pluginOptionsVal['csbwfs_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_li_image'];}
155
+ else{$lImg=plugins_url('images/in.png',__FILE__);}
156
+ //get mail button image
157
+ if($pluginOptionsVal['csbwfs_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_mail_image'];}
158
+ else{$mImg=plugins_url('images/ml.png',__FILE__);}
159
+ //get google plus button image
160
+ if($pluginOptionsVal['csbwfs_gp_image']!=''){ $gImg=$pluginOptionsVal['csbwfs_gp_image'];}
161
+ else{$gImg=plugins_url('images/gp.png',__FILE__);}
162
+ //get pinterest button image
163
+ if($pluginOptionsVal['csbwfs_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_pin_image'];}
164
+ else{$pImg=plugins_url('images/pinit.png',__FILE__);}
165
+ //get email message
166
+ if(is_page() || is_single() || is_category() || is_archive()){
167
+
168
+ if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
169
+ $mailMsg='?subject='.get_the_title().'&body='.get_the_permalink();}
170
+ }else
171
+ {
172
+ $mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
173
+ }
174
+
175
+
176
+ // Top Margin
177
+ if($pluginOptionsVal['csbwfs_top_margin']!=''){
178
+ $margin=$pluginOptionsVal['csbwfs_top_margin'];
179
+ }else
180
+ {
181
+ $margin='25%';
182
+ }
183
+
184
+ //Sidebar Position
185
+ if($pluginOptionsVal['csbwfs_position']=='right'){
186
+ $style=' style="top:'.$margin.';right:-5px;"';
187
+ $idName=' id="csbwfs-right"';
188
+ $showImg='hide.png';
189
+ $hideImg='show.png';
190
+
191
+ }else
192
+ {
193
+ $idName=' id="csbwfs-left"';
194
+ $style=' style="top:'.$margin.';left:0;"';
195
+ $showImg='show.png';
196
+ $hideImg='hide.png';
197
+ }
198
+ ?>
199
+ <div id="delaydiv">
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;?>&nbsp;&nbsp;<?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
+ <div id="gp"><a href="https://plus.google.com/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,
223
+ '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Google Plus">
224
+ <img src="<?php echo $gImg;?>"></a></div>
225
+ </div>
226
+ <?php endif;?>
227
+ <?php if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):?>
228
+ <!-- Linkdin -->
229
+ <div class="sbutton">
230
+ <div id="li">
231
+ <a href="https://www.linkedin.com/cws/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,
232
+ '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Linkdin"> <img src="<?php echo $lImg;?>"></a></div>
233
+ </div>
234
+ <?php endif;?>
235
+ <?php if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):?>
236
+ <!-- Pinterest -->
237
+ <div class="sbutton">
238
+ <div id="pin"><a onclick="window.open('http://pinterest.com/pin/create/button/?url=<?php echo $shareurl;?>&amp;media=http://myrevsource.pbodev.info/Projects/newrevsite/img/logo.png&amp;description=<?php echo $ShareTitle;?> :<?php echo $shareurl;?>','pinIt','toolbar=0,status=0,width=620,height=500');" href="javascript:void(0);" style="width: 45px;" alt="Pinterest"><img src="<?php echo $pImg;?>"></a></div>
239
+ </div>
240
+ <?php endif;?>
241
+ <?php if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):?>
242
+ <!-- Mail-->
243
+ <div class="sbutton">
244
+ <div id="ml"><a href="mailto:<?php echo $mailMsg;?>" alt="Email"><img src="<?php echo $mImg;?>"></a></div>
245
+ </div>
246
+ <?php endif;?>
247
+ </div>
248
+
249
+ <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>
250
+
251
+ </div>
252
+ </div>
253
+ <?php
254
+ }
255
+ ?>
css/csbwfs.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .social-widget {
2
+ position: fixed;
3
+ width: 50px;
4
+ z-index: 99999;
5
+ }
6
+
7
+ .social-widget .sbutton {
8
+ float: right;
9
+ height: 41px;
10
+ margin: 0;
11
+ position: relative;
12
+ width: 50px;
13
+ }
14
+ .sbutton img{padding:5px;}
15
+
16
+ #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)}
17
+
18
+ #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;}
19
+
20
+ #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;}
21
+
22
+ #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;}
23
+
24
+ #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;}
25
+
26
+ #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;}
27
+ #csbwfs-right #fb a {
28
+ position: absolute;
29
+ right: 0;
30
+
31
+ }
32
+ #csbwfs-right #tw a {
33
+ position: absolute;
34
+ right: 0;
35
+
36
+ }
37
+ #csbwfs-right #gp a {
38
+ position: absolute;
39
+ right: 0;
40
+
41
+ }
42
+
43
+ #csbwfs-right #li a {
44
+ position: absolute;
45
+ right: 0;
46
+
47
+ }
48
+ #csbwfs-right #pin a {
49
+ position: absolute;
50
+ right: 0;
51
+
52
+ }
53
+ #csbwfs-right #ml a {
54
+ position: absolute;
55
+ right: 0;
56
+
57
+ }
58
+
59
+ #csbwfs-right a#hide {padding-right:33px;}
60
+
61
+
62
+ #csbwfs-right a#show {float:right;}
63
+
css/csbwfs1.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,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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
+ register_setting('csbwf_sidebar_options','csbwfs_delayTimeBtn');
60
+
61
+ }
62
+
63
+
64
+ // Add settings link to plugin list page in admin
65
+ function csbwfs_add_settings_link( $links ) {
66
+ $settings_link = '<a href="options-general.php?page=csbwfs-settings">' . __( 'Settings', 'csbwfs' ) . '</a>';
67
+ array_unshift( $links, $settings_link );
68
+ return $links;
69
+ }
70
+
71
+ $plugin = plugin_basename( __FILE__ );
72
+ add_filter( "plugin_action_links_$plugin", 'csbwfs_add_settings_link' );
73
+
74
+ /** Display the Options form for CSBWFS */
75
+
76
+ function csbwf_sidebar_admin_option_page(){ ?>
77
+
78
+ <div style="width: 80%; padding: 10px; margin: 10px;">
79
+
80
+ <h2>Custom Share Buttons With Floating Sidebar Settings</h2>
81
+
82
+ <p style="padding-bottom: 2%;">Please fill all options value.</p>
83
+
84
+ <!-- Start Options Form -->
85
+
86
+ <form action="options.php" method="post" id="csbwf-sidebar-admin-form">
87
+ <table class="cssfw">
88
+ <tr>
89
+ <th><?php echo 'Enable Plugin:';?></th>
90
+ <td>
91
+ <input type="checkbox" id="csbwfs_active" name="csbwfs_active" value='1' <?php if(get_option('csbwfs_active')!=''){ echo ' checked="checked"'; }?>/>
92
+ </td>
93
+ <td rowspan="17" valign="top" style="padding-left: 20px;border-left:1px solid #ccc;">
94
+ <h2>Plugin Author:</h2>
95
+ <div style="font-size: 14px;">
96
+ <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><a href="mailto:raghunath.0087@gmail.com" target="_blank">Contact Me!</a><br><br>Author Blog <a href="http://raghunathgurjar.wordpress.com" target="_blank">http://raghunathgurjar.wordpress.com</a>
97
+ <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>
98
+ My Other Plugins:<br>
99
+ <ul>
100
+ <li><a href="https://wordpress.org/plugins/simple-testimonial-rutator/" target="_blank">Simple Testimonial Rutator(Responsive)</a></li>
101
+ <li><a href="https://wordpress.org/plugins/wp-easy-recipe/" target="_blank">WP Easy Recipe</a></li>
102
+ </ul>
103
+ </div></td>
104
+ </tr>
105
+ <tr>
106
+ <th nowrap><?php echo 'Siderbar Position:';?></th>
107
+ <td>
108
+ <select id="csbwfs_position" name="csbwfs_position" >
109
+ <option value="left" <?php if(get_option('csbwfs_position')=='left'){echo 'selected="selected"';}?>>Left</option>
110
+ <option value="right" <?php if(get_option('csbwfs_position')=='right'){echo 'selected="selected"';}?>>Right</option>
111
+ </select>
112
+ </td>
113
+ </tr>
114
+ <tr><th nowrap valign="top"><?php echo 'Delay Time: '; ?></th><td><input type="text" name="csbwfs_delayTimeBtn" id="csbwfs_delayTimeBtn" value="<?php echo get_option('csbwfs_delayTimeBtn')?get_option('csbwfs_delayTimeBtn'):0;?>" size="40" class="regular-text ltr"><br><i>Publish share buttons after given time(millisecond)</i></td></tr>
115
+
116
+ <tr><td colspan="2">&nbsp;</td></tr>
117
+ <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>
118
+ <tr>
119
+ <th><?php echo 'Facebook:';?></th>
120
+ <td>
121
+
122
+ <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"/>
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <th><?php echo 'Twitter:';?></th>
127
+ <td>
128
+
129
+ <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"/>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <th><?php echo 'Linkdin:';?></th>
134
+ <td>
135
+
136
+ <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"/>
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <th><?php echo 'Pintrest:';?></th>
141
+ <td>
142
+
143
+ <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"/>
144
+ </td>
145
+ </tr>
146
+ <tr>
147
+ <th><?php echo 'Google:';?></th>
148
+ <td>
149
+
150
+ <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"/>
151
+ </td>
152
+ </tr>
153
+ <tr>
154
+ <th><?php echo 'Mail:';?></th>
155
+ <td>
156
+
157
+ <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"/>
158
+ </td>
159
+ </tr>
160
+ <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>
161
+
162
+ <tr>
163
+ <th><?php echo 'Top Margin:';?></th>
164
+ <td>
165
+
166
+ <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"/>
167
+ </td>
168
+ </tr>
169
+
170
+ <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>
171
+ <tr>
172
+ <th valign="top"><?php echo 'Publish Buttons:';?></th>
173
+ <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>
174
+ <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>
175
+ <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>
176
+ <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>
177
+ <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>
178
+ <input type="checkbox" id="publish5" name="csbwfs_mpublishBtn" value="yes" <?php if(get_option('csbwfs_mpublishBtn')=='yes'){echo 'checked="checked"';}?>/> <b>Mailbox Button</b>
179
+ <?php if(get_option('csbwfs_mpublishBtn')=='yes'){?>
180
+ <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>
181
+ <?php } ?>
182
+ </td>
183
+ </tr>
184
+ <tr><td colspan="2">&nbsp;</td></tr>
185
+ <tr>
186
+ <th>&nbsp;</th>
187
+ <td><?php echo get_submit_button('Save Settings','button-primary','submit','','');?></td>
188
+ </tr>
189
+ <tr><td colspan="2">&nbsp;</td></tr>
190
+ </table>
191
+ <?php settings_fields('csbwf_sidebar_options'); ?>
192
+
193
+ </form>
194
+
195
+ <!-- End Options Form -->
196
+ </div>
197
+
198
+ <?php
199
+ }
200
+
201
+ require dirname(__FILE__).'/csbwfs-class.php';
202
+
203
+ /*
204
+
205
+ *Delete the options during disable the plugins
206
+
207
+ */
208
+
209
+ if( function_exists('register_uninstall_hook') )
210
+
211
+ register_uninstall_hook(__FILE__,'csbwf_sidebar_uninstall');
212
+
213
+ //Delete all Custom Tweets options after delete the plugin from admin
214
+ function csbwf_sidebar_uninstall(){
215
+
216
+ delete_option('csbwfs_active');
217
+ delete_option('csbwfs_position');
218
+ delete_option('csbwfs_fb_image');
219
+ delete_option('csbwfs_tw_image');
220
+ delete_option('csbwfs_li_image');
221
+ delete_option('csbwfs_mail_image');
222
+ delete_option('csbwfs_gp_image');
223
+ delete_option('csbwfs_pin_image');
224
+ delete_option('csbwfs_fpublishBtn');
225
+ delete_option('csbwfs_tpublishBtn');
226
+ delete_option('csbwfs_gpublishBtn');
227
+ delete_option('csbwfs_ppublishBtn');
228
+ delete_option('csbwfs_lpublishBtn');
229
+ delete_option('csbwfs_mpublishBtn');
230
+ delete_option('csbwfs_mailMessage');
231
+ delete_option('csbwfs_top_margin');
232
+
233
+ }
234
+ ?>
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,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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.
14
+
15
+ Even you can change the share buttons images if you wish!.
16
+
17
+ Using this plugin you can easly share your website with your firends on Facebook,Twitter,Linkedin,Pinterest,Google+.
18
+
19
+ There are not added any external JS files in this plugin so it's does not effect on your site speed as well.
20
+
21
+ Live [demo](http://www.mrwebsolution.in/)
22
+
23
+
24
+ == Installation ==
25
+
26
+ Step 1. Upload "custom-share-buttons-with-floating-sidebar" folder to the `/wp-content/plugins/` directory
27
+
28
+ Step 2. Activate the plugin through the Plugins menu in WordPress
29
+
30
+ Step 3. Go to Settings/"Custom Share Buttons with Floating Sidebar" and configure the plugin settings.
31
+
32
+ == Frequently Asked Questions ==
33
+ 1.How add floating share buttons on my website?
34
+
35
+ After active the plugin you have must need to enable this plugin and cheked the checkbox other settings as well.
36
+
37
+ 2.Can i change the custom share buttons images from admin?
38
+
39
+ Yes,admin can changes all social share custom buttons images if you wish, for that you have only need to define the buttons images path from plugins settings page.
40
+
41
+ 3.Is there any demo site where your plugins have been used?
42
+
43
+ Yes, Please visit on this [site](http://www.mrwebsolution.in/) for check live demo
44
+
45
+ 3.Can i define the top margin for share buttons block?
46
+
47
+ Yes, admin can define the top margin from plugin settings page
48
+
49
+
50
+
51
+ == Screenshots ==
52
+
53
+ 1. screenshot-1.png
54
+
55
+ 2. screenshot-2.png
56
+
57
+ 3. screenshot-3.png
58
+
59
+
60
+ == Changelog ==
61
+
62
+ = 1.0 =
63
+ * First stable release
64
+
65
+ = 1.1 =
66
+ * Fixed the right float sidebar issue
67
+ * Added new option for define the margin from TOP
68
+ * Added the show/hide buttons
69
+ * On Mail buttons :by default set current page title as a mail subject-line and page link in mail-body
70
+
71
+ = 1.2 =
72
+ * Fixed button image gap issue for right position
73
+ * Added new option for set the delay time to publish the share butttons