Hupso Share Buttons for Twitter, Facebook & Google+ - Version 3.2

Version Description

  • It is now possible to hide buttons for specific post using shortcode [hupso_hide]
  • It is now possible to show buttons for specific post at custom position using shortcode hupso
  • Text for social networks is now pulled from post's title
  • Fixed a bug where share buttons did not load inside posts for some themes
Download this release

Release Info

Developer kasal
Plugin Icon 128x128 Hupso Share Buttons for Twitter, Facebook & Google+
Version 3.2
Comparing to
See all releases

Code changes from version 3.1 to 3.2

Files changed (2) hide show
  1. readme.txt +27 -6
  2. share-buttons-hupso.php +69 -35
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: kasal
3
  Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google+, social, sharing, stumbleupon, addthis, sharethis, sexybookmarks, addtoany, lockerz, shareaholic
5
  Requires at least: 2.8
6
- Tested up to: 3.4
7
- Stable tag: 3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -16,21 +16,26 @@ Add simple social sharing buttons to your articles. Your visitors will be able t
16
 
17
  These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
18
 
19
- Main features / advantages:
20
 
21
  * Slick, minimalistic design.
22
  * Very small and fast. The code for sharing button is very small (only a few KB), so share buttons will not slow down your website - even on devices with slow network connections.
23
- * All major social networks are supported: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo, Delicious.
24
  * Social media counters: Twitter Tweet, Facebook Like, Google +1, Linkedin Share.
25
  * Compatible with all major web browsers: Firefox, Chrome, Internet Explorer, Safari, Opera.
26
  * Share toolbar works with desktop and mobile devices (mobile phones and tablets). Tested with PC, Apple iOS / iPhone / iPad and Google Android devices.
27
  * Real-time button preview in admin settings.
28
  * Support for right-to-left (RTL) scripts/languages (Arabic, Persian, Urdu, Hebrew, Yiddish, Syriac, Thaana/Dhivehi, N'Ko, Chinese, Japanese).
 
29
 
30
  Share Buttons are very easy to configure. Just select button type, size, position and which social networking services do you want to offer to your visitors.
31
- Button will apear below your articles or on top of them as you choose.
32
 
33
- [Share Buttons Demo](http://www.hupso.com/share/).
 
 
 
 
34
 
35
 
36
  == Installation ==
@@ -46,10 +51,20 @@ Button will apear below your articles or on top of them as you choose.
46
 
47
  From the Wordpress Administration go to "Plugins" and click on "Settings" under plugin name
48
 
 
 
 
 
 
49
  = Which social networks are supported? =
50
 
51
  All major social networks are supported: Twitter, Facebook, Google+, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicious.
52
 
 
 
 
 
 
53
  = What settings are available? =
54
 
55
  From Settings screen you are able to choose:
@@ -95,6 +110,12 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
95
 
96
  == Changelog ==
97
 
 
 
 
 
 
 
98
  = 3.1 =
99
  * Bugfix for Share button not loading properly
100
  * Settings are now deleted on plugin uninstall
3
  Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google+, social, sharing, stumbleupon, addthis, sharethis, sexybookmarks, addtoany, lockerz, shareaholic
5
  Requires at least: 2.8
6
+ Tested up to: 3.5
7
+ Stable tag: 3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
16
 
17
  These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
18
 
19
+ ** Main features / advantages **
20
 
21
  * Slick, minimalistic design.
22
  * Very small and fast. The code for sharing button is very small (only a few KB), so share buttons will not slow down your website - even on devices with slow network connections.
23
+ * All major social networks are supported: Twitter, Facebook (Facebook Share / Facebook Like / Facebook Send), Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo, Delicious.
24
  * Social media counters: Twitter Tweet, Facebook Like, Google +1, Linkedin Share.
25
  * Compatible with all major web browsers: Firefox, Chrome, Internet Explorer, Safari, Opera.
26
  * Share toolbar works with desktop and mobile devices (mobile phones and tablets). Tested with PC, Apple iOS / iPhone / iPad and Google Android devices.
27
  * Real-time button preview in admin settings.
28
  * Support for right-to-left (RTL) scripts/languages (Arabic, Persian, Urdu, Hebrew, Yiddish, Syriac, Thaana/Dhivehi, N'Ko, Chinese, Japanese).
29
+ * Hide or show buttons for specific posts (see shortcodes below)
30
 
31
  Share Buttons are very easy to configure. Just select button type, size, position and which social networking services do you want to offer to your visitors.
32
+ Buttons will appear below your articles or on top of them as you choose.
33
 
34
+ ** Shortcodes **
35
+ Use [hupso_hide] anywhere in post's text to hide buttons for specific post.
36
+ Use [hupso] to show buttons for specific post at custom position using shortcode. They will be shown exactly where this shortcode appears.
37
+
38
+ [Share Buttons Demo](http://www.hupso.com/share/) | [FAQ] (http://wordpress.org/extend/plugins/hupso-share-buttons-for-twitter-facebook-google/faq/) | [Feedback] (http://www.hupso.com/share/feedback/)
39
 
40
 
41
  == Installation ==
51
 
52
  From the Wordpress Administration go to "Plugins" and click on "Settings" under plugin name
53
 
54
+ = How can I hide/show share buttons for specific posts? =
55
+
56
+ You can hide share buttons for specific post using shortcode [hupso_hide]. Add [hupso_hide] anywhere in your post's text and buttons will be hidden.
57
+ You can show share buttons for specific post at custom position using shortcode [hupso]. Add [hupso] in your post's text where you want the buttons to appear.
58
+
59
  = Which social networks are supported? =
60
 
61
  All major social networks are supported: Twitter, Facebook, Google+, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicious.
62
 
63
+ = Buttons are not working properly. What can I do? =
64
+
65
+ Please upgrade the plugin to the latest version. If that does not help then try to reinstall the plugin (uninstall it and install it again).
66
+ If you still have problems then send bug report [using this feedback form](http://www.hupso.com/share/feedback/).
67
+
68
  = What settings are available? =
69
 
70
  From Settings screen you are able to choose:
110
 
111
  == Changelog ==
112
 
113
+ = 3.2 =
114
+ * It is now possible to hide buttons for specific post using shortcode [hupso_hide]
115
+ * It is now possible to show buttons for specific post at custom position using shortcode [hupso] (buttons will be displayed exactly where this shortcode appears)
116
+ * Text for social networks is now pulled from post's title
117
+ * Fixed a bug where share buttons did not load inside posts for some themes
118
+
119
  = 3.1 =
120
  * Bugfix for Share button not loading properly
121
  * Settings are now deleted on plugin uninstall
share-buttons-hupso.php CHANGED
@@ -3,10 +3,12 @@
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
- Version: 3.1
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
 
10
  */
11
 
12
  $hupso_dev = '';
@@ -16,7 +18,7 @@ add_filter( 'the_content', 'hupso_the_content', 10 );
16
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
17
  add_filter( 'the_excerpt', 'hupso_the_content', 100 );
18
 
19
- load_plugin_textdomain( 'share_buttons_hupso', false, dirname( __FILE__ ) . '/languages' );
20
 
21
  if ( is_admin() ) {
22
  add_filter('plugin_action_links', 'hupso_plugin_action_links', 10, 2);
@@ -99,17 +101,16 @@ function hupso_set_facebook_thumbnail() {
99
  }
100
 
101
  function hupso_get_the_excerpt($content) {
102
- remove_filter('the_content', 'hupso_the_content');
103
  return $content;
104
  }
105
 
106
  function hupso_admin_settings_show() {
107
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
108
 
109
- $hupso_share_image = __('Share');
110
 
111
  if ( !current_user_can( 'manage_options' ) ) {
112
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
113
  }
114
 
115
  /* save settings */
@@ -118,27 +119,33 @@ function hupso_admin_settings_show() {
118
  }
119
 
120
  echo '<div class="wrap" style="padding-bottom:100px;"><div class="icon32" id="icon-users"></div>';
121
- echo '<h2>'. __('Hupso Share Buttons for Twitter, Facebook & Google+ (Settings)').'</h2>';
122
  echo '<form name="hupso_settings_form" method="post" action="">';
123
 
124
  echo '<div id="right" style="float:right; width:200px; margin-right:10px; margin-left:20px; margin-top:20px;">';
125
- echo '<div id="button_preview" style="background: #F7FFBF; padding: 10px 10px 10px 10px; "><h3>Preview:</h3><br/>';
126
  echo '<div id="button"></div>';
127
  echo '<div id="move_mouse"><p style="font-size:13px; padding-top: 15px;"><b>Move your mouse over the button to see the sharing menu.</b></p></div><br/><br/>';
128
- echo '<div style="padding-left:40px;"><input class="button-primary" name="submit-preview" type="submit" onclick="hupso_create_code()" value="' . __('Save Settings') . '" /></div>';
129
  echo '</div>';
130
- echo '<div id="feedback" style="background: #C7FFA3; padding: 10px 10px 10px 10px; margin-top:50px; ">';
 
 
 
 
 
131
  echo '<p><b>Bugs? Comments?</b></p>';
132
  echo '<p>We value your feedback. Please send comments, bug reports and suggestions, so we can make this plugin the best social sharing plugin for Wordpress.</p>';
133
  echo '<p><a href="http://www.hupso.com/share/feedback/" target="_blank">Use this form</a> (opens in new window).</p>';
134
  echo '</div>';
 
135
  echo '</div>';
136
 
137
 
138
  $start = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ -->';
139
  $end = '<!-- Hupso Share Buttons -->';
140
  $class_name = 'hupso_pop';
141
- $alt = 'Social Sharing Buttons';
142
  $class_url = ' href="http://www.hupso.com/share/" ';
143
  $style = 'padding-left:5px; padding-top:5px; padding-bottom:5px; margin:0';
144
 
@@ -167,7 +174,7 @@ function hupso_admin_settings_show() {
167
  <div id="button_type">
168
  <table border="0">
169
  <tr>
170
- <td style="width:100px;"><?php _e('Button type'); ?>
171
  </td>
172
  <?php
173
  $hupso_button_type = get_option( 'hupso_button_type', 'share_toolbar' );
@@ -179,7 +186,7 @@ function hupso_admin_settings_show() {
179
  default: $hupso_share_toolbar_checked = $checked;
180
  }
181
  ?>
182
- <td><input type="radio" name="button_type" onclick="hupso_create_code()" value="share_button" <?php echo $hupso_share_button_checked; ?> /> Share Button <br/><img src="<?php echo $hupso_plugin_url.'/buttons/button100x23.png';?>" /><br/><br/>
183
  <input type="radio" name="button_type" onclick="hupso_create_code()" value="share_toolbar" <?php echo $hupso_share_toolbar_checked; ?> /> Share Toolbar <br/><img src="<?php echo $hupso_plugin_url.'/img/share_toolbar_short.png';?>" /><br/><br/>
184
  <input type="radio" name="button_type" onclick="hupso_create_code()" value="counters" <?php echo $hupso_share_counters_checked; ?> /> Counters <br/><img src="<?php echo $hupso_plugin_url.'/img/counters.png';?>" /><br/><br/>
185
  </td>
@@ -191,7 +198,7 @@ function hupso_admin_settings_show() {
191
  <div id="button_style">
192
  <table border="0">
193
  <tr>
194
- <td style="width:100px;"><?php _e('Button size'); ?></td>
195
  <td>
196
  <table border="0">
197
  <tr><td><input type="radio" name="size" value="button60x14" onclick="hupso_create_code()" <?php echo $button60_checked; ?> /></td><td style="padding-right:10px;"><?php echo $button_60_img ?></td></tr>
@@ -208,7 +215,7 @@ function hupso_admin_settings_show() {
208
  <div id="toolbar_size" style="display:none;">
209
  <table border="0">
210
  <tr>
211
- <td style="width:100px;"><?php _e('Toolbar size'); ?></td>
212
  <td style="width:100px">
213
  <?php
214
  $hupso_toolbar_size = get_option( 'hupso_toolbar_size', 'medium' );
@@ -220,9 +227,9 @@ function hupso_admin_settings_show() {
220
  default: $hupso_toolbar_size_medium_checked = $checked;
221
  }
222
  ?>
223
- <input type="radio" name="select_toolbar_size" value="big" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_big_checked; ?> /> Big<br/>
224
- <input type="radio" name="select_toolbar_size" value="medium" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_medium_checked; ?> /> Medium<br/>
225
- <input type="radio" name="select_toolbar_size" value="small" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_small_checked; ?> /> Small<br/>
226
  </tr>
227
  </table>
228
  </div>
@@ -230,7 +237,7 @@ function hupso_admin_settings_show() {
230
  <div id="services">
231
  <table border="0">
232
  <tr>
233
- <td style="width:100px;"><?php _e('Social networks'); ?></td>
234
  <td><hr style="height:1px; width:200px;"/><?php hupso_settings_print_services(); ?></td>
235
  </tr>
236
  </table>
@@ -256,7 +263,7 @@ function hupso_admin_settings_show() {
256
  <div id="counters_config" style="display:none;">
257
  <table border="0">
258
  <tr>
259
- <td style="width:100px;"><?php _e('Social networks'); ?></td>
260
  <td>
261
  <table>
262
  <tr>
@@ -294,7 +301,7 @@ function hupso_admin_settings_show() {
294
  <div id="show_icons">
295
  <table border="0">
296
  <tr>
297
- <td style="width:100px;"><?php _e('Type of menu'); ?></td>
298
  <?php
299
  $menu_type = get_option( 'hupso_menu_type', 'labels' );
300
  $checked = ' checked="checked" ';
@@ -305,15 +312,15 @@ function hupso_admin_settings_show() {
305
  }
306
 
307
  ?>
308
- <td><hr style="height:1px; width:200px;"/><input type="radio" name="menu_type" value="labels" onclick="hupso_create_code()" <?php echo $hupso_labels_checked; ?> /> <?php _e('Show icons and service names'); ?><br/>
309
- <input type="radio" name="menu_type" value="icons" onclick="hupso_create_code()" <?php echo $hupso_icons_checked; ?> /> <?php _e('Show icons only'); ?><br/></td>
310
  </tr>
311
  </table>
312
  </div>
313
 
314
  <table border="0">
315
  <tr>
316
- <td style="width:100px;"><?php _e('Button position'); ?></td>
317
  <?php
318
  $button_position = get_option( 'hupso_button_position', 'below' );
319
  $checked = ' checked="checked" ';
@@ -324,11 +331,11 @@ function hupso_admin_settings_show() {
324
  }
325
  ?>
326
  <td><hr style="height:1px; width:200px;" align="left"/>
327
- <input type="radio" name="hupso_button_position" value="above" <?php echo $hupso_above_checked; ?> /> <?php _e('Above the post'); ?><br/>
328
- <input type="radio" name="hupso_button_position" value="below" <?php echo $hupso_below_checked; ?> /> <?php _e('Below the post'); ?><br/></td>
329
  </tr>
330
  <tr>
331
- <td style="width:100px;"><?php _e('Display options'); ?></td>
332
  <td><hr style="height:1px; width:200px;" align="left"/>
333
  <?php
334
  $checked = ' checked="checked" ';
@@ -345,12 +352,12 @@ function hupso_admin_settings_show() {
345
  else
346
  $hupso_show_category_checked = '';
347
  ?>
348
- <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page - show social buttons in posts on front page'); ?><br/>
349
- <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Categories - show social buttons in posts when viewing categories, tags or dates'); ?><br/>
350
  </td>
351
  </tr>
352
  </table>
353
- <br/><br/><input class="button-primary" name="submit" type="submit" onclick="hupso_create_code()" value="<?php _e('Save Settings'); ?>" />
354
  </form>
355
  </div>
356
 
@@ -476,7 +483,15 @@ function hupso_the_content( $content ) {
476
  return $content;
477
  }
478
 
 
 
 
 
 
 
 
479
  $post_url = get_permalink($GLOBALS['post']->ID);
 
480
 
481
  $hupso_show_frontpage = get_option( 'hupso_show_frontpage' , '1' );
482
  $hupso_show_category = get_option( 'hupso_show_category' , '1' );
@@ -492,7 +507,7 @@ function hupso_the_content( $content ) {
492
 
493
 
494
  /* default code */
495
- $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="http://static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" border="0" style="padding-top:5px; float:left;" alt="Social Share Toolbar"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Google Plus","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
496
 
497
  $code = get_option( 'hupso_share_buttons_code', $share_code );
498
  $button_type = get_option( 'hupso_button_type', 'share_toolbar' );
@@ -551,6 +566,18 @@ function hupso_the_content( $content ) {
551
 
552
  }
553
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  $code .= '</script>';
555
 
556
  switch ( $button_type ) {
@@ -570,10 +597,17 @@ function hupso_the_content( $content ) {
570
 
571
  $position = get_option( 'hupso_button_position', 'below' );
572
 
573
- if ( $position == 'below' )
574
- $new_content = $content . '<p>' . $code . '</p>';
575
- else
576
- $new_content = '<p>' . $code . '</p>' . $content;
 
 
 
 
 
 
 
577
 
578
  return $new_content;
579
 
@@ -605,7 +639,7 @@ function hupso_plugin_action_links( $links, $file ) {
605
 
606
  // check to make sure we are on the correct plugin
607
  if ( $file == $this_plugin ) {
608
- $settings_link = '<a href="options-general.php?page=hupso-share-buttons-for-twitter-facebook-google/share-buttons-hupso.php">' . __('Settings') . '</a>';
609
  array_unshift( $links, $settings_link );
610
  }
611
 
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
+ Version: 3.2
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+ Text Domain: share_buttons_hupso
11
+ Domain Path: /languages
12
  */
13
 
14
  $hupso_dev = '';
18
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
19
  add_filter( 'the_excerpt', 'hupso_the_content', 100 );
20
 
21
+ load_plugin_textdomain( 'share_buttons_hupso', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
22
 
23
  if ( is_admin() ) {
24
  add_filter('plugin_action_links', 'hupso_plugin_action_links', 10, 2);
101
  }
102
 
103
  function hupso_get_the_excerpt($content) {
 
104
  return $content;
105
  }
106
 
107
  function hupso_admin_settings_show() {
108
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
109
 
110
+ $hupso_share_image = __('Share', 'share_buttons_hupso');
111
 
112
  if ( !current_user_can( 'manage_options' ) ) {
113
+ wp_die( __( 'You do not have sufficient permissions to access this page.' , 'share_buttons_hupso') );
114
  }
115
 
116
  /* save settings */
119
  }
120
 
121
  echo '<div class="wrap" style="padding-bottom:100px;"><div class="icon32" id="icon-users"></div>';
122
+ echo '<h2>'. __('Hupso Share Buttons for Twitter, Facebook & Google+ (Settings)', 'share_buttons_hupso').'</h2>';
123
  echo '<form name="hupso_settings_form" method="post" action="">';
124
 
125
  echo '<div id="right" style="float:right; width:200px; margin-right:10px; margin-left:20px; margin-top:20px;">';
126
+ echo '<div id="button_preview" style="background: #F7FFBF; padding: 10px 10px 10px 10px; "><h3>' . __( 'Preview', 'share_buttons_hupso') . '</h3><br/>';
127
  echo '<div id="button"></div>';
128
  echo '<div id="move_mouse"><p style="font-size:13px; padding-top: 15px;"><b>Move your mouse over the button to see the sharing menu.</b></p></div><br/><br/>';
129
+ echo '<div style="padding-left:40px;"><input class="button-primary" name="submit-preview" type="submit" onclick="hupso_create_code()" value="' . __('Save Settings', 'share_buttons_hupso') . '" /></div>';
130
  echo '</div>';
131
+ echo '<div id="tips" style="background: #CCCCFF; padding: 10px 10px 10px 10px; margin-top:30px; ">';
132
+ echo '<p><b>Shortcodes</b></p>';
133
+ echo '<p>Use <b>[hupso_hide]</b> anywhere in post\'s text to hide buttons for specific post.</p>';
134
+ echo '<p>Use <b>[hupso]</b> anywhere in post\'s text to show buttons for specific post at custom position.</p>';
135
+ echo '</div>';
136
+ echo '<div id="feedback" style="background: #C7FFA3; padding: 10px 10px 10px 10px; margin-top:30px; ">';
137
  echo '<p><b>Bugs? Comments?</b></p>';
138
  echo '<p>We value your feedback. Please send comments, bug reports and suggestions, so we can make this plugin the best social sharing plugin for Wordpress.</p>';
139
  echo '<p><a href="http://www.hupso.com/share/feedback/" target="_blank">Use this form</a> (opens in new window).</p>';
140
  echo '</div>';
141
+
142
  echo '</div>';
143
 
144
 
145
  $start = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ -->';
146
  $end = '<!-- Hupso Share Buttons -->';
147
  $class_name = 'hupso_pop';
148
+ $alt = 'Share';
149
  $class_url = ' href="http://www.hupso.com/share/" ';
150
  $style = 'padding-left:5px; padding-top:5px; padding-bottom:5px; margin:0';
151
 
174
  <div id="button_type">
175
  <table border="0">
176
  <tr>
177
+ <td style="width:100px;"><?php _e('Button type', 'share_buttons_hupso'); ?>
178
  </td>
179
  <?php
180
  $hupso_button_type = get_option( 'hupso_button_type', 'share_toolbar' );
186
  default: $hupso_share_toolbar_checked = $checked;
187
  }
188
  ?>
189
+ <td><input type="radio" name="button_type" onclick="hupso_create_code()" value="share_button" <?php echo $hupso_share_button_checked; ?> /> Share Button<br/><img src="<?php echo $hupso_plugin_url.'/buttons/button100x23.png';?>" /><br/><br/>
190
  <input type="radio" name="button_type" onclick="hupso_create_code()" value="share_toolbar" <?php echo $hupso_share_toolbar_checked; ?> /> Share Toolbar <br/><img src="<?php echo $hupso_plugin_url.'/img/share_toolbar_short.png';?>" /><br/><br/>
191
  <input type="radio" name="button_type" onclick="hupso_create_code()" value="counters" <?php echo $hupso_share_counters_checked; ?> /> Counters <br/><img src="<?php echo $hupso_plugin_url.'/img/counters.png';?>" /><br/><br/>
192
  </td>
198
  <div id="button_style">
199
  <table border="0">
200
  <tr>
201
+ <td style="width:100px;"><?php _e('Button size', 'share_buttons_hupso'); ?></td>
202
  <td>
203
  <table border="0">
204
  <tr><td><input type="radio" name="size" value="button60x14" onclick="hupso_create_code()" <?php echo $button60_checked; ?> /></td><td style="padding-right:10px;"><?php echo $button_60_img ?></td></tr>
215
  <div id="toolbar_size" style="display:none;">
216
  <table border="0">
217
  <tr>
218
+ <td style="width:100px;"><?php _e('Toolbar size', 'share_buttons_hupso'); ?></td>
219
  <td style="width:100px">
220
  <?php
221
  $hupso_toolbar_size = get_option( 'hupso_toolbar_size', 'medium' );
227
  default: $hupso_toolbar_size_medium_checked = $checked;
228
  }
229
  ?>
230
+ <input type="radio" name="select_toolbar_size" value="big" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_big_checked; ?> /> <?php _e( 'Big', 'share_buttons_hupso');?> <br/>
231
+ <input type="radio" name="select_toolbar_size" value="medium" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_medium_checked; ?> /> <?php _e( 'Medium', 'share_buttons_hupso');?> <br/>
232
+ <input type="radio" name="select_toolbar_size" value="small" onclick="hupso_create_code()" <?php echo $hupso_toolbar_size_small_checked; ?> /> <?php _e( 'Small', 'share_buttons_hupso');?> <br/>
233
  </tr>
234
  </table>
235
  </div>
237
  <div id="services">
238
  <table border="0">
239
  <tr>
240
+ <td style="width:100px;"><?php _e('Social networks', 'share_buttons_hupso'); ?></td>
241
  <td><hr style="height:1px; width:200px;"/><?php hupso_settings_print_services(); ?></td>
242
  </tr>
243
  </table>
263
  <div id="counters_config" style="display:none;">
264
  <table border="0">
265
  <tr>
266
+ <td style="width:100px;"><?php _e('Social networks', 'share_buttons_hupso'); ?></td>
267
  <td>
268
  <table>
269
  <tr>
301
  <div id="show_icons">
302
  <table border="0">
303
  <tr>
304
+ <td style="width:100px;"><?php _e('Type of menu', 'share_buttons_hupso'); ?></td>
305
  <?php
306
  $menu_type = get_option( 'hupso_menu_type', 'labels' );
307
  $checked = ' checked="checked" ';
312
  }
313
 
314
  ?>
315
+ <td><hr style="height:1px; width:200px;"/><input type="radio" name="menu_type" value="labels" onclick="hupso_create_code()" <?php echo $hupso_labels_checked; ?> /> <?php _e('Show icons and service names', 'share_buttons_hupso'); ?><br/>
316
+ <input type="radio" name="menu_type" value="icons" onclick="hupso_create_code()" <?php echo $hupso_icons_checked; ?> /> <?php _e('Show icons only', 'share_buttons_hupso'); ?><br/></td>
317
  </tr>
318
  </table>
319
  </div>
320
 
321
  <table border="0">
322
  <tr>
323
+ <td style="width:100px;"><?php _e('Button position', 'share_buttons_hupso'); ?></td>
324
  <?php
325
  $button_position = get_option( 'hupso_button_position', 'below' );
326
  $checked = ' checked="checked" ';
331
  }
332
  ?>
333
  <td><hr style="height:1px; width:200px;" align="left"/>
334
+ <input type="radio" name="hupso_button_position" value="above" <?php echo $hupso_above_checked; ?> /> <?php _e('Above the post', 'share_buttons_hupso'); ?><br/>
335
+ <input type="radio" name="hupso_button_position" value="below" <?php echo $hupso_below_checked; ?> /> <?php _e('Below the post', 'share_buttons_hupso'); ?><br/></td>
336
  </tr>
337
  <tr>
338
+ <td style="width:100px;"><?php _e('Display options', 'share_buttons_hupso'); ?></td>
339
  <td><hr style="height:1px; width:200px;" align="left"/>
340
  <?php
341
  $checked = ' checked="checked" ';
352
  else
353
  $hupso_show_category_checked = '';
354
  ?>
355
+ <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page - show social buttons in posts on front page', 'share_buttons_hupso'); ?><br/>
356
+ <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Categories - show social buttons in posts when viewing categories, tags or dates', 'share_buttons_hupso'); ?><br/>
357
  </td>
358
  </tr>
359
  </table>
360
+ <br/><br/><input class="button-primary" name="submit" type="submit" onclick="hupso_create_code()" value="<?php _e('Save Settings', 'share_buttons_hupso'); ?>" />
361
  </form>
362
  </div>
363
 
483
  return $content;
484
  }
485
 
486
+ /* Do now show share buttons when [hupso_hide] is used */
487
+ if ( stripos($content, '[hupso_hide]') !== false ) {
488
+ $content = str_ireplace('[hupso_hide]', '', $content);
489
+ $content = str_ireplace('[hupso]', '', $content);
490
+ return $content;
491
+ }
492
+
493
  $post_url = get_permalink($GLOBALS['post']->ID);
494
+ $post_title = $GLOBALS['post']->post_title;
495
 
496
  $hupso_show_frontpage = get_option( 'hupso_show_frontpage' , '1' );
497
  $hupso_show_category = get_option( 'hupso_show_category' , '1' );
507
 
508
 
509
  /* default code */
510
+ $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="http://static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" border="0" style="padding-top:5px; float:left;" alt="Share"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Google Plus","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
511
 
512
  $code = get_option( 'hupso_share_buttons_code', $share_code );
513
  $button_type = get_option( 'hupso_button_type', 'share_toolbar' );
566
 
567
  }
568
 
569
+ switch ( $button_type ) {
570
+ case 'share_button':
571
+ $code .= 'var hupso_title="' . $post_title . '";';
572
+ break;
573
+ case 'share_toolbar':
574
+ $code .= 'var hupso_title_t="' . $post_title . '";';
575
+ break;
576
+ case 'counters':
577
+ $code .= 'var hupso_title_c="' . $post_title . '";';
578
+ break;
579
+ }
580
+
581
  $code .= '</script>';
582
 
583
  switch ( $button_type ) {
597
 
598
  $position = get_option( 'hupso_button_position', 'below' );
599
 
600
+ if ( stripos($content, '[hupso]') !== false) {
601
+ $new_content = str_ireplace('[hupso]', '<p>' . $code . '</p>', $content);
602
+ }
603
+ else {
604
+ if ( $position == 'below' ) {
605
+ $new_content = $content . '<p>' . $code . '</p>';
606
+ }
607
+ else {
608
+ $new_content = '<p>' . $code . '</p>' . $content;
609
+ }
610
+ }
611
 
612
  return $new_content;
613
 
639
 
640
  // check to make sure we are on the correct plugin
641
  if ( $file == $this_plugin ) {
642
+ $settings_link = '<a href="options-general.php?page=hupso-share-buttons-for-twitter-facebook-google/share-buttons-hupso.php">' . __('Settings', 'share_buttons_hupso') . '</a>';
643
  array_unshift( $links, $settings_link );
644
  }
645