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

Version Description

  • Pinterest support (Pin it button)
  • Option to display custom Share image from URL
  • Select image to use for Facebook sharing (Facebook thumbnail)
  • Share buttons can now be hidden inside template files (by setting $HUPSO_SHOW
Download this release

Release Info

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

Code changes from version 3.8 to 3.9

buttons/PinExt.png ADDED
Binary file
img/services/pinterest.png ADDED
Binary file
js/create_button.js CHANGED
@@ -136,6 +136,10 @@ function hupso_create_code() {
136
 
137
  hupso_url = $.trim($("input:text[name=page_url]").val());
138
  hupso_title = $.trim($("input:text[name=page_title]").val());
 
 
 
 
139
  hupso_counters_lang = $("#hupso_counters_lang option:selected").val();
140
 
141
  hupso_background_color = $.trim($("input:text[name=background_color]").val()).toUpperCase();
@@ -176,14 +180,21 @@ function hupso_create_code() {
176
  hupso_services += '"facebook_send"';
177
  counters_preview += ' <img src="http://static.hupso.com/share/img/counters/facebook_send.png" />';
178
  }
179
- }
180
-
181
  // google +1
182
  var google_plus_one = $("input:checkbox[name=google_plus_one]:checked").val();
183
  if (google_plus_one == 1) {
184
  hupso_services += '"google"';
185
  counters_preview += '<span style="padding-left:20px;"><img src="http://static.hupso.com/share/img/counters/google_plus_one.png" /></span>';
186
  }
 
 
 
 
 
 
 
187
 
188
  // linkedin
189
  var linkedin_share = $("input:checkbox[name=linkedin_share]:checked").val();
@@ -205,6 +216,8 @@ function hupso_create_code() {
205
  hupso_services += '"Facebook",';
206
  if ( $( "input:checkbox[name=googleplus]:checked" ).val() == 1 )
207
  hupso_services += '"Google Plus",';
 
 
208
  if ( $( "input:checkbox[name=linkedin]:checked" ).val() == 1 )
209
  hupso_services += '"Linkedin",';
210
  if ( $( "input:checkbox[name=stumbleupon]:checked" ).val() == 1 )
@@ -355,7 +368,7 @@ function hupso_create_code() {
355
 
356
  switch ( button_type ) {
357
  case 'share_button':
358
- code += '<img src="http://static.hupso.com/share/buttons/'+bsize+'.png" width="'+bwidth+'" height="'+bheight+'" border="0" alt="Share"/>';
359
  break;
360
  case 'share_toolbar':
361
  if ( share_image == 'hide' ) {
@@ -363,10 +376,10 @@ switch ( button_type ) {
363
  share_image_lang = '';
364
  }
365
  if ( share_image == 'custom') {
366
- code += '<img src="' + share_image_custom_url + '" border="0" style="padding-top:5px; float:left;" alt="Share"/>';
367
  }
368
  else {
369
- code += '<img src="http://static.hupso.com/share/buttons/'+share_image_lang+toolbar_share+'.png" border="0" style="padding-top:5px; float:left;" alt="Share"/>';
370
  }
371
  break;
372
  case 'counters':
@@ -376,10 +389,10 @@ switch ( button_type ) {
376
  share_image_lang = '';
377
  }
378
  if ( share_image == 'custom') {
379
- code += '<img src="' + share_image_custom_url + '" border="0" style="padding-top:5px; float:left;" alt="Share"/>';
380
  }
381
  else {
382
- code += '<img src="http://static.hupso.com/share/buttons/'+share_image_lang + share_url + '.png" border="0" style="padding-top:2px; float:left;" alt="Share"/>';
383
  }
384
 
385
  break;
136
 
137
  hupso_url = $.trim($("input:text[name=page_url]").val());
138
  hupso_title = $.trim($("input:text[name=page_title]").val());
139
+
140
+ var title_dec = $('<div />').html(hupso_title).text();
141
+ hupso_title = title_dec.replace(/\"/g,'&quot;');
142
+
143
  hupso_counters_lang = $("#hupso_counters_lang option:selected").val();
144
 
145
  hupso_background_color = $.trim($("input:text[name=background_color]").val()).toUpperCase();
180
  hupso_services += '"facebook_send"';
181
  counters_preview += ' <img src="http://static.hupso.com/share/img/counters/facebook_send.png" />';
182
  }
183
+ }
184
+
185
  // google +1
186
  var google_plus_one = $("input:checkbox[name=google_plus_one]:checked").val();
187
  if (google_plus_one == 1) {
188
  hupso_services += '"google"';
189
  counters_preview += '<span style="padding-left:20px;"><img src="http://static.hupso.com/share/img/counters/google_plus_one.png" /></span>';
190
  }
191
+
192
+ // pinterest
193
+ var pinterest_pin = $("input:checkbox[name=pinterest_pin]:checked").val();
194
+ if (pinterest_pin == 1) {
195
+ hupso_services += '"pinterest"';
196
+ counters_preview += '<span style="padding-left:20px;"><img src="http://static.hupso.com/share/buttons/PinExt.png" /></span>';
197
+ }
198
 
199
  // linkedin
200
  var linkedin_share = $("input:checkbox[name=linkedin_share]:checked").val();
216
  hupso_services += '"Facebook",';
217
  if ( $( "input:checkbox[name=googleplus]:checked" ).val() == 1 )
218
  hupso_services += '"Google Plus",';
219
+ if ( $( "input:checkbox[name=pinterest]:checked" ).val() == 1 )
220
+ hupso_services += '"Pinterest",';
221
  if ( $( "input:checkbox[name=linkedin]:checked" ).val() == 1 )
222
  hupso_services += '"Linkedin",';
223
  if ( $( "input:checkbox[name=stumbleupon]:checked" ).val() == 1 )
368
 
369
  switch ( button_type ) {
370
  case 'share_button':
371
+ code += '<img src="http://static.hupso.com/share/buttons/'+bsize+'.png" width="'+bwidth+'" height="'+bheight+'" border="0" alt="Share Button"/>';
372
  break;
373
  case 'share_toolbar':
374
  if ( share_image == 'hide' ) {
376
  share_image_lang = '';
377
  }
378
  if ( share_image == 'custom') {
379
+ code += '<img src="' + share_image_custom_url + '" border="0" style="padding-top:5px; float:left; padding-right:5px;" alt="Share Button"/>';
380
  }
381
  else {
382
+ code += '<img src="http://static.hupso.com/share/buttons/'+share_image_lang+toolbar_share+'.png" border="0" style="padding-top:5px; float:left;" alt="Share Button"/>';
383
  }
384
  break;
385
  case 'counters':
389
  share_image_lang = '';
390
  }
391
  if ( share_image == 'custom') {
392
+ code += '<img src="' + share_image_custom_url + '" border="0" style="padding-top:5px; float:left; padding-right:5px;" alt="Share Button"/>';
393
  }
394
  else {
395
+ code += '<img src="http://static.hupso.com/share/buttons/'+share_image_lang + share_url + '.png" border="0" style="padding-top:2px; float:left;" alt="Share Button"/>';
396
  }
397
 
398
  break;
readme.txt CHANGED
@@ -4,15 +4,15 @@ 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.1
7
- Stable tag: 3.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Help visitors share your posts on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit and others.
12
 
13
  == Description ==
14
 
15
- 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.
16
 
17
  These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
18
 
@@ -20,8 +20,8 @@ These services are used by millions of people every day, so sharing your content
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.
@@ -35,6 +35,7 @@ These services are used by millions of people every day, so sharing your content
35
  * Sidebar widget
36
  * Use of shortcodes inside template files
37
  * Display staring stats for whole website or for each page individually
 
38
 
39
 
40
  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.
@@ -84,6 +85,10 @@ Then drag Hupso Share Buttons Widget from left and drop it on the sidebar on the
84
  Add this PHP code inside template files at position where you want to show share buttons: echo do_shortcode('[hupso]');
85
  You can configure share buttons in plugin settings.
86
 
 
 
 
 
87
  = Can I use shortcodes inside widget text? =
88
 
89
  Yes, you can. Just include [hupso] anywhere in widget text area and share buttons will be displayed there.
@@ -113,7 +118,7 @@ Please look at *Screenshots* for more information.
113
 
114
  = Are share buttons using Javascript? =
115
 
116
- Yes. Javascript is required for sharing buttons to function properly and it must be enabled. Menu/toolbar/preview interface for share buttons is loaded at run-time from our servers so we can add minor enhancements and fix browser bugs the moment they are discovered without forcing you to upgrade the plugin all the time. Some button images are loaded from your local Wordpress installation and some from our servers. Counters load javascript code from Twitter, Facebook, Google and Linkedin.
117
 
118
  = Are share buttons free? =
119
 
@@ -134,6 +139,7 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
134
 
135
  == Screenshots ==
136
 
 
137
  1. Share Toolbar and Counters on the same page (demo)
138
  2. Counters (Twitter Tweet, Facebook Like, Google +1, Linkedin Share)
139
  3. Share Toolbar (big)
@@ -144,8 +150,15 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
144
  8. Share buttons under post, sidebar widget and text widget - Spanish version (73 languages available)
145
  9. Share buttons under post, sidebar widget and text widget - Chinese version (73 languages available)
146
 
 
147
  == Changelog ==
148
 
 
 
 
 
 
 
149
  = 3.8 =
150
  * Option to show or hide share buttons for search pages
151
  * Option to use custom title and url for sharing (useful if you want counters to show sharing stats for your whole website, not for each page individually)
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.1
7
+ Stable tag: 3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Help visitors share your posts on popular social networks: Twitter, Facebook, Google Plus, Linkedin, Pinterest, StumbleUpon, Digg, Reddit and others.
12
 
13
  == Description ==
14
 
15
+ 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, Pinterest, StumbleUpon, Digg, Reddit, Bebo and Delicous.
16
 
17
  These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
18
 
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, Pinterest, StumbleUpon, Digg, Reddit, Bebo, Delicious.
24
+ * Social media counters: Twitter Tweet, Facebook Like, Google +1, Linkedin Share, Pinterest - Pin it
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.
35
  * Sidebar widget
36
  * Use of shortcodes inside template files
37
  * Display staring stats for whole website or for each page individually
38
+ * Select image to use for Facebook sharing (Facebook thumbnail)
39
 
40
 
41
  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.
85
  Add this PHP code inside template files at position where you want to show share buttons: echo do_shortcode('[hupso]');
86
  You can configure share buttons in plugin settings.
87
 
88
+ = How can I hide share buttons inside template files? =
89
+
90
+ Use this code: $HUPSO_SHOW = false; Make sure you do this before div id="content". This will hide the buttons in content. Share buttons will still show in widget (if used).
91
+
92
  = Can I use shortcodes inside widget text? =
93
 
94
  Yes, you can. Just include [hupso] anywhere in widget text area and share buttons will be displayed there.
118
 
119
  = Are share buttons using Javascript? =
120
 
121
+ Yes. Javascript is required for sharing buttons to function properly and it must be enabled. Menu/toolbar/preview interface for share buttons is loaded at run-time from our servers so we can add minor enhancements and fix browser bugs the moment they are discovered without forcing you to upgrade the plugin all the time. Some button images are loaded from your local Wordpress installation and some from our servers. Counters load javascript code from Twitter, Facebook, Google, Linkedin, Pinterest or from other social services that are selected.
122
 
123
  = Are share buttons free? =
124
 
139
 
140
  == Screenshots ==
141
 
142
+
143
  1. Share Toolbar and Counters on the same page (demo)
144
  2. Counters (Twitter Tweet, Facebook Like, Google +1, Linkedin Share)
145
  3. Share Toolbar (big)
150
  8. Share buttons under post, sidebar widget and text widget - Spanish version (73 languages available)
151
  9. Share buttons under post, sidebar widget and text widget - Chinese version (73 languages available)
152
 
153
+
154
  == Changelog ==
155
 
156
+ = 3.9 =
157
+ * Pinterest support (Pin it button)
158
+ * Option to display custom Share image from URL
159
+ * Select image to use for Facebook sharing (Facebook thumbnail)
160
+ * Share buttons can now be hidden inside template files (by setting $HUPSO_SHOW = false anywhere before div id="content")
161
+
162
  = 3.8 =
163
  * Option to show or hide share buttons for search pages
164
  * Option to use custom title and url for sharing (useful if you want counters to show sharing stats for your whole website, not for each page individually)
share-buttons-hupso.php CHANGED
@@ -3,7 +3,7 @@
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.8
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -14,6 +14,8 @@ Domain Path: /languages
14
  $hupso_dev = '';
15
  $hupso_state = 'normal';
16
 
 
 
17
  $hupso_plugin_url = plugins_url() . '/hupso-share-buttons-for-twitter-facebook-google';
18
  add_filter( 'the_content', 'hupso_the_content', 10 );
19
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
@@ -30,10 +32,10 @@ add_action( 'admin_head', 'hupso_admin_head' );
30
  add_action( 'wp_head', 'hupso_set_facebook_thumbnail', 1 );
31
 
32
  $hupso_all_services = array(
33
- 'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
34
  );
35
  $hupso_default_services = array(
36
- 'Twitter', 'Facebook', 'Google Plus', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
37
  );
38
 
39
  add_action('widgets_init', 'hupso_widget_init');
@@ -71,6 +73,7 @@ function hupso_plugin_uninstall() {
71
  delete_option( 'hupso_toolbar_size' );
72
  delete_option( 'hupso_share_image' );
73
  delete_option( 'hupso_share_image_lang' );
 
74
  delete_option( 'hupso_menu_type' );
75
  delete_option( 'hupso_button_position' );
76
  delete_option( 'hupso_show_posts' );
@@ -82,6 +85,7 @@ function hupso_plugin_uninstall() {
82
  delete_option( 'hupso_facebook_like' );
83
  delete_option( 'hupso_facebook_send' );
84
  delete_option( 'hupso_google_plus_one' );
 
85
  delete_option( 'hupso_linkedin_share' );
86
  delete_option( 'hupso_counters_lang' );
87
  delete_option( 'hupso_share_buttons_code' );
@@ -96,6 +100,8 @@ function hupso_plugin_uninstall() {
96
  delete_option( 'hupso_delicious' );
97
  delete_option( 'hupso_title_text' );
98
  delete_option( 'hupso_twitter_via' );
 
 
99
  delete_option( 'hupso_css_style' );
100
  delete_option( 'hupso_widget_text' );
101
  delete_option( 'hupso_password_protected' );
@@ -127,11 +133,49 @@ function hupso_admin_head() {
127
 
128
  function hupso_set_facebook_thumbnail() {
129
  global $post;
 
 
130
  if ( !is_singular() )
131
  return;
132
- if ( ( function_exists('has_post_thumbnail') ) && ( has_post_thumbnail( $post->ID ) ) ) {
133
- $thumb_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
134
- echo '<meta property="og:image" content="' . esc_attr( $thumb_image[0] ) . '"/>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
  }
137
 
@@ -170,17 +214,25 @@ function hupso_admin_settings_show() {
170
  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/>';
171
  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>';
172
  echo '</div>';
 
173
  echo '<div id="tips" style="background: #CCCCFF; padding: 10px 10px 10px 10px; margin-top:30px; ">';
174
  echo '<p><b>' . __('Shortcodes', 'share_buttons_hupso') . '</b></p>';
175
  echo '<p>Use <b>[hupso_hide]</b> anywhere in post\'s text to hide buttons for specific post.</p>';
176
  echo '<p>Use <b>[hupso]</b> anywhere in post\'s text to show buttons for specific post at custom position.</p>';
177
  echo '<p>Use <b>Hupso Share Buttons Widget</b> to show share buttons in sidebar or footer.</p>';
178
  echo '<p>Use <b>echo do_shortcode( \'[hupso]\' ); </b> to show share buttons anywhere inside template files.</p>';
 
179
  echo '</div>';
 
180
  echo '<div id="feedback" style="background: #C7FFA3; padding: 10px 10px 10px 10px; margin-top:30px; ">';
181
  echo '<p><b>Bugs? Comments?</b></p>';
182
  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>';
183
- echo '<p><a href="http://www.hupso.com/share/feedback/" target="_blank">Use this form</a> (opens in new window).</p>';
 
 
 
 
 
184
  echo '</div>';
185
 
186
  echo '</div>';
@@ -189,7 +241,7 @@ function hupso_admin_settings_show() {
189
  $start = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ -->';
190
  $end = '<!-- Hupso Share Buttons -->';
191
  $class_name = 'hupso_pop';
192
- $alt = 'Share';
193
  $class_url = ' href="http://www.hupso.com/share/" ';
194
  $style = 'padding-left:5px; padding-top:5px; padding-bottom:5px; margin:0';
195
 
@@ -306,14 +358,17 @@ function hupso_admin_settings_show() {
306
  $hupso_share_image_show_checked = '';
307
  $hupso_share_image_hide_checked = '';
308
  $hupso_share_image_lang_checked = '';
 
309
  switch ( $hupso_share_image ) {
310
  case '':
311
  case 'show': $hupso_share_image_show_checked = $checked; break;
312
  case 'hide': $hupso_share_image_hide_checked = $checked; break;
313
  case 'lang': $hupso_share_image_lang_checked = $checked; break;
 
314
  }
315
 
316
- $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '');
 
317
 
318
  ?>
319
  <input type="radio" name="hupso_share_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="show" <?php echo $hupso_share_image_show_checked; ?>/> <?php _e('Show in language', 'share_buttons_hupso');?>:
@@ -343,6 +398,7 @@ function hupso_admin_settings_show() {
343
  <option value="cs" <?php if ($hupso_share_image_lang == 'cs') echo ' selected ';?>>Czech</option>
344
  </select><br/>
345
  <input type="radio" name="hupso_share_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="hide" <?php echo $hupso_share_image_hide_checked; ?>/> <?php _e('Hide', 'share_buttons_hupso'); ?><br/>
 
346
  <hr style="height:1px; width:500px;"/>
347
  </td>
348
  </tr>
@@ -364,6 +420,7 @@ function hupso_admin_settings_show() {
364
  $facebook_like_checked = '';
365
  $facebook_send_checked = '';
366
  $google_plus_one_checked = '';
 
367
  $linkedin_share_checked = '';
368
 
369
  $twitter_tweet = get_option( 'hupso_twitter_tweet', '1' );
@@ -378,6 +435,9 @@ function hupso_admin_settings_show() {
378
  $google_plus_one = get_option( 'hupso_google_plus_one', '1' );
379
  if ( $google_plus_one == 1 ) $google_plus_one_checked = $checked;
380
 
 
 
 
381
  $linkedin_share = get_option( 'hupso_linkedin_share', '1' );
382
  if ( $linkedin_share == 1 ) $linkedin_share_checked = $checked;
383
  ?>
@@ -408,6 +468,11 @@ function hupso_admin_settings_show() {
408
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/google_plus_one.png" /></td>
409
  <td></td>
410
  </tr>
 
 
 
 
 
411
  <tr>
412
  <td><input type="checkbox" name="linkedin_share" onclick="hupso_create_code()" value="1" <?php echo $linkedin_share_checked;?> /></td>
413
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/linkedin_share.png" /></td>
@@ -595,10 +660,61 @@ function hupso_admin_settings_show() {
595
  $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
596
 
597
  ?>
598
- @<input type="text" name="hupso_twitter_via" onclick="hupso_create_code()" onchange="hupso_create_code()" onmouseout="hupso_create_code()" size="30" value="<?php echo $hupso_twitter_via; ?>" /> <span style="padding-left:30px;"><?php _e('Add "via @yourprofile" to tweets', 'share_buttons_hupso');?>.</span><br/>
599
  </td>
600
  </tr>
601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
602
  <tr>
603
  <td style="width:100px;"><?php _e('CSS style', 'share_buttons_hupso'); ?></td>
604
  <td><hr style="height:1px; width:400px;" align="left"/>
@@ -636,7 +752,8 @@ function hupso_admin_settings_show() {
636
  <?php
637
  /* page_title */
638
  $checked = ' checked="checked" ';
639
- $hupso_page_title = get_option( 'hupso_page_title', '');
 
640
  ?>
641
  <input type="text" name="page_title" value="<?php echo $hupso_page_title;?>" onchange="hupso_create_code()" onmouseout="hupso_create_code()" size="50" /><br/><?php _e('Enter custom text that will always be used for sharing.', 'share_buttons_hupso'); ?><br/><?php _e('Leave this blank to use title of current page as text for sharing. [Default]', 'share_buttons_hupso'); ?>
642
  </td>
@@ -717,6 +834,15 @@ function hupso_admin_settings_save() {
717
  } else {
718
  $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '');
719
  }
 
 
 
 
 
 
 
 
 
720
 
721
  /* save services */
722
  $hupso_vars = 'var hupso_services=new Array(';
@@ -795,6 +921,9 @@ function hupso_admin_settings_save() {
795
  $google_plus_one = @$_POST[ 'google_plus_one' ];
796
  update_option( 'hupso_google_plus_one', $google_plus_one );
797
 
 
 
 
798
  $linkedin_share = @$_POST[ 'linkedin_share' ];
799
  update_option( 'hupso_linkedin_share', $linkedin_share );
800
  }
@@ -811,6 +940,18 @@ function hupso_admin_settings_save() {
811
  update_option( 'hupso_twitter_via', $hupso_twitter_via );
812
  }
813
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  /* Save CSS style */
815
  if ( $post ) {
816
  $hupso_css_style = @$_POST[ 'hupso_css_style' ];
@@ -864,7 +1005,14 @@ function hupso_the_widget( $content ) {
864
 
865
  function hupso_the_content( $content ) {
866
 
867
- global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state;
 
 
 
 
 
 
 
868
 
869
  /* Do now show share buttons when [hupso_hide] is used */
870
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
@@ -969,7 +1117,7 @@ function hupso_the_content( $content ) {
969
 
970
 
971
  $hupso_page_url = get_option( 'hupso_page_url', '' );
972
- $hupso_page_title = get_option( 'hupso_page_title', '' );
973
 
974
 
975
  /* default code */
@@ -1138,6 +1286,7 @@ function hupso_settings_print_services() {
1138
  }
1139
  $text =' <img src="' . $hupso_plugin_url . '/img/services/' . $service_name . '.png"/> ' . $service_text;
1140
  echo '<input type="checkbox" name="' . $service_name . '" value="1" onclick="hupso_create_code()" ' . $checked . ' /> ' . $text . '<br/>';
 
1141
  }
1142
  }
1143
 
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.9
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
  $hupso_dev = '';
15
  $hupso_state = 'normal';
16
 
17
+ $HUPSO_SHOW = true;
18
+
19
  $hupso_plugin_url = plugins_url() . '/hupso-share-buttons-for-twitter-facebook-google';
20
  add_filter( 'the_content', 'hupso_the_content', 10 );
21
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
32
  add_action( 'wp_head', 'hupso_set_facebook_thumbnail', 1 );
33
 
34
  $hupso_all_services = array(
35
+ 'Twitter', 'Facebook', 'Google Plus', 'Pinterest', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
36
  );
37
  $hupso_default_services = array(
38
+ 'Twitter', 'Facebook', 'Google Plus', 'Pinterest', 'Linkedin', 'StumbleUpon', 'Digg', 'Reddit', 'Bebo', 'Delicious'
39
  );
40
 
41
  add_action('widgets_init', 'hupso_widget_init');
73
  delete_option( 'hupso_toolbar_size' );
74
  delete_option( 'hupso_share_image' );
75
  delete_option( 'hupso_share_image_lang' );
76
+ delete_option( 'hupso_share_image_custom_url' );
77
  delete_option( 'hupso_menu_type' );
78
  delete_option( 'hupso_button_position' );
79
  delete_option( 'hupso_show_posts' );
85
  delete_option( 'hupso_facebook_like' );
86
  delete_option( 'hupso_facebook_send' );
87
  delete_option( 'hupso_google_plus_one' );
88
+ delete_option( 'hupso_pinterest_pin' );
89
  delete_option( 'hupso_linkedin_share' );
90
  delete_option( 'hupso_counters_lang' );
91
  delete_option( 'hupso_share_buttons_code' );
100
  delete_option( 'hupso_delicious' );
101
  delete_option( 'hupso_title_text' );
102
  delete_option( 'hupso_twitter_via' );
103
+ delete_option( 'hupso_facebook_image' );
104
+ delete_option( 'hupso_facebook_custom_image' );
105
  delete_option( 'hupso_css_style' );
106
  delete_option( 'hupso_widget_text' );
107
  delete_option( 'hupso_password_protected' );
133
 
134
  function hupso_set_facebook_thumbnail() {
135
  global $post;
136
+
137
+ /*
138
  if ( !is_singular() )
139
  return;
140
+ */
141
+
142
+ $thumb_image = '';
143
+ $hupso_facebook_image = get_option( 'hupso_facebook_image', 'fch' );
144
+ $hupso_facebook_custom_image = get_option( 'hupso_facebook_custom_image', '' );
145
+
146
+ switch ( $hupso_facebook_image ) {
147
+ case 'header':
148
+ $thumb_image = get_header_image();
149
+ break;
150
+ case 'featured':
151
+ if ( ( function_exists('has_post_thumbnail') ) && ( has_post_thumbnail( $post->ID ) ) ) {
152
+ $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
153
+ $thumb_image = $thumb_image_temp[0];
154
+ }
155
+ break;
156
+ case 'custom':
157
+ $thumb_image = $hupso_facebook_custom_image;
158
+ break;
159
+ case 'none':
160
+ $thumb_image = '';
161
+ break;
162
+ case 'fch': /* featured, custom, header */
163
+ if ( ( function_exists('has_post_thumbnail') ) && ( has_post_thumbnail( $post->ID ) ) ) {
164
+ $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
165
+ $thumb_image = $thumb_image_temp[0];
166
+ break;
167
+ }
168
+ if ( $hupso_facebook_custom_image != '') {
169
+ $thumb_image = $hupso_facebook_custom_image;
170
+ break;
171
+ }
172
+ $thumb_image = get_header_image();
173
+ break;
174
+ }
175
+
176
+
177
+ if ( $thumb_image != '' ) {
178
+ echo '<meta property="og:image" content="' . esc_attr( $thumb_image ) . '"/>';
179
  }
180
  }
181
 
214
  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/>';
215
  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>';
216
  echo '</div>';
217
+
218
  echo '<div id="tips" style="background: #CCCCFF; padding: 10px 10px 10px 10px; margin-top:30px; ">';
219
  echo '<p><b>' . __('Shortcodes', 'share_buttons_hupso') . '</b></p>';
220
  echo '<p>Use <b>[hupso_hide]</b> anywhere in post\'s text to hide buttons for specific post.</p>';
221
  echo '<p>Use <b>[hupso]</b> anywhere in post\'s text to show buttons for specific post at custom position.</p>';
222
  echo '<p>Use <b>Hupso Share Buttons Widget</b> to show share buttons in sidebar or footer.</p>';
223
  echo '<p>Use <b>echo do_shortcode( \'[hupso]\' ); </b> to show share buttons anywhere inside template files.</p>';
224
+ echo '<p>Use <b>$HUPSO_SHOW = false;</b> to hide share buttons inside template files. Make sure you do this before div id="content". This will hide the buttons in content. Share buttons will still show in widget (if used).</p>';
225
  echo '</div>';
226
+
227
  echo '<div id="feedback" style="background: #C7FFA3; padding: 10px 10px 10px 10px; margin-top:30px; ">';
228
  echo '<p><b>Bugs? Comments?</b></p>';
229
  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>';
230
+ echo '<p><a href="http://www.hupso.com/share/feedback/" target="_blank">Use this suggestion form</a></p>';
231
+ echo '</div>';
232
+
233
+ echo '<div id="generic" style="background: #FFDD7F; padding: 10px 10px 10px 10px; margin-top:30px; ">';
234
+ echo '<p><b>Generic HTML code</b></p>';
235
+ echo '<p>If you need generic HTML code for Hupso Share Buttons to use in HTML documents or inside other CMS, you can <a href="http://www.hupso.com/share/" target="_blank">generate the code here</a>.</p>';
236
  echo '</div>';
237
 
238
  echo '</div>';
241
  $start = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ -->';
242
  $end = '<!-- Hupso Share Buttons -->';
243
  $class_name = 'hupso_pop';
244
+ $alt = 'Share Button';
245
  $class_url = ' href="http://www.hupso.com/share/" ';
246
  $style = 'padding-left:5px; padding-top:5px; padding-bottom:5px; margin:0';
247
 
358
  $hupso_share_image_show_checked = '';
359
  $hupso_share_image_hide_checked = '';
360
  $hupso_share_image_lang_checked = '';
361
+ $hupso_share_image_custom_checked = '';
362
  switch ( $hupso_share_image ) {
363
  case '':
364
  case 'show': $hupso_share_image_show_checked = $checked; break;
365
  case 'hide': $hupso_share_image_hide_checked = $checked; break;
366
  case 'lang': $hupso_share_image_lang_checked = $checked; break;
367
+ case 'custom': $hupso_share_image_custom_checked = $checked; break;
368
  }
369
 
370
+ $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '' );
371
+ $hupso_share_image_custom_url = get_option ( 'hupso_share_image_custom_url', '' );
372
 
373
  ?>
374
  <input type="radio" name="hupso_share_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="show" <?php echo $hupso_share_image_show_checked; ?>/> <?php _e('Show in language', 'share_buttons_hupso');?>:
398
  <option value="cs" <?php if ($hupso_share_image_lang == 'cs') echo ' selected ';?>>Czech</option>
399
  </select><br/>
400
  <input type="radio" name="hupso_share_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="hide" <?php echo $hupso_share_image_hide_checked; ?>/> <?php _e('Hide', 'share_buttons_hupso'); ?><br/>
401
+ <input type="radio" name="hupso_share_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="custom" <?php echo $hupso_share_image_custom_checked; ?>/> <?php _e('Custom image from URL', 'share_buttons_hupso'); ?>: <input name="hupso_share_image_custom_url" type="text" onmouseout="hupso_create_code()" onchange="hupso_create_code()" value="<?php echo $hupso_share_image_custom_url;?>" size="50" /><br/><span style="padding-left:30px; font-size:10px;">(<?php _e('Optimal image height: 32px - big, 24px - medium, 16px - small/counters', 'share_buttons_hupso'); ?>)</span><br/>
402
  <hr style="height:1px; width:500px;"/>
403
  </td>
404
  </tr>
420
  $facebook_like_checked = '';
421
  $facebook_send_checked = '';
422
  $google_plus_one_checked = '';
423
+ $pinterest_pin_checked = '';
424
  $linkedin_share_checked = '';
425
 
426
  $twitter_tweet = get_option( 'hupso_twitter_tweet', '1' );
435
  $google_plus_one = get_option( 'hupso_google_plus_one', '1' );
436
  if ( $google_plus_one == 1 ) $google_plus_one_checked = $checked;
437
 
438
+ $pinterest_pin = get_option( 'hupso_pinterest_pin', '1' );
439
+ if ( $pinterest_pin == 1 ) $pinterest_pin_checked = $checked;
440
+
441
  $linkedin_share = get_option( 'hupso_linkedin_share', '1' );
442
  if ( $linkedin_share == 1 ) $linkedin_share_checked = $checked;
443
  ?>
468
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/google_plus_one.png" /></td>
469
  <td></td>
470
  </tr>
471
+ <tr>
472
+ <td><input type="checkbox" name="pinterest_pin" onclick="hupso_create_code()" value="1" <?php echo $pinterest_pin_checked;?> /></td>
473
+ <td><img src="<?php echo $hupso_plugin_url; ?>/buttons/PinExt.png" /></td>
474
+ <td></td>
475
+ </tr>
476
  <tr>
477
  <td><input type="checkbox" name="linkedin_share" onclick="hupso_create_code()" value="1" <?php echo $linkedin_share_checked;?> /></td>
478
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/linkedin_share.png" /></td>
660
  $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
661
 
662
  ?>
663
+ @<input type="text" name="hupso_twitter_via" onclick="hupso_create_code()" onchange="hupso_create_code()" onmouseout="hupso_create_code()" size="30" value="<?php echo $hupso_twitter_via; ?>" /> <span style="padding-left:30px;"><?php _e('Add "via @yourprofile" to tweets', 'share_buttons_hupso', 'share_buttons_hupso');?>.</span><br/>
664
  </td>
665
  </tr>
666
 
667
+ <tr>
668
+ <td style="width:100px;"><?php _e('Image for Facebook thumbnail', 'share_buttons_hupso'); ?></td>
669
+ <td><hr style="height:1px; width:500px;" align="left"/>
670
+ <?php
671
+
672
+ $checked = ' checked="checked" ';
673
+
674
+ /* Facebook image */
675
+ $hupso_facebook_image_header_checked = '';
676
+ $hupso_facebook_image_featured_checked = '';
677
+ $hupso_facebook_image_custom_checked = '';
678
+ $hupso_facebook_image_none_checked = '';
679
+ $hupso_facebook_image_fch_checked = '';
680
+
681
+ $hupso_facebook_image = get_option( 'hupso_facebook_image', 'fch' );
682
+
683
+ switch ( $hupso_facebook_image ) {
684
+ case 'header':
685
+ $hupso_facebook_image_header_checked = $checked;
686
+ break;
687
+ case 'featured':
688
+ $hupso_facebook_image_featured_checked = $checked;
689
+ break;
690
+ case 'custom':
691
+ $hupso_facebook_image_custom_checked = $checked;
692
+ break;
693
+ case 'none':
694
+ $hupso_facebook_image_none_checked = $checked;
695
+ break;
696
+ case 'fch': /* featured, custom, header */
697
+ $hupso_facebook_image_fch_checked = $checked;
698
+ break;
699
+ }
700
+
701
+ /* Facebook custom image */
702
+ $hupso_facebook_custom_image = get_option( 'hupso_facebook_custom_image', '' );
703
+
704
+ /* Other */
705
+ $header_image = trim(get_header_image());
706
+
707
+ ?>
708
+ <span style="font-size:10px"><?php _e('After you change settings here, please wait 24 hours (or more) for Facebook to fetch new thumbnails', 'share_buttons_hupso');?>.</span><br/>
709
+
710
+ <input type="radio" name="hupso_facebook_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="header" <?php echo $hupso_facebook_image_header_checked; ?>/> <?php _e('Header image', 'share_buttons_hupso'); ?> <?php if ( $header_image != '' ) { echo '(<a href="' . $header_image . '" title="' . __( 'Click here to see full header image', 'share_buttons_hupso' ) . '" target="_blank">' . __( 'preview', 'share_buttons_hupso' ) . '</a>)'; } ?><br/>
711
+ <input type="radio" name="hupso_facebook_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="featured" <?php echo $hupso_facebook_image_featured_checked; ?>/> <?php _e('Featured image of post', 'share_buttons_hupso'); ?><br/>
712
+ <input type="radio" name="hupso_facebook_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="custom" <?php echo $hupso_facebook_image_custom_checked; ?>/> <?php _e('Custom image from URL', 'share_buttons_hupso'); ?>: <input type="text" name="hupso_facebook_custom_image" onclick="hupso_create_code()" onchange="hupso_create_code()" onmouseout="hupso_create_code()" size="50" value="<?php echo $hupso_facebook_custom_image; ?>" /><br/>
713
+ <input type="radio" name="hupso_facebook_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="none" <?php echo $hupso_facebook_image_none_checked; ?>/> <?php _e('None', 'share_buttons_hupso'); ?><br/>
714
+ <input type="radio" name="hupso_facebook_image" onclick="hupso_create_code()" onchange="hupso_create_code()" value="fch" <?php echo $hupso_facebook_image_fch_checked; ?>/> <?php _e('FCH - use Featured image of post (if available), then use Custom image (if available), then use Header image (if available)', 'share_buttons_hupso'); ?><br/>
715
+ </td>
716
+ </tr>
717
+
718
  <tr>
719
  <td style="width:100px;"><?php _e('CSS style', 'share_buttons_hupso'); ?></td>
720
  <td><hr style="height:1px; width:400px;" align="left"/>
752
  <?php
753
  /* page_title */
754
  $checked = ' checked="checked" ';
755
+ $hupso_page_title = stripslashes(get_option( 'hupso_page_title', ''));
756
+ $hupso_page_title = htmlentities($hupso_page_title);
757
  ?>
758
  <input type="text" name="page_title" value="<?php echo $hupso_page_title;?>" onchange="hupso_create_code()" onmouseout="hupso_create_code()" size="50" /><br/><?php _e('Enter custom text that will always be used for sharing.', 'share_buttons_hupso'); ?><br/><?php _e('Leave this blank to use title of current page as text for sharing. [Default]', 'share_buttons_hupso'); ?>
759
  </td>
834
  } else {
835
  $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '');
836
  }
837
+
838
+ /* save share_image_custom_url */
839
+ if ( $post ) {
840
+ $hupso_share_image_custom_url = @$_POST[ 'hupso_share_image_custom_url' ];
841
+ update_option( 'hupso_share_image_custom_url', $hupso_share_image_custom_url );
842
+ } else {
843
+ $hupso_share_image_custom_url = get_option ( 'hupso_share_image_custom_url', '');
844
+ }
845
+
846
 
847
  /* save services */
848
  $hupso_vars = 'var hupso_services=new Array(';
921
  $google_plus_one = @$_POST[ 'google_plus_one' ];
922
  update_option( 'hupso_google_plus_one', $google_plus_one );
923
 
924
+ $pinterest_pin = @$_POST[ 'pinterest_pin' ];
925
+ update_option( 'hupso_pinterest_pin', $pinterest_pin );
926
+
927
  $linkedin_share = @$_POST[ 'linkedin_share' ];
928
  update_option( 'hupso_linkedin_share', $linkedin_share );
929
  }
940
  update_option( 'hupso_twitter_via', $hupso_twitter_via );
941
  }
942
 
943
+ /* Save Facebook image */
944
+ if ( $post ) {
945
+ $hupso_facebook_image = @$_POST[ 'hupso_facebook_image' ];
946
+ update_option( 'hupso_facebook_image', $hupso_facebook_image );
947
+ }
948
+
949
+ /* Save Facebook custom image */
950
+ if ( $post ) {
951
+ $hupso_facebook_custom_image = @$_POST[ 'hupso_facebook_custom_image' ];
952
+ update_option( 'hupso_facebook_custom_image', $hupso_facebook_custom_image );
953
+ }
954
+
955
  /* Save CSS style */
956
  if ( $post ) {
957
  $hupso_css_style = @$_POST[ 'hupso_css_style' ];
1005
 
1006
  function hupso_the_content( $content ) {
1007
 
1008
+ global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW;
1009
+
1010
+
1011
+ if ($HUPSO_SHOW == false) {
1012
+ $content = str_ireplace('[hupso_hide]', '', $content);
1013
+ $content = str_ireplace('[hupso]', '', $content);
1014
+ return $content;
1015
+ }
1016
 
1017
  /* Do now show share buttons when [hupso_hide] is used */
1018
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
1117
 
1118
 
1119
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1120
+ $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1121
 
1122
 
1123
  /* default code */
1286
  }
1287
  $text =' <img src="' . $hupso_plugin_url . '/img/services/' . $service_name . '.png"/> ' . $service_text;
1288
  echo '<input type="checkbox" name="' . $service_name . '" value="1" onclick="hupso_create_code()" ' . $checked . ' /> ' . $text . '<br/>';
1289
+
1290
  }
1291
  }
1292