Custom Share Buttons with Floating Sidebar - Version 4.2

Version Description

  • Tested with latest wordpress version 5.9.3
    • Optimized Code
Download this release

Release Info

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

Code changes from version 4.0 to 4.2

csbwfs-class.php CHANGED
@@ -1,760 +1,754 @@
1
- <?php
2
- /*
3
- * Custom Share Buttons With Floating Sidebar (C)
4
- * @get_csbwf_sidebar_options()
5
- * @get_csbwf_sidebar_content()
6
- * */
7
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
- // get all options value for "Custom Share Buttons with Floating Sidebar"
9
- function get_csbwf_sidebar_options() {
10
- global $wpdb;
11
- $ctOptions = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'csbwfs_%'");
12
-
13
- foreach ($ctOptions as $option) {
14
- $ctOptions[$option->option_name] = $option->option_value;
15
- }
16
-
17
- return $ctOptions;
18
- }
19
- /** Get the current url*/
20
- if(!function_exists('csbwfs_current_path_protocol')):
21
- function csbwfs_current_path_protocol($s, $use_forwarded_host=false)
22
- {
23
- $pwahttp = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true:false;
24
- $pwasprotocal = strtolower($s['SERVER_PROTOCOL']);
25
- $pwa_protocol = substr($pwasprotocal, 0, strpos($pwasprotocal, '/')) . (($pwahttp) ? 's' : '');
26
- $port = $s['SERVER_PORT'];
27
- $port = ((!$pwahttp && $port=='80') || ($pwahttp && $port=='443')) ? '' : ':'.$port;
28
- $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
29
- $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
30
- return $pwa_protocol . '://' . $host;
31
- }
32
- endif;
33
- if(!function_exists('csbwfs_get_current_page_url')):
34
- function csbwfs_get_current_page_url($s, $use_forwarded_host=false)
35
- {
36
- return csbwfs_current_path_protocol($s, $use_forwarded_host) . $s['REQUEST_URI'];
37
- }
38
- endif;
39
- /*
40
- * Site is browsing in mobile or not
41
- * @csbwfsIsMobile()
42
- * */
43
- if(!function_exists('csbwfsIsMobile')):
44
- function csbwfsIsMobile() {
45
- // Check the server headers to see if they're mobile friendly
46
- if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
47
- return true;
48
- }
49
- // Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
50
- if(isset($_SERVER["HTTP_USER_AGENT"])):
51
- if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
52
- return false;
53
- }
54
- endif;
55
-
56
- // If the http_accept header supports wap then it's a mobile too
57
- if(isset($_SERVER["HTTP_ACCEPT"])):
58
- if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"])) {
59
- return true;
60
- }
61
- endif;
62
- // Still no luck? Let's have a look at the user agent on the browser. If it contains
63
- // any of the following, it's probably a mobile device. Kappow!
64
- if(isset($_SERVER["HTTP_USER_AGENT"])){
65
- $user_agents = array("midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
66
- foreach($user_agents as $user_string){
67
- if(preg_match("/".$user_string."/i",$_SERVER["HTTP_USER_AGENT"])) {
68
- return true;
69
- }
70
- }
71
- }
72
- // None of the above? Then it's probably not a mobile device.
73
- return false;
74
- }
75
- endif;
76
- // Get plugin options
77
- $pluginOptionsVal=get_csbwf_sidebar_options();
78
- //check plugin in enable or not
79
- if(isset($pluginOptionsVal['csbwfs_active']) && $pluginOptionsVal['csbwfs_active']==1){
80
-
81
- if((csbwfsIsMobile()) &&
82
- isset($pluginOptionsVal['csbwfs_deactive_for_mob']) && $pluginOptionsVal['csbwfs_deactive_for_mob']!='')
83
- {
84
- // silent is Gold;
85
- }else
86
- {
87
- add_action('wp_footer','get_csbwf_sidebar_content');
88
- add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
89
- add_action('wp_footer','csbwf_sidebar_load_inline_js');
90
- add_action('wp_footer','csbwfs_cookie');
91
- }
92
-
93
- }
94
-
95
- function csbwfs_cookie()
96
- {
97
- echo $cookieVal='<script>csbwfsCheckCookie();function csbwfsSetCookie(cname,cvalue,exdays) {
98
- var d = new Date();
99
- d.setTime(d.getTime() + (exdays*24*60*60*1000));
100
- var expires = "expires=" + d.toGMTString();
101
- document.cookie = cname+"="+cvalue+"; "+expires;
102
- }
103
-
104
- function csbwfsGetCookie(cname) {
105
- var name = cname + "=";
106
- var ca = document.cookie.split(\';\');
107
- for(var i=0; i<ca.length; i++) {
108
- var c = ca[i];
109
- while (c.charAt(0)==\' \') c = c.substring(1);
110
- if (c.indexOf(name) != -1) {
111
- return c.substring(name.length, c.length);
112
- }
113
- }
114
- return "";
115
- }
116
-
117
- function csbwfsCheckCookie() {
118
- var hideshowhide = "'.get_option('csbwfs_rmSHBtn').'"
119
- var button_status=csbwfsGetCookie("csbwfs_show_hide_status");
120
- if (button_status != "") {
121
-
122
- } else {
123
- csbwfsSetCookie("csbwfs_show_hide_status", "active",1);
124
- }
125
- if(hideshowhide=="yes")
126
- {
127
- csbwfsSetCookie("csbwfs_show_hide_status", "active",0);
128
- }
129
- }
130
-
131
- </script>';
132
- }
133
- if(isset($pluginOptionsVal['csbwfs_buttons_active']) && $pluginOptionsVal['csbwfs_buttons_active']==1){
134
- add_filter( 'the_content', 'csbfs_the_content_filter', 20);
135
- add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
136
- }
137
- //register style and scrip files
138
- function csbwf_sidebar_scripts() {
139
- wp_enqueue_script( 'jquery' ); // wordpress jQuery
140
- wp_register_style( 'csbwf_sidebar_style', plugins_url( 'css/csbwfs.css',__FILE__ ) );
141
- wp_enqueue_style( 'csbwf_sidebar_style' );
142
- }
143
- /*********************************************************
144
- "Add the jQuery code in head section using hooks"
145
- *********************************************************/
146
- function csbwf_sidebar_load_inline_js()
147
- {
148
- $pluginOptionsVal=get_csbwf_sidebar_options();
149
- $jscnt='<script>
150
- var windWidth=jQuery( window ).width();
151
- //alert(windWidth);
152
- var animateWidth;
153
- var defaultAnimateWidth;';
154
- $jscnt.='
155
- jQuery(document).ready(function()
156
- {
157
- animateWidth="55";
158
- defaultAnimateWidth= animateWidth-10;
159
- animateHeight="49";
160
- defaultAnimateHeight= animateHeight-2;';
161
- if($pluginOptionsVal['csbwfs_delayTimeBtn']!='0'):
162
- $jscnt.='jQuery("#csbwfs-delaydiv").hide();
163
- setTimeout(function(){
164
- jQuery("#csbwfs-delaydiv").fadeIn();}, '.$pluginOptionsVal['csbwfs_delayTimeBtn'].');';
165
- endif;
166
-
167
- if($pluginOptionsVal['csbwfs_position']=='right' || $pluginOptionsVal['csbwfs_position']=='left'){
168
-
169
- $jscnt.='jQuery("div.csbwfsbtns a").hover(function(){
170
- jQuery(this).animate({width:animateWidth});
171
- },function(){
172
- jQuery(this).stop( true, true ).animate({width:defaultAnimateWidth});
173
- });';
174
- }else
175
- {
176
- //silent
177
-
178
- }
179
-
180
- if(isset($pluginOptionsVal['csbwfs_auto_hide']) && $pluginOptionsVal['csbwfs_auto_hide']!=''):
181
- $jscnt.='csbwfsSetCookie("csbwfs_show_hide_status","in_active","1");';
182
- endif;
183
-
184
- $jscnt.='jQuery("div.csbwfs-show").hide();
185
- jQuery("div.csbwfs-show a").click(function(){
186
- jQuery("div#csbwfs-social-inner").show(500);
187
- jQuery("div.csbwfs-show").hide(500);
188
- jQuery("div.csbwfs-hide").show(500);
189
- csbwfsSetCookie("csbwfs_show_hide_status","active","1");
190
- });
191
-
192
- jQuery("div.csbwfs-hide a").click(function(){
193
- jQuery("div.csbwfs-show").show(500);
194
- jQuery("div.csbwfs-hide").hide(500);
195
- jQuery("div#csbwfs-social-inner").hide(500);
196
- csbwfsSetCookie("csbwfs_show_hide_status","in_active","1");
197
- });';
198
-
199
- $jscnt.='var button_status=csbwfsGetCookie("csbwfs_show_hide_status");
200
- if (button_status =="in_active") {
201
- jQuery("div.csbwfs-show").show();
202
- jQuery("div.csbwfs-hide").hide();
203
- jQuery("div#csbwfs-social-inner").hide();
204
- } else {
205
- jQuery("div#csbwfs-social-inner").show();
206
- jQuery("div.csbwfs-show").hide();
207
- jQuery("div.csbwfs-hide").show();
208
- }';
209
-
210
-
211
- $jscnt.='});
212
-
213
- </script>';
214
-
215
- echo $jscnt;
216
- }
217
-
218
- /********************************************************
219
- "Custom Share Buttons with Floating Sidebar" HTML
220
- *********************************************************/
221
- function get_csbwf_sidebar_content() {
222
- global $post;
223
- $pluginOptionsVal=get_csbwf_sidebar_options();
224
- $shareurl = htmlspecialchars(csbwfs_get_current_page_url($_SERVER), ENT_QUOTES, 'UTF-8');
225
- $ShareTitle = (is_front_page() && is_home()) ? get_bloginfo('name'): trim(wp_title('',false));
226
- $ShareTitle= htmlspecialchars(rawurlencode($ShareTitle));
227
- $ShareTitle = str_replace("%26%23039%3B","",$ShareTitle);// remove single quate
228
- /* Get All buttons Image */
229
- //get facebook button image
230
- if($pluginOptionsVal['csbwfs_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_fb_image'];}
231
- else{$fImg='';}
232
- //get twitter button image
233
- if($pluginOptionsVal['csbwfs_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_tw_image'];}
234
- else{$tImg='';}
235
- //get Linkedin button image
236
- if($pluginOptionsVal['csbwfs_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_li_image'];}
237
- else{$lImg='';}
238
- //get mail button image
239
- if($pluginOptionsVal['csbwfs_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_mail_image'];}
240
- else{$mImg='';}
241
- //get pinterest button image
242
- if($pluginOptionsVal['csbwfs_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_pin_image'];}
243
- else{$pImg='';}
244
- //get youtube button image
245
- if(isset($pluginOptionsVal['csbwfs_yt_image']) && $pluginOptionsVal['csbwfs_yt_image']!=''){ $ytImg=$pluginOptionsVal['csbwfs_yt_image'];}
246
- else{$ytImg='';}
247
- //get reddit plus button image
248
- if(isset($pluginOptionsVal['csbwfs_re_image']) && $pluginOptionsVal['csbwfs_re_image']!=''){ $reImg=$pluginOptionsVal['csbwfs_re_image'];}
249
- else{$reImg='';}
250
- //get stumbleupon button image
251
- if(isset($pluginOptionsVal['csbwfs_st_image']) && $pluginOptionsVal['csbwfs_st_image']!=''){ $stImg=$pluginOptionsVal['csbwfs_st_image'];}
252
- else{$stImg='';}
253
- /* Get All buttons Image Alt/Title */
254
- //get facebook button image alt/title
255
- if($pluginOptionsVal['csbwfs_fb_title']!=''){ $fImgAlt=$pluginOptionsVal['csbwfs_fb_title'];}
256
- else{$fImgAlt='Share On Facebook';}
257
- //get twitter button image alt/title
258
- if($pluginOptionsVal['csbwfs_tw_title']!=''){ $tImgAlt=$pluginOptionsVal['csbwfs_tw_title'];}
259
- else{$tImgAlt='Share On Twitter';}
260
- //get Linkedin button image alt/title
261
- if($pluginOptionsVal['csbwfs_li_title']!=''){ $lImgAlt=$pluginOptionsVal['csbwfs_li_title'];}
262
- else{$lImgAlt='Share On Linkedin';}
263
- //get mail button image alt/title
264
- if($pluginOptionsVal['csbwfs_mail_title']!=''){ $mImgAlt=$pluginOptionsVal['csbwfs_mail_title'];}
265
- else{$mImgAlt='Contact us';}
266
- //get pinterest button image alt/title
267
- if($pluginOptionsVal['csbwfs_pin_title']!=''){ $pImgAlt=$pluginOptionsVal['csbwfs_pin_title'];}
268
- else{$pImgAlt='Share On Pinterest';}
269
- //get youtube button image alt/title
270
- if(isset($pluginOptionsVal['csbwfs_yt_title']) && $pluginOptionsVal['csbwfs_yt_title']!=''){ $ytImgAlt=$pluginOptionsVal['csbwfs_yt_title'];}
271
- else{$ytImgAlt='Share On Youtube';}
272
- //get reddit plus button image alt/title
273
- if(isset($pluginOptionsVal['csbwfs_re_title']) && $pluginOptionsVal['csbwfs_re_title']!=''){ $reImgAlt=$pluginOptionsVal['csbwfs_re_title'];}
274
- else{$reImgAlt='Share On Reddit';}
275
- //get stumbleupon button image alt/title
276
- if(isset($pluginOptionsVal['csbwfs_st_title']) && $pluginOptionsVal['csbwfs_st_title']!=''){ $stImgAlt=$pluginOptionsVal['csbwfs_st_title'];}
277
- else{$stImgAlt='Share On Stumbleupon';}
278
- //get email message
279
- if(is_page() || is_single() || is_category() || is_archive()){
280
- if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
281
- $mailMsg='?subject='.$ShareTitle.'&body='.$shareurl;}
282
- }else
283
- {
284
- $mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
285
- }
286
- // Top Margin
287
- if($pluginOptionsVal['csbwfs_top_margin']!=''){
288
- $margin=$pluginOptionsVal['csbwfs_top_margin'];
289
- }else
290
- {
291
- $margin='25%';
292
- }
293
-
294
- //Sidebar Position
295
- if($pluginOptionsVal['csbwfs_position']=='right'){
296
- $style=' style="top:'.$margin.';right:-5px;"'; $idName=' id="csbwfs-right"'; $showImg='hide-r.png'; $hideImg='show.png';
297
- }else if($pluginOptionsVal['csbwfs_position']=='bottom'){
298
- $style=' style="bottom:0;"'; $idName=' id="csbwfs-bottom"'; $showImg='hide-b.png'; $hideImg='show.png';
299
- }
300
- else
301
- {
302
- $idName=' id="csbwfs-left"'; $style=' style="top:'.$margin.';left:0;"'; $showImg='hide-l.png';$hideImg='hide.png';
303
- }
304
- /* Get All buttons background color */
305
- //get facebook button image background color
306
- if($pluginOptionsVal['csbwfs_fb_bg']!=''){ $fImgbg=' style="background:'.$pluginOptionsVal['csbwfs_fb_bg'].';"';}
307
- else{$fImgbg='';}
308
- //get twitter button image background color
309
- if($pluginOptionsVal['csbwfs_tw_bg']!=''){ $tImgbg=' style="background:'.$pluginOptionsVal['csbwfs_tw_bg'].';"';}
310
- else{$tImgbg='';}
311
- //get Linkedin button image background color
312
- if($pluginOptionsVal['csbwfs_li_bg']!=''){ $lImgbg=' style="background:'.$pluginOptionsVal['csbwfs_li_bg'].';"';}
313
- else{$lImgbg='';}
314
- //get mail button image background color
315
- if($pluginOptionsVal['csbwfs_mail_bg']!=''){ $mImgbg=' style="background:'.$pluginOptionsVal['csbwfs_mail_bg'].';"';}
316
- else{$mImgbg='';}
317
- //get pinterest button image background color
318
- if($pluginOptionsVal['csbwfs_pin_bg']!=''){ $pImgbg=' style="background:'.$pluginOptionsVal['csbwfs_pin_bg'].';"';}
319
- else{$pImgbg='';}
320
-
321
- //get youtube button image background color
322
- if(isset($pluginOptionsVal['csbwfs_yt_bg']) && $pluginOptionsVal['csbwfs_yt_bg']!=''){ $ytImgbg=' style="background:'.$pluginOptionsVal['csbwfs_yt_bg'].';"';}else{$ytImgbg='';}
323
- //get reddit button image background color
324
- if(isset($pluginOptionsVal['csbwfs_re_bg']) && $pluginOptionsVal['csbwfs_re_bg']!=''){ $reImgbg=' style="background:'.$pluginOptionsVal['csbwfs_re_bg'].';"';}else{$reImgbg='';}
325
- //get stumbleupon button image background color
326
- if(isset($pluginOptionsVal['csbwfs_st_bg']) && $pluginOptionsVal['csbwfs_st_bg']!=''){ $stImgbg=' style="background:'.$pluginOptionsVal['csbwfs_st_bg'].';"';} else{$stImgbg='';}
327
-
328
- /** Message */
329
- if($pluginOptionsVal['csbwfs_show_btn']!=''){ $showbtn=$pluginOptionsVal['csbwfs_show_btn'];}
330
- else{$showbtn='Show Buttons';}
331
- //get show/hide button message
332
- if($pluginOptionsVal['csbwfs_hide_btn']!=''){ $hidebtn=$pluginOptionsVal['csbwfs_hide_btn'];}
333
- else{$hidebtn='Hide Buttons';}
334
- //get mail button message
335
- if($pluginOptionsVal['csbwfs_share_msg']!=''){ $sharemsg=$pluginOptionsVal['csbwfs_share_msg'];}
336
- else{$sharemsg='Share This With Your Friends';}
337
-
338
- /** Check display Show/Hide button or not*/
339
- if(isset($pluginOptionsVal['csbwfs_rmSHBtn']) && $pluginOptionsVal['csbwfs_rmSHBtn']!=''):
340
- $isActiveHideShowBtn='yes';
341
- else:
342
- $isActiveHideShowBtn='no';
343
- endif;
344
- $floatingSidebarContent='<div id="csbwfs-delaydiv"><div class="csbwfs-social-widget" '.$idName.' title="'.$sharemsg.'" '.$style.'>';
345
-
346
- if($isActiveHideShowBtn!='yes') :
347
- $floatingSidebarContent .= '<div class="csbwfs-show"><a href="javascript:" title="'.$showbtn.'" id="csbwfs-show"><img src="'.plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$showImg).'" alt="'.$showbtn.'"></a></div>';
348
- endif;
349
-
350
- $floatingSidebarContent .= '<div id="csbwfs-social-inner">';
351
-
352
- /** FB */
353
- if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
354
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-fb" class="csbwfs-fb"><a href="javascript:" onclick="javascript:window.open(\'//www.facebook.com/sharer/sharer.php?u='.$shareurl.'\', \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600\');return false;" target="_blank" title="'.$fImgAlt.'" '.$fImgbg.'>';
355
-
356
- if($fImg!=''){
357
- $floatingSidebarContent .='<img src="'.$fImg.'" alt="'.$fImgAlt.'" width="35" height="35" >';
358
- }else{
359
- $floatingSidebarContent .='<i class="csbwfs_facebook"></i>';
360
- }
361
- $floatingSidebarContent .='</a></div></div>';
362
- endif;
363
-
364
- /** TW */
365
- if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
366
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-tw" class="csbwfs-tw"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url='.$shareurl.'&text='.$ShareTitle.'\',\'_blank\',\'width=800,height=300\')" title="'.$tImgAlt.'" '.$tImgbg.'>';
367
- if($tImg!='')
368
- {
369
- $floatingSidebarContent .='<img src="'.$tImg.'" alt="'.$tImgAlt.'" width="35" height="35" >';
370
- }else{
371
- $floatingSidebarContent .='<i class="csbwfs_twitter"></i>';
372
- }
373
- $floatingSidebarContent .='</a></div></div>';
374
-
375
- endif;
376
-
377
- /** LI */
378
- if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
379
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-li" class="csbwfs-li"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/cws/share?mini=true&url='. $shareurl.'\',\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" title="'.$lImgAlt.'" '.$lImgbg.'>';
380
- if($lImg!='')
381
- {
382
- $floatingSidebarContent .='<img src="'.$lImg.'" alt="'.$lImgAlt.'" width="35" height="35" >';
383
- }else{
384
- $floatingSidebarContent .='<i class="csbwfs_linkedin"></i>';
385
- }
386
- $floatingSidebarContent .='</a></div></div>';
387
- endif;
388
-
389
- /** PIN */
390
- if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
391
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-pin" class="csbwfs-pin"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);" '.$pImgbg.' title="'.$pImgAlt.'">';
392
- if($pImg!='')
393
- {
394
- $floatingSidebarContent .='<img src="'.$pImg.'" alt="'.$pImgAlt.'" width="35" height="35" >';
395
- }else{
396
- $floatingSidebarContent .='<i class="csbwfs_pinterest"></i>';
397
- }
398
- $floatingSidebarContent .='</a></div></div>';
399
- endif;
400
-
401
- /** Reddit */
402
- if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
403
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-re" class="csbwfs-re"><a onclick="window.open(\'//reddit.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$reImgbg.' title="'.$reImgAlt.'">';
404
- if($reImg!='')
405
- {
406
- $floatingSidebarContent .='<img src="'.$reImg.'" alt="'.$reImgAlt.'" width="35" height="35" >';
407
- }else{
408
- $floatingSidebarContent .='<i class="csbwfs_reddit"></i>';
409
- }
410
- $floatingSidebarContent .='</a></div></div>';
411
- endif;
412
-
413
- /** Stumbleupon/Mix */
414
- if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
415
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-st" class="csbwfs-st"><a onclick="window.open(\'//mix.com/mixit?su=submit&url='.$shareurl.'\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$stImgbg.' title="'.$stImgAlt.'">';
416
- if($stImg!='')
417
- {
418
- $floatingSidebarContent .='<img src="'.$stImg.'" alt="'.$stImgAlt.'" width="35" height="35" >';
419
- }else{
420
- $floatingSidebarContent .='<i class="csbwfs_stumbleupon"></i>';
421
- }
422
- $floatingSidebarContent .='</a></div></div>';
423
- endif;
424
- /** YT */
425
- if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
426
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-yt" class="csbwfs-yt"><a onclick="window.open(\''.$pluginOptionsVal['csbwfs_ytPath'].'\');" href="javascript:void(0);" '.$ytImgbg.' title="'.$ytImgAlt.'">';
427
- if($ytImg!='')
428
- {
429
- $floatingSidebarContent .='<img src="'.$ytImg.'" alt="'.$ytImgAlt.'" width="35" height="35" >';
430
- }else{
431
- $floatingSidebarContent .='<i class="csbwfs_youtube"></i>';
432
- }
433
- $floatingSidebarContent .='</a></div></div>';
434
- endif;
435
- /** Skype */
436
- if((isset($pluginOptionsVal['csbwfs_skpublishBtn']) && $pluginOptionsVal['csbwfs_skpublishBtn']!='') && (isset($pluginOptionsVal['csbwfs_skPath']) && $pluginOptionsVal['csbwfs_skPath']!='')):
437
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-sk" class="csbwfs-sk"><a href="skype:'.$pluginOptionsVal['csbwfs_skPath'].'" >';
438
- $floatingSidebarContent .='<i class="csbwfs_skype"></i>';
439
- $floatingSidebarContent .='</a></div></div>';
440
- endif;
441
- /** Mail*/
442
- if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
443
- $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-ml" class="csbwfs-ml"><a href="mailto:'.$mailMsg.'" title="'.$mImgAlt.'" '.$mImgbg.' >';
444
- if($mImg!='')
445
- {
446
- $floatingSidebarContent .='<img src="'.$mImg.'" alt="'.$mImgAlt.'" width="35" height="35" >';
447
- }else{
448
- $floatingSidebarContent .='<i class="csbwfs_mail"></i>';
449
- }
450
- $floatingSidebarContent .='</a></div></div>';
451
- endif;
452
-
453
- $floatingSidebarContent .='</div>'; //End social-inner
454
-
455
- if($isActiveHideShowBtn!='yes') :
456
- $floatingSidebarContent .='<div class="csbwfs-hide"><a href="javascript:" title="'.$hidebtn.'" id="csbwfs-hide"><img src="'.plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$hideImg).'" alt="'.$hidebtn.'"></a></div>';
457
- endif;
458
-
459
- $floatingSidebarContent .='</div></div>'; //End social-inner
460
- /** Check conditions */
461
- // Returns the content.
462
- if(isset($pluginOptionsVal['csbwfs_hide_home'])){$hideOnHome=$pluginOptionsVal['csbwfs_hide_home']; }else{ $hideOnHome='';}
463
-
464
- if((is_home() && is_front_page()) && $hideOnHome=='yes'):
465
- $floatingSidebarContent='';
466
- endif;
467
- if(is_front_page() && $hideOnHome=='yes' ):
468
- $floatingSidebarContent='';
469
- endif;
470
- /** hide on 404 pages */
471
- if(is_404()):$floatingSidebarContent='';endif;
472
-
473
- print $floatingSidebarContent;
474
- }
475
-
476
- /**
477
- * Add social share bottons to the end of every post/page.
478
- *
479
- * @uses is_home()
480
- * @uses is_page()
481
- * @uses is_single()
482
- */
483
- function csbfs_the_content_filter( $content ) {
484
-
485
- global $post;
486
- $pluginOptionsVal=get_csbwf_sidebar_options();
487
- if(is_category())
488
- {
489
- $category_id = get_query_var('cat');
490
- $cats = get_the_category();
491
- $ShareTitle=$cats[0]->name;
492
- }elseif($post && is_singular($post->post_type))
493
- {
494
- $ShareTitle=$post->post_title;
495
- }
496
- elseif(is_archive()){
497
- global $wp;
498
- if ( is_day() ) :
499
- $ShareTitle='Daily Archives: '. get_the_date();
500
- elseif ( is_month() ) :
501
- $ShareTitle='Monthly Archives: '. get_the_date('F Y');
502
- elseif ( is_year() ) :
503
- $ShareTitle='Yearly Archives: '. get_the_date('Y');
504
- elseif ( is_author() ) :
505
- $ShareTitle='Author Archives: '. get_the_author();
506
- else :
507
- $ShareTitle ='Blog Archives';
508
- endif;
509
- }
510
- else
511
- {
512
- $ShareTitle=get_bloginfo('name');
513
- }
514
- /* Set title and url for home page */
515
- if(is_home() && is_front_page()){
516
- $ShareTitle=get_bloginfo('name');
517
- }
518
-
519
- $shareurl = htmlspecialchars(csbwfs_get_current_page_url($_SERVER), ENT_QUOTES, 'UTF-8');
520
-
521
- $ShareTitle= htmlspecialchars(rawurlencode($ShareTitle));
522
-
523
- /* Get All buttons Image */
524
-
525
- //get facebook button image
526
- if($pluginOptionsVal['csbwfs_page_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_page_fb_image'];}
527
- else{$fImg='';}
528
- //get twitter button image
529
- if($pluginOptionsVal['csbwfs_page_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_page_tw_image'];}
530
- else{$tImg='';}
531
- //get Linkedin button image
532
- if($pluginOptionsVal['csbwfs_page_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_page_li_image'];}
533
- else{$lImg='';}
534
- //get mail button image
535
- if($pluginOptionsVal['csbwfs_page_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_page_mail_image'];}
536
- else{$mImg='';}
537
- //get pinterest button image
538
- if($pluginOptionsVal['csbwfs_page_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_page_pin_image'];}
539
- else{$pImg='';}
540
-
541
- //get youtube button image
542
- if(isset($pluginOptionsVal['csbwfs_page_yt_image']) && $pluginOptionsVal['csbwfs_page_yt_image']!=''){ $ytImg=$pluginOptionsVal['csbwfs_page_yt_image'];}
543
- else{$ytImg='';}
544
- //get reddit plus button image
545
- if(isset($pluginOptionsVal['csbwfs_page_re_image']) && $pluginOptionsVal['csbwfs_page_re_image']!=''){ $reImg=$pluginOptionsVal['csbwfs_page_re_image'];}
546
- else{$reImg='';}
547
- //get stumbleupon button image
548
- if(isset($pluginOptionsVal['csbwfs_page_st_image']) && $pluginOptionsVal['csbwfs_page_st_image']!=''){ $stImg=$pluginOptionsVal['csbwfs_page_st_image'];}
549
- else{$stImg='';}
550
-
551
- /* Get All buttons Image Alt/Title */
552
- //get facebook button image alt/title
553
- if($pluginOptionsVal['csbwfs_page_fb_title']!=''){ $fImgAlt=$pluginOptionsVal['csbwfs_page_fb_title'];}
554
- else{$fImgAlt='Share On Facebook';}
555
- //get twitter button image alt/title
556
- if($pluginOptionsVal['csbwfs_page_tw_title']!=''){ $tImgAlt=$pluginOptionsVal['csbwfs_page_tw_title'];}
557
- else{$tImgAlt='Share On Twitter';}
558
- //get Linkedin button image alt/title
559
- if($pluginOptionsVal['csbwfs_page_li_title']!=''){ $lImgAlt=$pluginOptionsVal['csbwfs_page_li_title'];}
560
- else{$lImgAlt='Share On Linkedin';}
561
- //get mail button image alt/title
562
- if($pluginOptionsVal['csbwfs_page_mail_title']!=''){ $mImgAlt=$pluginOptionsVal['csbwfs_page_mail_title'];}
563
- else{$mImgAlt='Contact us';}
564
- //get pinterest button image alt/title
565
- if($pluginOptionsVal['csbwfs_page_pin_title']!=''){ $pImgAlt=$pluginOptionsVal['csbwfs_page_pin_title'];}
566
- else{$pImgAlt='Share On Pinterest';}
567
- //get youtube button image alt/title
568
- if(isset($pluginOptionsVal['csbwfs_page_yt_title']) && $pluginOptionsVal['csbwfs_page_yt_title']!=''){ $ytImgAlt=$pluginOptionsVal['csbwfs_page_yt_title'];}
569
- else{$ytImgAlt='Share On Youtube';}
570
- //get reddit plus button image alt/title
571
- if(isset($pluginOptionsVal['csbwfs_page_re_title']) && $pluginOptionsVal['csbwfs_page_re_title']!=''){ $reImgAlt=$pluginOptionsVal['csbwfs_page_re_title'];}
572
- else{$reImgAlt='Share On Reddit';}
573
- //get stumbleupon button image alt/title
574
- if(isset($pluginOptionsVal['csbwfs_page_st_title']) && $pluginOptionsVal['csbwfs_page_st_title']!=''){ $stImgAlt=$pluginOptionsVal['csbwfs_page_st_title'];}
575
- else{$stImgAlt='Share On Stumbleupon';}
576
-
577
- /* Get All buttons background color */
578
- //get facebook button image background color
579
- if($pluginOptionsVal['csbwfs_page_fb_bg']!=''){ $fImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_fb_bg'].';"';}
580
- else{$fImgbg='';}
581
- //get twitter button image background color
582
- if($pluginOptionsVal['csbwfs_page_tw_bg']!=''){ $tImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_tw_bg'].';"';}
583
- else{$tImgbg='';}
584
- //get Linkedin button image background color
585
- if($pluginOptionsVal['csbwfs_page_li_bg']!=''){ $lImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_li_bg'].';"';}
586
- else{$lImgbg='';}
587
- //get mail button image background color
588
- if($pluginOptionsVal['csbwfs_page_mail_bg']!=''){ $mImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_mail_bg'].';"';}
589
- else{$mImgbg='';}
590
- //get pinterest button image background color
591
- if($pluginOptionsVal['csbwfs_page_pin_bg']!=''){ $pImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_pin_bg'].';"';}
592
- else{$pImgbg='';}
593
-
594
- //get youtube button image background color
595
- if(isset($pluginOptionsVal['csbwfs_page_yt_bg']) && $pluginOptionsVal['csbwfs_page_yt_bg']!=''){ $ytImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_yt_bg'].';"';}else{$ytImgbg='';}
596
- //get reddit button image background color
597
- if(isset($pluginOptionsVal['csbwfs_page_re_bg']) && $pluginOptionsVal['csbwfs_page_re_bg']!=''){ $reImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_re_bg'].';"';}else{$reImgbg='';}
598
- //get stumbleupon button image background color
599
- if(isset($pluginOptionsVal['csbwfs_page_st_bg']) && $pluginOptionsVal['csbwfs_page_st_bg']!=''){ $stImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_st_bg'].';"';} else{$stImgbg='';}
600
- //get email message
601
- if(is_page() || is_single() || is_category() || is_archive()){
602
-
603
- if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
604
- $mailMsg='?subject='.get_the_title().'&body='.$shareurl;}
605
- }else
606
- {
607
- $mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
608
- }
609
- if(isset($pluginOptionsVal['csbwfs_btn_position']) && $pluginOptionsVal['csbwfs_btn_position']!=''):
610
- $btnPosition=$pluginOptionsVal['csbwfs_btn_position'];
611
- else:
612
- $btnPosition='left';
613
- endif;
614
-
615
- if(isset($pluginOptionsVal['csbwfs_btn_text']) && $pluginOptionsVal['csbwfs_btn_text']!=''):
616
- $btnText=$pluginOptionsVal['csbwfs_btn_text'];
617
- else:
618
- $btnText='';
619
- endif;
620
-
621
- $shareButtonContent='<div id="socialButtonOnPage" class="'.$btnPosition.'SocialButtonOnPage">';
622
- if($btnText!=''):
623
- $shareButtonContent.='<div class="sharethis-arrow" title="'.$btnText.'"><span>'.$btnText.'</span></div>';
624
- endif;
625
- /* Facebook*/
626
- if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
627
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="fb-p" class="csbwfs-fb"><a href="javascript:" onclick="window.open(\'//www.facebook.com/sharer/sharer.php?u='.$shareurl.'\',\'Facebook\',\'width=800,height=300\');return false;"
628
- target="_blank" title="'.$fImgAlt.'" '.$fImgbg.'>';
629
- if($fImg!=''){
630
- $shareButtonContent .='<img src="'.$fImg.'" alt="'.$fImgAlt.'" width="35" height="35" >';
631
- }else{
632
- $shareButtonContent .='<i class="csbwfs_facebook"></i>';
633
- }
634
- $shareButtonContent .='</a></div></div>';
635
- endif;
636
-
637
- /* Twitter */
638
- if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
639
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="tw-p" class="csbwfs-tw"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url='.$shareurl.'&text='.$ShareTitle.'&nbsp;&nbsp;\', \'_blank\', \'width=800,height=300\')" title="'.$tImgAlt.'" '.$tImgbg.'>';
640
- if($tImg!='')
641
- {
642
- $shareButtonContent .='<img src="'.$tImg.'" alt="'.$tImgAlt.'" width="35" height="35" >';
643
- }else{
644
- $shareButtonContent .='<i class="csbwfs_twitter"></i>';
645
- }
646
- $shareButtonContent .='</a></div></div>';
647
- endif;
648
- /* Linkedin */
649
- if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
650
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="li-p" class="csbwfs-li"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/shareArticle?mini=true&url='.$shareurl.'\',\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" title="'.$lImgAlt.'" '.$lImgbg.'>';
651
- if($lImg!='')
652
- {
653
- $shareButtonContent .='<img src="'.$lImg.'" alt="'.$lImgAlt.'" width="35" height="35" >';
654
- }else{
655
- $shareButtonContent .='<i class="csbwfs_linkedin"></i>';
656
- }
657
- $shareButtonContent .='</a></div></div>';
658
- endif;
659
-
660
- /* Pinterest */
661
- if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
662
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="pin-p" class="csbwfs-pin"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);" title="'.$pImgAlt.'" '.$pImgbg.'>';
663
- if($pImg!='')
664
- {
665
- $shareButtonContent .='<img src="'.$pImg.'" alt="'.$pImgAlt.'" width="35" height="35" >';
666
- }else{
667
- $shareButtonContent .='<i class="csbwfs_pinterest"></i>';
668
- }
669
- $shareButtonContent .='</a></div></div>';
670
- endif;
671
- /* Reddit */
672
- if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
673
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="re-p" class="csbwfs-re"><a onclick="window.open(\'//reddit.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" title="'.$reImgAlt.'" '.$reImgbg.'>';
674
- if($reImg!='')
675
- {
676
- $shareButtonContent .='<img src="'.$reImg.'" alt="'.$reImgAlt.'" width="35" height="35" >';
677
- }else{
678
- $shareButtonContent .='<i class="csbwfs_reddit"></i>';
679
- }
680
- $shareButtonContent .='</a></div></div>';
681
- endif;
682
- /* Stumbleupon/Mix */
683
- if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
684
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="st-p" class="csbwfs-st"><a onclick="window.open(\'//mix.com/mixit?su=submit&url='.$shareurl.'\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" title="'.$stImgAlt.'" '.$stImgbg.'>';
685
- if($stImg!='')
686
- {
687
- $shareButtonContent .='<img src="'.$stImg.'" alt="'.$stImgAlt.'" width="35" height="35" >';
688
- }else{
689
- $shareButtonContent .='<i class="csbwfs_stumbleupon"></i>';
690
- }
691
- $shareButtonContent .='</a></div></div>';
692
- endif;
693
- /* Youtube */
694
- if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
695
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="yt-p" class="csbwfs-yt"><a onclick="window.open(\''.$pluginOptionsVal['csbwfs_ytPath'].'\');" href="javascript:void(0);" title="'.$ytImgAlt.'" '.$ytImgbg.'>';
696
- if($ytImg!='')
697
- {
698
- $shareButtonContent .='<img src="'.$ytImg.'" alt="'.$ytImgAlt.'" width="35" height="35" >';
699
- }else{
700
- $shareButtonContent .='<i class="csbwfs_youtube"></i>';
701
- }
702
- $shareButtonContent .='</a></div></div>';
703
- endif;
704
- /** Skype */
705
- if((isset($pluginOptionsVal['csbwfs_skpublishBtn']) && $pluginOptionsVal['csbwfs_skpublishBtn']!='') && (isset($pluginOptionsVal['csbwfs_skPath']) && $pluginOptionsVal['csbwfs_skPath']!='')):
706
- $shareButtonContent .='<div class="csbwfs-sbutton-post"><div id="sk-p" class="csbwfs-sk"><a href="skype:'.$pluginOptionsVal['csbwfs_skPath'].'" >';
707
- $shareButtonContent .='<i class="csbwfs_skype"></i>';
708
- $shareButtonContent .='</a></div></div>';
709
- endif;
710
- /* Email */
711
- if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
712
- $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="ml-p" class="csbwfs-ml"><a href="mailto:'.$mailMsg.'" title="'.$mImgAlt.'" '.$mImgbg.'>';
713
- if($mImg!='')
714
- {
715
- $shareButtonContent .='<img src="'.$mImg.'" alt="'.$mImgAlt.'" width="35" height="35" >';
716
- }else{
717
- $shareButtonContent .='<i class="csbwfs_mail"></i>';
718
- }
719
- $shareButtonContent .='</a></div></div>';
720
- endif;
721
- $shareButtonContent.='</div>';
722
-
723
- // Returns the content.
724
- global $post;
725
- $shareButtonContentReturn='';
726
- /* DEFAULT HOME */
727
- if((is_home() && is_front_page()) && $pluginOptionsVal['csbwfs_page_hide_home']=='yes'):
728
- $shareButtonContentReturn=$shareButtonContent;
729
- endif;
730
- /* STATIC front page */
731
- if(is_front_page() && $pluginOptionsVal['csbwfs_page_hide_home']=='yes'):
732
- $shareButtonContentReturn=$shareButtonContent;
733
- endif;
734
- //post
735
- if(is_single() && $pluginOptionsVal['csbwfs_page_hide_post']=='yes'):
736
- $shareButtonContentReturn=$shareButtonContent;
737
- endif;
738
- //page
739
- if(is_page() && $pluginOptionsVal['csbwfs_page_hide_page']=='yes'):
740
- if(!is_front_page()):
741
- $shareButtonContentReturn=$shareButtonContent;
742
- endif;
743
- endif;
744
- //archive
745
- if(is_archive() && $pluginOptionsVal['csbwfs_page_hide_archive']=='yes'):
746
- $shareButtonContentReturn=$shareButtonContent;
747
- endif;
748
- // 404
749
- if(is_404()):
750
- $shareButtonContentReturn='';
751
- endif;
752
- /** Buttons position on content */
753
- if(isset($pluginOptionsVal['csbwfs_btn_display']) && $pluginOptionsVal['csbwfs_btn_display']=='above'){
754
- $finalContent= $shareButtonContentReturn.$content;
755
- }else
756
- {
757
- $finalContent = $content.$shareButtonContentReturn;
758
- }
759
- return $finalContent;
760
- }
1
+ <?php
2
+ /*
3
+ * Custom Share Buttons With Floating Sidebar (C)
4
+ * @get_csbwf_sidebar_options()
5
+ * @get_csbwf_sidebar_content()
6
+ * */
7
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
+ // get all options value for "Custom Share Buttons with Floating Sidebar"
9
+ function get_csbwf_sidebar_options() {
10
+ global $wpdb;
11
+ $ctOptions = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE 'csbwfs_%'");
12
+
13
+ foreach ($ctOptions as $option) {
14
+ $ctOptions[$option->option_name] = esc_attr( $option->option_value );
15
+ }
16
+
17
+ return $ctOptions;
18
+ }
19
+ /** Get the current url*/
20
+ if(!function_exists('csbwfs_current_path_protocol')):
21
+ function csbwfs_current_path_protocol($s, $use_forwarded_host=false)
22
+ {
23
+ $pwahttp = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true:false;
24
+ $pwasprotocal = strtolower($s['SERVER_PROTOCOL']);
25
+ $pwa_protocol = substr($pwasprotocal, 0, strpos($pwasprotocal, '/')) . (($pwahttp) ? 's' : '');
26
+ $port = $s['SERVER_PORT'];
27
+ $port = ((!$pwahttp && $port=='80') || ($pwahttp && $port=='443')) ? '' : ':'.$port;
28
+ $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
29
+ $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
30
+ return $pwa_protocol . '://' . $host;
31
+ }
32
+ endif;
33
+ if(!function_exists('csbwfs_get_current_page_url')):
34
+ function csbwfs_get_current_page_url($s, $use_forwarded_host=false)
35
+ {
36
+ return csbwfs_current_path_protocol($s, $use_forwarded_host) . $s['REQUEST_URI'];
37
+ }
38
+ endif;
39
+ /*
40
+ * Site is browsing in mobile or not
41
+ * @csbwfsIsMobile()
42
+ * */
43
+ if(!function_exists('csbwfsIsMobile')):
44
+ function csbwfsIsMobile() {
45
+ // Check the server headers to see if they're mobile friendly
46
+ if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
47
+ return true;
48
+ }
49
+ // Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
50
+ if(isset($_SERVER["HTTP_USER_AGENT"])):
51
+ if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
52
+ return false;
53
+ }
54
+ endif;
55
+
56
+ // If the http_accept header supports wap then it's a mobile too
57
+ if(isset($_SERVER["HTTP_ACCEPT"])):
58
+ if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"])) {
59
+ return true;
60
+ }
61
+ endif;
62
+ // Still no luck? Let's have a look at the user agent on the browser. If it contains
63
+ // any of the following, it's probably a mobile device. Kappow!
64
+ if(isset($_SERVER["HTTP_USER_AGENT"])){
65
+ $user_agents = array("midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
66
+ foreach($user_agents as $user_string){
67
+ if(preg_match("/".$user_string."/i",$_SERVER["HTTP_USER_AGENT"])) {
68
+ return true;
69
+ }
70
+ }
71
+ }
72
+ // None of the above? Then it's probably not a mobile device.
73
+ return false;
74
+ }
75
+ endif;
76
+ // Get plugin options
77
+ $pluginOptionsVal=get_csbwf_sidebar_options();
78
+ //check plugin in enable or not
79
+ if(isset($pluginOptionsVal['csbwfs_active']) && $pluginOptionsVal['csbwfs_active']==1){
80
+
81
+ if((csbwfsIsMobile()) &&
82
+ isset($pluginOptionsVal['csbwfs_deactive_for_mob']) && $pluginOptionsVal['csbwfs_deactive_for_mob']!='')
83
+ {
84
+ // silent is Gold;
85
+ }else
86
+ {
87
+ add_action('wp_footer','get_csbwf_sidebar_content');
88
+ add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
89
+ add_action('wp_enqueue_scripts','csbwf_sidebar_load_inline_js');
90
+ add_action('wp_enqueue_scripts','csbwfs_cookie');
91
+ }
92
+
93
+ }
94
+
95
+ function csbwfs_cookie() {
96
+ $cookieVal=' csbwfsCheckCookie();function csbwfsSetCookie(cname,cvalue,exdays) {
97
+ var d = new Date();
98
+ d.setTime(d.getTime() + (exdays*24*60*60*1000));
99
+ var expires = "expires=" + d.toGMTString();
100
+ document.cookie = cname+"="+cvalue+"; "+expires;
101
+ }
102
+
103
+ function csbwfsGetCookie(cname) {
104
+ var name = cname + "=";
105
+ var ca = document.cookie.split(\';\');
106
+ for(var i=0; i<ca.length; i++) {
107
+ var c = ca[i];
108
+ while (c.charAt(0)==\' \') c = c.substring(1);
109
+ if (c.indexOf(name) != -1) {
110
+ return c.substring(name.length, c.length);
111
+ }
112
+ }
113
+ return "";
114
+ }
115
+
116
+ function csbwfsCheckCookie() {
117
+ var hideshowhide = "'.esc_attr( get_option('csbwfs_rmSHBtn') ).'"
118
+ var button_status=csbwfsGetCookie("csbwfs_show_hide_status");
119
+ if (button_status != "") {
120
+
121
+ } else {
122
+ csbwfsSetCookie("csbwfs_show_hide_status", "active",1);
123
+ }
124
+ if(hideshowhide=="yes")
125
+ {
126
+ csbwfsSetCookie("csbwfs_show_hide_status", "active",0);
127
+ }
128
+ }
129
+ ';
130
+ wp_add_inline_script( 'jquery-core', $cookieVal );
131
+ }
132
+ if(isset($pluginOptionsVal['csbwfs_buttons_active']) && $pluginOptionsVal['csbwfs_buttons_active']==1){
133
+ add_filter( 'the_content', 'csbfs_the_content_filter', 20);
134
+ add_action( 'wp_enqueue_scripts', 'csbwf_sidebar_scripts' );
135
+ }
136
+ //register style and scrip files
137
+ function csbwf_sidebar_scripts() {
138
+ wp_enqueue_script( 'jquery' ); // wordpress jQuery
139
+ wp_register_style( 'csbwf_sidebar_style', plugins_url( 'css/csbwfs.css',__FILE__ ) );
140
+ wp_enqueue_style( 'csbwf_sidebar_style' );
141
+ }
142
+ /*********************************************************
143
+ "Add the jQuery code in head section using hooks"
144
+ *********************************************************/
145
+ function csbwf_sidebar_load_inline_js() {
146
+ $pluginOptionsVal=get_csbwf_sidebar_options();
147
+ $jscnt='
148
+ var windWidth=jQuery( window ).width();
149
+ //alert(windWidth);
150
+ var animateWidth;
151
+ var defaultAnimateWidth;';
152
+ $jscnt.=' jQuery(document).ready(function() {
153
+ animateWidth="55";
154
+ defaultAnimateWidth= animateWidth-10;
155
+ animateHeight="49";
156
+ defaultAnimateHeight= animateHeight-2;';
157
+ if($pluginOptionsVal['csbwfs_delayTimeBtn']!='0'):
158
+ $jscnt.='jQuery("#csbwfs-delaydiv").hide();
159
+ setTimeout(function(){
160
+ jQuery("#csbwfs-delaydiv").fadeIn();}, '.esc_attr($pluginOptionsVal['csbwfs_delayTimeBtn']).');';
161
+ endif;
162
+
163
+ if($pluginOptionsVal['csbwfs_position']=='right' || $pluginOptionsVal['csbwfs_position']=='left'){
164
+
165
+ $jscnt.='jQuery("div.csbwfsbtns a").hover(function(){
166
+ jQuery(this).animate({width:animateWidth});
167
+ },function(){
168
+ jQuery(this).stop( true, true ).animate({width:defaultAnimateWidth});
169
+ });';
170
+ }else
171
+ {
172
+ //silent
173
+
174
+ }
175
+
176
+ if(isset($pluginOptionsVal['csbwfs_auto_hide']) && $pluginOptionsVal['csbwfs_auto_hide']!=''):
177
+ $jscnt.='csbwfsSetCookie("csbwfs_show_hide_status","in_active","1");';
178
+ endif;
179
+ $jscnt.='jQuery("div.csbwfs-show").hide();
180
+ jQuery("div.csbwfs-show a").click(function(){
181
+ jQuery("div#csbwfs-social-inner").show(500);
182
+ jQuery("div.csbwfs-show").hide(500);
183
+ jQuery("div.csbwfs-hide").show(500);
184
+ csbwfsSetCookie("csbwfs_show_hide_status","active","1");
185
+ });
186
+
187
+ jQuery("div.csbwfs-hide a").click(function(){
188
+ jQuery("div.csbwfs-show").show(500);
189
+ jQuery("div.csbwfs-hide").hide(500);
190
+ jQuery("div#csbwfs-social-inner").hide(500);
191
+ csbwfsSetCookie("csbwfs_show_hide_status","in_active","1");
192
+ });';
193
+
194
+ $jscnt.='var button_status=csbwfsGetCookie("csbwfs_show_hide_status");
195
+ if (button_status =="in_active") {
196
+ jQuery("div.csbwfs-show").show();
197
+ jQuery("div.csbwfs-hide").hide();
198
+ jQuery("div#csbwfs-social-inner").hide();
199
+ } else {
200
+ jQuery("div#csbwfs-social-inner").show();
201
+ jQuery("div.csbwfs-show").hide();
202
+ jQuery("div.csbwfs-hide").show();
203
+ }';
204
+
205
+
206
+ $jscnt.='});';
207
+
208
+ wp_add_inline_script( 'jquery-core', $jscnt );
209
+
210
+ }
211
+
212
+ /********************************************************
213
+ "Custom Share Buttons with Floating Sidebar" HTML
214
+ *********************************************************/
215
+ function get_csbwf_sidebar_content() {
216
+ global $post;
217
+ $pluginOptionsVal=get_csbwf_sidebar_options();
218
+ $shareurl = esc_url(htmlspecialchars(csbwfs_get_current_page_url($_SERVER), ENT_QUOTES, 'UTF-8'));
219
+ $ShareTitle = (is_front_page() && is_home()) ? get_bloginfo('name'): trim(wp_title('',false));
220
+ $ShareTitle= htmlspecialchars(rawurlencode($ShareTitle));
221
+ $ShareTitle = str_replace("%26%23039%3B","",$ShareTitle);// remove single quate
222
+ /* Get All buttons Image */
223
+ //get facebook button image
224
+ if($pluginOptionsVal['csbwfs_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_fb_image'];}
225
+ else{$fImg='';}
226
+ //get twitter button image
227
+ if($pluginOptionsVal['csbwfs_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_tw_image'];}
228
+ else{$tImg='';}
229
+ //get Linkedin button image
230
+ if($pluginOptionsVal['csbwfs_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_li_image'];}
231
+ else{$lImg='';}
232
+ //get mail button image
233
+ if($pluginOptionsVal['csbwfs_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_mail_image'];}
234
+ else{$mImg='';}
235
+ //get pinterest button image
236
+ if($pluginOptionsVal['csbwfs_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_pin_image'];}
237
+ else{$pImg='';}
238
+ //get youtube button image
239
+ if(isset($pluginOptionsVal['csbwfs_yt_image']) && $pluginOptionsVal['csbwfs_yt_image']!=''){ $ytImg=$pluginOptionsVal['csbwfs_yt_image'];}
240
+ else{$ytImg='';}
241
+ //get reddit plus button image
242
+ if(isset($pluginOptionsVal['csbwfs_re_image']) && $pluginOptionsVal['csbwfs_re_image']!=''){ $reImg=$pluginOptionsVal['csbwfs_re_image'];}
243
+ else{$reImg='';}
244
+ //get stumbleupon button image
245
+ if(isset($pluginOptionsVal['csbwfs_st_image']) && $pluginOptionsVal['csbwfs_st_image']!=''){ $stImg=$pluginOptionsVal['csbwfs_st_image'];}
246
+ else{$stImg='';}
247
+ /* Get All buttons Image Alt/Title */
248
+ //get facebook button image alt/title
249
+ if($pluginOptionsVal['csbwfs_fb_title']!=''){ $fImgAlt=$pluginOptionsVal['csbwfs_fb_title'];}
250
+ else{$fImgAlt='Share On Facebook';}
251
+ //get twitter button image alt/title
252
+ if($pluginOptionsVal['csbwfs_tw_title']!=''){ $tImgAlt=$pluginOptionsVal['csbwfs_tw_title'];}
253
+ else{$tImgAlt='Share On Twitter';}
254
+ //get Linkedin button image alt/title
255
+ if($pluginOptionsVal['csbwfs_li_title']!=''){ $lImgAlt=$pluginOptionsVal['csbwfs_li_title'];}
256
+ else{$lImgAlt='Share On Linkedin';}
257
+ //get mail button image alt/title
258
+ if($pluginOptionsVal['csbwfs_mail_title']!=''){ $mImgAlt=$pluginOptionsVal['csbwfs_mail_title'];}
259
+ else{$mImgAlt='Contact us';}
260
+ //get pinterest button image alt/title
261
+ if($pluginOptionsVal['csbwfs_pin_title']!=''){ $pImgAlt=$pluginOptionsVal['csbwfs_pin_title'];}
262
+ else{$pImgAlt='Share On Pinterest';}
263
+ //get youtube button image alt/title
264
+ if(isset($pluginOptionsVal['csbwfs_yt_title']) && $pluginOptionsVal['csbwfs_yt_title']!=''){ $ytImgAlt=$pluginOptionsVal['csbwfs_yt_title'];}
265
+ else{$ytImgAlt='Share On Youtube';}
266
+ //get reddit plus button image alt/title
267
+ if(isset($pluginOptionsVal['csbwfs_re_title']) && $pluginOptionsVal['csbwfs_re_title']!=''){ $reImgAlt=$pluginOptionsVal['csbwfs_re_title'];}
268
+ else{$reImgAlt='Share On Reddit';}
269
+ //get stumbleupon button image alt/title
270
+ if(isset($pluginOptionsVal['csbwfs_st_title']) && $pluginOptionsVal['csbwfs_st_title']!=''){ $stImgAlt=$pluginOptionsVal['csbwfs_st_title'];}
271
+ else{$stImgAlt='Share On Stumbleupon';}
272
+ //get email message
273
+ if(is_page() || is_single() || is_category() || is_archive()){
274
+ if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
275
+ $mailMsg='?subject='.$ShareTitle.'&body='.$shareurl;}
276
+ }else
277
+ {
278
+ $mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
279
+ }
280
+ // Top Margin
281
+ if($pluginOptionsVal['csbwfs_top_margin']!=''){
282
+ $margin=$pluginOptionsVal['csbwfs_top_margin'];
283
+ }else
284
+ {
285
+ $margin='25%';
286
+ }
287
+
288
+ //Sidebar Position
289
+ if($pluginOptionsVal['csbwfs_position']=='right'){
290
+ $style=' style="top:'.$margin.';right:-5px;"'; $idName=' id="csbwfs-right"'; $showImg='hide-r.png'; $hideImg='show.png';
291
+ }else if($pluginOptionsVal['csbwfs_position']=='bottom'){
292
+ $style=' style="bottom:0;"'; $idName=' id="csbwfs-bottom"'; $showImg='hide-b.png'; $hideImg='show.png';
293
+ }
294
+ else
295
+ {
296
+ $idName=' id="csbwfs-left"'; $style=' style="top:'.$margin.';left:0;"'; $showImg='hide-l.png';$hideImg='hide.png';
297
+ }
298
+ /* Get All buttons background color */
299
+ //get facebook button image background color
300
+ if($pluginOptionsVal['csbwfs_fb_bg']!=''){ $fImgbg=' style="background:'.$pluginOptionsVal['csbwfs_fb_bg'].';"';}
301
+ else{$fImgbg='';}
302
+ //get twitter button image background color
303
+ if($pluginOptionsVal['csbwfs_tw_bg']!=''){ $tImgbg=' style="background:'.$pluginOptionsVal['csbwfs_tw_bg'].';"';}
304
+ else{$tImgbg='';}
305
+ //get Linkedin button image background color
306
+ if($pluginOptionsVal['csbwfs_li_bg']!=''){ $lImgbg=' style="background:'.$pluginOptionsVal['csbwfs_li_bg'].';"';}
307
+ else{$lImgbg='';}
308
+ //get mail button image background color
309
+ if($pluginOptionsVal['csbwfs_mail_bg']!=''){ $mImgbg=' style="background:'.$pluginOptionsVal['csbwfs_mail_bg'].';"';}
310
+ else{$mImgbg='';}
311
+ //get pinterest button image background color
312
+ if($pluginOptionsVal['csbwfs_pin_bg']!=''){ $pImgbg=' style="background:'.$pluginOptionsVal['csbwfs_pin_bg'].';"';}
313
+ else{$pImgbg='';}
314
+
315
+ //get youtube button image background color
316
+ if(isset($pluginOptionsVal['csbwfs_yt_bg']) && $pluginOptionsVal['csbwfs_yt_bg']!=''){ $ytImgbg=' style="background:'.$pluginOptionsVal['csbwfs_yt_bg'].';"';}else{$ytImgbg='';}
317
+ //get reddit button image background color
318
+ if(isset($pluginOptionsVal['csbwfs_re_bg']) && $pluginOptionsVal['csbwfs_re_bg']!=''){ $reImgbg=' style="background:'.$pluginOptionsVal['csbwfs_re_bg'].';"';}else{$reImgbg='';}
319
+ //get stumbleupon button image background color
320
+ if(isset($pluginOptionsVal['csbwfs_st_bg']) && $pluginOptionsVal['csbwfs_st_bg']!=''){ $stImgbg=' style="background:'.$pluginOptionsVal['csbwfs_st_bg'].';"';} else{$stImgbg='';}
321
+
322
+ /** Message */
323
+ if($pluginOptionsVal['csbwfs_show_btn']!=''){ $showbtn=$pluginOptionsVal['csbwfs_show_btn'];}
324
+ else{$showbtn='Show Buttons';}
325
+ //get show/hide button message
326
+ if($pluginOptionsVal['csbwfs_hide_btn']!=''){ $hidebtn=$pluginOptionsVal['csbwfs_hide_btn'];}
327
+ else{$hidebtn='Hide Buttons';}
328
+ //get mail button message
329
+ if($pluginOptionsVal['csbwfs_share_msg']!=''){ $sharemsg=$pluginOptionsVal['csbwfs_share_msg'];}
330
+ else{$sharemsg='Share This With Your Friends';}
331
+
332
+ /** Check display Show/Hide button or not*/
333
+ if(isset($pluginOptionsVal['csbwfs_rmSHBtn']) && $pluginOptionsVal['csbwfs_rmSHBtn']!=''):
334
+ $isActiveHideShowBtn='yes';
335
+ else:
336
+ $isActiveHideShowBtn='no';
337
+ endif;
338
+ $floatingSidebarContent='<div id="csbwfs-delaydiv"><div class="csbwfs-social-widget" '.$idName.' title="'.$sharemsg.'" '.$style.'>';
339
+
340
+ if($isActiveHideShowBtn!='yes') :
341
+ $floatingSidebarContent .= '<div class="csbwfs-show"><a href="javascript:" title="'.$showbtn.'" id="csbwfs-show"><img src="'.plugin_dir_url( __FILE__ ).'images/'.$showImg.'" alt="'.$showbtn.'"></a></div>';
342
+ endif;
343
+
344
+ $floatingSidebarContent .= '<div id="csbwfs-social-inner">';
345
+
346
+ /** FB */
347
+ if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
348
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-fb" class="csbwfs-fb"><a href="javascript:" onclick="javascript:window.open(\'//www.facebook.com/sharer/sharer.php?u='.$shareurl.'\', \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600\');return false;" target="_blank" title="'.$fImgAlt.'" '.$fImgbg.'>';
349
+
350
+ if($fImg!=''){
351
+ $floatingSidebarContent .='<img src="'.$fImg.'" alt="'.$fImgAlt.'" width="35" height="35" >';
352
+ }else{
353
+ $floatingSidebarContent .='<i class="csbwfs_facebook"></i>';
354
+ }
355
+ $floatingSidebarContent .='</a></div></div>';
356
+ endif;
357
+
358
+ /** TW */
359
+ if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
360
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-tw" class="csbwfs-tw"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url='.$shareurl.'&text='.$ShareTitle.'\',\'_blank\',\'width=800,height=300\')" title="'.$tImgAlt.'" '.$tImgbg.'>';
361
+ if($tImg!='')
362
+ {
363
+ $floatingSidebarContent .='<img src="'.$tImg.'" alt="'.$tImgAlt.'" width="35" height="35" >';
364
+ }else{
365
+ $floatingSidebarContent .='<i class="csbwfs_twitter"></i>';
366
+ }
367
+ $floatingSidebarContent .='</a></div></div>';
368
+
369
+ endif;
370
+
371
+ /** LI */
372
+ if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
373
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-li" class="csbwfs-li"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/cws/share?mini=true&url='. $shareurl.'\',\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" title="'.$lImgAlt.'" '.$lImgbg.'>';
374
+ if($lImg!='')
375
+ {
376
+ $floatingSidebarContent .='<img src="'.$lImg.'" alt="'.$lImgAlt.'" width="35" height="35" >';
377
+ }else{
378
+ $floatingSidebarContent .='<i class="csbwfs_linkedin"></i>';
379
+ }
380
+ $floatingSidebarContent .='</a></div></div>';
381
+ endif;
382
+
383
+ /** PIN */
384
+ if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
385
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-pin" class="csbwfs-pin"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);" '.$pImgbg.' title="'.$pImgAlt.'">';
386
+ if($pImg!='')
387
+ {
388
+ $floatingSidebarContent .='<img src="'.$pImg.'" alt="'.$pImgAlt.'" width="35" height="35" >';
389
+ }else{
390
+ $floatingSidebarContent .='<i class="csbwfs_pinterest"></i>';
391
+ }
392
+ $floatingSidebarContent .='</a></div></div>';
393
+ endif;
394
+
395
+ /** Reddit */
396
+ if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
397
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-re" class="csbwfs-re"><a onclick="window.open(\'//reddit.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$reImgbg.' title="'.$reImgAlt.'">';
398
+ if($reImg!='')
399
+ {
400
+ $floatingSidebarContent .='<img src="'.$reImg.'" alt="'.$reImgAlt.'" width="35" height="35" >';
401
+ }else{
402
+ $floatingSidebarContent .='<i class="csbwfs_reddit"></i>';
403
+ }
404
+ $floatingSidebarContent .='</a></div></div>';
405
+ endif;
406
+
407
+ /** Stumbleupon/Mix */
408
+ if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
409
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-st" class="csbwfs-st"><a onclick="window.open(\'//mix.com/mixit?su=submit&url='.$shareurl.'\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$stImgbg.' title="'.$stImgAlt.'">';
410
+ if($stImg!='')
411
+ {
412
+ $floatingSidebarContent .='<img src="'.$stImg.'" alt="'.$stImgAlt.'" width="35" height="35" >';
413
+ }else{
414
+ $floatingSidebarContent .='<i class="csbwfs_stumbleupon"></i>';
415
+ }
416
+ $floatingSidebarContent .='</a></div></div>';
417
+ endif;
418
+ /** YT */
419
+ if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
420
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-yt" class="csbwfs-yt"><a onclick="window.open(\''.$pluginOptionsVal['csbwfs_ytPath'].'\');" href="javascript:void(0);" '.$ytImgbg.' title="'.$ytImgAlt.'">';
421
+ if($ytImg!='')
422
+ {
423
+ $floatingSidebarContent .='<img src="'.$ytImg.'" alt="'.$ytImgAlt.'" width="35" height="35" >';
424
+ }else{
425
+ $floatingSidebarContent .='<i class="csbwfs_youtube"></i>';
426
+ }
427
+ $floatingSidebarContent .='</a></div></div>';
428
+ endif;
429
+ /** Skype */
430
+ if((isset($pluginOptionsVal['csbwfs_skpublishBtn']) && $pluginOptionsVal['csbwfs_skpublishBtn']!='') && (isset($pluginOptionsVal['csbwfs_skPath']) && $pluginOptionsVal['csbwfs_skPath']!='')):
431
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-sk" class="csbwfs-sk"><a href="skype:'.$pluginOptionsVal['csbwfs_skPath'].'" >';
432
+ $floatingSidebarContent .='<i class="csbwfs_skype"></i>';
433
+ $floatingSidebarContent .='</a></div></div>';
434
+ endif;
435
+ /** Mail*/
436
+ if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
437
+ $floatingSidebarContent .='<div class="csbwfs-sbutton csbwfsbtns"><div id="csbwfs-ml" class="csbwfs-ml"><a href="mailto:'.$mailMsg.'" title="'.$mImgAlt.'" '.$mImgbg.' >';
438
+ if($mImg!='')
439
+ {
440
+ $floatingSidebarContent .='<img src="'.$mImg.'" alt="'.$mImgAlt.'" width="35" height="35" >';
441
+ }else{
442
+ $floatingSidebarContent .='<i class="csbwfs_mail"></i>';
443
+ }
444
+ $floatingSidebarContent .='</a></div></div>';
445
+ endif;
446
+
447
+ $floatingSidebarContent .='</div>'; //End social-inner
448
+
449
+ if($isActiveHideShowBtn!='yes') :
450
+ $floatingSidebarContent .='<div class="csbwfs-hide"><a href="javascript:" title="'.$hidebtn.'" id="csbwfs-hide"><img src="'.plugin_dir_url( __FILE__ ).'images/'.$hideImg.'" alt="'.$hidebtn.'"></a></div>';
451
+ endif;
452
+
453
+ $floatingSidebarContent .='</div></div>'; //End social-inner
454
+ /** Check conditions */
455
+ // Returns the content.
456
+ if(isset($pluginOptionsVal['csbwfs_hide_home'])){$hideOnHome=$pluginOptionsVal['csbwfs_hide_home']; }else{ $hideOnHome='';}
457
+
458
+ if((is_home() && is_front_page()) && $hideOnHome=='yes'):
459
+ $floatingSidebarContent='';
460
+ endif;
461
+ if(is_front_page() && $hideOnHome=='yes' ):
462
+ $floatingSidebarContent='';
463
+ endif;
464
+ /** hide on 404 pages */
465
+ if(is_404()):$floatingSidebarContent='';endif;
466
+
467
+ _e($floatingSidebarContent,'wpexpertsin');
468
+ }
469
+
470
+ /**
471
+ * Add social share bottons to the end of every post/page.
472
+ *
473
+ * @uses is_home()
474
+ * @uses is_page()
475
+ * @uses is_single()
476
+ */
477
+ function csbfs_the_content_filter( $content ) {
478
+
479
+ global $post;
480
+ $pluginOptionsVal=get_csbwf_sidebar_options();
481
+ if(is_category())
482
+ {
483
+ $category_id = get_query_var('cat');
484
+ $cats = get_the_category();
485
+ $ShareTitle=$cats[0]->name;
486
+ }elseif($post && is_singular($post->post_type))
487
+ {
488
+ $ShareTitle=$post->post_title;
489
+ }
490
+ elseif(is_archive()){
491
+ global $wp;
492
+ if ( is_day() ) :
493
+ $ShareTitle='Daily Archives: '. get_the_date();
494
+ elseif ( is_month() ) :
495
+ $ShareTitle='Monthly Archives: '. get_the_date('F Y');
496
+ elseif ( is_year() ) :
497
+ $ShareTitle='Yearly Archives: '. get_the_date('Y');
498
+ elseif ( is_author() ) :
499
+ $ShareTitle='Author Archives: '. get_the_author();
500
+ else :
501
+ $ShareTitle ='Blog Archives';
502
+ endif;
503
+ }
504
+ else
505
+ {
506
+ $ShareTitle=get_bloginfo('name');
507
+ }
508
+ /* Set title and url for home page */
509
+ if(is_home() && is_front_page()){
510
+ $ShareTitle=get_bloginfo('name');
511
+ }
512
+
513
+ $shareurl = esc_url(htmlspecialchars(csbwfs_get_current_page_url($_SERVER), ENT_QUOTES, 'UTF-8'));
514
+
515
+ $ShareTitle= htmlspecialchars(rawurlencode($ShareTitle));
516
+
517
+ /* Get All buttons Image */
518
+
519
+ //get facebook button image
520
+ if($pluginOptionsVal['csbwfs_page_fb_image']!=''){ $fImg=$pluginOptionsVal['csbwfs_page_fb_image'];}
521
+ else{$fImg='';}
522
+ //get twitter button image
523
+ if($pluginOptionsVal['csbwfs_page_tw_image']!=''){ $tImg=$pluginOptionsVal['csbwfs_page_tw_image'];}
524
+ else{$tImg='';}
525
+ //get Linkedin button image
526
+ if($pluginOptionsVal['csbwfs_page_li_image']!=''){ $lImg=$pluginOptionsVal['csbwfs_page_li_image'];}
527
+ else{$lImg='';}
528
+ //get mail button image
529
+ if($pluginOptionsVal['csbwfs_page_mail_image']!=''){ $mImg=$pluginOptionsVal['csbwfs_page_mail_image'];}
530
+ else{$mImg='';}
531
+ //get pinterest button image
532
+ if($pluginOptionsVal['csbwfs_page_pin_image']!=''){ $pImg=$pluginOptionsVal['csbwfs_page_pin_image'];}
533
+ else{$pImg='';}
534
+
535
+ //get youtube button image
536
+ if(isset($pluginOptionsVal['csbwfs_page_yt_image']) && $pluginOptionsVal['csbwfs_page_yt_image']!=''){ $ytImg=$pluginOptionsVal['csbwfs_page_yt_image'];}
537
+ else{$ytImg='';}
538
+ //get reddit plus button image
539
+ if(isset($pluginOptionsVal['csbwfs_page_re_image']) && $pluginOptionsVal['csbwfs_page_re_image']!=''){ $reImg=$pluginOptionsVal['csbwfs_page_re_image'];}
540
+ else{$reImg='';}
541
+ //get stumbleupon button image
542
+ if(isset($pluginOptionsVal['csbwfs_page_st_image']) && $pluginOptionsVal['csbwfs_page_st_image']!=''){ $stImg=$pluginOptionsVal['csbwfs_page_st_image'];}
543
+ else{$stImg='';}
544
+
545
+ /* Get All buttons Image Alt/Title */
546
+ //get facebook button image alt/title
547
+ if($pluginOptionsVal['csbwfs_page_fb_title']!=''){ $fImgAlt=$pluginOptionsVal['csbwfs_page_fb_title'];}
548
+ else{$fImgAlt='Share On Facebook';}
549
+ //get twitter button image alt/title
550
+ if($pluginOptionsVal['csbwfs_page_tw_title']!=''){ $tImgAlt=$pluginOptionsVal['csbwfs_page_tw_title'];}
551
+ else{$tImgAlt='Share On Twitter';}
552
+ //get Linkedin button image alt/title
553
+ if($pluginOptionsVal['csbwfs_page_li_title']!=''){ $lImgAlt=$pluginOptionsVal['csbwfs_page_li_title'];}
554
+ else{$lImgAlt='Share On Linkedin';}
555
+ //get mail button image alt/title
556
+ if($pluginOptionsVal['csbwfs_page_mail_title']!=''){ $mImgAlt=$pluginOptionsVal['csbwfs_page_mail_title'];}
557
+ else{$mImgAlt='Contact us';}
558
+ //get pinterest button image alt/title
559
+ if($pluginOptionsVal['csbwfs_page_pin_title']!=''){ $pImgAlt=$pluginOptionsVal['csbwfs_page_pin_title'];}
560
+ else{$pImgAlt='Share On Pinterest';}
561
+ //get youtube button image alt/title
562
+ if(isset($pluginOptionsVal['csbwfs_page_yt_title']) && $pluginOptionsVal['csbwfs_page_yt_title']!=''){ $ytImgAlt=$pluginOptionsVal['csbwfs_page_yt_title'];}
563
+ else{$ytImgAlt='Share On Youtube';}
564
+ //get reddit plus button image alt/title
565
+ if(isset($pluginOptionsVal['csbwfs_page_re_title']) && $pluginOptionsVal['csbwfs_page_re_title']!=''){ $reImgAlt=$pluginOptionsVal['csbwfs_page_re_title'];}
566
+ else{$reImgAlt='Share On Reddit';}
567
+ //get stumbleupon button image alt/title
568
+ if(isset($pluginOptionsVal['csbwfs_page_st_title']) && $pluginOptionsVal['csbwfs_page_st_title']!=''){ $stImgAlt=$pluginOptionsVal['csbwfs_page_st_title'];}
569
+ else{$stImgAlt='Share On Stumbleupon';}
570
+
571
+ /* Get All buttons background color */
572
+ //get facebook button image background color
573
+ if($pluginOptionsVal['csbwfs_page_fb_bg']!=''){ $fImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_fb_bg'].';"';}
574
+ else{$fImgbg='';}
575
+ //get twitter button image background color
576
+ if($pluginOptionsVal['csbwfs_page_tw_bg']!=''){ $tImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_tw_bg'].';"';}
577
+ else{$tImgbg='';}
578
+ //get Linkedin button image background color
579
+ if($pluginOptionsVal['csbwfs_page_li_bg']!=''){ $lImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_li_bg'].';"';}
580
+ else{$lImgbg='';}
581
+ //get mail button image background color
582
+ if($pluginOptionsVal['csbwfs_page_mail_bg']!=''){ $mImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_mail_bg'].';"';}
583
+ else{$mImgbg='';}
584
+ //get pinterest button image background color
585
+ if($pluginOptionsVal['csbwfs_page_pin_bg']!=''){ $pImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_pin_bg'].';"';}
586
+ else{$pImgbg='';}
587
+
588
+ //get youtube button image background color
589
+ if(isset($pluginOptionsVal['csbwfs_page_yt_bg']) && $pluginOptionsVal['csbwfs_page_yt_bg']!=''){ $ytImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_yt_bg'].';"';}else{$ytImgbg='';}
590
+ //get reddit button image background color
591
+ if(isset($pluginOptionsVal['csbwfs_page_re_bg']) && $pluginOptionsVal['csbwfs_page_re_bg']!=''){ $reImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_re_bg'].';"';}else{$reImgbg='';}
592
+ //get stumbleupon button image background color
593
+ if(isset($pluginOptionsVal['csbwfs_page_st_bg']) && $pluginOptionsVal['csbwfs_page_st_bg']!=''){ $stImgbg=' style="background:'.$pluginOptionsVal['csbwfs_page_st_bg'].';"';} else{$stImgbg='';}
594
+ //get email message
595
+ if(is_page() || is_single() || is_category() || is_archive()){
596
+
597
+ if($pluginOptionsVal['csbwfs_mailMessage']!=''){ $mailMsg=$pluginOptionsVal['csbwfs_mailMessage'];} else{
598
+ $mailMsg='?subject='.get_the_title().'&body='.$shareurl;}
599
+ }else
600
+ {
601
+ $mailMsg='?subject='.get_bloginfo('name').'&body='.home_url('/');
602
+ }
603
+ if(isset($pluginOptionsVal['csbwfs_btn_position']) && $pluginOptionsVal['csbwfs_btn_position']!=''):
604
+ $btnPosition=$pluginOptionsVal['csbwfs_btn_position'];
605
+ else:
606
+ $btnPosition='left';
607
+ endif;
608
+
609
+ if(isset($pluginOptionsVal['csbwfs_btn_text']) && $pluginOptionsVal['csbwfs_btn_text']!=''):
610
+ $btnText=$pluginOptionsVal['csbwfs_btn_text'];
611
+ else:
612
+ $btnText='';
613
+ endif;
614
+
615
+ $shareButtonContent='<div id="socialButtonOnPage" class="'.$btnPosition.'SocialButtonOnPage">';
616
+ if($btnText!=''):
617
+ $shareButtonContent.='<div class="sharethis-arrow" title="'.$btnText.'"><span>'.$btnText.'</span></div>';
618
+ endif;
619
+ /* Facebook*/
620
+ if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
621
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="fb-p" class="csbwfs-fb"><a href="javascript:" onclick="window.open(\'//www.facebook.com/sharer/sharer.php?u='.$shareurl.'\',\'Facebook\',\'width=800,height=300\');return false;"
622
+ target="_blank" title="'.$fImgAlt.'" '.$fImgbg.'>';
623
+ if($fImg!=''){
624
+ $shareButtonContent .='<img src="'.$fImg.'" alt="'.$fImgAlt.'" width="35" height="35" >';
625
+ }else{
626
+ $shareButtonContent .='<i class="csbwfs_facebook"></i>';
627
+ }
628
+ $shareButtonContent .='</a></div></div>';
629
+ endif;
630
+
631
+ /* Twitter */
632
+ if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
633
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="tw-p" class="csbwfs-tw"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url='.$shareurl.'&text='.$ShareTitle.'&nbsp;&nbsp;\', \'_blank\', \'width=800,height=300\')" title="'.$tImgAlt.'" '.$tImgbg.'>';
634
+ if($tImg!='')
635
+ {
636
+ $shareButtonContent .='<img src="'.$tImg.'" alt="'.$tImgAlt.'" width="35" height="35" >';
637
+ }else{
638
+ $shareButtonContent .='<i class="csbwfs_twitter"></i>';
639
+ }
640
+ $shareButtonContent .='</a></div></div>';
641
+ endif;
642
+ /* Linkedin */
643
+ if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
644
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="li-p" class="csbwfs-li"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/shareArticle?mini=true&url='.$shareurl.'\',\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;" title="'.$lImgAlt.'" '.$lImgbg.'>';
645
+ if($lImg!='')
646
+ {
647
+ $shareButtonContent .='<img src="'.$lImg.'" alt="'.$lImgAlt.'" width="35" height="35" >';
648
+ }else{
649
+ $shareButtonContent .='<i class="csbwfs_linkedin"></i>';
650
+ }
651
+ $shareButtonContent .='</a></div></div>';
652
+ endif;
653
+
654
+ /* Pinterest */
655
+ if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
656
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="pin-p" class="csbwfs-pin"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);" title="'.$pImgAlt.'" '.$pImgbg.'>';
657
+ if($pImg!='')
658
+ {
659
+ $shareButtonContent .='<img src="'.$pImg.'" alt="'.$pImgAlt.'" width="35" height="35" >';
660
+ }else{
661
+ $shareButtonContent .='<i class="csbwfs_pinterest"></i>';
662
+ }
663
+ $shareButtonContent .='</a></div></div>';
664
+ endif;
665
+ /* Reddit */
666
+ if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
667
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="re-p" class="csbwfs-re"><a onclick="window.open(\'//reddit.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" title="'.$reImgAlt.'" '.$reImgbg.'>';
668
+ if($reImg!='')
669
+ {
670
+ $shareButtonContent .='<img src="'.$reImg.'" alt="'.$reImgAlt.'" width="35" height="35" >';
671
+ }else{
672
+ $shareButtonContent .='<i class="csbwfs_reddit"></i>';
673
+ }
674
+ $shareButtonContent .='</a></div></div>';
675
+ endif;
676
+ /* Stumbleupon/Mix */
677
+ if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
678
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="st-p" class="csbwfs-st"><a onclick="window.open(\'//mix.com/mixit?su=submit&url='.$shareurl.'\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" title="'.$stImgAlt.'" '.$stImgbg.'>';
679
+ if($stImg!='')
680
+ {
681
+ $shareButtonContent .='<img src="'.$stImg.'" alt="'.$stImgAlt.'" width="35" height="35" >';
682
+ }else{
683
+ $shareButtonContent .='<i class="csbwfs_stumbleupon"></i>';
684
+ }
685
+ $shareButtonContent .='</a></div></div>';
686
+ endif;
687
+ /* Youtube */
688
+ if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
689
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="yt-p" class="csbwfs-yt"><a onclick="window.open(\''.$pluginOptionsVal['csbwfs_ytPath'].'\');" href="javascript:void(0);" title="'.$ytImgAlt.'" '.$ytImgbg.'>';
690
+ if($ytImg!='')
691
+ {
692
+ $shareButtonContent .='<img src="'.$ytImg.'" alt="'.$ytImgAlt.'" width="35" height="35" >';
693
+ }else{
694
+ $shareButtonContent .='<i class="csbwfs_youtube"></i>';
695
+ }
696
+ $shareButtonContent .='</a></div></div>';
697
+ endif;
698
+ /** Skype */
699
+ if((isset($pluginOptionsVal['csbwfs_skpublishBtn']) && $pluginOptionsVal['csbwfs_skpublishBtn']!='') && (isset($pluginOptionsVal['csbwfs_skPath']) && $pluginOptionsVal['csbwfs_skPath']!='')):
700
+ $shareButtonContent .='<div class="csbwfs-sbutton-post"><div id="sk-p" class="csbwfs-sk"><a href="skype:'.$pluginOptionsVal['csbwfs_skPath'].'" >';
701
+ $shareButtonContent .='<i class="csbwfs_skype"></i>';
702
+ $shareButtonContent .='</a></div></div>';
703
+ endif;
704
+ /* Email */
705
+ if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
706
+ $shareButtonContent.='<div class="csbwfs-sbutton-post"><div id="ml-p" class="csbwfs-ml"><a href="mailto:'.$mailMsg.'" title="'.$mImgAlt.'" '.$mImgbg.'>';
707
+ if($mImg!='')
708
+ {
709
+ $shareButtonContent .='<img src="'.$mImg.'" alt="'.$mImgAlt.'" width="35" height="35" >';
710
+ }else{
711
+ $shareButtonContent .='<i class="csbwfs_mail"></i>';
712
+ }
713
+ $shareButtonContent .='</a></div></div>';
714
+ endif;
715
+ $shareButtonContent.='</div>';
716
+
717
+ // Returns the content.
718
+ global $post;
719
+ $shareButtonContentReturn='';
720
+ /* DEFAULT HOME */
721
+ if((is_home() && is_front_page()) && $pluginOptionsVal['csbwfs_page_hide_home']=='yes'):
722
+ $shareButtonContentReturn=$shareButtonContent;
723
+ endif;
724
+ /* STATIC front page */
725
+ if(is_front_page() && $pluginOptionsVal['csbwfs_page_hide_home']=='yes'):
726
+ $shareButtonContentReturn=$shareButtonContent;
727
+ endif;
728
+ //post
729
+ if(is_single() && $pluginOptionsVal['csbwfs_page_hide_post']=='yes'):
730
+ $shareButtonContentReturn=$shareButtonContent;
731
+ endif;
732
+ //page
733
+ if(is_page() && $pluginOptionsVal['csbwfs_page_hide_page']=='yes'):
734
+ if(!is_front_page()):
735
+ $shareButtonContentReturn=$shareButtonContent;
736
+ endif;
737
+ endif;
738
+ //archive
739
+ if(is_archive() && $pluginOptionsVal['csbwfs_page_hide_archive']=='yes'):
740
+ $shareButtonContentReturn=$shareButtonContent;
741
+ endif;
742
+ // 404
743
+ if(is_404()):
744
+ $shareButtonContentReturn='';
745
+ endif;
746
+ /** Buttons position on content */
747
+ if(isset($pluginOptionsVal['csbwfs_btn_display']) && $pluginOptionsVal['csbwfs_btn_display']=='above'){
748
+ $finalContent= $shareButtonContentReturn.$content;
749
+ }else
750
+ {
751
+ $finalContent = $content.$shareButtonContentReturn;
752
+ }
753
+ return $finalContent;
754
+ }
 
 
 
 
 
 
custom-share-buttons-with-floating-sidebar.php CHANGED
@@ -2,13 +2,13 @@
2
  /*
3
  Plugin Name: Custom Share Buttons with Floating Sidebar
4
  Plugin URI: https://www.wp-experts.in
5
- Description: Share buttons with extra features to sharing your website posts/pages on Facebook, Twitter, Instagram, Whatsapp, Pinterest etc.
6
  Author: WP Experts Team
7
  Author URI: https://www.wp-experts.in
8
- Version: 4.0
9
  */
10
 
11
- /* Copyright 2018-2020 custom-share-buttons-with-floating-sidebar (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
@@ -25,15 +25,13 @@ Version: 4.0
25
  */
26
  //Admin "Custom Share Buttons with Floating Sidebar" Menu Item
27
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
- if(!class_exists('Csbwfs_Class'))
29
- {
30
- class Csbwfs_Class
31
- {
32
  /**
33
  * Construct the plugin object
34
  */
35
- public function __construct()
36
- {
37
  // register actions
38
  add_action('admin_init', array(&$this, 'csbwfs_admin_init'));
39
  add_action('admin_menu', array(&$this, 'csbwf_sidebar_menu'));
@@ -66,8 +64,7 @@ if(!class_exists('Csbwfs_Class'))
66
  /**
67
  * hook into WP's admin_init action hook
68
  */
69
- public function csbwfs_admin_init()
70
- {
71
  // Set up the settings for this plugin
72
  $this->csbwf_sidebar_init();
73
  // Possibly do additional admin_init tasks
@@ -75,105 +72,102 @@ if(!class_exists('Csbwfs_Class'))
75
  /**
76
  * Initialize some custom settings
77
  */
78
- public function csbwf_sidebar_init()
79
- {
80
  // register the settings for this plugin
81
- register_setting('csbwf_sidebar_options','csbwfs_active');
82
- register_setting('csbwf_sidebar_options','csbwfs_position');
83
- register_setting('csbwf_sidebar_options','csbwfs_btn_position');
84
- register_setting('csbwf_sidebar_options','csbwfs_btn_text');
85
- register_setting('csbwf_sidebar_options','csbwfs_fb_image');
86
- register_setting('csbwf_sidebar_options','csbwfs_tw_image');
87
- register_setting('csbwf_sidebar_options','csbwfs_li_image');
88
- register_setting('csbwf_sidebar_options','csbwfs_re_image');
89
- register_setting('csbwf_sidebar_options','csbwfs_st_image');
90
- register_setting('csbwf_sidebar_options','csbwfs_mail_image');
91
- register_setting('csbwf_sidebar_options','csbwfs_pin_image');
92
- register_setting('csbwf_sidebar_options','csbwfs_yt_image');
93
- register_setting('csbwf_sidebar_options','csbwfs_fb_bg');
94
- register_setting('csbwf_sidebar_options','csbwfs_tw_bg');
95
- register_setting('csbwf_sidebar_options','csbwfs_li_bg');
96
- register_setting('csbwf_sidebar_options','csbwfs_mail_bg');
97
- register_setting('csbwf_sidebar_options','csbwfs_pin_bg');
98
- register_setting('csbwf_sidebar_options','csbwfs_re_bg');
99
- register_setting('csbwf_sidebar_options','csbwfs_st_bg');
100
- register_setting('csbwf_sidebar_options','csbwfs_yt_bg');
101
- register_setting('csbwf_sidebar_options','csbwfs_page_fb_bg');
102
- register_setting('csbwf_sidebar_options','csbwfs_page_tw_bg');
103
- register_setting('csbwf_sidebar_options','csbwfs_page_li_bg');
104
- register_setting('csbwf_sidebar_options','csbwfs_page_mail_bg');
105
- register_setting('csbwf_sidebar_options','csbwfs_page_pin_bg');
106
- register_setting('csbwf_sidebar_options','csbwfs_page_re_bg');
107
- register_setting('csbwf_sidebar_options','csbwfs_page_st_bg');
108
- register_setting('csbwf_sidebar_options','csbwfs_page_yt_bg');
109
- register_setting('csbwf_sidebar_options','csbwfs_fpublishBtn');
110
- register_setting('csbwf_sidebar_options','csbwfs_tpublishBtn');
111
- register_setting('csbwf_sidebar_options','csbwfs_ppublishBtn');
112
- register_setting('csbwf_sidebar_options','csbwfs_ytpublishBtn');
113
- register_setting('csbwf_sidebar_options','csbwfs_skpublishBtn');
114
- register_setting('csbwf_sidebar_options','csbwfs_skPath');
115
- register_setting('csbwf_sidebar_options','csbwfs_republishBtn');
116
- register_setting('csbwf_sidebar_options','csbwfs_stpublishBtn');
117
- register_setting('csbwf_sidebar_options','csbwfs_ytPath');
118
- register_setting('csbwf_sidebar_options','csbwfs_lpublishBtn');
119
- register_setting('csbwf_sidebar_options','csbwfs_mpublishBtn');
120
- register_setting('csbwf_sidebar_options','csbwfs_mailMessage');
121
- register_setting('csbwf_sidebar_options','csbwfs_top_margin');
122
- register_setting('csbwf_sidebar_options','csbwfs_delayTimeBtn');
123
- register_setting('csbwf_sidebar_options','csbwfs_btn_display');
124
  /** Image Alt */
125
- register_setting('csbwf_sidebar_options','csbwfs_fb_title');
126
- register_setting('csbwf_sidebar_options','csbwfs_tw_title');
127
- register_setting('csbwf_sidebar_options','csbwfs_li_title');
128
- register_setting('csbwf_sidebar_options','csbwfs_pin_title');
129
- register_setting('csbwf_sidebar_options','csbwfs_mail_title');
130
- register_setting('csbwf_sidebar_options','csbwfs_yt_title');
131
- register_setting('csbwf_sidebar_options','csbwfs_re_title');
132
- register_setting('csbwf_sidebar_options','csbwfs_st_title');
133
- register_setting('csbwf_sidebar_options','csbwfs_page_fb_title');
134
- register_setting('csbwf_sidebar_options','csbwfs_page_tw_title');
135
- register_setting('csbwf_sidebar_options','csbwfs_page_li_title');
136
- register_setting('csbwf_sidebar_options','csbwfs_page_pin_title');
137
- register_setting('csbwf_sidebar_options','csbwfs_page_mail_title');
138
- register_setting('csbwf_sidebar_options','csbwfs_page_yt_title');
139
- register_setting('csbwf_sidebar_options','csbwfs_page_re_title');
140
- register_setting('csbwf_sidebar_options','csbwfs_page_st_title');
141
- register_setting('csbwf_sidebar_options','csbwfs_auto_hide');
142
  //Options for post/pages
143
- register_setting('csbwf_sidebar_options','csbwfs_buttons_active');
144
- register_setting('csbwf_sidebar_options','csbwfs_page_hide_home');
145
- register_setting('csbwf_sidebar_options','csbwfs_page_hide_post');
146
- register_setting('csbwf_sidebar_options','csbwfs_page_hide_page');
147
- register_setting('csbwf_sidebar_options','csbwfs_page_hide_archive');
148
- register_setting('csbwf_sidebar_options','csbwfs_hide_home');
149
- register_setting('csbwf_sidebar_options','csbwfs_page_fb_image');
150
- register_setting('csbwf_sidebar_options','csbwfs_page_tw_image');
151
- register_setting('csbwf_sidebar_options','csbwfs_page_li_image');
152
- register_setting('csbwf_sidebar_options','csbwfs_page_mail_image');
153
- register_setting('csbwf_sidebar_options','csbwfs_page_pin_image');
154
- register_setting('csbwf_sidebar_options','csbwfs_page_re_image');
155
- register_setting('csbwf_sidebar_options','csbwfs_page_st_image');
156
- register_setting('csbwf_sidebar_options','csbwfs_page_yt_image');
157
  /** message content */
158
- register_setting('csbwf_sidebar_options','csbwfs_show_btn');
159
- register_setting('csbwf_sidebar_options','csbwfs_hide_btn');
160
- register_setting('csbwf_sidebar_options','csbwfs_share_msg');
161
- register_setting('csbwf_sidebar_options','csbwfs_rmSHBtn');
162
  //register_setting('csbwf_sidebar_options','csbwfs_featuredshrimg');
163
  //register_setting('csbwf_sidebar_options','csbwfs_defaultfeaturedshrimg');
164
- register_setting('csbwf_sidebar_options','csbwfs_deactive_for_mob');
165
  } // END public function init_custom_settings()
166
  /**
167
  * add a menu
168
  */
169
- public function csbwf_sidebar_menu()
170
- {
171
  add_options_page('Social Share Buttons(CSBWFS)','Social Share Buttons(CSBWFS)','manage_options','csbwfs-settings',array(&$this,'csbwf_sidebar_admin_option_page'));
172
 
173
  } // END public function add_menu()
174
 
175
- public function csbwf_sidebar_admin_option_page()
176
- {
177
  if(!current_user_can('manage_options'))
178
  {
179
  wp_die(__('You do not have sufficient permissions to access this page.'));
@@ -202,15 +196,14 @@ if(!class_exists('Csbwfs_Class'))
202
  */
203
  public static function csbwfs_add_settings_link( $links ) {
204
  $settings_link = '<a href="options-general.php?page=csbwfs-settings">' . __( 'Settings', 'csbwfs' ) . '</a>';
205
- $settings_link .= ' | <a href="https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank">' . __( 'FLAT 50% DISCOUNT ON Add-on', 'csbwfs' ) . '</a>';
206
  array_unshift( $links, $settings_link );
207
  return $links;
208
  }
209
  /**
210
  * uninstall the plugin
211
  */
212
- public function csbwfs_uninstall()
213
- {
214
  delete_option('csbwfs_active');
215
  delete_option('csbbuttons_active');
216
  delete_option('csbwfs_position');
@@ -271,24 +264,21 @@ if(!class_exists('Csbwfs_Class'))
271
  /**
272
  * Activate the plugin
273
  */
274
- public static function csbwfs_activate()
275
- {
276
  // Do nothing
277
  } // END public static function activate
278
 
279
  /**
280
  * Deactivate the plugin
281
  */
282
- public static function csbwfs_deactivate()
283
- {
284
  // Do nothing
285
  } // END public static function deactivate
286
 
287
  } // END class Csbwfs_Class
288
  } // END if(!class_exists('Csbwfs_Class'))
289
 
290
- if(class_exists('Csbwfs_Class'))
291
- {
292
  // Installation and uninstallation hooks
293
  register_activation_hook(__FILE__, array('Csbwfs_Class', 'csbwfs_activate'));
294
  register_deactivation_hook(__FILE__, array('Csbwfs_Class', 'csbwfs_deactivate'));
@@ -296,14 +286,11 @@ if(class_exists('Csbwfs_Class'))
296
  // instantiate the plugin class
297
  $csbwfs_plugin_template = new Csbwfs_Class();
298
  // Add a link to the settings page onto the plugin page
299
- if(isset($csbwfs_plugin_template))
300
- {
301
  $plugin = plugin_basename(__FILE__);
302
  add_filter("plugin_action_links_$plugin", array('Csbwfs_Class','csbwfs_add_settings_link'));
303
  require dirname(__FILE__).'/csbwfs-class.php';
304
  //shortcode
305
  require dirname(__FILE__).'/lib/shortcode.php';
306
  }
307
-
308
-
309
  }
2
  /*
3
  Plugin Name: Custom Share Buttons with Floating Sidebar
4
  Plugin URI: https://www.wp-experts.in
5
+ Description: Share buttons with extra features to sharing your website posts/pages on social sites (like Facebook, Twitter, Instagram, Whatsapp, Pinterest etc.)
6
  Author: WP Experts Team
7
  Author URI: https://www.wp-experts.in
8
+ Version: 4.2
9
  */
10
 
11
+ /* Copyright 2018-2022 custom-share-buttons-with-floating-sidebar (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
25
  */
26
  //Admin "Custom Share Buttons with Floating Sidebar" Menu Item
27
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
+
29
+ if(!class_exists('Csbwfs_Class')) {
30
+ class Csbwfs_Class {
 
31
  /**
32
  * Construct the plugin object
33
  */
34
+ public function __construct() {
 
35
  // register actions
36
  add_action('admin_init', array(&$this, 'csbwfs_admin_init'));
37
  add_action('admin_menu', array(&$this, 'csbwf_sidebar_menu'));
64
  /**
65
  * hook into WP's admin_init action hook
66
  */
67
+ public function csbwfs_admin_init() {
 
68
  // Set up the settings for this plugin
69
  $this->csbwf_sidebar_init();
70
  // Possibly do additional admin_init tasks
72
  /**
73
  * Initialize some custom settings
74
  */
75
+ public function csbwf_sidebar_init() {
 
76
  // register the settings for this plugin
77
+ register_setting('csbwf_sidebar_options','csbwfs_active','sanitize_text_field');
78
+ register_setting('csbwf_sidebar_options','csbwfs_position','sanitize_text_field');
79
+ register_setting('csbwf_sidebar_options','csbwfs_btn_position','sanitize_text_field');
80
+ register_setting('csbwf_sidebar_options','csbwfs_btn_text','sanitize_text_field');
81
+ register_setting('csbwf_sidebar_options','csbwfs_fb_image','sanitize_text_field');
82
+ register_setting('csbwf_sidebar_options','csbwfs_tw_image','sanitize_text_field');
83
+ register_setting('csbwf_sidebar_options','csbwfs_li_image','sanitize_text_field');
84
+ register_setting('csbwf_sidebar_options','csbwfs_re_image','sanitize_text_field');
85
+ register_setting('csbwf_sidebar_options','csbwfs_st_image','sanitize_text_field');
86
+ register_setting('csbwf_sidebar_options','csbwfs_mail_image','sanitize_text_field');
87
+ register_setting('csbwf_sidebar_options','csbwfs_pin_image','sanitize_text_field');
88
+ register_setting('csbwf_sidebar_options','csbwfs_yt_image','sanitize_text_field');
89
+ register_setting('csbwf_sidebar_options','csbwfs_fb_bg','sanitize_text_field');
90
+ register_setting('csbwf_sidebar_options','csbwfs_tw_bg','sanitize_text_field');
91
+ register_setting('csbwf_sidebar_options','csbwfs_li_bg','sanitize_text_field');
92
+ register_setting('csbwf_sidebar_options','csbwfs_mail_bg','sanitize_text_field');
93
+ register_setting('csbwf_sidebar_options','csbwfs_pin_bg','sanitize_text_field');
94
+ register_setting('csbwf_sidebar_options','csbwfs_re_bg','sanitize_text_field');
95
+ register_setting('csbwf_sidebar_options','csbwfs_st_bg','sanitize_text_field');
96
+ register_setting('csbwf_sidebar_options','csbwfs_yt_bg','sanitize_text_field');
97
+ register_setting('csbwf_sidebar_options','csbwfs_page_fb_bg','sanitize_text_field');
98
+ register_setting('csbwf_sidebar_options','csbwfs_page_tw_bg','sanitize_text_field');
99
+ register_setting('csbwf_sidebar_options','csbwfs_page_li_bg','sanitize_text_field');
100
+ register_setting('csbwf_sidebar_options','csbwfs_page_mail_bg','sanitize_text_field');
101
+ register_setting('csbwf_sidebar_options','csbwfs_page_pin_bg','sanitize_text_field');
102
+ register_setting('csbwf_sidebar_options','csbwfs_page_re_bg','sanitize_text_field');
103
+ register_setting('csbwf_sidebar_options','csbwfs_page_st_bg','sanitize_text_field');
104
+ register_setting('csbwf_sidebar_options','csbwfs_page_yt_bg','sanitize_text_field');
105
+ register_setting('csbwf_sidebar_options','csbwfs_fpublishBtn','sanitize_text_field');
106
+ register_setting('csbwf_sidebar_options','csbwfs_tpublishBtn','sanitize_text_field');
107
+ register_setting('csbwf_sidebar_options','csbwfs_ppublishBtn','sanitize_text_field');
108
+ register_setting('csbwf_sidebar_options','csbwfs_ytpublishBtn','sanitize_text_field');
109
+ register_setting('csbwf_sidebar_options','csbwfs_skpublishBtn','sanitize_text_field');
110
+ register_setting('csbwf_sidebar_options','csbwfs_skPath','sanitize_text_field');
111
+ register_setting('csbwf_sidebar_options','csbwfs_republishBtn','sanitize_text_field');
112
+ register_setting('csbwf_sidebar_options','csbwfs_stpublishBtn','sanitize_text_field');
113
+ register_setting('csbwf_sidebar_options','csbwfs_ytPath','sanitize_text_field');
114
+ register_setting('csbwf_sidebar_options','csbwfs_lpublishBtn','sanitize_text_field');
115
+ register_setting('csbwf_sidebar_options','csbwfs_mpublishBtn','sanitize_text_field');
116
+ register_setting('csbwf_sidebar_options','csbwfs_mailMessage','sanitize_text_field');
117
+ register_setting('csbwf_sidebar_options','csbwfs_top_margin','sanitize_text_field');
118
+ register_setting('csbwf_sidebar_options','csbwfs_delayTimeBtn','sanitize_text_field');
119
+ register_setting('csbwf_sidebar_options','csbwfs_btn_display','sanitize_text_field');
120
  /** Image Alt */
121
+ register_setting('csbwf_sidebar_options','csbwfs_fb_title','sanitize_text_field');
122
+ register_setting('csbwf_sidebar_options','csbwfs_tw_title','sanitize_text_field');
123
+ register_setting('csbwf_sidebar_options','csbwfs_li_title','sanitize_text_field');
124
+ register_setting('csbwf_sidebar_options','csbwfs_pin_title','sanitize_text_field');
125
+ register_setting('csbwf_sidebar_options','csbwfs_mail_title','sanitize_text_field');
126
+ register_setting('csbwf_sidebar_options','csbwfs_yt_title','sanitize_text_field');
127
+ register_setting('csbwf_sidebar_options','csbwfs_re_title','sanitize_text_field');
128
+ register_setting('csbwf_sidebar_options','csbwfs_st_title','sanitize_text_field');
129
+ register_setting('csbwf_sidebar_options','csbwfs_page_fb_title','sanitize_text_field');
130
+ register_setting('csbwf_sidebar_options','csbwfs_page_tw_title','sanitize_text_field');
131
+ register_setting('csbwf_sidebar_options','csbwfs_page_li_title','sanitize_text_field');
132
+ register_setting('csbwf_sidebar_options','csbwfs_page_pin_title','sanitize_text_field');
133
+ register_setting('csbwf_sidebar_options','csbwfs_page_mail_title','sanitize_text_field');
134
+ register_setting('csbwf_sidebar_options','csbwfs_page_yt_title','sanitize_text_field');
135
+ register_setting('csbwf_sidebar_options','csbwfs_page_re_title','sanitize_text_field');
136
+ register_setting('csbwf_sidebar_options','csbwfs_page_st_title','sanitize_text_field');
137
+ register_setting('csbwf_sidebar_options','csbwfs_auto_hide','sanitize_text_field');
138
  //Options for post/pages
139
+ register_setting('csbwf_sidebar_options','csbwfs_buttons_active','sanitize_text_field');
140
+ register_setting('csbwf_sidebar_options','csbwfs_page_hide_home','sanitize_text_field');
141
+ register_setting('csbwf_sidebar_options','csbwfs_page_hide_post','sanitize_text_field');
142
+ register_setting('csbwf_sidebar_options','csbwfs_page_hide_page','sanitize_text_field');
143
+ register_setting('csbwf_sidebar_options','csbwfs_page_hide_archive','sanitize_text_field');
144
+ register_setting('csbwf_sidebar_options','csbwfs_hide_home','sanitize_text_field');
145
+ register_setting('csbwf_sidebar_options','csbwfs_page_fb_image','sanitize_text_field');
146
+ register_setting('csbwf_sidebar_options','csbwfs_page_tw_image','sanitize_text_field');
147
+ register_setting('csbwf_sidebar_options','csbwfs_page_li_image','sanitize_text_field');
148
+ register_setting('csbwf_sidebar_options','csbwfs_page_mail_image','sanitize_text_field');
149
+ register_setting('csbwf_sidebar_options','csbwfs_page_pin_image','sanitize_text_field');
150
+ register_setting('csbwf_sidebar_options','csbwfs_page_re_image','sanitize_text_field');
151
+ register_setting('csbwf_sidebar_options','csbwfs_page_st_image','sanitize_text_field');
152
+ register_setting('csbwf_sidebar_options','csbwfs_page_yt_image','sanitize_text_field');
153
  /** message content */
154
+ register_setting('csbwf_sidebar_options','csbwfs_show_btn','sanitize_text_field');
155
+ register_setting('csbwf_sidebar_options','csbwfs_hide_btn','sanitize_text_field');
156
+ register_setting('csbwf_sidebar_options','csbwfs_share_msg','sanitize_text_field');
157
+ register_setting('csbwf_sidebar_options','csbwfs_rmSHBtn','sanitize_text_field');
158
  //register_setting('csbwf_sidebar_options','csbwfs_featuredshrimg');
159
  //register_setting('csbwf_sidebar_options','csbwfs_defaultfeaturedshrimg');
160
+ register_setting('csbwf_sidebar_options','csbwfs_deactive_for_mob','sanitize_text_field');
161
  } // END public function init_custom_settings()
162
  /**
163
  * add a menu
164
  */
165
+ public function csbwf_sidebar_menu() {
 
166
  add_options_page('Social Share Buttons(CSBWFS)','Social Share Buttons(CSBWFS)','manage_options','csbwfs-settings',array(&$this,'csbwf_sidebar_admin_option_page'));
167
 
168
  } // END public function add_menu()
169
 
170
+ public function csbwf_sidebar_admin_option_page() {
 
171
  if(!current_user_can('manage_options'))
172
  {
173
  wp_die(__('You do not have sufficient permissions to access this page.'));
196
  */
197
  public static function csbwfs_add_settings_link( $links ) {
198
  $settings_link = '<a href="options-general.php?page=csbwfs-settings">' . __( 'Settings', 'csbwfs' ) . '</a>';
199
+ $settings_link .= ' | <a href="https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank">' . __( 'FLAT 10% DISCOUNT! GET ADD-ON', 'csbwfs' ) . '</a>';
200
  array_unshift( $links, $settings_link );
201
  return $links;
202
  }
203
  /**
204
  * uninstall the plugin
205
  */
206
+ public function csbwfs_uninstall() {
 
207
  delete_option('csbwfs_active');
208
  delete_option('csbbuttons_active');
209
  delete_option('csbwfs_position');
264
  /**
265
  * Activate the plugin
266
  */
267
+ public static function csbwfs_activate() {
 
268
  // Do nothing
269
  } // END public static function activate
270
 
271
  /**
272
  * Deactivate the plugin
273
  */
274
+ public static function csbwfs_deactivate() {
 
275
  // Do nothing
276
  } // END public static function deactivate
277
 
278
  } // END class Csbwfs_Class
279
  } // END if(!class_exists('Csbwfs_Class'))
280
 
281
+ if(class_exists('Csbwfs_Class')) {
 
282
  // Installation and uninstallation hooks
283
  register_activation_hook(__FILE__, array('Csbwfs_Class', 'csbwfs_activate'));
284
  register_deactivation_hook(__FILE__, array('Csbwfs_Class', 'csbwfs_deactivate'));
286
  // instantiate the plugin class
287
  $csbwfs_plugin_template = new Csbwfs_Class();
288
  // Add a link to the settings page onto the plugin page
289
+ if(isset($csbwfs_plugin_template)) {
 
290
  $plugin = plugin_basename(__FILE__);
291
  add_filter("plugin_action_links_$plugin", array('Csbwfs_Class','csbwfs_add_settings_link'));
292
  require dirname(__FILE__).'/csbwfs-class.php';
293
  //shortcode
294
  require dirname(__FILE__).'/lib/shortcode.php';
295
  }
 
 
296
  }
images/mrweb-logo.jpg ADDED
Binary file
images/mrweb.jpg ADDED
Binary file
images/raghu.jpg ADDED
Binary file
lib/settings.php CHANGED
@@ -1,294 +1,294 @@
1
- <div style="width: 80%; padding: 10px; margin: 10px;">
2
- <h1>Custom Share Buttons With Floating Sidebar Settings</h1>
3
- <!-- Start Options Form -->
4
-
5
- <form action="options.php" method="post" id="csbwf-sidebar-admin-form">
6
-
7
- <div id="csbwf-tab-menu"><a id="csbwfs-general" class="csbwf-tab-links active" >General</a> <a id="csbwfs-sidebar" class="csbwf-tab-links">Floating Sidebar</a> <a id="csbwfs-share-buttons" class="csbwf-tab-links">Social Share Buttons</a> <a id="csbwfs-pro" class="csbwf-tab-links">GO PRO</a> <a id="csbwfs-support" class="csbwf-tab-links">Support</a></div>
8
- <p align="right"><span class="submit-btn"><?php echo get_submit_button('Save Settings','button-primary extrabtn','submit','','');?></span></p>
9
- <div class="csbwfs-setting">
10
- <!-- General Setting -->
11
- <div class="first csbwfs-tab" id="div-csbwfs-general">
12
- <h2>General Settings</h2>
13
- <table cellpadding="10">
14
- <tr>
15
- <td valign="top" nowrap>
16
- <p><input type="checkbox" id="csbwfs_active" name="csbwfs_active" value='1' <?php checked(get_option('csbwfs_active'),1);?>/> <b><?php _e('Enable Sidebar');?> </b></p>
17
- <p><h3><strong><?php _e('Social Share Button Publish Options:','csbwfs');?></strong></h3></p>
18
- <p><input type="checkbox" id="publish1" value="yes" name="csbwfs_fpublishBtn" <?php checked(get_option('csbwfs_fpublishBtn'),'yes');?>/><b>Facebook</b></p>
19
- <p><input type="checkbox" id="publish2" name="csbwfs_tpublishBtn" value="yes" <?php checked(get_option('csbwfs_tpublishBtn'),'yes');?>/> <b>Twitter</b></p>
20
- <p><input type="checkbox" id="publish4" name="csbwfs_lpublishBtn" value="yes" <?php checked(get_option('csbwfs_lpublishBtn'),'yes');?>/> <b>Linkedin</b></p>
21
- <p><input type="checkbox" id="publish6" name="csbwfs_ppublishBtn" value="yes" <?php checked(get_option('csbwfs_ppublishBtn'),'yes');?>/> <b>Pinterest</b></p>
22
- <p><input type="checkbox" id="publish7" name="csbwfs_republishBtn" value="yes" <?php checked(get_option('csbwfs_republishBtn'),'yes');?>/> <b>Reddit</b></p>
23
- <p><input type="checkbox" id="publish8" name="csbwfs_stpublishBtn" value="yes" <?php checked(get_option('csbwfs_stpublishBtn'),'yes');?>/> <b>Stumbleupon</b></p>
24
- <p><input type="checkbox" id="publish5" name="csbwfs_mpublishBtn" value="yes" <?php checked(get_option('csbwfs_mpublishBtn'),'yes');?>/> <b>Mail</b></p>
25
- <?php if(get_option('csbwfs_mpublishBtn')=='yes');{?>
26
- <p id="mailmsg"><input type="text" name="csbwfs_mailMessage" id="csbwfs_mailMessage" value="<?php echo get_option('csbwfs_mailMessage');?>" placeholder="your@email.com?subject=Your Subject" size="40" class="regular-text ltr"><br><i>Leave empty to add current page title as subject line and url as body text </i></p>
27
- <?php } ?>
28
- <p><input type="checkbox" id="ytBtns" name="csbwfs_ytpublishBtn" value="yes" <?php checked(get_option('csbwfs_ytpublishBtn'),'yes');?>/> <b>Youtube</b></p>
29
- <p id="ytpath"><input type="text" name="csbwfs_ytPath" id="csbwfs_ytPath" value="<?php echo get_option('csbwfs_ytPath');?>" placeholder="http://www.youtube.com" size="40" class="regular-text ltr"><br>add youtube channel url</p>
30
- <p><input type="checkbox" id="skBtns" name="csbwfs_skpublishBtn" value="yes" <?php checked(get_option('csbwfs_skpublishBtn'),'yes');?>/> <b>Skype</b></p>
31
- <p id="skpath"><input type="text" name="csbwfs_skPath" id="csbwfs_skPath" value="<?php echo get_option('csbwfs_skPath');?>" placeholder="skype_user_id" size="40" class="regular-text ltr"><br>Define skype user id</p>
32
- <p><label><h3 ><strong><?php _e('Define your custom message:','csbwfs');?></strong></h3></label></p>
33
- <p><label><?php _e('Show:');?></label><input type="text" id="csbwfs_show_btn" name="csbwfs_show_btn" value="<?php echo get_option('csbwfs_show_btn'); ?>" placeholder="Show Buttons" size="40"/></p>
34
- <p><label><?php _e('Hide:');?></label><input type="text" id="csbwfs_hide_btn" name="csbwfs_hide_btn" value="<?php echo get_option('csbwfs_hide_btn'); ?>" placeholder="Hide Buttons" size="40"/></p>
35
- <p><label><?php _e('Message:');?></label><input type="textbox" id="csbwfs_share_msg" name="csbwfs_share_msg" value="<?php echo get_option('csbwfs_share_msg'); ?>" placeholder="Share This With Your Friends" size="40"/></p>
36
- </td>
37
- <td valign="top" style="border-left:1px solid #ccc;padding-left:20px;">
38
- <h2>Shortcode</h2>
39
- <code>[csbwfs_buttons buttons='fb,tw,li,pi,yt,re,st,ml,sk']</code> <br>(sk-Skype, tw-Twitter, li-Linkedin, pi-Pinterest, yt-Youtube, re-Reddit, st-Stumbleupon/Mix, ml-Mail, sk-Skype)
40
- <p style="font-size:16px;">Watch given below video to view addon features and settings</p>
41
- <iframe width="100%" height="500" src="https://www.youtube.com/embed/L8UAqBbqqoU?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
42
- <h2><a href="http://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank" class="contact-author"><strong>Click Here</strong></a> to download addon.</h2>
43
- </tr>
44
- </table>
45
- </div>
46
- <!-- Floating Sidebar -->
47
- <div class="csbwfs-tab" id="div-csbwfs-sidebar">
48
- <h2>Floating Sidebar Settings</h2>
49
- <table>
50
- <tr>
51
- <th nowrap><?php echo 'Siderbar Position:';?></th>
52
- <td>
53
- <select id="csbwfs_position" name="csbwfs_position" >
54
- <option value="left" <?php selected(get_option('csbwfs_position'),'left');?>>Left</option>
55
- <option value="right" <?php selected(get_option('csbwfs_position'),'right');?>>Right</option>
56
- <option value="bottom" <?php selected(get_option('csbwfs_position'),'bottom');?>>Bottom</option>
57
- </select>
58
- </td>
59
- </tr>
60
- <tr>
61
- <th>&nbsp;</th>
62
- <td><input type="checkbox" id="csbwfs_rmSHBtn" name="csbwfs_rmSHBtn" value="yes" <?php checked(get_option('csbwfs_rmSHBtn'),'yes');?>/> <strong><?php _e('Remove Show/Hide Button:','csbwfs');?></strong></td>
63
- </tr>
64
- <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>
65
- <tr>
66
- <th>&nbsp;</th>
67
- <td><input type="checkbox" id="csbwfs_deactive_for_mob" name="csbwfs_deactive_for_mob" value="yes" <?php checked(get_option('csbwfs_deactive_for_mob'),'yes');?>/><?php _e('Disable Sidebar For Mobile','csbwfs');?></td>
68
- </tr>
69
- <tr><th></th>
70
- <td><input type="checkbox" id="csbwfs_auto_hide" name="csbwfs_auto_hide" value="yes" <?php checked(get_option('csbwfs_auto_hide'),'yes');?>/><?php _e('Auto Hide Sidebar On Page Load','csbwfs');?></td>
71
- </tr>
72
- <tr><th>&nbsp;</th><td><input type="checkbox" id="csbwfs_hide_home" value="yes" name="csbwfs_hide_home" <?php checked(get_option('csbwfs_hide_home'),'yes');?>/>Hide Sidebar On Home Page</td></tr>
73
- <tr><td colspan="2"><strong><h4>Social Share Button Images 32X32 (Optional) :</h4></strong></td></tr>
74
- <tr><td colspan="2" align="right"><input type="button" id="csbwfs_resetpage" value="Reset"></td></tr>
75
- <tr>
76
- <th><?php echo 'Facebook:';?></th>
77
- <td class="csbwfsButtonsImg" id="csbwfsButtonsFbImg">
78
- <input type="text" id="csbwfs_fb_image" name="csbwfs_fb_image" value="<?php echo get_option('csbwfs_fb_image'); ?>" placeholder="Insert facebook button image path" size="30" class="inputButtonid"/> <input id="csbwfs_fb_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_fb_bg" data-default-color="#305891" class="color-field" name="csbwfs_fb_bg" value="<?php echo get_option('csbwfs_fb_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_fb_title" name="csbwfs_fb_title" value="<?php echo get_option('csbwfs_fb_title'); ?>" placeholder="Share on facebook" size="20" class="csbwfs_title"/>
79
- </td>
80
- </tr>
81
- <tr><th><?php echo 'Twitter:';?></th>
82
- <td class="csbwfsButtonsImg" id="csbwfsButtonsTwImg">
83
- <input type="text" id="csbwfs_tw_image" name="csbwfs_tw_image" value="<?php echo get_option('csbwfs_tw_image'); ?>" placeholder="Insert twitter button image path" size="30" class="inputButtonid"/><input id="csbwfs_tw_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_tw_bg" name="csbwfs_tw_bg" value="<?php echo get_option('csbwfs_tw_bg'); ?>" data-default-color="#2ca8d2" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_tw_title" name="csbwfs_tw_title" value="<?php echo get_option('csbwfs_tw_title'); ?>" placeholder="Share on twitter" size="20" class="csbwfs_title"/>
84
- </td>
85
- </tr>
86
- <tr>
87
- <th><?php echo 'Linkedin:';?></th>
88
- <td class="csbwfsButtonsImg" id="csbwfsButtonsLiImg">
89
- <input type="text" id="csbwfs_li_image" name="csbwfs_li_image" value="<?php echo get_option('csbwfs_li_image'); ?>" placeholder="Insert Linkedin button image path" class="inputButtonid" size="30" class="buttonimg"/><input id="csbwfs_li_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_li_bg" name="csbwfs_li_bg" value="<?php echo get_option('csbwfs_li_bg'); ?>" data-default-color="#dd4c39" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_li_title" name="csbwfs_li_title" value="<?php echo get_option('csbwfs_li_title'); ?>" placeholder="Share on Linkedin" size="20" class="csbwfs_title"/>
90
- </td>
91
- </tr>
92
- <tr><th><?php echo 'Pintrest:';?></th>
93
- <td class="csbwfsButtonsImg" id="csbwfsButtonsPiImg">
94
- <input type="text" id="csbwfs_pin_image" name="csbwfs_pin_image" value="<?php echo get_option('csbwfs_pin_image'); ?>" class="inputButtonid" placeholder="Insert pinterest button image path" size="30" class="buttonimg"/><input id="csbwfs_pin_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_pin_bg" name="csbwfs_pin_bg" value="<?php echo get_option('csbwfs_pin_bg'); ?>" data-default-color="#ca2027" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_pin_title" name="csbwfs_pin_title" value="<?php echo get_option('csbwfs_pin_title'); ?>" placeholder="Share on pintrest" size="20" class="csbwfs_title"/>
95
- </td>
96
- </tr>
97
-
98
- <tr><th><?php echo 'Reddit:';?></th>
99
- <td class="csbwfsButtonsImg" id="csbwfsButtonsReImg">
100
- <input type="text" id="csbwfs_re_image" name="csbwfs_re_image" value="<?php echo get_option('csbwfs_re_image'); ?>" placeholder="Insert reddit button image path" size="30" class="inputButtonid"/><input id="csbwfs_re_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_re_bg" name="csbwfs_re_bg" value="<?php echo get_option('csbwfs_re_bg'); ?>" data-default-color="#ff1a00" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_re_title" name="csbwfs_re_title" value="<?php echo get_option('csbwfs_re_title'); ?>" placeholder="Share on reddit" size="20" class="csbwfs_title"/>
101
- </td>
102
- </tr>
103
- <tr><th><?php echo 'Stumbleupon:';?></th>
104
- <td class="csbwfsButtonsImg" id="csbwfsButtonsStImg">
105
- <input type="text" id="csbwfs_st_image" name="csbwfs_st_image" value="<?php echo get_option('csbwfs_st_image'); ?>" placeholder="Insert stumbleupon button image path" size="30" class="inputButtonid"/><input id="csbwfs_st_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_st_bg" name="csbwfs_st_bg" value="<?php echo get_option('csbwfs_st_bg'); ?>" data-default-color="#eb4924" class="color-field" size="20"/>
106
- &nbsp;&nbsp;<input type="text" id="csbwfs_st_title" name="csbwfs_st_title" value="<?php echo get_option('csbwfs_st_title'); ?>" placeholder="Share on stumbleupon" size="20" class="csbwfs_title"/>
107
- </td>
108
- </tr>
109
- <tr><th><?php echo 'Mail:';?></th>
110
- <td class="csbwfsButtonsImg" id="csbwfsButtonsMaImg">
111
- <input type="text" id="csbwfs_mail_image" name="csbwfs_mail_image" value="<?php echo get_option('csbwfs_mail_image'); ?>" placeholder="Insert mail button image path" size="30" class="inputButtonid"/><input id="csbwfs_mail_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_mail_bg" name="csbwfs_mail_bg" value="<?php echo get_option('csbwfs_mail_bg'); ?>" data-default-color="#738a8d" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_mail_title" name="csbwfs_mail_title" value="<?php echo get_option('csbwfs_mail_title'); ?>" placeholder="Send contact request" size="20" class="csbwfs_title"/>
112
- </td>
113
- </tr>
114
- <tr><th><?php echo 'Youtube:';?></th>
115
- <td class="csbwfsButtonsImg" id="csbwfsButtonsYtImg">
116
- <input type="text" id="csbwfs_yt_image" name="csbwfs_yt_image" value="<?php echo get_option('csbwfs_yt_image'); ?>" placeholder="Insert youtube button image path" size="30" class="inputButtonid"/><input id="csbwfs_yt_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_yt_bg" name="csbwfs_yt_bg" value="<?php echo get_option('csbwfs_yt_bg'); ?>" data-default-color="#ffffff" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_yt_title" name="csbwfs_yt_title" value="<?php echo get_option('csbwfs_yt_title'); ?>" placeholder="Youtube" size="20" class="csbwfs_title"/>
117
- </td>
118
- </tr>
119
- <tr><td colspan="2"><h3><strong>Style(Optional):</strong></h3></td></tr>
120
-
121
- <tr>
122
- <th><?php echo 'Top Margin:';?></th>
123
- <td>
124
-
125
- <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"/>
126
- </td>
127
- </tr>
128
- </table>
129
- </div>
130
- <!-- Share Buttons -->
131
- <div class="csbwfs-tab" id="div-csbwfs-share-buttons">
132
- <h2>Social Share Buttons Settings</h2>
133
- <table>
134
- <td><?php _e('Enable:','csbwfs');?></td>
135
- <td colspan="2">
136
- <input type="checkbox" id="csbwfs_buttons_active" name="csbwfs_buttons_active" value='1' <?php checked(get_option('csbwfs_buttons_active'),1);?>/>
137
- </td>
138
- </tr>
139
- <tr>
140
- <th nowrap><?php echo 'Share Button Position:';?></th>
141
- <td>
142
- <select id="csbwfs_btn_position" name="csbwfs_btn_position" >
143
- <option value="left" <?php selected(get_option('csbwfs_btn_position'),'left');?>>Left</option>
144
- <option value="right" <?php selected(get_option('csbwfs_btn_position'),'right');?>>Right</option>
145
- </select>
146
- </td>
147
- </tr>
148
- <tr>
149
- <th nowrap><?php echo 'Display Buttons On ';?></th>
150
- <td>
151
- <select id="csbwfs_btn_display" name="csbwfs_btn_display" >
152
- <option value="below" <?php selected(get_option('csbwfs_btn_display'),'below');?>>Bottom Of The Content</option>
153
- <option value="above" <?php selected(get_option('csbwfs_btn_display'),'above');?>>Top Of The Content</option>
154
- </select>
155
- </td>
156
- </tr>
157
- <tr>
158
- <th nowrap><?php echo 'Share Button Text:';?></th>
159
- <td>
160
- <input type="textbox" id="csbwfs_btn_text" name="csbwfs_btn_text" value="<?php echo get_option('csbwfs_btn_text'); ?>" placeholder="Share This!" size="20"/>
161
- <i>(Leave blank if you want hide button)</i></td>
162
- </tr>
163
- <tr><td colspan="2"><strong>Show Share Buttons On :</strong> Home <input type="checkbox" id="csbwfs_page_hide_home" value="yes" name="csbwfs_page_hide_home" <?php checked(get_option('csbwfs_page_hide_home'),'yes');?>/> Page <input type="checkbox" id="csbwfs_page_hide_page" value="yes" name="csbwfs_page_hide_page" <?php checked(get_option('csbwfs_page_hide_page'),'yes');?>/> Post <input type="checkbox" id="csbwfs_page_hide_post" value="yes" name="csbwfs_page_hide_post" <?php checked(get_option('csbwfs_page_hide_post'),'yes');?>/> Category/Archive <input type="checkbox" id="csbwfs_page_hide_archive" value="yes" name="csbwfs_page_hide_archive" <?php checked(get_option('csbwfs_page_hide_archive'),'yes');?>/> <br>
164
- </td></tr>
165
-
166
- <tr><td colspan="2"><strong><h4>Social Share Button Images 32X32 (Optional) :</h4></strong></td></tr>
167
- <tr><td colspan="2" align="right"><input type="button" id="csbwfsresetpage" value="RESET"></td></tr>
168
- <tr><th><?php echo 'Facebook:';?></th>
169
- <td class="csbwfsButtonsImg" id="csbwfsButtonsFbImg2"><input type="text" id="csbwfs_page_fb_image" name="csbwfs_page_fb_image" value="<?php echo get_option('csbwfs_page_fb_image'); ?>" placeholder="Insert facebook button image path" size="40" class="inputButtonid"/>
170
- <input id="csbwfs_fb_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_fb_bg" data-default-color="#305891" class="color-field" name="csbwfs_page_fb_bg" value="<?php echo get_option('csbwfs_page_fb_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_fb_title" name="csbwfs_page_fb_title" value="<?php echo get_option('csbwfs_page_fb_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
171
- </td>
172
- </tr>
173
- <tr>
174
- <th><?php echo 'Twitter:';?></th>
175
- <td class="csbwfsButtonsImg" id="csbwfsButtonsTwImg2">
176
- <input type="text" id="csbwfs_page_tw_image" name="csbwfs_page_tw_image" value="<?php echo get_option('csbwfs_page_tw_image'); ?>" placeholder="Insert twitter button image path" size="40" class="inputButtonid"/>
177
- <input id="csbwfs_tw_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_tw_bg" data-default-color="#2ca8d2" class="color-field" name="csbwfs_page_tw_bg" value="<?php echo get_option('csbwfs_page_tw_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_tw_title" name="csbwfs_page_tw_title" value="<?php echo get_option('csbwfs_page_tw_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
178
- </td>
179
- </tr>
180
- <tr><th><?php echo 'Linkedin:';?></th>
181
- <td class="csbwfsButtonsImg" id="csbwfsButtonsLiImg2"><input type="text" id="csbwfs_page_li_image" name="csbwfs_page_li_image" value="<?php echo get_option('csbwfs_page_li_image'); ?>" placeholder="Insert Linkedin button image path" size="40" class="inputButtonid"/>
182
- <input id="csbwfs_li_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_li_bg" data-default-color="#dd4c39" class="color-field" name="csbwfs_page_li_bg" value="<?php echo get_option('csbwfs_page_li_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_li_title" name="csbwfs_page_li_title" value="<?php echo get_option('csbwfs_page_li_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
183
- </td>
184
- </tr>
185
- <tr>
186
- <th><?php echo 'Pintrest:';?></th>
187
- <td class="csbwfsButtonsImg" id="csbwfsButtonsPiImg2"><input type="text" id="csbwfs_page_pin_image" name="csbwfs_page_pin_image" value="<?php echo get_option('csbwfs_page_pin_image'); ?>" placeholder="Insert pinterest button image path" size="40" class="inputButtonid"/>
188
- <input id="csbwfs_pi_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_pin_bg" data-default-color="#ca2027" class="color-field" name="csbwfs_page_pin_bg" value="<?php echo get_option('csbwfs_page_pin_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_pin_title" name="csbwfs_page_pin_title" value="<?php echo get_option('csbwfs_page_pin_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
189
- </td>
190
- </tr>
191
-
192
- <tr>
193
- <th><?php echo 'Reddit:';?></th>
194
- <td class="csbwfsButtonsImg" id="csbwfsButtonsReImg2">
195
- <input type="text" id="csbwfs_page_re_image" name="csbwfs_page_re_image" value="<?php echo get_option('csbwfs_page_re_image'); ?>" placeholder="Insert reddit button image path" size="40" class="inputButtonid"/>
196
- <input id="csbwfs_re_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_re_bg" data-default-color="#ff1a00" class="color-field" name="csbwfs_page_re_bg" value="<?php echo get_option('csbwfs_page_re_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_re_title" name="csbwfs_page_re_title" value="<?php echo get_option('csbwfs_page_re_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
197
- </td>
198
- </tr>
199
- <tr>
200
- <th><?php echo 'Stumbleupon:';?></th>
201
- <td class="csbwfsButtonsImg" id="csbwfsButtonsStImg2">
202
- <input type="text" id="csbwfs_page_st_image" name="csbwfs_page_st_image" value="<?php echo get_option('csbwfs_page_st_image'); ?>" placeholder="Insert stumbleupon button image path" size="40" class="inputButtonid"/>
203
- <input id="csbwfs_st_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_st_bg" data-default-color="#eb4924" class="color-field" name="csbwfs_page_st_bg" value="<?php echo get_option('csbwfs_page_st_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_st_title" name="csbwfs_page_st_title" value="<?php echo get_option('csbwfs_page_st_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
204
- </td>
205
- </tr>
206
- <tr>
207
- <th><?php echo 'Mail:';?></th>
208
- <td class="csbwfsButtonsImg" id="csbwfsButtonsMlImg2">
209
- <input type="text" id="csbwfs_page_mail_image" name="csbwfs_page_mail_image" value="<?php echo get_option('csbwfs_page_mail_image'); ?>" placeholder="Insert mail button image path" size="40" class="inputButtonid"/>
210
- <input id="csbwfs_ml_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_mail_bg" data-default-color="#738a8d" class="color-field" name="csbwfs_page_mail_bg" value="<?php echo get_option('csbwfs_page_mail_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_mail_title" name="csbwfs_page_mail_title" value="<?php echo get_option('csbwfs_page_mail_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
211
- </td>
212
- </tr>
213
- <tr>
214
- <th><?php echo 'Youtube:';?></th>
215
- <td class="csbwfsButtonsImg" id="csbwfsButtonsYtImg2">
216
- <input type="text" id="csbwfs_page_yt_image" name="csbwfs_page_yt_image" value="<?php echo get_option('csbwfs_page_yt_image'); ?>" placeholder="Insert youtube button image path" size="40" class="inputButtonid"/>
217
- <input id="csbwfs_yt_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_yt_bg" data-default-color="#ffffff" class="color-field" name="csbwfs_page_yt_bg" value="<?php echo get_option('csbwfs_page_yt_bg'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_yt_title" name="csbwfs_page_yt_title" value="<?php echo get_option('csbwfs_page_yt_title'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
218
- </td>
219
- </tr>
220
- </table>
221
-
222
- </div>
223
- <!-- Support -->
224
- <div class="last author csbwfs-tab" id="div-csbwfs-support">
225
-
226
- <h2>Plugin Support</h2>
227
-
228
- <p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A" target="_blank" style="font-size: 17px; font-weight: bold;"><img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" title="Donate for this plugin"></a></p>
229
-
230
- <p><strong>Plugin Author:</strong><br><a href="https://www.ep-experts.in" target="_blank">WP-Experts.In Team</a></p>
231
- <p><a href="mailto:raghunath.0087@gmail.com" target="_blank" class="contact-author">Contact Author</a></p>
232
- <p><strong>Our Other Plugins:</strong><br>
233
- <ol>
234
- <li><a href="https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar" target="_blank">Custom Share Buttons With Floating Sidebar</a></li>
235
- <li><a href="https://wordpress.org/plugins/protect-wp-admin/" target="_blank">Protect WP-Admin</a></li>
236
- <li><a href="https://wordpress.org/plugins/wp-sales-notifier/" target="_blank">WP Sales Notifier</a></li>
237
- <li><a href="https://wordpress.org/plugins/wp-categories-widget/" target="_blank">WP Categories Widget</a></li>
238
- <li><a href="https://wordpress.org/plugins/wp-protect-content/" target="_blank">WP Protect Content</a></li>
239
- <li><a href="https://wordpress.org/plugins/wp-version-remover/" target="_blank">WP Version Remover</a></li>
240
- <li><a href="https://wordpress.org/plugins/wp-posts-widget/" target="_blank">WP Post Widget</a></li>
241
- <li><a href="https://wordpress.org/plugins/wp-importer" target="_blank">WP Importer</a></li>
242
- <li><a href="https://wordpress.org/plugins/wp-csv-importer/" target="_blank">WP CSV Importer</a></li>
243
- <li><a href="https://wordpress.org/plugins/wp-testimonial/" target="_blank">WP Testimonial</a></li>
244
- <li><a href="https://wordpress.org/plugins/wc-sales-count-manager/" target="_blank">WooCommerce Sales Count Manager</a></li>
245
- <li><a href="https://wordpress.org/plugins/wp-social-buttons/" target="_blank">WP Social Buttons</a></li>
246
- <li><a href="https://wordpress.org/plugins/wp-youtube-gallery/" target="_blank">WP Youtube Gallery</a></li>
247
- <li><a href="https://wordpress.org/plugins/tweets-slider/" target="_blank">Tweets Slider</a></li>
248
- <li><a href="https://wordpress.org/plugins/rg-responsive-gallery/" target="_blank">RG Responsive Slider</a></li>
249
- <li><a href="https://wordpress.org/plugins/cf7-advance-security" target="_blank">Contact Form 7 Advance Security WP-Admin</a></li>
250
- <li><a href="https://wordpress.org/plugins/wp-easy-recipe/" target="_blank">WP Easy Recipe</a></li>
251
- </ol>
252
- </div>
253
- <!-- GO PRO -->
254
- <div class="last author csbwfs-tab" id="div-csbwfs-pro">
255
- <h2 style="color:green;text-align:center;"><strong>Pay one time use lifetime!!!!!</strong></h2>
256
- <table>
257
- <tr>
258
- <td valign="top" width="30%">
259
- <h2>GO PRO</h2>
260
- <p><a href="https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank" class="contact-author">Click here</a> to download addon.</p>
261
- <p>We have released an add-on for Custom Share Buttons With Floating Sidebar which not only demonstrates the flexibility of CSBWFS, but also adds some important features:</p>
262
- <iframe width="560" height="450" src="https://www.youtube.com/embed/f_qk4qxAsz8" frameborder="0" allowfullscreen></iframe>
263
- </td>
264
- <td><h2>Key Features</h2><hr>
265
- <ol>
266
- <li>Responsive Floating Sidebar</li>
267
- <li>Shortcode</li>
268
- <li>Hide floating sidebar for any post type</li>
269
- <li>Hide Floating Sidebar for any taxonomy</li>
270
- <li>Show Share Buttons for any taxonomy</li>
271
- <li>Define sidebar/share buttons position</li>
272
- <li>Responsive Popup box Contact Form</li>
273
- <li> Shortcode supportable light box</li>
274
- <li>OG meta tags fields</li>
275
- <li>Choose different style of sidebar</li>
276
- <li>Use share buttons as social buttons</li>
277
- <li>Define Twitter username</li>
278
- <li>Share count buttons(FB, ST, PIN,Xing and Reddit)</li>
279
- <li>Manage buttons image, title, background color and url</li>
280
- <li>10 extra custom sidebar buttons to use it as your button</li>
281
- <li>Show/Hide social share buttons on specific page/post</li>
282
- <li>Page specific sidebar position (Left/Right/Bottom)</li>
283
- <li>add social site official page URL for all social buttons</li>
284
- </ol>
285
- </td>
286
- </tr>
287
- </table>
288
- </div>
289
- </div>
290
- <span class="submit-btn"><?php echo get_submit_button('Save Settings','button-primary','submit','','');?></span>
291
- <?php settings_fields('csbwf_sidebar_options'); ?>
292
- </form>
293
- <!-- End Options Form -->
294
- </div>
1
+ <div style="width: 80%; padding: 10px; margin: 10px;">
2
+ <h1>Custom Share Buttons With Floating Sidebar Settings</h1>
3
+ <!-- Start Options Form -->
4
+
5
+ <form action="options.php" method="post" id="csbwf-sidebar-admin-form">
6
+
7
+ <div id="csbwf-tab-menu"><a id="csbwfs-general" class="csbwf-tab-links active" >General</a> <a id="csbwfs-sidebar" class="csbwf-tab-links">Floating Sidebar</a> <a id="csbwfs-share-buttons" class="csbwf-tab-links">Social Share Buttons</a> <a id="csbwfs-pro" class="csbwf-tab-links">GO PRO</a> <a id="csbwfs-support" class="csbwf-tab-links">Support</a></div>
8
+ <p align="right"><span class="submit-btn"><?php _e( get_submit_button('Save Settings','button-primary extrabtn','submit','',''),'wpexpertsin');?></span></p>
9
+ <div class="csbwfs-setting">
10
+ <!-- General Setting -->
11
+ <div class="first csbwfs-tab" id="div-csbwfs-general">
12
+ <h2>General Settings</h2>
13
+ <table cellpadding="10">
14
+ <tr>
15
+ <td valign="top" nowrap>
16
+ <p><input type="checkbox" id="csbwfs_active" name="csbwfs_active" value='1' <?php checked(get_option('csbwfs_active'),1);?>/> <b><?php esc_attr_e('Enable Sidebar','wpexpertsin');?> </b></p>
17
+ <p><h3><strong><?php esc_attr_e('Social Share Button Publish Options:','wpexpertsin');?></strong></h3></p>
18
+ <p><input type="checkbox" id="publish1" value="yes" name="csbwfs_fpublishBtn" <?php checked(get_option('csbwfs_fpublishBtn'),'yes');?>/><b>Facebook</b></p>
19
+ <p><input type="checkbox" id="publish2" name="csbwfs_tpublishBtn" value="yes" <?php checked(get_option('csbwfs_tpublishBtn'),'yes');?>/> <b>Twitter</b></p>
20
+ <p><input type="checkbox" id="publish4" name="csbwfs_lpublishBtn" value="yes" <?php checked(get_option('csbwfs_lpublishBtn'),'yes');?>/> <b>Linkedin</b></p>
21
+ <p><input type="checkbox" id="publish6" name="csbwfs_ppublishBtn" value="yes" <?php checked(get_option('csbwfs_ppublishBtn'),'yes');?>/> <b>Pinterest</b></p>
22
+ <p><input type="checkbox" id="publish7" name="csbwfs_republishBtn" value="yes" <?php checked(get_option('csbwfs_republishBtn'),'yes');?>/> <b>Reddit</b></p>
23
+ <p><input type="checkbox" id="publish8" name="csbwfs_stpublishBtn" value="yes" <?php checked(get_option('csbwfs_stpublishBtn'),'yes');?>/> <b>Stumbleupon</b></p>
24
+ <p><input type="checkbox" id="publish5" name="csbwfs_mpublishBtn" value="yes" <?php checked(get_option('csbwfs_mpublishBtn'),'yes');?>/> <b>Mail</b></p>
25
+ <?php if(get_option('csbwfs_mpublishBtn')=='yes');{?>
26
+ <p id="mailmsg"><input type="text" name="csbwfs_mailMessage" id="csbwfs_mailMessage" value="<?php esc_attr_e( get_option('csbwfs_mailMessage'),'wpexpertsin');?>" placeholder="your@email.com?subject=Your Subject" size="40" class="regular-text ltr"><br><i>Leave empty to add current page title as subject line and url as body text </i></p>
27
+ <?php } ?>
28
+ <p><input type="checkbox" id="ytBtns" name="csbwfs_ytpublishBtn" value="yes" <?php checked(get_option('csbwfs_ytpublishBtn'),'yes');?>/> <b>Youtube</b></p>
29
+ <p id="ytpath"><input type="text" name="csbwfs_ytPath" id="csbwfs_ytPath" value="<?php esc_attr_e( get_option('csbwfs_ytPath'),'wpexpertsin');?>" placeholder="http://www.youtube.com" size="40" class="regular-text ltr"><br>add youtube channel url</p>
30
+ <p><input type="checkbox" id="skBtns" name="csbwfs_skpublishBtn" value="yes" <?php checked(get_option('csbwfs_skpublishBtn'),'yes');?>/> <b>Skype</b></p>
31
+ <p id="skpath"><input type="text" name="csbwfs_skPath" id="csbwfs_skPath" value="<?php esc_attr_e( get_option('csbwfs_skPath'),'wpexpertsin');?>" placeholder="skype_user_id" size="40" class="regular-text ltr"><br>Define skype user id</p>
32
+ <p><label><h3 ><strong><?php esc_attr_e('Define your custom message:','csbwfs');?></strong></h3></label></p>
33
+ <p><label><?php esc_attr_e('Show:','wpexpertsin');?></label><input type="text" id="csbwfs_show_btn" name="csbwfs_show_btn" value="<?php esc_attr_e( get_option('csbwfs_show_btn'),'wpexpertsin'); ?>" placeholder="Show Buttons" size="40"/></p>
34
+ <p><label><?php esc_attr_e('Hide:','wpexpertsin');?></label><input type="text" id="csbwfs_hide_btn" name="csbwfs_hide_btn" value="<?php esc_attr_e( get_option('csbwfs_hide_btn'),'wpexpertsin'); ?>" placeholder="Hide Buttons" size="40"/></p>
35
+ <p><label><?php esc_attr_e('Message:','wpexpertsin');?></label><input type="textbox" id="csbwfs_share_msg" name="csbwfs_share_msg" value="<?php esc_attr_e( get_option('csbwfs_share_msg'),'wpexpertsin'); ?>" placeholder="Share This With Your Friends" size="40"/></p>
36
+ </td>
37
+ <td valign="top" style="border-left:1px solid #ccc;padding-left:20px;">
38
+ <h2>Shortcode</h2>
39
+ <code>[csbwfs_buttons buttons='fb,tw,li,pi,yt,re,st,ml,sk']</code> <br>(sk-Skype, tw-Twitter, li-Linkedin, pi-Pinterest, yt-Youtube, re-Reddit, st-Stumbleupon/Mix, ml-Mail, sk-Skype)
40
+ <p style="font-size:16px;">Watch given below video to view addon features and settings</p>
41
+ <iframe width="100%" height="500" src="https://www.youtube.com/embed/L8UAqBbqqoU?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
42
+ <h2><a href="http://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank" class="contact-author"><strong>Click Here</strong></a> to download addon.</h2>
43
+ </tr>
44
+ </table>
45
+ </div>
46
+ <!-- Floating Sidebar -->
47
+ <div class="csbwfs-tab" id="div-csbwfs-sidebar">
48
+ <h2>Floating Sidebar Settings</h2>
49
+ <table>
50
+ <tr>
51
+ <th nowrap><?php esc_attr_e( 'Siderbar Position:','wpexpertsin');?></th>
52
+ <td>
53
+ <select id="csbwfs_position" name="csbwfs_position" >
54
+ <option value="left" <?php selected(get_option('csbwfs_position'),'left');?>>Left</option>
55
+ <option value="right" <?php selected(get_option('csbwfs_position'),'right');?>>Right</option>
56
+ <option value="bottom" <?php selected(get_option('csbwfs_position'),'bottom');?>>Bottom</option>
57
+ </select>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <th>&nbsp;</th>
62
+ <td><input type="checkbox" id="csbwfs_rmSHBtn" name="csbwfs_rmSHBtn" value="yes" <?php checked(get_option('csbwfs_rmSHBtn'),'yes');?>/> <strong><?php esc_attr_e('Remove Show/Hide Button:','wpexpertsin');?></strong></td>
63
+ </tr>
64
+ <tr><th nowrap valign="top"><?php esc_attr_e( 'Delay Time: ','wpexpertsin'); ?></th><td><input type="text" name="csbwfs_delayTimeBtn" id="csbwfs_delayTimeBtn" value="<?php esc_attr_e( get_option('csbwfs_delayTimeBtn')? get_option('csbwfs_delayTimeBtn'):0,'wpexpertsin');?>" size="40" class="regular-text ltr"><br><i>Publish share buttons after given time(millisecond)</i></td></tr>
65
+ <tr>
66
+ <th>&nbsp;</th>
67
+ <td><input type="checkbox" id="csbwfs_deactive_for_mob" name="csbwfs_deactive_for_mob" value="yes" <?php checked(get_option('csbwfs_deactive_for_mob'),'yes');?>/><?php esc_attr_e('Disable Sidebar For Mobile','csbwfs');?></td>
68
+ </tr>
69
+ <tr><th></th>
70
+ <td><input type="checkbox" id="csbwfs_auto_hide" name="csbwfs_auto_hide" value="yes" <?php checked(get_option('csbwfs_auto_hide'),'yes');?>/><?php esc_attr_e('Auto Hide Sidebar On Page Load','csbwfs');?></td>
71
+ </tr>
72
+ <tr><th>&nbsp;</th><td><input type="checkbox" id="csbwfs_hide_home" value="yes" name="csbwfs_hide_home" <?php checked(get_option('csbwfs_hide_home'),'yes');?>/>Hide Sidebar On Home Page</td></tr>
73
+ <tr><td colspan="2"><strong><h4>Social Share Button Images 32X32 (Optional) :</h4></strong></td></tr>
74
+ <tr><td colspan="2" align="right"><input type="button" id="csbwfs_resetpage" value="Reset"></td></tr>
75
+ <tr>
76
+ <th><?php esc_attr_e( 'Facebook:','wpexpertsin');?></th>
77
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsFbImg">
78
+ <input type="text" id="csbwfs_fb_image" name="csbwfs_fb_image" value="<?php esc_attr_e( get_option('csbwfs_fb_image'),'wpexpertsin'); ?>" placeholder="Insert facebook button image path" size="30" class="inputButtonid"/> <input id="csbwfs_fb_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_fb_bg" data-default-color="#305891" class="color-field" name="csbwfs_fb_bg" value="<?php esc_attr_e( get_option('csbwfs_fb_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_fb_title" name="csbwfs_fb_title" value="<?php esc_attr_e( get_option('csbwfs_fb_title'),'wpexpertsin'); ?>" placeholder="Share on facebook" size="20" class="csbwfs_title"/>
79
+ </td>
80
+ </tr>
81
+ <tr><th><?php esc_attr_e( 'Twitter:','wpexpertsin');?></th>
82
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsTwImg">
83
+ <input type="text" id="csbwfs_tw_image" name="csbwfs_tw_image" value="<?php esc_attr_e( get_option('csbwfs_tw_image'),'wpexpertsin'); ?>" placeholder="Insert twitter button image path" size="30" class="inputButtonid"/><input id="csbwfs_tw_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_tw_bg" name="csbwfs_tw_bg" value="<?php esc_attr_e( get_option('csbwfs_tw_bg'),'wpexpertsin'); ?>" data-default-color="#2ca8d2" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_tw_title" name="csbwfs_tw_title" value="<?php esc_attr_e( get_option('csbwfs_tw_title'),'wpexpertsin'); ?>" placeholder="Share on twitter" size="20" class="csbwfs_title"/>
84
+ </td>
85
+ </tr>
86
+ <tr>
87
+ <th><?php esc_attr_e( 'Linkedin:','wpexpertsin');?></th>
88
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsLiImg">
89
+ <input type="text" id="csbwfs_li_image" name="csbwfs_li_image" value="<?php esc_attr_e( get_option('csbwfs_li_image'),'wpexpertsin'); ?>" placeholder="Insert Linkedin button image path" class="inputButtonid" size="30" class="buttonimg"/><input id="csbwfs_li_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_li_bg" name="csbwfs_li_bg" value="<?php esc_attr_e( get_option('csbwfs_li_bg'),'wpexpertsin'); ?>" data-default-color="#dd4c39" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_li_title" name="csbwfs_li_title" value="<?php esc_attr_e( get_option('csbwfs_li_title'),'wpexpertsin'); ?>" placeholder="Share on Linkedin" size="20" class="csbwfs_title"/>
90
+ </td>
91
+ </tr>
92
+ <tr><th><?php esc_attr_e( 'Pintrest:','wpexpertsin');?></th>
93
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsPiImg">
94
+ <input type="text" id="csbwfs_pin_image" name="csbwfs_pin_image" value="<?php esc_attr_e( get_option('csbwfs_pin_image'),'wpexpertsin'); ?>" class="inputButtonid" placeholder="Insert pinterest button image path" size="30" class="buttonimg"/><input id="csbwfs_pin_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_pin_bg" name="csbwfs_pin_bg" value="<?php esc_attr_e( get_option('csbwfs_pin_bg'),'wpexpertsin'); ?>" data-default-color="#ca2027" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_pin_title" name="csbwfs_pin_title" value="<?php esc_attr_e( get_option('csbwfs_pin_title'),'wpexpertsin'); ?>" placeholder="Share on pintrest" size="20" class="csbwfs_title"/>
95
+ </td>
96
+ </tr>
97
+
98
+ <tr><th><?php esc_attr_e( 'Reddit:','wpexpertsin');?></th>
99
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsReImg">
100
+ <input type="text" id="csbwfs_re_image" name="csbwfs_re_image" value="<?php esc_attr_e( get_option('csbwfs_re_image'),'wpexpertsin'); ?>" placeholder="Insert reddit button image path" size="30" class="inputButtonid"/><input id="csbwfs_re_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_re_bg" name="csbwfs_re_bg" value="<?php esc_attr_e( get_option('csbwfs_re_bg'),'wpexpertsin'); ?>" data-default-color="#ff1a00" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_re_title" name="csbwfs_re_title" value="<?php esc_attr_e( get_option('csbwfs_re_title'),'wpexpertsin'); ?>" placeholder="Share on reddit" size="20" class="csbwfs_title"/>
101
+ </td>
102
+ </tr>
103
+ <tr><th><?php esc_attr_e( 'Stumbleupon:','wpexpertsin');?></th>
104
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsStImg">
105
+ <input type="text" id="csbwfs_st_image" name="csbwfs_st_image" value="<?php esc_attr_e( get_option('csbwfs_st_image'),'wpexpertsin'); ?>" placeholder="Insert stumbleupon button image path" size="30" class="inputButtonid"/><input id="csbwfs_st_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_st_bg" name="csbwfs_st_bg" value="<?php esc_attr_e( get_option('csbwfs_st_bg'),'wpexpertsin'); ?>" data-default-color="#eb4924" class="color-field" size="20"/>
106
+ &nbsp;&nbsp;<input type="text" id="csbwfs_st_title" name="csbwfs_st_title" value="<?php esc_attr_e( get_option('csbwfs_st_title'),'wpexpertsin'); ?>" placeholder="Share on stumbleupon" size="20" class="csbwfs_title"/>
107
+ </td>
108
+ </tr>
109
+ <tr><th><?php esc_attr_e( 'Mail:','wpexpertsin');?></th>
110
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsMaImg">
111
+ <input type="text" id="csbwfs_mail_image" name="csbwfs_mail_image" value="<?php esc_attr_e( get_option('csbwfs_mail_image'),'wpexpertsin'); ?>" placeholder="Insert mail button image path" size="30" class="inputButtonid"/><input id="csbwfs_mail_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_mail_bg" name="csbwfs_mail_bg" value="<?php esc_attr_e( get_option('csbwfs_mail_bg'),'wpexpertsin'); ?>" data-default-color="#738a8d" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_mail_title" name="csbwfs_mail_title" value="<?php esc_attr_e( get_option('csbwfs_mail_title'),'wpexpertsin'); ?>" placeholder="Send contact request" size="20" class="csbwfs_title"/>
112
+ </td>
113
+ </tr>
114
+ <tr><th><?php esc_attr_e( 'Youtube:','wpexpertsin');?></th>
115
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsYtImg">
116
+ <input type="text" id="csbwfs_yt_image" name="csbwfs_yt_image" value="<?php esc_attr_e( get_option('csbwfs_yt_image'),'wpexpertsin'); ?>" placeholder="Insert youtube button image path" size="30" class="inputButtonid"/><input id="csbwfs_yt_image_button" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_yt_bg" name="csbwfs_yt_bg" value="<?php esc_attr_e( get_option('csbwfs_yt_bg'),'wpexpertsin'); ?>" data-default-color="#ffffff" class="color-field" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_yt_title" name="csbwfs_yt_title" value="<?php esc_attr_e( get_option('csbwfs_yt_title'),'wpexpertsin'); ?>" placeholder="Youtube" size="20" class="csbwfs_title"/>
117
+ </td>
118
+ </tr>
119
+ <tr><td colspan="2"><h3><strong>Style(Optional):</strong></h3></td></tr>
120
+
121
+ <tr>
122
+ <th><?php esc_attr_e( 'Top Margin:','wpexpertsin');?></th>
123
+ <td>
124
+
125
+ <input type="textbox" id="csbwfs_top_margin" name="csbwfs_top_margin" value="<?php esc_attr_e( get_option('csbwfs_top_margin'),'wpexpertsin'); ?>" placeholder="10% OR 10px" size="10"/>
126
+ </td>
127
+ </tr>
128
+ </table>
129
+ </div>
130
+ <!-- Share Buttons -->
131
+ <div class="csbwfs-tab" id="div-csbwfs-share-buttons">
132
+ <h2>Social Share Buttons Settings</h2>
133
+ <table>
134
+ <td><?php esc_attr_e('Enable:','wpexpertsin');?></td>
135
+ <td colspan="2">
136
+ <input type="checkbox" id="csbwfs_buttons_active" name="csbwfs_buttons_active" value='1' <?php checked(get_option('csbwfs_buttons_active'),1);?>/>
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <th nowrap><?php esc_attr_e( 'Share Button Position:','wpexpertsin');?></th>
141
+ <td>
142
+ <select id="csbwfs_btn_position" name="csbwfs_btn_position" >
143
+ <option value="left" <?php selected(get_option('csbwfs_btn_position'),'left');?>>Left</option>
144
+ <option value="right" <?php selected(get_option('csbwfs_btn_position'),'right');?>>Right</option>
145
+ </select>
146
+ </td>
147
+ </tr>
148
+ <tr>
149
+ <th nowrap><?php esc_attr_e( 'Display Buttons On ','wpexpertsin');?></th>
150
+ <td>
151
+ <select id="csbwfs_btn_display" name="csbwfs_btn_display" >
152
+ <option value="below" <?php selected(get_option('csbwfs_btn_display'),'below');?>>Bottom Of The Content</option>
153
+ <option value="above" <?php selected(get_option('csbwfs_btn_display'),'above');?>>Top Of The Content</option>
154
+ </select>
155
+ </td>
156
+ </tr>
157
+ <tr>
158
+ <th nowrap><?php esc_attr_e( 'Share Button Text:','wpexpertsin');?></th>
159
+ <td>
160
+ <input type="textbox" id="csbwfs_btn_text" name="csbwfs_btn_text" value="<?php esc_attr_e( get_option('csbwfs_btn_text'),'wpexpertsin'); ?>" placeholder="Share This!" size="20"/>
161
+ <i>(Leave blank if you want hide button)</i></td>
162
+ </tr>
163
+ <tr><td colspan="2"><strong>Show Share Buttons On :</strong> Home <input type="checkbox" id="csbwfs_page_hide_home" value="yes" name="csbwfs_page_hide_home" <?php checked(get_option('csbwfs_page_hide_home'),'yes');?>/> Page <input type="checkbox" id="csbwfs_page_hide_page" value="yes" name="csbwfs_page_hide_page" <?php checked(get_option('csbwfs_page_hide_page'),'yes');?>/> Post <input type="checkbox" id="csbwfs_page_hide_post" value="yes" name="csbwfs_page_hide_post" <?php checked(get_option('csbwfs_page_hide_post'),'yes');?>/> Category/Archive <input type="checkbox" id="csbwfs_page_hide_archive" value="yes" name="csbwfs_page_hide_archive" <?php checked(get_option('csbwfs_page_hide_archive'),'yes');?>/> <br>
164
+ </td></tr>
165
+
166
+ <tr><td colspan="2"><strong><h4>Social Share Button Images 32X32 (Optional) :</h4></strong></td></tr>
167
+ <tr><td colspan="2" align="right"><input type="button" id="csbwfsresetpage" value="RESET"></td></tr>
168
+ <tr><th><?php esc_attr_e( 'Facebook:','wpexpertsin');?></th>
169
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsFbImg2"><input type="text" id="csbwfs_page_fb_image" name="csbwfs_page_fb_image" value="<?php esc_attr_e( get_option('csbwfs_page_fb_image'),'wpexpertsin'); ?>" placeholder="Insert facebook button image path" size="40" class="inputButtonid"/>
170
+ <input id="csbwfs_fb_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_fb_bg" data-default-color="#305891" class="color-field" name="csbwfs_page_fb_bg" value="<?php esc_attr_e( get_option('csbwfs_page_fb_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_fb_title" name="csbwfs_page_fb_title" value="<?php esc_attr_e( get_option('csbwfs_page_fb_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
171
+ </td>
172
+ </tr>
173
+ <tr>
174
+ <th><?php esc_attr_e( 'Twitter:','wpexpertsin');?></th>
175
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsTwImg2">
176
+ <input type="text" id="csbwfs_page_tw_image" name="csbwfs_page_tw_image" value="<?php esc_attr_e( get_option('csbwfs_page_tw_image'),'wpexpertsin'); ?>" placeholder="Insert twitter button image path" size="40" class="inputButtonid"/>
177
+ <input id="csbwfs_tw_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_tw_bg" data-default-color="#2ca8d2" class="color-field" name="csbwfs_page_tw_bg" value="<?php esc_attr_e( get_option('csbwfs_page_tw_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_tw_title" name="csbwfs_page_tw_title" value="<?php esc_attr_e( get_option('csbwfs_page_tw_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
178
+ </td>
179
+ </tr>
180
+ <tr><th><?php esc_attr_e( 'Linkedin:','wpexpertsin');?></th>
181
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsLiImg2"><input type="text" id="csbwfs_page_li_image" name="csbwfs_page_li_image" value="<?php esc_attr_e( get_option('csbwfs_page_li_image'),'wpexpertsin'); ?>" placeholder="Insert Linkedin button image path" size="40" class="inputButtonid"/>
182
+ <input id="csbwfs_li_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_li_bg" data-default-color="#dd4c39" class="color-field" name="csbwfs_page_li_bg" value="<?php esc_attr_e( get_option('csbwfs_page_li_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_li_title" name="csbwfs_page_li_title" value="<?php esc_attr_e( get_option('csbwfs_page_li_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
183
+ </td>
184
+ </tr>
185
+ <tr>
186
+ <th><?php esc_attr_e( 'Pintrest:','wpexpertsin');?></th>
187
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsPiImg2"><input type="text" id="csbwfs_page_pin_image" name="csbwfs_page_pin_image" value="<?php esc_attr_e( get_option('csbwfs_page_pin_image'),'wpexpertsin'); ?>" placeholder="Insert pinterest button image path" size="40" class="inputButtonid"/>
188
+ <input id="csbwfs_pi_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_pin_bg" data-default-color="#ca2027" class="color-field" name="csbwfs_page_pin_bg" value="<?php esc_attr_e( get_option('csbwfs_page_pin_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_pin_title" name="csbwfs_page_pin_title" value="<?php esc_attr_e( get_option('csbwfs_page_pin_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
189
+ </td>
190
+ </tr>
191
+
192
+ <tr>
193
+ <th><?php esc_attr_e( 'Reddit:','wpexpertsin');?></th>
194
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsReImg2">
195
+ <input type="text" id="csbwfs_page_re_image" name="csbwfs_page_re_image" value="<?php esc_attr_e( get_option('csbwfs_page_re_image'),'wpexpertsin'); ?>" placeholder="Insert reddit button image path" size="40" class="inputButtonid"/>
196
+ <input id="csbwfs_re_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_re_bg" data-default-color="#ff1a00" class="color-field" name="csbwfs_page_re_bg" value="<?php esc_attr_e( get_option('csbwfs_page_re_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_re_title" name="csbwfs_page_re_title" value="<?php esc_attr_e( get_option('csbwfs_page_re_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
197
+ </td>
198
+ </tr>
199
+ <tr>
200
+ <th><?php esc_attr_e( 'Stumbleupon:','wpexpertsin');?></th>
201
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsStImg2">
202
+ <input type="text" id="csbwfs_page_st_image" name="csbwfs_page_st_image" value="<?php esc_attr_e( get_option('csbwfs_page_st_image'),'wpexpertsin'); ?>" placeholder="Insert stumbleupon button image path" size="40" class="inputButtonid"/>
203
+ <input id="csbwfs_st_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_st_bg" data-default-color="#eb4924" class="color-field" name="csbwfs_page_st_bg" value="<?php esc_attr_e( get_option('csbwfs_page_st_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_st_title" name="csbwfs_page_st_title" value="<?php esc_attr_e( get_option('csbwfs_page_st_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
204
+ </td>
205
+ </tr>
206
+ <tr>
207
+ <th><?php esc_attr_e( 'Mail:','wpexpertsin');?></th>
208
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsMlImg2">
209
+ <input type="text" id="csbwfs_page_mail_image" name="csbwfs_page_mail_image" value="<?php esc_attr_e( get_option('csbwfs_page_mail_image'),'wpexpertsin'); ?>" placeholder="Insert mail button image path" size="40" class="inputButtonid"/>
210
+ <input id="csbwfs_ml_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_mail_bg" data-default-color="#738a8d" class="color-field" name="csbwfs_page_mail_bg" value="<?php esc_attr_e( get_option('csbwfs_page_mail_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_mail_title" name="csbwfs_page_mail_title" value="<?php esc_attr_e( get_option('csbwfs_page_mail_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
211
+ </td>
212
+ </tr>
213
+ <tr>
214
+ <th><?php esc_attr_e( 'Youtube:','wpexpertsin');?></th>
215
+ <td class="csbwfsButtonsImg" id="csbwfsButtonsYtImg2">
216
+ <input type="text" id="csbwfs_page_yt_image" name="csbwfs_page_yt_image" value="<?php esc_attr_e( get_option('csbwfs_page_yt_image'),'wpexpertsin'); ?>" placeholder="Insert youtube button image path" size="40" class="inputButtonid"/>
217
+ <input id="csbwfs_yt_image_button2" type="button" value="Upload Image" class="cswbfsUploadBtn"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_yt_bg" data-default-color="#ffffff" class="color-field" name="csbwfs_page_yt_bg" value="<?php esc_attr_e( get_option('csbwfs_page_yt_bg'),'wpexpertsin'); ?>" size="20"/>&nbsp;&nbsp;<input type="text" id="csbwfs_page_yt_title" name="csbwfs_page_yt_title" value="<?php esc_attr_e( get_option('csbwfs_page_yt_title'),'wpexpertsin'); ?>" placeholder="Alt Text" size="20" class="csbwfs_title"/>
218
+ </td>
219
+ </tr>
220
+ </table>
221
+
222
+ </div>
223
+ <!-- Support -->
224
+ <div class="last author csbwfs-tab" id="div-csbwfs-support">
225
+
226
+ <h2>Plugin Support</h2>
227
+
228
+ <p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A" target="_blank" style="font-size: 17px; font-weight: bold;"><img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" title="Donate for this plugin"></a></p>
229
+
230
+ <p><strong>Plugin Author:</strong><br><a href="https://www.ep-experts.in" target="_blank">WP-Experts.In Team</a></p>
231
+ <p><a href="mailto:raghunath.0087@gmail.com" target="_blank" class="contact-author">Contact Author</a></p>
232
+ <p><strong>Our Other Plugins:</strong><br>
233
+ <ol>
234
+ <li><a href="https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar" target="_blank">Custom Share Buttons With Floating Sidebar</a></li>
235
+ <li><a href="https://wordpress.org/plugins/protect-wp-admin/" target="_blank">Protect WP-Admin</a></li>
236
+ <li><a href="https://wordpress.org/plugins/wp-sales-notifier/" target="_blank">WP Sales Notifier</a></li>
237
+ <li><a href="https://wordpress.org/plugins/wp-categories-widget/" target="_blank">WP Categories Widget</a></li>
238
+ <li><a href="https://wordpress.org/plugins/wp-protect-content/" target="_blank">WP Protect Content</a></li>
239
+ <li><a href="https://wordpress.org/plugins/wp-version-remover/" target="_blank">WP Version Remover</a></li>
240
+ <li><a href="https://wordpress.org/plugins/wp-posts-widget/" target="_blank">WP Post Widget</a></li>
241
+ <li><a href="https://wordpress.org/plugins/wp-importer" target="_blank">WP Importer</a></li>
242
+ <li><a href="https://wordpress.org/plugins/wp-csv-importer/" target="_blank">WP CSV Importer</a></li>
243
+ <li><a href="https://wordpress.org/plugins/wp-testimonial/" target="_blank">WP Testimonial</a></li>
244
+ <li><a href="https://wordpress.org/plugins/wc-sales-count-manager/" target="_blank">WooCommerce Sales Count Manager</a></li>
245
+ <li><a href="https://wordpress.org/plugins/wp-social-buttons/" target="_blank">WP Social Buttons</a></li>
246
+ <li><a href="https://wordpress.org/plugins/wp-youtube-gallery/" target="_blank">WP Youtube Gallery</a></li>
247
+ <li><a href="https://wordpress.org/plugins/tweets-slider/" target="_blank">Tweets Slider</a></li>
248
+ <li><a href="https://wordpress.org/plugins/rg-responsive-gallery/" target="_blank">RG Responsive Slider</a></li>
249
+ <li><a href="https://wordpress.org/plugins/cf7-advance-security" target="_blank">Contact Form 7 Advance Security WP-Admin</a></li>
250
+ <li><a href="https://wordpress.org/plugins/wp-easy-recipe/" target="_blank">WP Easy Recipe</a></li>
251
+ </ol>
252
+ </div>
253
+ <!-- GO PRO -->
254
+ <div class="last author csbwfs-tab" id="div-csbwfs-pro">
255
+ <h2 style="color:green;text-align:center;"><strong>Pay one time use lifetime!!!!!</strong></h2>
256
+ <table>
257
+ <tr>
258
+ <td valign="top" width="30%">
259
+ <h2>GO PRO</h2>
260
+ <p><a href="https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon" target="_blank" class="contact-author">Click here</a> to download addon.</p>
261
+ <p>We have released an add-on for Custom Share Buttons With Floating Sidebar which not only demonstrates the flexibility of CSBWFS, but also adds some important features:</p>
262
+ <iframe width="560" height="450" src="https://www.youtube.com/embed/f_qk4qxAsz8" frameborder="0" allowfullscreen></iframe>
263
+ </td>
264
+ <td><h2>Key Features</h2><hr>
265
+ <ol>
266
+ <li>Responsive Floating Sidebar</li>
267
+ <li>Shortcode</li>
268
+ <li>Hide floating sidebar for any post type</li>
269
+ <li>Hide Floating Sidebar for any taxonomy</li>
270
+ <li>Show Share Buttons for any taxonomy</li>
271
+ <li>Define sidebar/share buttons position</li>
272
+ <li>Responsive Popup box Contact Form</li>
273
+ <li> Shortcode supportable light box</li>
274
+ <li>OG meta tags fields</li>
275
+ <li>Choose different style of sidebar</li>
276
+ <li>Use share buttons as social buttons</li>
277
+ <li>Define Twitter username</li>
278
+ <li>Share count buttons(FB, ST, PIN,Xing and Reddit)</li>
279
+ <li>Manage buttons image, title, background color and url</li>
280
+ <li>10 extra custom sidebar buttons to use it as your button</li>
281
+ <li>Show/Hide social share buttons on specific page/post</li>
282
+ <li>Page specific sidebar position (Left/Right/Bottom)</li>
283
+ <li>add social site official page URL for all social buttons</li>
284
+ </ol>
285
+ </td>
286
+ </tr>
287
+ </table>
288
+ </div>
289
+ </div>
290
+ <span class="submit-btn"><?php _e( get_submit_button('Save Settings','button-primary','submit','',''),'wpexpertsin');?></span>
291
+ <?php settings_fields('csbwf_sidebar_options'); ?>
292
+ </form>
293
+ <!-- End Options Form -->
294
+ </div>
lib/shortcode.php CHANGED
@@ -1,86 +1,89 @@
1
- <?php
2
- /*
3
- * Template files to define CSBWFS Shortcodes
4
- * @add_shortcode()
5
- * @do_shortcode()
6
- * shortcode [csbwfs_buttons]
7
- **/
8
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
-
10
- if(!class_exists('CsbwfsShortcodeClass')):
11
- class CsbwfsShortcodeClass {
12
- /**
13
- * Construct the plugin object
14
- */
15
- public function __construct()
16
- {
17
- // register actions
18
- add_shortcode( 'csbwfs_buttons', array(&$this, 'csbwfs_shortcode_func' ) );
19
- add_filter( 'widget_text', 'do_shortcode' );
20
- } // END public function __construct
21
-
22
-
23
- public function csbwfs_shortcode_style_func() {
24
- echo '<style type="text/css">.csbwfs-shortcode a{box-shadow:inherit}.csbwfs-shortcode a i{display:inline-block;position:relative;width:35px;height:36px;background-image:url('.plugin_dir_url( __FILE__ ).'../images/minify-social.png)}.csbwfs-shortcode{display:inline-block;position:relative;width:auto;}.csbwfs-shortcode i.csbwfs_facebook{background-position:68% 4%}.csbwfs-shortcode i.csbwfs_twitter{background-position:14% 4%}.csbwfs-shortcode i.csbwfs_plus{background-position:80% 4%}.csbwfs-shortcode i.csbwfs_linkedin{background-position:92% 4%}.csbwfs-shortcode i.csbwfs_pinterest{background-position:14% 19%}.csbwfs-shortcode i.csbwfs_youtube{background-position:32% 4%}.csbwfs-shortcode i.csbwfs_reddit{background-position:26% 19%}.csbwfs-shortcode i.csbwfs_stumbleupon{background-position:44% 19%}.csbwfs-shortcode i.csbwfs_mail{background-position:8% 19%}.csbwfs-shortcode i.csbwfs_skype {background-position: 38% 19%;}</style>';
25
- }
26
-
27
- public static function csbwfs_shortcode_func($atts) {
28
- //[csbwfs_buttons buttons='fb,tw,li,pi,yt,re,st,ml']
29
- $shortcode_html = '';
30
- $btnsordaryy = isset($atts['buttons']) ? explode(',',$atts['buttons']) : array();
31
- $class = isset($atts['class']) ? $atts['class'] : '';
32
- if(is_array($btnsordaryy) && count($btnsordaryy) > 0 ){
33
- add_action( 'wp_footer', array(&$this,'csbwfs_shortcode_style_func' ));
34
- $shortcode_html .= '<div id="csbwfs-shortcode" class="'.$class.'">';
35
- foreach($btnsordaryy as $btnsVal)
36
- {
37
- /** FB */
38
- if($btnsVal=='fb'):
39
- $shortcode_html .='<div id="csbwfs-fb" class="csbwfs-shortcode"><a href="javascript:" onclick="javascript:window.open(\'//www.facebook.com/sharer/sharer.php?u=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\', \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600\');return false;" target="_blank" ><i class="csbwfs_facebook"></i></a></div>';
40
- endif;
41
- /** TW */
42
- if($btnsVal=='tw'):
43
- $shortcode_html .='<div id="csbwfs-tw" class="csbwfs-shortcode"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url=\'+encodeURIComponent(location.href)+\'&text=\'+encodeURIComponent(document.title)+\'&jump=close\',\'_blank\',\'width=800,height=300\')" ><i class="csbwfs_twitter"></i></a></div>';
44
-
45
- endif;
46
-
47
- /** LI */
48
- if($btnsVal=='li'):
49
- $shortcode_html .='<div id="csbwfs-li" class="csbwfs-shortcode"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/shareArticle?mini=true&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" ><i class="csbwfs_linkedin"></i></a></div>';
50
- endif;
51
-
52
- /** PIN */
53
- if($btnsVal=='pi'):
54
- $shortcode_html .='<div id="csbwfs-pin" class="csbwfs-shortcode"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);"><i class="csbwfs_pinterest"></i></a></div>';
55
- endif;
56
-
57
- /** Reddit */
58
- if($btnsVal=='re'):
59
- $shortcode_html .='<div id="csbwfs-re" class="csbwfs-shortcode"><a onclick="window.open(\'//reddit.com/submit?url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);"><i class="csbwfs_reddit"></i></a></div>';
60
- endif;
61
-
62
- /** Stumbleupon/Mix */
63
- if($btnsVal=='st'):
64
- $shortcode_html .='<div id="csbwfs-st" class="csbwfs-shortcode"><a onclick="window.open(\'//mix.com/mixit?su=submit&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);"><i class="csbwfs_stumbleupon"></i></a></div>';
65
- endif;
66
- /** YT */
67
- if($btnsVal=='yt'):
68
- $shortcode_html .='<div id="csbwfs-yt" class="csbwfs-shortcode"><a onclick="window.open(\''.get_option('csbwfs_ytPath').'\');" href="javascript:void(0);"><i class="csbwfs_youtube"></i></a></div>';
69
- endif;
70
- /** Skype */
71
- if($btnsVal=='sk'):
72
- $shortcode_html .='<div id="csbwfs-sk" class="csbwfs-shortcode"><a href="skype:'.get_option('csbwfs_skPath').'"><i class="csbwfs_skype"></i></a></div>';
73
- endif;
74
- /** Mail*/
75
- if($btnsVal=='ml'):
76
- $shortcode_html .='<div id="csbwfs-ml" class="csbwfs-shortcode"><a onclick="javascript:window.location=(\'mailto:'.get_bloginfo('admin_email').'\'+\'?subject=\'+encodeURIComponent(document.title)+\'&body=\'+encodeURIComponent(location.href));" href="javascript:void(0);" ><i class="csbwfs_mail"></i></a></div>';
77
- endif;
78
- }
79
- $shortcode_html .='</div>'; //End #csbwfs-shortcode
80
- }
81
- return $shortcode_html;
82
- }
83
- }
84
- //init class
85
- new CsbwfsShortcodeClass(); //init
86
- endif;
 
 
 
1
+ <?php
2
+ /*
3
+ * Template files to define CSBWFS Shortcodes
4
+ * @add_shortcode()
5
+ * @do_shortcode()
6
+ * shortcode [csbwfs_buttons]
7
+ **/
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ if(!class_exists('CsbwfsShortcodeClass')):
11
+ class CsbwfsShortcodeClass {
12
+ /**
13
+ * Construct the plugin object
14
+ */
15
+ public function __construct()
16
+ {
17
+ // register actions
18
+ add_shortcode( 'csbwfs_buttons', array(&$this, 'csbwfs_shortcode_func' ) );
19
+ // register shortcode style
20
+ add_action( 'wp_enqueue_scripts', array(&$this, 'csbwfs_shortcode_style_func' ) );
21
+ add_filter( 'widget_text', 'do_shortcode' );
22
+ } // END public function __construct
23
+
24
+
25
+ public function csbwfs_shortcode_style_func() {
26
+ $csb_shortcodecss = ' .csbwfs-shortcode a{box-shadow:inherit}.csbwfs-shortcode a i{display:inline-block;position:relative;width:35px;height:36px;background-image:url('.plugin_dir_url( __FILE__ ).'../images/minify-social.png)}.csbwfs-shortcode{display:inline-block;position:relative;width:auto;}.csbwfs-shortcode i.csbwfs_facebook{background-position:68% 4%}.csbwfs-shortcode i.csbwfs_twitter{background-position:14% 4%}.csbwfs-shortcode i.csbwfs_plus{background-position:80% 4%}.csbwfs-shortcode i.csbwfs_linkedin{background-position:92% 4%}.csbwfs-shortcode i.csbwfs_pinterest{background-position:14% 19%}.csbwfs-shortcode i.csbwfs_youtube{background-position:32% 4%}.csbwfs-shortcode i.csbwfs_reddit{background-position:26% 19%}.csbwfs-shortcode i.csbwfs_stumbleupon{background-position:44% 19%}.csbwfs-shortcode i.csbwfs_mail{background-position:8% 19%}.csbwfs-shortcode i.csbwfs_skype {background-position: 38% 19%;} ';
27
+ wp_register_style( 'csbwfs_shortcode_style', false );
28
+ wp_add_inline_style( 'csbwfs_shortcode_style', $csb_shortcodecss );
29
+ }
30
+
31
+ public static function csbwfs_shortcode_func($atts) {
32
+ //[csbwfs_buttons buttons='fb,tw,li,pi,yt,re,st,ml']
33
+ $shortcode_html = '';
34
+ $btnsordaryy = isset($atts['buttons']) ? explode(',',$atts['buttons']) : array();
35
+ $class = isset($atts['class']) ? $atts['class'] : '';
36
+ if(is_array($btnsordaryy) && count($btnsordaryy) > 0 ){
37
+ wp_enqueue_style( 'csbwfs_shortcode_style' ); //load shortcode style
38
+ $shortcode_html .= '<div id="csbwfs-shortcode" class="'.esc_attr($class).'">';
39
+ foreach($btnsordaryy as $btnsVal) {
40
+ /** FB */
41
+ if($btnsVal=='fb'):
42
+ $shortcode_html .='<div id="csbwfs-fb" class="csbwfs-shortcode"><a href="javascript:" onclick="javascript:window.open(\'//www.facebook.com/sharer/sharer.php?u=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\', \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600\');return false;" target="_blank" ><i class="csbwfs_facebook"></i></a></div>';
43
+ endif;
44
+ /** TW */
45
+ if($btnsVal=='tw'):
46
+ $shortcode_html .='<div id="csbwfs-tw" class="csbwfs-shortcode"><a href="javascript:" onclick="window.open(\'//twitter.com/share?url=\'+encodeURIComponent(location.href)+\'&text=\'+encodeURIComponent(document.title)+\'&jump=close\',\'_blank\',\'width=800,height=300\')" ><i class="csbwfs_twitter"></i></a></div>';
47
+
48
+ endif;
49
+
50
+ /** LI */
51
+ if($btnsVal=='li'):
52
+ $shortcode_html .='<div id="csbwfs-li" class="csbwfs-shortcode"><a href="javascript:" onclick="javascript:window.open(\'//www.linkedin.com/shareArticle?mini=true&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" ><i class="csbwfs_linkedin"></i></a></div>';
53
+ endif;
54
+
55
+ /** PIN */
56
+ if($btnsVal=='pi'):
57
+ $shortcode_html .='<div id="csbwfs-pin" class="csbwfs-shortcode"><a onclick="javascript:void((function(){var e=document.createElement(\'script\');e.setAttribute(\'type\',\'text/javascript\');e.setAttribute(\'charset\',\'UTF-8\');e.setAttribute(\'src\',\'//assets.pinterest.com/js/pinmarklet.js?r=\'+Math.random()*99999999);document.body.appendChild(e)})());" href="javascript:void(0);"><i class="csbwfs_pinterest"></i></a></div>';
58
+ endif;
59
+
60
+ /** Reddit */
61
+ if($btnsVal=='re'):
62
+ $shortcode_html .='<div id="csbwfs-re" class="csbwfs-shortcode"><a onclick="window.open(\'//reddit.com/submit?url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);"><i class="csbwfs_reddit"></i></a></div>';
63
+ endif;
64
+
65
+ /** Stumbleupon/Mix */
66
+ if($btnsVal=='st'):
67
+ $shortcode_html .='<div id="csbwfs-st" class="csbwfs-shortcode"><a onclick="window.open(\'//mix.com/mixit?su=submit&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&jump=close\',\'Mix\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);"><i class="csbwfs_stumbleupon"></i></a></div>';
68
+ endif;
69
+ /** YT */
70
+ if($btnsVal=='yt'):
71
+ $shortcode_html .='<div id="csbwfs-yt" class="csbwfs-shortcode"><a onclick="window.open(\''.get_option('csbwfs_ytPath').'\');" href="javascript:void(0);"><i class="csbwfs_youtube"></i></a></div>';
72
+ endif;
73
+ /** Skype */
74
+ if($btnsVal=='sk'):
75
+ $shortcode_html .='<div id="csbwfs-sk" class="csbwfs-shortcode"><a href="skype:'.get_option('csbwfs_skPath').'"><i class="csbwfs_skype"></i></a></div>';
76
+ endif;
77
+ /** Mail*/
78
+ if($btnsVal=='ml'):
79
+ $shortcode_html .='<div id="csbwfs-ml" class="csbwfs-shortcode"><a onclick="javascript:window.location=(\'mailto:'.get_bloginfo('admin_email').'\'+\'?subject=\'+encodeURIComponent(document.title)+\'&body=\'+encodeURIComponent(location.href));" href="javascript:void(0);" ><i class="csbwfs_mail"></i></a></div>';
80
+ endif;
81
+ }
82
+ $shortcode_html .='</div>'; //End #csbwfs-shortcode
83
+ }
84
+ return $shortcode_html;
85
+ }
86
+ }
87
+ //init class
88
+ new CsbwfsShortcodeClass(); //init
89
+ endif;
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Custom Share Buttons with Floating Sidebar ===
2
  Contributors: wpexpertsin, india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A
4
- Tags: social share buttons,custom share buttons,facebook, twitter,linkedin,Stumbleupon/Mix,Reddit,pinterest,Xing, social share floating sidebar
5
- Requires at least: 5.0
6
- Tested up to: 5.6.2
7
- Stable tag: 4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,16 +12,13 @@ Share buttons with extra features to sharing your website posts/pages on Faceboo
12
 
13
  == Description ==
14
 
15
- = Wordpress Most Popular Social Share Plugin = to share your website among your friends through social sites( Facebook, Twitter, Instagram, Whatsapp, Pinterest etc.) and help you to quickly grow your business.
16
 
17
- More than 22 billion shares are viewed each and every day on the internet, with sharing becoming an increasingly important part of every website owner’s marketing strategies.
18
 
19
- With this plugin, you can give users a tool to share your website (posts/pages/products) via their accounts on popular social networks.
20
-
21
- Install and start driving high quality referrals to your website.
22
-
23
- You can display social share buttons on your website via floating sidebar. Easily Customizable & Extensible social share buttons and they will not affect your site speed as well.
24
 
 
25
 
26
  ### [Addon Demo](https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon).
27
 
@@ -58,7 +55,7 @@ fb-facebook, tw-twitter, li-linkedin, pi-pinterest, yt-youtube, re-reddit, st-st
58
 
59
  = Go Pro =
60
 
61
- We have also released an addon of Custom Share Buttons With Floating Sidebar which not only demonstrates the flexibility of free version, but also added some more important features.
62
 
63
  Add-on Featrues :
64
 
@@ -92,10 +89,10 @@ We have also released an addon of Custom Share Buttons With Floating Sidebar whi
92
  * An option to show/hide sidebar from any specific page
93
  * Faster support
94
 
95
- **[Download Addon](https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon)**
96
 
97
 
98
- For any query contact to **[plugin author](mailto:raghunath.0087@gmail.com)**
99
 
100
 
101
  == Installation ==
@@ -107,19 +104,19 @@ Step 2. Activate the plugin through the Plugins menu in WordPress
107
  Step 3. Go to Settings/"Social Share Buttons(CSBWFS)" and configure the plugin settings.
108
 
109
  == Frequently Asked Questions ==
110
- #How add floating share buttons on my website?
111
 
112
  * After active the plugin you have must need to enable this plugin through the plugin settings.
113
 
114
- #Can i change the custom share buttons images from admin?
115
 
116
  * 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.
117
 
118
- #Can i disable the floating sidebar for mobile?
119
 
120
  * Yes,You can disable the floating sidebar by configure the plugin settings
121
 
122
- #Can i define the top margin for share buttons block?
123
 
124
  * Yes, admin can define the top margin from plugin settings page
125
 
@@ -169,6 +166,16 @@ Step 3. Go to Settings/"Social Share Buttons(CSBWFS)" and configure the plugin s
169
 
170
  == Changelog ==
171
 
 
 
 
 
 
 
 
 
 
 
172
  = 3.9 =
173
  * Tested with latest wordpress version 5.4
174
  * Optimized code
1
  === Custom Share Buttons with Floating Sidebar ===
2
  Contributors: wpexpertsin, india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A
4
+ Tags: social share buttons,custom share buttons, facebook, twitter, linkedin, Stumbleupon, Reddit, Pinterest, Xing, social buttons, floating sidebar
5
+ Requires at least: 5.6
6
+ Tested up to: 6.0
7
+ Stable tag: 4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ = Most Popular Social Share Wordpress Plugin =
16
 
17
+ Share your website among your friends through social sites( Facebook, Twitter, Instagram, Whatsapp, Pinterest etc.) and grow your business.
18
 
19
+ This plugin provide a very simple social tool to share your website (posts/pages/products) on popular social networks. Install and start driving high quality referrals to your website.
 
 
 
 
20
 
21
+ Plugin give you an option to display social share buttons via floating sidebar. Easily Customizable & Extensible social share buttons and they will not affect your site speed as well.
22
 
23
  ### [Addon Demo](https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon).
24
 
55
 
56
  = Go Pro =
57
 
58
+ We have also released an addon of Custom Share Buttons With Floating Sidebar which not only demonstrates the flexibility of free version, but also providing some more important features.
59
 
60
  Add-on Featrues :
61
 
89
  * An option to show/hide sidebar from any specific page
90
  * Faster support
91
 
92
+ **[Download Addon](https://www.wp-experts.in/products/share-buttons-with-floating-sidebar-pro-addon/?utm_source=wordpress.org&utm_medium=free-plugin&utm_campaign=15off)**
93
 
94
 
95
+ Do You Have Any Query? **[Submit here](https://www.wp-experts.in/contact-us/?utm_source=wordpress.org&utm_medium=free-plugin&utm_campaign=csbwfs-social)**
96
 
97
 
98
  == Installation ==
104
  Step 3. Go to Settings/"Social Share Buttons(CSBWFS)" and configure the plugin settings.
105
 
106
  == Frequently Asked Questions ==
107
+ #How to add floating share buttons on my website?
108
 
109
  * After active the plugin you have must need to enable this plugin through the plugin settings.
110
 
111
+ #Can I change the custom share buttons images from admin?
112
 
113
  * 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.
114
 
115
+ #Can I disable the floating sidebar for mobile?
116
 
117
  * Yes,You can disable the floating sidebar by configure the plugin settings
118
 
119
+ #Can I define the top margin for share buttons block?
120
 
121
  * Yes, admin can define the top margin from plugin settings page
122
 
166
 
167
  == Changelog ==
168
 
169
+
170
+ = 4.2 =
171
+ * Tested with latest wordpress version 5.9.3
172
+ * Optimized Code
173
+
174
+
175
+ = 4.1 =
176
+ * Tested with latest wordpress version 5.8
177
+
178
+
179
  = 3.9 =
180
  * Tested with latest wordpress version 5.4
181
  * Optimized code