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

Version Description

  • Option to show or hide share buttons in excerpts
Download this release

Release Info

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

Code changes from version 3.9.8 to 3.9.9

Files changed (3) hide show
  1. readme.txt +5 -1
  2. share-buttons-hupso.php +50 -34
  3. style.css +3 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
- Stable tag: 3.9.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -42,6 +42,7 @@ These services are used by millions of people every day, so sharing your content
42
  * Support for SSL (https)
43
  * Email button
44
  * Print button
 
45
 
46
  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.
47
  Buttons will appear below your articles or on top of them (or both) as you choose.
@@ -256,6 +257,9 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
256
 
257
  == Changelog ==
258
 
 
 
 
259
  = 3.9.8 =
260
  * Email button
261
  * Print button
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
+ Stable tag: 3.9.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
42
  * Support for SSL (https)
43
  * Email button
44
  * Print button
45
+ * All share buttons are optional: You can add or remove any button from plugin settings
46
 
47
  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.
48
  Buttons will appear below your articles or on top of them (or both) as you choose.
257
 
258
  == Changelog ==
259
 
260
+ = 3.9.9 =
261
+ * Option to show or hide share buttons in excerpts
262
+
263
  = 3.9.8 =
264
  * Email button
265
  * Print button
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.9.8
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -47,7 +47,7 @@ if ( ! function_exists( 'is_ssl' ) ) {
47
 
48
  add_filter( 'the_content', 'hupso_the_content_normal', 10 );
49
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
50
- add_filter( 'the_excerpt', 'hupso_the_content_normal', 100 );
51
 
52
  load_plugin_textdomain( 'share_buttons_hupso', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
53
 
@@ -120,6 +120,7 @@ function hupso_plugin_uninstall() {
120
  delete_option( 'hupso_show_pages' );
121
  delete_option( 'hupso_show_frontpage' );
122
  delete_option( 'hupso_show_category' );
 
123
  delete_option( 'hupso_show_search' );
124
  delete_option( 'hupso_twitter_tweet' );
125
  delete_option( 'hupso_facebook_like' );
@@ -222,12 +223,6 @@ function hupso_set_facebook_thumbnail() {
222
  }
223
  }
224
 
225
- function hupso_get_the_excerpt($content) {
226
- $content = str_ireplace('[hupso_hide]', '', $content);
227
- $content = str_ireplace('[hupso]', '', $content);
228
- return $content;
229
- }
230
-
231
  function hupso_admin_settings_show() {
232
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
233
 
@@ -637,6 +632,7 @@ function hupso_admin_settings_show() {
637
  $hupso_show_pages_checked = '';
638
  $hupso_show_frontpage_checked = '';
639
  $hupso_show_category_checked = '';
 
640
 
641
  /* posts */
642
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
@@ -659,13 +655,20 @@ function hupso_admin_settings_show() {
659
  else
660
  $hupso_show_frontpage_checked = '';
661
 
662
- /* categories */
663
  $hupso_show_category = get_option( 'hupso_show_category', '1' );
664
  if ( $hupso_show_category == 1 )
665
  $hupso_show_category_checked = $checked;
666
  else
667
  $hupso_show_category_checked = '';
668
 
 
 
 
 
 
 
 
669
  /* search pages */
670
  $hupso_show_search = get_option( 'hupso_show_search', '1');
671
  if ( $hupso_show_search == '1' )
@@ -686,7 +689,9 @@ function hupso_admin_settings_show() {
686
  <input type="checkbox" name="hupso_show_posts" value="1" <?php echo $hupso_show_posts_checked; ?> /> <?php _e('Posts', 'share_buttons_hupso'); ?><br/>
687
  <input type="checkbox" name="hupso_show_pages" value="1" <?php echo $hupso_show_pages_checked; ?> /> <?php _e('Pages', 'share_buttons_hupso'); ?><br/>
688
  <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page', 'share_buttons_hupso'); ?><br/>
689
- <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Categories (categories, tags, dates, authors)', 'share_buttons_hupso'); ?><br/>
 
 
690
  <input type="checkbox" name="hupso_show_search" value="1" <?php echo $hupso_show_search_checked; ?> /> <?php _e('Search pages', 'share_buttons_hupso'); ?><br/>
691
  <input type="checkbox" name="hupso_password_protected" value="1" <?php echo $hupso_password_protected_checked; ?> /> <?php _e('Password protected posts', 'share_buttons_hupso'); ?><br/>
692
 
@@ -1046,6 +1051,9 @@ function hupso_admin_settings_save() {
1046
  $hupso_show_category = @$_POST[ 'hupso_show_category' ];
1047
  update_option( 'hupso_show_category', $hupso_show_category );
1048
 
 
 
 
1049
  $hupso_show_search = @$_POST[ 'hupso_show_search' ];
1050
  update_option( 'hupso_show_search', $hupso_show_search );
1051
 
@@ -1146,13 +1154,33 @@ function hupso_admin_settings_save() {
1146
 
1147
  }
1148
 
1149
-
1150
  function hupso_the_widget( $content ) {
1151
  global $hupso_state;
1152
  $hupso_state = 'widget';
1153
  return hupso_the_content ( $content );
1154
  }
1155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1156
  function hupso_the_content_normal( $content ) {
1157
  global $hupso_state;
1158
  $hupso_state = 'normal';
@@ -1164,22 +1192,19 @@ function hupso_the_content( $content ) {
1164
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p;
1165
 
1166
  if ($HUPSO_SHOW == false) {
1167
- $content = str_ireplace('[hupso_hide]', '', $content);
1168
- $content = str_ireplace('[hupso]', '', $content);
1169
  return $content;
1170
  }
1171
 
1172
  /* Do now show share buttons when [hupso_hide] is used */
1173
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
1174
- $content = str_ireplace('[hupso_hide]', '', $content);
1175
- $content = str_ireplace('[hupso]', '', $content);
1176
  return $content;
1177
  }
1178
 
1179
  /* Do not show share buttons in feeds */
1180
  if ( ($hupso_state == 'normal') && (is_feed()) ) {
1181
- $content = str_ireplace('[hupso_hide]', '', $content);
1182
- $content = str_ireplace('[hupso]', '', $content);
1183
  return $content;
1184
  }
1185
 
@@ -1201,22 +1226,19 @@ function hupso_the_content( $content ) {
1201
 
1202
  $hupso_show_search = get_option( 'hupso_show_search' , '1' );
1203
  if ( ($hupso_state == 'normal') && (is_search()) && ($hupso_show_search != 1) ) {
1204
- $content = str_ireplace('[hupso_hide]', '', $content);
1205
- $content = str_ireplace('[hupso]', '', $content);
1206
  return $content;
1207
  }
1208
 
1209
  $hupso_show_posts = get_option( 'hupso_show_posts' , '1' );
1210
  if ( ($hupso_state == 'normal') && (is_single()) && ($hupso_show_posts != 1) ) {
1211
- $content = str_ireplace('[hupso_hide]', '', $content);
1212
- $content = str_ireplace('[hupso]', '', $content);
1213
  return $content;
1214
  }
1215
 
1216
  $hupso_show_pages = get_option( 'hupso_show_pages' , '1' );
1217
  if ( ($hupso_state == 'normal') && (is_page()) && ($hupso_show_pages != 1) ) {
1218
- $content = str_ireplace('[hupso_hide]', '', $content);
1219
- $content = str_ireplace('[hupso]', '', $content);
1220
  return $content;
1221
  }
1222
 
@@ -1225,14 +1247,12 @@ function hupso_the_content( $content ) {
1225
 
1226
  /* Do not show share buttons if option is disabled */
1227
  if ( ($hupso_state == 'normal') && (is_home()) && ($hupso_show_frontpage != 1) ) {
1228
- $content = str_ireplace('[hupso_hide]', '', $content);
1229
- $content = str_ireplace('[hupso]', '', $content);
1230
  return $content;
1231
  }
1232
  /* Do not show share buttons if option is disabled */
1233
  if ( ($hupso_state == 'normal') && (is_archive()) && ($hupso_show_category != 1) ) {
1234
- $content = str_ireplace('[hupso_hide]', '', $content);
1235
- $content = str_ireplace('[hupso]', '', $content);
1236
  return $content;
1237
  }
1238
 
@@ -1249,8 +1269,7 @@ function hupso_the_content( $content ) {
1249
  $hupso_hide_categories = array();
1250
  }
1251
  if ( ($hupso_state == 'normal') && (@in_array($current_category, (array) $hupso_hide_categories)) ) {
1252
- $content = str_ireplace('[hupso_hide]', '', $content);
1253
- $content = str_ireplace('[hupso]', '', $content);
1254
  return $content;
1255
  }
1256
 
@@ -1272,9 +1291,6 @@ function hupso_the_content( $content ) {
1272
  $post_title = '';
1273
  }
1274
 
1275
-
1276
-
1277
-
1278
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1279
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1280
 
@@ -1360,7 +1376,7 @@ function hupso_the_content( $content ) {
1360
  if ( ($hupso_shortcode_params != '') && ($h_url != '') ) {
1361
  $new_url = $h_url;
1362
  }
1363
-
1364
  switch ( $button_type ) {
1365
  case 'share_button':
1366
  $code .= 'var hupso_url="' . $new_url . '";';
@@ -1430,7 +1446,7 @@ function hupso_the_content( $content ) {
1430
  }
1431
 
1432
  if ( stripos($content, '[hupso]') !== false) {
1433
- $new_content = str_ireplace('[hupso]', '<div' . $hupso_css_out. '>' . $code . '</div>', $content);
1434
  }
1435
  else {
1436
  switch ( $position ) {
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.9
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
47
 
48
  add_filter( 'the_content', 'hupso_the_content_normal', 10 );
49
  add_filter( 'get_the_excerpt', 'hupso_get_the_excerpt', 1);
50
+ add_filter( 'the_excerpt', 'hupso_the_excerpt', 100 );
51
 
52
  load_plugin_textdomain( 'share_buttons_hupso', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
53
 
120
  delete_option( 'hupso_show_pages' );
121
  delete_option( 'hupso_show_frontpage' );
122
  delete_option( 'hupso_show_category' );
123
+ delete_option( 'hupso_show_excerpts' );
124
  delete_option( 'hupso_show_search' );
125
  delete_option( 'hupso_twitter_tweet' );
126
  delete_option( 'hupso_facebook_like' );
223
  }
224
  }
225
 
 
 
 
 
 
 
226
  function hupso_admin_settings_show() {
227
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
228
 
632
  $hupso_show_pages_checked = '';
633
  $hupso_show_frontpage_checked = '';
634
  $hupso_show_category_checked = '';
635
+ $hupso_show_excerpts_checked = '';
636
 
637
  /* posts */
638
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
655
  else
656
  $hupso_show_frontpage_checked = '';
657
 
658
+ /* archive pages (categories, tags, dates, authors) */
659
  $hupso_show_category = get_option( 'hupso_show_category', '1' );
660
  if ( $hupso_show_category == 1 )
661
  $hupso_show_category_checked = $checked;
662
  else
663
  $hupso_show_category_checked = '';
664
 
665
+ /* excerpts */
666
+ $hupso_show_excerpts = get_option( 'hupso_show_excerpts', '1' );
667
+ if ( $hupso_show_excerpts == 1 )
668
+ $hupso_show_excerpts_checked = $checked;
669
+ else
670
+ $hupso_show_excerpts_checked = '';
671
+
672
  /* search pages */
673
  $hupso_show_search = get_option( 'hupso_show_search', '1');
674
  if ( $hupso_show_search == '1' )
689
  <input type="checkbox" name="hupso_show_posts" value="1" <?php echo $hupso_show_posts_checked; ?> /> <?php _e('Posts', 'share_buttons_hupso'); ?><br/>
690
  <input type="checkbox" name="hupso_show_pages" value="1" <?php echo $hupso_show_pages_checked; ?> /> <?php _e('Pages', 'share_buttons_hupso'); ?><br/>
691
  <input type="checkbox" name="hupso_show_frontpage" value="1" <?php echo $hupso_show_frontpage_checked; ?> /> <?php _e('Front page', 'share_buttons_hupso'); ?><br/>
692
+ <input type="checkbox" name="hupso_show_category" value="1" <?php echo $hupso_show_category_checked; ?> /> <?php _e('Archive pages (categories, tags, dates, authors)', 'share_buttons_hupso'); ?><br/>
693
+ <input type="checkbox" name="hupso_show_excerpts" value="1" <?php echo $hupso_show_excerpts_checked; ?> /> <?php _e('Excerpts', 'share_buttons_hupso'); ?><br/>
694
+
695
  <input type="checkbox" name="hupso_show_search" value="1" <?php echo $hupso_show_search_checked; ?> /> <?php _e('Search pages', 'share_buttons_hupso'); ?><br/>
696
  <input type="checkbox" name="hupso_password_protected" value="1" <?php echo $hupso_password_protected_checked; ?> /> <?php _e('Password protected posts', 'share_buttons_hupso'); ?><br/>
697
 
1051
  $hupso_show_category = @$_POST[ 'hupso_show_category' ];
1052
  update_option( 'hupso_show_category', $hupso_show_category );
1053
 
1054
+ $hupso_show_excerpts = @$_POST[ 'hupso_show_excerpts' ];
1055
+ update_option( 'hupso_show_excerpts', $hupso_show_excerpts );
1056
+
1057
  $hupso_show_search = @$_POST[ 'hupso_show_search' ];
1058
  update_option( 'hupso_show_search', $hupso_show_search );
1059
 
1154
 
1155
  }
1156
 
 
1157
  function hupso_the_widget( $content ) {
1158
  global $hupso_state;
1159
  $hupso_state = 'widget';
1160
  return hupso_the_content ( $content );
1161
  }
1162
 
1163
+ function hupso_get_the_excerpt( $content ) {
1164
+ $content = hupso_remove_shortcodes( $content );
1165
+ $hupso_show_excerpts = get_option( 'hupso_show_excerpts' , '1' );
1166
+ if ( $hupso_show_excerpts == 1 ) {
1167
+ return hupso_the_content ( $content );
1168
+ }
1169
+ else {
1170
+ return $content;
1171
+ }
1172
+ }
1173
+
1174
+ function hupso_the_excerpt( $content ) {
1175
+ $content = hupso_remove_shortcodes( $content );
1176
+ return $content;
1177
+ }
1178
+
1179
+ function hupso_remove_shortcodes( $content ) {
1180
+ $content = preg_replace('/\[hupso(.)*\]/i', '', $content);
1181
+ return $content;
1182
+ }
1183
+
1184
  function hupso_the_content_normal( $content ) {
1185
  global $hupso_state;
1186
  $hupso_state = 'normal';
1192
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p;
1193
 
1194
  if ($HUPSO_SHOW == false) {
1195
+ $content = hupso_remove_shortcodes( $content );
 
1196
  return $content;
1197
  }
1198
 
1199
  /* Do now show share buttons when [hupso_hide] is used */
1200
  if ( ($hupso_state == 'normal') && ( stripos($content, '[hupso_hide]') !== false ) ) {
1201
+ $content = hupso_remove_shortcodes( $content );
 
1202
  return $content;
1203
  }
1204
 
1205
  /* Do not show share buttons in feeds */
1206
  if ( ($hupso_state == 'normal') && (is_feed()) ) {
1207
+ $content = hupso_remove_shortcodes( $content );
 
1208
  return $content;
1209
  }
1210
 
1226
 
1227
  $hupso_show_search = get_option( 'hupso_show_search' , '1' );
1228
  if ( ($hupso_state == 'normal') && (is_search()) && ($hupso_show_search != 1) ) {
1229
+ $content = hupso_remove_shortcodes( $content );
 
1230
  return $content;
1231
  }
1232
 
1233
  $hupso_show_posts = get_option( 'hupso_show_posts' , '1' );
1234
  if ( ($hupso_state == 'normal') && (is_single()) && ($hupso_show_posts != 1) ) {
1235
+ $content = hupso_remove_shortcodes( $content );
 
1236
  return $content;
1237
  }
1238
 
1239
  $hupso_show_pages = get_option( 'hupso_show_pages' , '1' );
1240
  if ( ($hupso_state == 'normal') && (is_page()) && ($hupso_show_pages != 1) ) {
1241
+ $content = hupso_remove_shortcodes( $content );
 
1242
  return $content;
1243
  }
1244
 
1247
 
1248
  /* Do not show share buttons if option is disabled */
1249
  if ( ($hupso_state == 'normal') && (is_home()) && ($hupso_show_frontpage != 1) ) {
1250
+ $content = hupso_remove_shortcodes( $content );
 
1251
  return $content;
1252
  }
1253
  /* Do not show share buttons if option is disabled */
1254
  if ( ($hupso_state == 'normal') && (is_archive()) && ($hupso_show_category != 1) ) {
1255
+ $content = hupso_remove_shortcodes( $content );
 
1256
  return $content;
1257
  }
1258
 
1269
  $hupso_hide_categories = array();
1270
  }
1271
  if ( ($hupso_state == 'normal') && (@in_array($current_category, (array) $hupso_hide_categories)) ) {
1272
+ $content = hupso_remove_shortcodes( $content );
 
1273
  return $content;
1274
  }
1275
 
1291
  $post_title = '';
1292
  }
1293
 
 
 
 
1294
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1295
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1296
 
1376
  if ( ($hupso_shortcode_params != '') && ($h_url != '') ) {
1377
  $new_url = $h_url;
1378
  }
1379
+
1380
  switch ( $button_type ) {
1381
  case 'share_button':
1382
  $code .= 'var hupso_url="' . $new_url . '";';
1446
  }
1447
 
1448
  if ( stripos($content, '[hupso]') !== false) {
1449
+ $new_content = str_ireplace( '[hupso]', '<div' . $hupso_css_out. '>' . $code . '</div>', $content);
1450
  }
1451
  else {
1452
  switch ( $position ) {
style.css CHANGED
@@ -1,3 +1,4 @@
1
- iframe {
2
- max-width: none;
3
  }
 
1
+ .fb_iframe_widget_lift {
2
+ max-width: none !important;
3
  }
4
+