Custom Share Buttons with Floating Sidebar - Version 1.7

Version Description

  • Released Pro Version
    • Added an option disable floating sidebar on home page
    • Fixed share url issue on home page
Download this release

Release Info

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

Code changes from version 1.6 to 1.7

csbwfs-class.php CHANGED
@@ -98,10 +98,15 @@ wp_enqueue_style( 'csbwf_sidebar_style' );
98
  function csbwf_sidebar_load_inline_js()
99
  {
100
  $pluginOptionsVal=get_csbwf_sidebar_options();
101
- $jscnt='<script>jQuery(document).ready(function()
102
- { ';
103
-
104
-
 
 
 
 
 
105
  if($pluginOptionsVal['csbwfs_delayTimeBtn']!='0'):
106
  $jscnt.='jQuery("#delaydiv").hide();
107
  setTimeout(function(){
@@ -110,72 +115,72 @@ function csbwf_sidebar_load_inline_js()
110
 
111
  if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
112
  $jscnt.='jQuery("div#tw a").hover(function(){
113
- jQuery("div#tw a").animate({width:"60px"});
114
  },function(){
115
- jQuery("div#tw a").stop( true, true ).animate({width:"45px"});
116
  });';
117
  endif;
118
 
119
  if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
120
  $jscnt.='jQuery("div#fb a").hover(function(){
121
- jQuery("div#fb a").animate({width:"60px"});
122
  },function(){
123
- jQuery("div#fb a").stop( true, true ).animate({width:"45px"});
124
  });';
125
  endif;
126
 
127
  if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
128
  $jscnt.='jQuery("div#ml a").hover(function(){
129
- jQuery("div#ml a").animate({width:"60px"});
130
  },function(){
131
- jQuery("div#ml a").stop( true, true ).animate({width:"45px"});
132
  });';
133
  endif;
134
 
135
  if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):
136
  $jscnt.='jQuery("div#gp a").hover(function(){
137
- jQuery("div#gp a").animate({width:"60px"});
138
  },function(){
139
- jQuery("div#gp a").stop( true, true ).animate({width:"45px"});
140
  });';
141
  endif;
142
 
143
  if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
144
  $jscnt.='jQuery("div#li a").hover(function(){
145
- jQuery("div#li a").animate({width:"60px"});
146
  },function(){
147
- jQuery("div#li a").stop( true, true ).animate({width:"45px"});
148
  });';
149
  endif;
150
 
151
  if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
152
  $jscnt.='jQuery("div#pin a").hover(function(){
153
- jQuery("div#pin a").animate({width:"60px"});
154
  },function(){
155
- jQuery("div#pin a").stop( true, true ).animate({width:"45px"});
156
  });';
157
  endif;
158
 
159
  if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
160
  $jscnt.='jQuery("div#yt a").hover(function(){
161
- jQuery("div#yt a").animate({width:"60px"});
162
  },function(){
163
- jQuery("div#yt a").stop( true, true ).animate({width:"45px"});
164
  });';
165
  endif;
166
  if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
167
  $jscnt.='jQuery("div#re a").hover(function(){
168
- jQuery("div#re a").animate({width:"60px"});
169
  },function(){
170
- jQuery("div#re a").stop( true, true ).animate({width:"45px"});
171
  });';
172
  endif;
173
 
174
  if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
175
  $jscnt.='jQuery("div#st a").hover(function(){
176
- jQuery("div#st a").animate({width:"60px"});
177
  },function(){
178
- jQuery("div#st a").stop( true, true ).animate({width:"45px"});
179
  });';
180
  endif;
181
 
@@ -204,8 +209,11 @@ function csbwf_sidebar_load_inline_js()
204
  jQuery("div.show").hide();
205
  jQuery("div.hide").show();
206
  }';
 
207
 
208
- $jscnt.='});</script>';
 
 
209
 
210
  echo $jscnt;
211
  }
@@ -271,6 +279,14 @@ if(is_category())
271
  $shareurl =home_url('/');
272
  $ShareTitle=get_bloginfo('name');
273
  }
 
 
 
 
 
 
 
 
274
  $ShareTitle= htmlspecialchars(urlencode($ShareTitle));
275
 
276
 
@@ -385,96 +401,89 @@ if($pluginOptionsVal['csbwfs_hide_btn']!=''){ $hidebtn=$pluginOptionsVal['csbwfs
385
  //get mail button message
386
  if($pluginOptionsVal['csbwfs_share_msg']!=''){ $sharemsg=$pluginOptionsVal['csbwfs_share_msg'];}
387
  else{$sharemsg='Share This With Your Friends';}
 
388
  /** Check display Show/Hide button or not*/
389
  if(isset($pluginOptionsVal['csbwfs_rmSHBtn']) && $pluginOptionsVal['csbwfs_rmSHBtn']!=''):
390
  $isActiveHideShowBtn='yes';
391
  else:
392
  $isActiveHideShowBtn='no';
393
  endif;
394
- ?>
395
- <div id="delaydiv">
396
- <div class='social-widget' <?php echo $idName;?> title="<?php echo $sharemsg; ?>" <?php echo $style;?> >
397
-
398
- <?php if($isActiveHideShowBtn!='yes') :?>
399
- <div class="show"><a href="javascript:" alt="<?php echo $showbtn;?>" id="show"><img src="<?php echo plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$showImg);?>" title="<?php echo $showbtn;?>"></a></div>
400
- <?php endif;?>
401
-
402
- <div id="social-inner">
403
- <?php if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):?>
404
- <!-- Facebook -->
405
- <div class="sbutton">
406
- <div id="fb">
407
- <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;"
408
- target="_blank" alt="Share on Facebook" <?php echo $fImgbg;?>> <img src="<?php echo $fImg;?>"></a></div>
409
- </div>
410
- <?php endif;?>
411
- <?php if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):?>
412
- <!-- Twitter -->
413
- <div class="sbutton">
414
-
415
- <div id="tw"><a href="javascript:" onclick="window.open('http://twitter.com/share?url=<?php echo $shareurl;?>&text=<?php echo $ShareTitle;?>','_blank','width=800,height=300')" alt="Twitter" <?php echo $tImgbg;?>><img src="<?php echo $tImg;?>"></a></div>
416
- </div>
417
- <?php endif;?>
418
- <?php if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):?>
419
- <!-- Google plus -->
420
- <div class="sbutton">
421
-
422
- <div id="gp"><a href="https://plus.google.com/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Google Plus" <?php echo $gImgbg;?> >
423
- <img src="<?php echo $gImg;?>"></a></div>
424
- </div>
425
- <?php endif;?>
426
- <?php if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):?>
427
- <!-- Linkdin -->
428
- <div class="sbutton">
429
-
430
- <div id="li">
431
- <a href="https://www.linkedin.com/cws/share?url=<?php echo $shareurl;?>" onclick="javascript:window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" alt="Google Plus" <?php echo $lImgbg;?>>
432
- <img src="<?php echo $lImg;?>"></a></div>
433
- </div>
434
- <?php endif;?>
435
- <?php if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):?>
436
- <!-- Pinterest -->
437
- <div class="sbutton">
438
-
439
- <div id="pin"><a onclick="window.open('http://pinterest.com/pin/create/button/?url=<?php echo $shareurl;?>&amp;media=<?php echo $pinShareImg;?>&amp;description=<?php echo $ShareTitle;?> :<?php echo $shareurl;?>','pinIt','toolbar=0,status=0,width=620,height=500');" href="javascript:void(0);" <?php echo $pImgbg;?>><img src="<?php echo $pImg;?>"></a></div>
440
- </div>
441
- <?php endif;?>
442
-
443
- <?php if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):?>
444
- <!-- Youtube -->
445
- <div class="sbutton">
446
-
447
- <div id="yt"><a onclick="window.open('<?php echo $pluginOptionsVal['csbwfs_ytPath'];?>');" href="javascript:void(0);" <?php echo $ytImgbg;?>><img src="<?php echo $ytImg;?>"></a></div>
448
- </div>
449
- <?php endif;?>
450
- <?php if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):?>
451
- <!-- Reddit -->
452
- <div class="sbutton">
453
- <div id="re"><a onclick="window.open('http://reddit.com/submit?url=<?php echo $shareurl;?>&amp;title=<?php echo $ShareTitle;?>','Stumbleupon','toolbar=0,status=0,width=620,height=500');" href="javascript:void(0);" <?php echo $reImgbg;?>><img src="<?php echo $reImg;?>"></a></div>
454
- </div>
455
- <?php endif;?>
456
- <?php if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):?>
457
- <!-- Stumbleupon -->
458
- <div class="sbutton">
459
-
460
- <div id="st"><a onclick="window.open('http://www.stumbleupon.com/submit?url=<?php echo $shareurl;?>&amp;title=<?php echo $ShareTitle;?>','Stumbleupon','toolbar=0,status=0,width=620,height=500');" href="javascript:void(0);" <?php echo $stImgbg;?>><img src="<?php echo $stImg;?>"></a></div>
461
- </div>
462
- <?php endif;?>
463
- <?php if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):?>
464
- <!-- Mail-->
465
- <div class="sbutton">
466
- <div id="ml"><a href="mailto:<?php echo $mailMsg;?>" alt="Email" <?php echo $mImgbg;?>><img src="<?php echo $mImg;?>" target="_blank"></a></div>
467
- </div>
468
- <?php endif;?>
469
-
470
- </div>
471
- <?php if($isActiveHideShowBtn!='yes') :?>
472
- <div class="hide"><a href="javascript:" alt="<?php echo $hidebtn;?>" id="hide"><img src="<?php echo plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$hideImg);?>" title="<?php echo $hidebtn;?>"></a></div>
473
- <?php endif;?>
474
- </div>
475
- </div>
476
- <?php
477
  }
 
478
  /**
479
  * Add social share bottons to the end of every post/page.
480
  *
@@ -503,6 +512,14 @@ if(is_category())
503
  $shareurl =home_url('/');
504
  $ShareTitle=get_bloginfo('name');
505
  }
 
 
 
 
 
 
 
 
506
  $ShareTitle= htmlspecialchars(urlencode($ShareTitle));
507
 
508
  /* Get All buttons Image */
@@ -587,7 +604,7 @@ endif;
587
 
588
  /* Email */
589
  if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
590
- $shareButtonContent.='<div class="sbutton-post"><div id="ml-p"><a target="_blank" href="mailto:'.$mailMsg.'" alt="Email"><img src="'.$mImg.'"></a></div></div>';
591
  endif;
592
  $shareButtonContent.='</div>';
593
 
@@ -627,13 +644,18 @@ if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
627
  return true;
628
  }
629
  // Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
 
630
  if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
631
  return false;
632
  }
 
 
633
  // If the http_accept header supports wap then it's a mobile too
 
634
  if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"])) {
635
  return true;
636
  }
 
637
  // Still no luck? Let's have a look at the user agent on the browser. If it contains
638
  // any of the following, it's probably a mobile device. Kappow!
639
  if(isset($_SERVER["HTTP_USER_AGENT"])){
98
  function csbwf_sidebar_load_inline_js()
99
  {
100
  $pluginOptionsVal=get_csbwf_sidebar_options();
101
+ $jscnt='<script>
102
+ var windWidth=jQuery( window ).width();
103
+ //alert(windWidth);
104
+ var animateWidth;
105
+ var defaultAnimateWidth;';
106
+ $jscnt.='
107
+ jQuery(document).ready(function()
108
+ {animateWidth="55";
109
+ defaultAnimateWidth= animateWidth-10;';
110
  if($pluginOptionsVal['csbwfs_delayTimeBtn']!='0'):
111
  $jscnt.='jQuery("#delaydiv").hide();
112
  setTimeout(function(){
115
 
116
  if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
117
  $jscnt.='jQuery("div#tw a").hover(function(){
118
+ jQuery("div#tw a").animate({width:animateWidth});
119
  },function(){
120
+ jQuery("div#tw a").stop( true, true ).animate({width:defaultAnimateWidth});
121
  });';
122
  endif;
123
 
124
  if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
125
  $jscnt.='jQuery("div#fb a").hover(function(){
126
+ jQuery("div#fb a").animate({width:animateWidth});
127
  },function(){
128
+ jQuery("div#fb a").stop( true, true ).animate({width:defaultAnimateWidth});
129
  });';
130
  endif;
131
 
132
  if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
133
  $jscnt.='jQuery("div#ml a").hover(function(){
134
+ jQuery("div#ml a").animate({width:animateWidth});
135
  },function(){
136
+ jQuery("div#ml a").stop( true, true ).animate({width:defaultAnimateWidth});
137
  });';
138
  endif;
139
 
140
  if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):
141
  $jscnt.='jQuery("div#gp a").hover(function(){
142
+ jQuery("div#gp a").animate({width:animateWidth});
143
  },function(){
144
+ jQuery("div#gp a").stop( true, true ).animate({width:defaultAnimateWidth});
145
  });';
146
  endif;
147
 
148
  if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
149
  $jscnt.='jQuery("div#li a").hover(function(){
150
+ jQuery("div#li a").animate({width:animateWidth});
151
  },function(){
152
+ jQuery("div#li a").stop( true, true ).animate({width:defaultAnimateWidth});
153
  });';
154
  endif;
155
 
156
  if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
157
  $jscnt.='jQuery("div#pin a").hover(function(){
158
+ jQuery("div#pin a").animate({width:animateWidth});
159
  },function(){
160
+ jQuery("div#pin a").stop( true, true ).animate({width:defaultAnimateWidth});
161
  });';
162
  endif;
163
 
164
  if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
165
  $jscnt.='jQuery("div#yt a").hover(function(){
166
+ jQuery("div#yt a").animate({width:animateWidth});
167
  },function(){
168
+ jQuery("div#yt a").stop( true, true ).animate({width:defaultAnimateWidth});
169
  });';
170
  endif;
171
  if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
172
  $jscnt.='jQuery("div#re a").hover(function(){
173
+ jQuery("div#re a").animate({width:animateWidth});
174
  },function(){
175
+ jQuery("div#re a").stop( true, true ).animate({width:defaultAnimateWidth});
176
  });';
177
  endif;
178
 
179
  if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
180
  $jscnt.='jQuery("div#st a").hover(function(){
181
+ jQuery("div#st a").animate({width:animateWidth});
182
  },function(){
183
+ jQuery("div#st a").stop( true, true ).animate({width:defaultAnimateWidth});
184
  });';
185
  endif;
186
 
209
  jQuery("div.show").hide();
210
  jQuery("div.hide").show();
211
  }';
212
+
213
 
214
+ $jscnt.='});
215
+
216
+ </script>';
217
 
218
  echo $jscnt;
219
  }
279
  $shareurl =home_url('/');
280
  $ShareTitle=get_bloginfo('name');
281
  }
282
+
283
+ /* Set title and url for home page */
284
+ if(is_home() || is_front_page())
285
+ {
286
+ $shareurl =home_url('/');
287
+ $ShareTitle=get_bloginfo('name');
288
+ }
289
+
290
  $ShareTitle= htmlspecialchars(urlencode($ShareTitle));
291
 
292
 
401
  //get mail button message
402
  if($pluginOptionsVal['csbwfs_share_msg']!=''){ $sharemsg=$pluginOptionsVal['csbwfs_share_msg'];}
403
  else{$sharemsg='Share This With Your Friends';}
404
+
405
  /** Check display Show/Hide button or not*/
406
  if(isset($pluginOptionsVal['csbwfs_rmSHBtn']) && $pluginOptionsVal['csbwfs_rmSHBtn']!=''):
407
  $isActiveHideShowBtn='yes';
408
  else:
409
  $isActiveHideShowBtn='no';
410
  endif;
411
+ $flitingSidebarContent='<div id="delaydiv"><div class="social-widget" '.$idName.' title="'.$sharemsg.'" '.$style.'>';
412
+
413
+ if($isActiveHideShowBtn!='yes') :
414
+ $flitingSidebarContent .= '<div class="show"><a href="javascript:" alt="'.$showbtn.'" id="show"><img src="'.plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$showImg).'" title="'.$showbtn.'"></a></div>';
415
+ endif;
416
+
417
+ $flitingSidebarContent .= '<div id="social-inner">';
418
+
419
+ /** FB */
420
+ if($pluginOptionsVal['csbwfs_fpublishBtn']!=''):
421
+ $flitingSidebarContent .='<div class="sbutton"><div id="fb"><a href="https://www.facebook.com/sharer/sharer.php?u='.$shareurl.'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600\');return false;" target="_blank" alt="Share on Facebook" '.$fImgbg.'> <img src="'.$fImg.'"></a></div></div>';
422
+ endif;
423
+
424
+ /** TW */
425
+ if($pluginOptionsVal['csbwfs_tpublishBtn']!=''):
426
+ $flitingSidebarContent .='<div class="sbutton"><div id="tw"><a href="javascript:" onclick="window.open(\'http://twitter.com/share?url='.$shareurl.'&text='.$ShareTitle.'\',\'_blank\',\'width=800,height=300\')" alt="Twitter" '.$tImgbg.'><img src="'.$tImg.'"></a></div></div>';
427
+ endif;
428
+
429
+ /** GP */
430
+ if($pluginOptionsVal['csbwfs_gpublishBtn']!=''):
431
+ $flitingSidebarContent .='<div class="sbutton"><div id="gp"><a href="https://plus.google.com/share?url='.$shareurl.'" onclick="javascript:window.open(this.href,\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" alt="Google Plus" '.$gImgbg.'><img src="'.$gImg.'"></a></div></div>';
432
+ endif;
433
+
434
+ /** LI */
435
+ if($pluginOptionsVal['csbwfs_lpublishBtn']!=''):
436
+ $flitingSidebarContent .='<div class="sbutton"><div id="li"><a href="https://www.linkedin.com/cws/share?mini=true&url='. $shareurl.'" onclick="javascript:window.open(this.href,\'\',\'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=800\');return false;" alt="Google Plus" '.$lImgbg.'><img src="'.$lImg.'"></a></div></div>';
437
+ endif;
438
+
439
+ /** PIN */
440
+ if($pluginOptionsVal['csbwfs_ppublishBtn']!=''):
441
+ $flitingSidebarContent .='<div class="sbutton"><div id="pin"><a onclick="window.open(\'http://pinterest.com/pin/create/button/?url='.$shareurl.'&amp;media='.$pinShareImg.'&amp;description='.$ShareTitle.' :'.$shareurl.'\',\'pinIt\',\'toolbar=0,status=0,width=800,height=500\');" href="javascript:void(0);" '.$pImgbg.'><img src="'.$pImg.'"></a></div></div>';
442
+ endif;
443
+
444
+ /** YT */
445
+ if(isset($pluginOptionsVal['csbwfs_ytpublishBtn']) && $pluginOptionsVal['csbwfs_ytpublishBtn']!=''):
446
+ $flitingSidebarContent .='<div class="sbutton"><div id="yt"><a onclick="window.open(\''.$pluginOptionsVal['csbwfs_ytPath'].'\');" href="javascript:void(0);" '.$ytImgbg.'><img src="'.$ytImg.'"></a></div></div>';
447
+ endif;
448
+
449
+ /** Reddit */
450
+ if(isset($pluginOptionsVal['csbwfs_republishBtn']) && $pluginOptionsVal['csbwfs_republishBtn']!=''):
451
+ $flitingSidebarContent .='<div class="sbutton"><div id="re"><a onclick="window.open(\'http://reddit.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Reddit\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$reImgbg.'><img src="'.$reImg.'"></a></div></div>';
452
+ endif;
453
+
454
+ /** Stumbleupon */
455
+ if(isset($pluginOptionsVal['csbwfs_stpublishBtn']) && $pluginOptionsVal['csbwfs_stpublishBtn']!=''):
456
+ $flitingSidebarContent .='<div class="sbutton"><div id="st"><a <a onclick="window.open(\'http://www.stumbleupon.com/submit?url='.$shareurl.'&amp;title='.$ShareTitle.'\',\'Stumbleupon\',\'toolbar=0,status=0,width=1000,height=800\');" href="javascript:void(0);" '.$stImgbg.'><img src="'. $stImg.'"></a></div></div>';
457
+ endif;
458
+
459
+ /** Mail*/
460
+ if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
461
+ $flitingSidebarContent .='<div class="sbutton"><div id="ml"><a href="mailto:'.$mailMsg.'" alt="Email" '.$mImgbg.'><img src="'.$mImg.'"></a></div></div>';
462
+ endif;
463
+
464
+ $flitingSidebarContent .='</div>'; //End social-inner
465
+
466
+ if($isActiveHideShowBtn!='yes') :
467
+ $flitingSidebarContent .='<div class="hide"><a href="javascript:" alt="'.$hidebtn.'" id="hide"><img src="'.plugins_url('custom-share-buttons-with-floating-sidebar/images/'.$hideImg).'" title="'.$hidebtn.'"></a></div>';
468
+ endif;
469
+
470
+ $flitingSidebarContent .='</div></div>'; //End social-inner
471
+
472
+
473
+ /** Check conditions */
474
+ // Returns the content.
475
+
476
+ if(isset($pluginOptionsVal['csbwfs_hide_home'])){$hideOnHome=$pluginOptionsVal['csbwfs_hide_home']; }else{ $hideOnHome='';}
477
+
478
+ if((is_home() && $hideOnHome=='yes' ) || (is_front_page() && $hideOnHome=='yes' )):
479
+ $flitingSidebarContent='';
480
+ endif;
481
+
482
+ print $flitingSidebarContent;
483
+
484
+
 
 
 
 
 
 
 
 
 
485
  }
486
+
487
  /**
488
  * Add social share bottons to the end of every post/page.
489
  *
512
  $shareurl =home_url('/');
513
  $ShareTitle=get_bloginfo('name');
514
  }
515
+
516
+ /* Set title and url for home page */
517
+ if(is_home() || is_front_page())
518
+ {
519
+ $shareurl =home_url('/');
520
+ $ShareTitle=get_bloginfo('name');
521
+ }
522
+
523
  $ShareTitle= htmlspecialchars(urlencode($ShareTitle));
524
 
525
  /* Get All buttons Image */
604
 
605
  /* Email */
606
  if($pluginOptionsVal['csbwfs_mpublishBtn']!=''):
607
+ $shareButtonContent.='<div class="sbutton-post"><div id="ml-p"><a href="mailto:'.$mailMsg.'" alt="Email"><img src="'.$mImg.'"></a></div></div>';
608
  endif;
609
  $shareButtonContent.='</div>';
610
 
644
  return true;
645
  }
646
  // Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
647
+ if(isset($_SERVER["HTTP_USER_AGENT"])):
648
  if(strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
649
  return false;
650
  }
651
+ endif;
652
+
653
  // If the http_accept header supports wap then it's a mobile too
654
+ if(isset($_SERVER["HTTP_ACCEPT"])):
655
  if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"])) {
656
  return true;
657
  }
658
+ endif;
659
  // Still no luck? Let's have a look at the user agent on the browser. If it contains
660
  // any of the following, it's probably a mobile device. Kappow!
661
  if(isset($_SERVER["HTTP_USER_AGENT"])){
custom-share-buttons-with-floating-sidebar.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.mrwebsolution.in/
5
  Description: "custom-share-buttons-with-floating-sidebar" is the very simple plugin for add to social share buttons with float sidebar. Even you can change the share buttons images if you wish
6
  Author: Raghunath
7
  Author URI: http://raghunathgurjar.wordpress.com
8
- Version: 1.6
9
  */
10
 
11
  /* Copyright YEAR PLUGIN_AUTHOR_NAME (email : raghunath.0087@gmail.com)
@@ -85,6 +85,8 @@ function csbwf_sidebar_init(){
85
  register_setting('csbwf_sidebar_options','csbwfs_page_hide_page');
86
  register_setting('csbwf_sidebar_options','csbwfs_page_hide_archive');
87
 
 
 
88
  register_setting('csbwf_sidebar_options','csbwfs_page_fb_image');
89
  register_setting('csbwf_sidebar_options','csbwfs_page_tw_image');
90
  register_setting('csbwf_sidebar_options','csbwfs_page_li_image');
@@ -215,6 +217,7 @@ function csbwf_sidebar_admin_option_page(){ ?>
215
  <th>&nbsp;</th>
216
  <td><input type="checkbox" id="csbwfs_deactive_for_mob" name="csbwfs_deactive_for_mob" value="yes" <?php if(get_option('csbwfs_deactive_for_mob')=='yes'){echo 'checked="checked"';}?>/> <strong><?php _e('Disable Sidebar For Mobile','csbwfs');?></strong></td>
217
  </tr>
 
218
  <tr><td colspan="2"><strong><h4>Social Share Button Images 36X34 (Optional) :</h4></strong></td></tr>
219
  <tr>
220
  <th><?php echo 'Facebook:';?></th>
@@ -318,7 +321,7 @@ function csbwf_sidebar_admin_option_page(){ ?>
318
  <input type="textbox" id="csbwfs_btn_text" name="csbwfs_btn_text" value="<?php echo get_option('csbwfs_btn_text'); ?>" placeholder="Share This!" size="20"/>
319
  </td>
320
  </tr>
321
- <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 if(get_option('csbwfs_page_hide_home')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> Page <input type="checkbox" id="csbwfs_page_hide_page" value="yes" name="csbwfs_page_hide_page" <?php if(get_option('csbwfs_page_hide_page')!='yes'){echo '';}else { echo 'checked="checked"';}?>/> Post <input type="checkbox" id="csbwfs_page_hide_post" value="yes" name="csbwfs_page_hide_post" <?php if(get_option('csbwfs_page_hide_post')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> Archive <input type="checkbox" id="csbwfs_page_hide_archive" value="yes" name="csbwfs_page_hide_archive" <?php if(get_option('csbwfs_page_hide_archive')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> <br>
322
  </td></tr>
323
 
324
  <tr><td colspan="2"><strong><h4>Social Share Button Images 31X30 (Optional) :</h4></strong></td></tr>
5
  Description: "custom-share-buttons-with-floating-sidebar" is the very simple plugin for add to social share buttons with float sidebar. Even you can change the share buttons images if you wish
6
  Author: Raghunath
7
  Author URI: http://raghunathgurjar.wordpress.com
8
+ Version: 1.7
9
  */
10
 
11
  /* Copyright YEAR PLUGIN_AUTHOR_NAME (email : raghunath.0087@gmail.com)
85
  register_setting('csbwf_sidebar_options','csbwfs_page_hide_page');
86
  register_setting('csbwf_sidebar_options','csbwfs_page_hide_archive');
87
 
88
+ register_setting('csbwf_sidebar_options','csbwfs_hide_home');
89
+
90
  register_setting('csbwf_sidebar_options','csbwfs_page_fb_image');
91
  register_setting('csbwf_sidebar_options','csbwfs_page_tw_image');
92
  register_setting('csbwf_sidebar_options','csbwfs_page_li_image');
217
  <th>&nbsp;</th>
218
  <td><input type="checkbox" id="csbwfs_deactive_for_mob" name="csbwfs_deactive_for_mob" value="yes" <?php if(get_option('csbwfs_deactive_for_mob')=='yes'){echo 'checked="checked"';}?>/> <strong><?php _e('Disable Sidebar For Mobile','csbwfs');?></strong></td>
219
  </tr>
220
+ <tr><th>&nbsp;</th><td><input type="checkbox" id="csbwfs_hide_home" value="yes" name="csbwfs_hide_home" <?php if(get_option('csbwfs_hide_home')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> <strong>Hide Sidebar On Home Page </strong></td></tr>
221
  <tr><td colspan="2"><strong><h4>Social Share Button Images 36X34 (Optional) :</h4></strong></td></tr>
222
  <tr>
223
  <th><?php echo 'Facebook:';?></th>
321
  <input type="textbox" id="csbwfs_btn_text" name="csbwfs_btn_text" value="<?php echo get_option('csbwfs_btn_text'); ?>" placeholder="Share This!" size="20"/>
322
  </td>
323
  </tr>
324
+ <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 if(get_option('csbwfs_page_hide_home')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> Page <input type="checkbox" id="csbwfs_page_hide_page" value="yes" name="csbwfs_page_hide_page" <?php if(get_option('csbwfs_page_hide_page')!='yes'){echo '';}else { echo 'checked="checked"';}?>/> Post <input type="checkbox" id="csbwfs_page_hide_post" value="yes" name="csbwfs_page_hide_post" <?php if(get_option('csbwfs_page_hide_post')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> Category/Archive <input type="checkbox" id="csbwfs_page_hide_archive" value="yes" name="csbwfs_page_hide_archive" <?php if(get_option('csbwfs_page_hide_archive')!='yes'){echo '';}else{echo 'checked="checked"';}?>/> <br>
325
  </td></tr>
326
 
327
  <tr><td colspan="2"><strong><h4>Social Share Button Images 31X30 (Optional) :</h4></strong></td></tr>
images/overlay.png ADDED
Binary file
readme.txt CHANGED
@@ -3,23 +3,19 @@ Contributors:india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4
4
  Tags: social share buttons,custom share buttons,facebook, twitter, google+, share, share links,linkedin,Stumbleupon,Reddit,pinterest,floating sidebar,float,floating share buttons,float share buttons
5
  Requires at least: 2.7
6
- Tested up to: 4.0.1
7
- Stable tag: 1.6
8
 
9
- Add Social Share Buttons With Floating Sidebar
10
-
11
- (Facebook,Twitter,Linkedin,Google+,Pinterest,Youtube,Mail,Stumbleupon,Reddit)
12
 
13
  == Description ==
14
 
15
- "custom-share-buttons-with-floating-sidebar" is the very simple plugin for share your site with your friends through social sites (Facebook,Twitter,Linkedin,Pinterest,Google+,Stumbleupon,Reddit).
16
-
17
- You can add a floating sidebar with all social buttons and Even you can change the share buttons images from admin if you wish!.
18
 
19
  There are not added any external JS files in this plugin so it's does not effect on your site speed as well.
20
-
21
- Live [demo](http://www.gurukulalwar.com/)
22
-
23
  = Features =
24
 
25
  * Options for add to Custom Image of any buttons
@@ -34,6 +30,23 @@ Live [demo](http://www.gurukulalwar.com/)
34
  * Option for disable sidebar for mobile
35
  * Option for define the pinterest share image
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  == Installation ==
39
 
@@ -86,6 +99,12 @@ Step 3. Go to Settings/"Custom Share Buttons with Floating Sidebar" and configur
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
89
  = 1.6 =
90
  * Added new option for disable floating sidebar for mobile site
91
  * Added two new Stumbleupon and Reddit buttons
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4
4
  Tags: social share buttons,custom share buttons,facebook, twitter, google+, share, share links,linkedin,Stumbleupon,Reddit,pinterest,floating sidebar,float,floating share buttons,float share buttons
5
  Requires at least: 2.7
6
+ Tested up to: 4.1
7
+ Stable tag: 1.7
8
 
9
+ Add Social Share Buttons Using Floating Sidebar On Your Site (Facebook,Twitter,Linkedin,Google+,Pinterest,Youtube,Mail,Stumbleupon,Reddit)
 
 
10
 
11
  == Description ==
12
 
13
+ "custom-share-buttons-with-floating-sidebar" is the very simple plugin for share your site with your friends through social sites (Facebook,Twitter,Linkedin,Pinterest,Google+,Stumbleupon,Reddit).You can add a floating sidebar with all social buttons and Even you can change the share buttons images from admin if you wish!.
 
 
14
 
15
  There are not added any external JS files in this plugin so it's does not effect on your site speed as well.
16
+
17
+ **[Upgrade to Pro Version](http://www.mrwebsolution.in/wordpress-plugins/custom-share-buttons-with-floating-sidebar/)**
18
+
19
  = Features =
20
 
21
  * Options for add to Custom Image of any buttons
30
  * Option for disable sidebar for mobile
31
  * Option for define the pinterest share image
32
 
33
+ **[Upgrade to Pro Version](http://www.mrwebsolution.in/wordpress-plugins/custom-share-buttons-with-floating-sidebar/)**
34
+
35
+ = Go Pro =
36
+
37
+ We have also 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:
38
+
39
+ * Responsive Floating Sidebar
40
+ * Hide Floating Sidebar On Home/Post/Page/Category
41
+ * Responsive Light-box Contact Form (for Mail Icon)
42
+ * Option for add the "Contact Form 7" into light box
43
+ * Advance Feature For Choose To Pinterest Share Image
44
+ * Option for Show/Hide sidebar on any specific page/post
45
+ * Option (OG Tags) for define facebook share content (image,content)
46
+ * Faster support via private forum
47
+
48
+ **[Live Demo](http://www.gurukulalwar.com/)**
49
+
50
 
51
  == Installation ==
52
 
99
 
100
  == Changelog ==
101
 
102
+ = 1.7 =
103
+ * Released Pro Version
104
+ * Added an option disable floating sidebar on home page
105
+ * Fixed share url issue on home page
106
+
107
+
108
  = 1.6 =
109
  * Added new option for disable floating sidebar for mobile site
110
  * Added two new Stumbleupon and Reddit buttons