Add Twitter, Facebook Like, Google plus one Social share - Version 2.1.0

Version Description

  • Added LinkedIn Share button
Download this release

Release Info

Developer BeingMaverick
Plugin Icon wp plugin Add Twitter, Facebook Like, Google plus one Social share
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.0 to 2.1.0

Files changed (5) hide show
  1. readme.txt +10 -3
  2. tf_admin_page.php +44 -12
  3. tf_display.php +16 -6
  4. tfg_style.css +4 -8
  5. twitter-facebook-share.php +1 -1
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Add Twitter, Facebook Like, Google plus one Social share ===
2
  Contributors: beingmaverick
3
  Plugin Site: http://www.searchtechword.com
4
- Tags: Facebook like, twitter button, twitter share, Google +1 (plus one) button, Google plus one, Stumbleupon, social share, twitter facebook share, google +1 share
5
  Requires at least: 2.8+
6
  Tested up to: 3.2
7
- Stable tag: 2.0.0
8
 
9
  == Description ==
10
  <br />
@@ -12,7 +12,7 @@ Stable tag: 2.0.0
12
  [Plugin Home Page](http://www.searchtechword.com/2011/06/wordpress-plugin-add-twitter-facebook-google-plus-one-share)
13
  <br />
14
  <br />
15
- This plugin is the most efficient way to integrate the important social share buttons like twitter, facebook like, google +1 (plus one) and stumbleupon in three different position and styles.
16
 
17
  * Automatically display the social share buttons Above the post, below the post, both above and below or floating left side of post.
18
 
@@ -57,6 +57,9 @@ You can Check Screen Shots on my website. I use the same plugin to display Socia
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 2.0.0 =
61
  * Added shortcode [tfg_social_share]
62
  * Option to disable social share for individual post and pages.
@@ -85,6 +88,10 @@ You can Check Screen Shots on my website. I use the same plugin to display Socia
85
 
86
  == Upgrade Notice ==
87
 
 
 
 
 
88
  = 2.0.0 =
89
 
90
  3 new features and few bug fixes.
1
  === Add Twitter, Facebook Like, Google plus one Social share ===
2
  Contributors: beingmaverick
3
  Plugin Site: http://www.searchtechword.com
4
+ Tags: Facebook like, twitter button, twitter share,LinkedIn, Google +1 (plus one) button, Google plus one, Stumbleupon, social share, twitter facebook share, google +1 share
5
  Requires at least: 2.8+
6
  Tested up to: 3.2
7
+ Stable tag: 2.1.0
8
 
9
  == Description ==
10
  <br />
12
  [Plugin Home Page](http://www.searchtechword.com/2011/06/wordpress-plugin-add-twitter-facebook-google-plus-one-share)
13
  <br />
14
  <br />
15
+ This plugin is the most efficient way to integrate the important social share buttons like twitter, facebook like, google +1 (plus one), LinkedIn and stumbleupon in three different position and styles.
16
 
17
  * Automatically display the social share buttons Above the post, below the post, both above and below or floating left side of post.
18
 
57
 
58
  == Changelog ==
59
 
60
+ = 2.1.0 =
61
+ * Added LinkedIn Share button
62
+
63
  = 2.0.0 =
64
  * Added shortcode [tfg_social_share]
65
  * Option to disable social share for individual post and pages.
88
 
89
  == Upgrade Notice ==
90
 
91
+ = 2.1.0 =
92
+
93
+ Added LinkedIn Share button
94
+
95
  = 2.0.0 =
96
 
97
  3 new features and few bug fixes.
tf_admin_page.php CHANGED
@@ -19,7 +19,8 @@ $active_buttons = array(
19
  'facebook_like'=>'Facebook like',
20
  'twitter'=>'Twitter',
21
  'stumbleupon'=>'Stumbleupon',
22
- 'Google_plusone'=>'Google PlusOne'
 
23
  );
24
 
25
  $show_in = array(
@@ -60,9 +61,12 @@ $show_in = array(
60
  $option['float_position'] = esc_html($_POST['twitter_facebook_share_float_position']);
61
  $option['twitter_count'] = (isset($_POST['twitter_facebook_share_twitter_count']) and $_POST['twitter_facebook_share_twitter_count']=='on') ? true : false;
62
  $option['google_count'] = (isset($_POST['twitter_facebook_share_google_count']) and $_POST['twitter_facebook_share_google_count']=='on') ? true : false;
 
63
  $option['google_width'] = esc_html($_POST['twitter_facebook_share_google_width']);
64
  $option['facebook_like_width'] = esc_html($_POST['twitter_facebook_share_facebook_like_width']);
65
  $option['twitter_width'] = esc_html($_POST['twitter_facebook_share_twitter_width']);
 
 
66
  update_option($option_name, $option);
67
  // Put a settings updated message on the screen
68
  $out .= '<div class="updated"><p><strong>'.__('Settings saved.', 'menu-test' ).'</strong></p></div>';
@@ -88,6 +92,7 @@ $show_in = array(
88
  $auto = ($option['auto']) ? 'checked="checked"' : '';
89
  $google_count = ($option['google_count']) ? 'checked="checked"' : '';
90
  $twitter_count = ($option['twitter_count']) ? 'checked="checked"' : '';
 
91
 
92
  $out .= '
93
  <div class="wrap">
@@ -214,20 +219,35 @@ $show_in = array(
214
  <table>
215
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Facebook Button width", 'menu-test' ).':</td>
216
  <td style="padding-bottom:20px;">
217
- <input type="text" name="twitter_facebook_share_facebook_like_width" value="'.stripslashes($option['facebook_like_width']).'" size="10">px<br />
218
  </td>
219
  <td style="padding-bottom:20px; padding-left:50px; padding-right:10px;" valign="top">'.__("Google +1 Button width", 'menu-test' ).':</td>
220
  <td style="padding-bottom:20px;">
221
- <input type="text" name="twitter_facebook_share_google_width" value="'.stripslashes($option['google_width']).'" size="10">px<br />
222
- </td></tr>
 
 
 
 
 
223
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Twitter Button width", 'menu-test' ).':</td>
224
  <td style="padding-bottom:20px;">
225
- <input type="text" name="twitter_facebook_share_twitter_width" value="'.stripslashes($option['twitter_width']).'" size="10"> px <br />
226
- </td></tr>
 
 
 
 
 
227
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Google +1 counter", 'menu-test' ).':</td>
228
  <td style="padding-bottom:20px;">
229
  <input type="checkbox" name="twitter_facebook_share_google_count" '.$google_count.' />
230
- </td></tr>
 
 
 
 
 
231
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Twitter counter", 'menu-test' ).':</td>
232
  <td style="padding-bottom:20px;">
233
  <input type="checkbox" name="twitter_facebook_share_twitter_count" '.$twitter_count.' />
@@ -329,14 +349,23 @@ function twitter_facebook_share_get_options_stored () {
329
  $option['facebook_like_width'] = '85';
330
  }
331
  if (!isset($option['twitter_width'])) {
332
- $option['twitter_width'] = '85';
333
  }
334
  if (!isset($option['google_width'])) {
335
- $option['google_width'] = '85';
 
 
 
 
 
 
336
  }
337
  if (!isset($option['twitter_count'])) {
338
  $option['twitter_count'] = true;
339
  }
 
 
 
340
  if (!isset($option['google_count'])) {
341
  $option['google_count'] = true;
342
  }
@@ -346,7 +375,7 @@ function twitter_facebook_share_get_options_stored () {
346
  function twitter_facebook_share_get_options_default ($position='above', $border='flat', $color='#F0F4F9',$left_space='60px',$bottom_space='40%', $float_position='fixed') {
347
  $option = array();
348
  $option['auto'] = true;
349
- $option['active_buttons'] = array('facebook_like'=>true, 'twitter'=>true, 'stumbleupon'=>true, 'Google_plusone'=>true);
350
  $option['show_in'] = array('posts'=>true, 'pages'=>true, 'home_page'=>true, 'tags'=>true, 'categories'=>true, 'authors'=>true, 'search'=>true,'date_arch'=>true);
351
  $option['position'] = $position;
352
  $option['border'] = $border;
@@ -357,10 +386,13 @@ function twitter_facebook_share_get_options_default ($position='above', $border=
357
  $option['bottom_space'] = $bottom_space;
358
  $option['float_position'] = $float_position;
359
  $option['facebook_like_width'] = '85';
360
- $option['twitter_width'] = '85';
361
- $option['google_width'] = '85';
 
 
362
  $option['google_count'] = true;
363
  $option['twitter_count'] = true;
 
364
  return $option;
365
  }
366
  ?>
19
  'facebook_like'=>'Facebook like',
20
  'twitter'=>'Twitter',
21
  'stumbleupon'=>'Stumbleupon',
22
+ 'Google_plusone'=>'Google PlusOne',
23
+ 'linkedin'=>'LinkedIn'
24
  );
25
 
26
  $show_in = array(
61
  $option['float_position'] = esc_html($_POST['twitter_facebook_share_float_position']);
62
  $option['twitter_count'] = (isset($_POST['twitter_facebook_share_twitter_count']) and $_POST['twitter_facebook_share_twitter_count']=='on') ? true : false;
63
  $option['google_count'] = (isset($_POST['twitter_facebook_share_google_count']) and $_POST['twitter_facebook_share_google_count']=='on') ? true : false;
64
+ $option['linkedin_count'] = (isset($_POST['twitter_facebook_share_linkedin_count']) and $_POST['twitter_facebook_share_linkedin_count']=='on') ? true : false;
65
  $option['google_width'] = esc_html($_POST['twitter_facebook_share_google_width']);
66
  $option['facebook_like_width'] = esc_html($_POST['twitter_facebook_share_facebook_like_width']);
67
  $option['twitter_width'] = esc_html($_POST['twitter_facebook_share_twitter_width']);
68
+ $option['linkedin_width'] = esc_html($_POST['twitter_facebook_share_linkedin_width']);
69
+ $option['stumbleupon_width'] = esc_html($_POST['twitter_facebook_share_stumbleupon_width']);
70
  update_option($option_name, $option);
71
  // Put a settings updated message on the screen
72
  $out .= '<div class="updated"><p><strong>'.__('Settings saved.', 'menu-test' ).'</strong></p></div>';
92
  $auto = ($option['auto']) ? 'checked="checked"' : '';
93
  $google_count = ($option['google_count']) ? 'checked="checked"' : '';
94
  $twitter_count = ($option['twitter_count']) ? 'checked="checked"' : '';
95
+ $linkedin_count = ($option['linkedin_count']) ? 'checked="checked"' : '';
96
 
97
  $out .= '
98
  <div class="wrap">
219
  <table>
220
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Facebook Button width", 'menu-test' ).':</td>
221
  <td style="padding-bottom:20px;">
222
+ <input type="text" name="twitter_facebook_share_facebook_like_width" value="'.stripslashes($option['facebook_like_width']).'" size="5">px<br />
223
  </td>
224
  <td style="padding-bottom:20px; padding-left:50px; padding-right:10px;" valign="top">'.__("Google +1 Button width", 'menu-test' ).':</td>
225
  <td style="padding-bottom:20px;">
226
+ <input type="text" name="twitter_facebook_share_google_width" value="'.stripslashes($option['google_width']).'" size="5">px<br />
227
+ </td>
228
+ <td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Stumbleupon Button width", 'menu-test' ).':</td>
229
+ <td style="padding-bottom:20px;">
230
+ <input type="text" name="twitter_facebook_share_stumbleupon_width" value="'.stripslashes($option['stumbleupon_width']).'" size="10"> px <br />
231
+ </td>
232
+ </tr>
233
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Twitter Button width", 'menu-test' ).':</td>
234
  <td style="padding-bottom:20px;">
235
+ <input type="text" name="twitter_facebook_share_twitter_width" value="'.stripslashes($option['twitter_width']).'" size="5"> px <br />
236
+ </td>
237
+ <td style="padding-bottom:20px; padding-left:50px; padding-right:10px;" valign="top">'.__("Linkedin Button width", 'menu-test' ).':</td>
238
+ <td style="padding-bottom:20px;">
239
+ <input type="text" name="twitter_facebook_share_linkedin_width" value="'.stripslashes($option['linkedin_width']).'" size="5"> px <br />
240
+ </td>
241
+ </tr>
242
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Google +1 counter", 'menu-test' ).':</td>
243
  <td style="padding-bottom:20px;">
244
  <input type="checkbox" name="twitter_facebook_share_google_count" '.$google_count.' />
245
+ </td>
246
+ <td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("LinkedIn counter", 'menu-test' ).':</td>
247
+ <td style="padding-bottom:20px;">
248
+ <input type="checkbox" name="twitter_facebook_share_linkedin_count" '.$linkedin_count.' />
249
+ </td>
250
+ </tr>
251
  <tr><td style="padding-bottom:20px; padding-right:10px;" valign="top">'.__("Twitter counter", 'menu-test' ).':</td>
252
  <td style="padding-bottom:20px;">
253
  <input type="checkbox" name="twitter_facebook_share_twitter_count" '.$twitter_count.' />
349
  $option['facebook_like_width'] = '85';
350
  }
351
  if (!isset($option['twitter_width'])) {
352
+ $option['twitter_width'] = '95';
353
  }
354
  if (!isset($option['google_width'])) {
355
+ $option['google_width'] = '80';
356
+ }
357
+ if (!isset($option['linkedin_width'])) {
358
+ $option['linkedin_width'] = '105';
359
+ }
360
+ if (!isset($option['stumbleupon_width'])) {
361
+ $option['stumbleupon_width'] = '85';
362
  }
363
  if (!isset($option['twitter_count'])) {
364
  $option['twitter_count'] = true;
365
  }
366
+ if (!isset($option['linkedin_count'])) {
367
+ $option['linkedin_count'] = true;
368
+ }
369
  if (!isset($option['google_count'])) {
370
  $option['google_count'] = true;
371
  }
375
  function twitter_facebook_share_get_options_default ($position='above', $border='flat', $color='#F0F4F9',$left_space='60px',$bottom_space='40%', $float_position='fixed') {
376
  $option = array();
377
  $option['auto'] = true;
378
+ $option['active_buttons'] = array('facebook_like'=>true, 'twitter'=>true, 'stumbleupon'=>true, 'Google_plusone'=>true, 'linkedin'=>true);
379
  $option['show_in'] = array('posts'=>true, 'pages'=>true, 'home_page'=>true, 'tags'=>true, 'categories'=>true, 'authors'=>true, 'search'=>true,'date_arch'=>true);
380
  $option['position'] = $position;
381
  $option['border'] = $border;
386
  $option['bottom_space'] = $bottom_space;
387
  $option['float_position'] = $float_position;
388
  $option['facebook_like_width'] = '85';
389
+ $option['twitter_width'] = '95';
390
+ $option['linkedin_width'] = '105';
391
+ $option['stumbleupon_width'] = '85';
392
+ $option['google_width'] = '80';
393
  $option['google_count'] = true;
394
  $option['twitter_count'] = true;
395
+ $option['linkedin_count'] = true;
396
  return $option;
397
  }
398
  ?>
tf_display.php CHANGED
@@ -20,6 +20,9 @@ function twitter_facebook_share_init() {
20
  if ($option['active_buttons']['Google_plusone']==true) {
21
  wp_enqueue_script('twitter_facebook_share_google', 'http://apis.google.com/js/plusone.js','','',$option['jsload']);
22
  }
 
 
 
23
 
24
  wp_enqueue_style('tfg_style', '/wp-content/plugins/twitter-facebook-google-plusone-share/tfg_style.css');
25
 
@@ -198,6 +201,9 @@ function kc_social_share($source)
198
  $output .= '
199
  <div class="buttons"><script src="http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r='.$post_link.'"></script></div>';
200
  }
 
 
 
201
  $output .= '</div><div style="clear:both"></div>';
202
  return $output;
203
  }
@@ -205,7 +211,7 @@ function kc_social_share($source)
205
 
206
  if (($option['position'] == 'below') || ($option['position'] == 'above') || ($option['position'] == 'both'))
207
  {
208
- $output = '<div id="bottomcontainerBox" style="' .$border. $bkcolor. '">';
209
  if ($option['active_buttons']['facebook_like']==true) {
210
  $output .= '
211
  <div style="float:left; width:' .$option['facebook_like_width']. 'px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
@@ -220,11 +226,6 @@ function kc_social_share($source)
220
  </div>';
221
  }
222
 
223
- if ($option['active_buttons']['stumbleupon']==true) {
224
- $output .= '
225
- <div style="float:left; width:85px; padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r='.$post_link.'"></script></div>';
226
- }
227
-
228
  if ($option['active_buttons']['twitter']==true) {
229
  $data_count = ($option['twitter_count']) ? 'horizontal' : 'none';
230
  if ($option['twitter_id'] != ''){
@@ -239,6 +240,15 @@ function kc_social_share($source)
239
  </div>';
240
  }
241
  }
 
 
 
 
 
 
 
 
 
242
  $output .= '
243
  </div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>';
244
 
20
  if ($option['active_buttons']['Google_plusone']==true) {
21
  wp_enqueue_script('twitter_facebook_share_google', 'http://apis.google.com/js/plusone.js','','',$option['jsload']);
22
  }
23
+ if ($option['active_buttons']['linkedin']==true) {
24
+ wp_enqueue_script('twitter_facebook_share_linkedin', 'http://platform.linkedin.com/in.js','','',$option['jsload']);
25
+ }
26
 
27
  wp_enqueue_style('tfg_style', '/wp-content/plugins/twitter-facebook-google-plusone-share/tfg_style.css');
28
 
201
  $output .= '
202
  <div class="buttons"><script src="http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r='.$post_link.'"></script></div>';
203
  }
204
+ if ($option['active_buttons']['linkedin']==true) {
205
+ $output .= '<div class="buttons" style="padding-left:0px;"><script type="in/share" data-url="' . $post_link . '" data-counter="top"></script></div>';
206
+ }
207
  $output .= '</div><div style="clear:both"></div>';
208
  return $output;
209
  }
211
 
212
  if (($option['position'] == 'below') || ($option['position'] == 'above') || ($option['position'] == 'both'))
213
  {
214
+ $output = '<div class="bottomcontainerBox" style="' .$border. $bkcolor. '">';
215
  if ($option['active_buttons']['facebook_like']==true) {
216
  $output .= '
217
  <div style="float:left; width:' .$option['facebook_like_width']. 'px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
226
  </div>';
227
  }
228
 
 
 
 
 
 
229
  if ($option['active_buttons']['twitter']==true) {
230
  $data_count = ($option['twitter_count']) ? 'horizontal' : 'none';
231
  if ($option['twitter_id'] != ''){
240
  </div>';
241
  }
242
  }
243
+ if ($option['active_buttons']['linkedin']==true) {
244
+ $counter = ($option['linkedin_count']) ? 'right' : '';
245
+ $output .= '<div style="float:left; width:' .$option['linkedin_width']. 'px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script type="in/share" data-url="' . $post_link . '" data-counter="' .$counter. '"></script></div>';
246
+ }
247
+ if ($option['active_buttons']['stumbleupon']==true) {
248
+ $output .= '
249
+ <div style="float:left; width:' .$option['stumbleupon_width']. 'px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r='.$post_link.'"></script></div>';
250
+ }
251
+
252
  $output .= '
253
  </div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>';
254
 
tfg_style.css CHANGED
@@ -2,26 +2,22 @@
2
 
3
  #leftcontainerBox {
4
  float:left;
5
- z-index: 1;
6
  }
7
 
8
  #leftcontainerBox .buttons {
9
  float:left;
10
  clear:both;
11
  margin:4px 4px 4px 4px;
12
- width:55px;
13
  height:60px;
14
  padding-bottom:2px;
 
15
  }
16
 
17
- #bottomcontainerBox {
18
  float:left;
19
  height:30px;
20
  width:100%;
21
  }
22
 
23
- #bottomcontainerBox .buttons {
24
- float:left;
25
- height:30px;
26
- margin:4px 4px 4px 4px;
27
- }
2
 
3
  #leftcontainerBox {
4
  float:left;
5
+ z-index: 1000;
6
  }
7
 
8
  #leftcontainerBox .buttons {
9
  float:left;
10
  clear:both;
11
  margin:4px 4px 4px 4px;
12
+ width:60px;
13
  height:60px;
14
  padding-bottom:2px;
15
+ padding-left:3px;
16
  }
17
 
18
+ .bottomcontainerBox {
19
  float:left;
20
  height:30px;
21
  width:100%;
22
  }
23
 
 
 
 
 
 
twitter-facebook-share.php CHANGED
@@ -5,7 +5,7 @@ Description: WordPress plugin for twitter, facebook, Google +1 (plus one) and ot
5
  Author: Kunal Chichkar
6
  Author URI: http://www.searchtechword.com
7
  Plugin URI: http://www.searchtechword.com/2011/06/wordpress-plugin-add-twitter-facebook-google-plus-one-share
8
- Version: 2.0.0
9
  License: GPL
10
  */
11
  /*
5
  Author: Kunal Chichkar
6
  Author URI: http://www.searchtechword.com
7
  Plugin URI: http://www.searchtechword.com/2011/06/wordpress-plugin-add-twitter-facebook-google-plus-one-share
8
+ Version: 2.1.0
9
  License: GPL
10
  */
11
  /*