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

Version Description

  • Compatibility and security improvements
Download this release

Release Info

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

Code changes from version 4.6.1 to 4.7.0

Files changed (2) hide show
  1. readme.txt +4 -1
  2. share-buttons-hupso.php +373 -15
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, addtoany, sexybookmarks, pinterest, print, tumblr, bebo, social media, social buttons, social share, email, print button, social plugin, social widget, email button, post, vkontakte, vk.com, reddit, delicous, del.icio.us, linkedin, tumblr, pinterest, stumbleupon, digg, stumble upon, pinterest button, tweet, like, share, sharing, shortcode, button, page, amp
5
  Requires at least: 2.9
6
  Tested up to: 5.4
7
- Stable tag: 4.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -307,6 +307,9 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
307
 
308
  == Changelog ==
309
 
 
 
 
310
  = 4.6.1 =
311
  * Compatibility and security improvements
312
 
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, addtoany, sexybookmarks, pinterest, print, tumblr, bebo, social media, social buttons, social share, email, print button, social plugin, social widget, email button, post, vkontakte, vk.com, reddit, delicous, del.icio.us, linkedin, tumblr, pinterest, stumbleupon, digg, stumble upon, pinterest button, tweet, like, share, sharing, shortcode, button, page, amp
5
  Requires at least: 2.9
6
  Tested up to: 5.4
7
+ Stable tag: 4.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
307
 
308
  == Changelog ==
309
 
310
+ = 4.7.0 =
311
+ * Compatibility and security improvements
312
+
313
  = 4.6.1 =
314
  * Compatibility and security improvements
315
 
share-buttons-hupso.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Hupso Social Media Share Buttons
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social share 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, Tumblr, Pinterest, StumbleUpon, Digg, Reddit, Bebo, VKontakte 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: 4.6.1
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Domain Path: /languages
12
  */
13
 
14
  global $HUPSO_VERSION;
15
- $HUPSO_VERSION = '4.6.1';
16
 
17
  $hupso_dev = '';
18
  $hupso_state = 'normal';
@@ -415,9 +415,10 @@ function hupso_admin_settings_show() {
415
  default: $hupso_share_toolbar_checked = $checked;
416
  }
417
  ?>
418
- <td><input type="radio" name="button_type" onclick="hupso_create_code()" onchange="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/>
419
  <input type="radio" name="button_type" onclick="hupso_create_code()" onchange="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_big.png';?>" /><br/><br/>
420
  <input type="radio" name="button_type" onclick="hupso_create_code()" onchange="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/>
 
421
  </td>
422
  </tr>
423
  <tr><td style="width:100px;"></td><td><hr style="height:1px; width:500px; float:left;"/></td></tr>
@@ -1297,12 +1298,6 @@ function hupso_admin_settings_save() {
1297
  update_option( 'hupso_hide_categories', $hupso_hide_categories );
1298
  }
1299
 
1300
- /* save button code */
1301
- if ( $post ) {
1302
- $code = stripslashes(@$_POST[ 'code' ]);
1303
- update_option( 'hupso_share_buttons_code', $code );
1304
- }
1305
-
1306
  /* save hupso_meta_box */
1307
  if ( $post ) {
1308
  $hupso_meta_box = sanitize_text_field(@$_POST[ 'hupso_meta_box' ]);
@@ -1331,7 +1326,7 @@ function hupso_admin_settings_save() {
1331
 
1332
  /* keep Facebook likes */
1333
  if ( $post ) {
1334
- $keep_likes = @$_POST[ 'hupso_keep_likes' ];
1335
  if ($keep_likes == '1') {
1336
  update_option( 'hupso_keep_likes', '1' );
1337
  }
@@ -1436,7 +1431,8 @@ function hupso_the_content_shortcodes( $content ) {
1436
  /* default code */
1437
  $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="' . $hupso_p . '//static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" style="border:0px; padding-top:5px; float:left;" alt="Share"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
1438
 
1439
- $code = get_option( 'hupso_share_buttons_code', $share_code );
 
1440
  if ( $hupso_p == 'https:' ) {
1441
  $code = str_replace( 'src="http://static.hupso.com', 'src="https://static.hupso.com', $code );
1442
  }
@@ -1608,6 +1604,366 @@ function hupso_the_content_shortcodes( $content ) {
1608
  return $new_content;
1609
  }
1610
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1611
  function hupso_the_content( $content ) {
1612
 
1613
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p, $post;
@@ -1789,7 +2145,8 @@ function hupso_the_content( $content ) {
1789
  /* default code */
1790
  $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="' . $hupso_p . '//static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" style="border:0px; padding-top:5px; float:left;" alt="Share"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
1791
 
1792
- $code = get_option( 'hupso_share_buttons_code', $share_code );
 
1793
  if ( $hupso_p == 'https:' ) {
1794
  $code = str_replace( 'src="http://static.hupso.com', 'src="https://static.hupso.com', $code );
1795
  }
@@ -1833,6 +2190,7 @@ function hupso_the_content( $content ) {
1833
  $code = str_replace( 'float:left', 'float:right', $code );
1834
  }
1835
 
 
1836
  /* Twitter via @ */
1837
  if ( $hupso_twitter_via != '') {
1838
  $code .= 'var hupso_twitter_via="' . esc_attr($hupso_twitter_via) . '";';
@@ -1900,13 +2258,13 @@ function hupso_the_content( $content ) {
1900
 
1901
  switch ( $button_type ) {
1902
  case 'share_button':
1903
- $code .= 'var hupso_title="' . esc_attr(str_replace('"', '&quot;', $new_title)) . '";';
1904
  break;
1905
  case 'share_toolbar':
1906
- $code .= 'var hupso_title_t="' . esc_attr(str_replace('"', '&quot;', $new_title)) . '";';
1907
  break;
1908
  case 'counters':
1909
- $code .= 'var hupso_title_c="' . esc_attr(str_replace('"', '&quot;', $new_title)) . '";';
1910
  break;
1911
  }
1912
  }
3
  Plugin Name: Hupso Social Media Share Buttons
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social share 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, Tumblr, Pinterest, StumbleUpon, Digg, Reddit, Bebo, VKontakte 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: 4.7.0
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
13
 
14
  global $HUPSO_VERSION;
15
+ $HUPSO_VERSION = '4.7.0';
16
 
17
  $hupso_dev = '';
18
  $hupso_state = 'normal';
415
  default: $hupso_share_toolbar_checked = $checked;
416
  }
417
  ?>
418
+ <td>
419
  <input type="radio" name="button_type" onclick="hupso_create_code()" onchange="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_big.png';?>" /><br/><br/>
420
  <input type="radio" name="button_type" onclick="hupso_create_code()" onchange="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/>
421
+ <input type="radio" name="button_type" onclick="hupso_create_code()" onchange="hupso_create_code()" value="share_button" <?php echo $hupso_share_button_checked; ?> /> Share Button (No longer supported, not recommended)<br/><img src="<?php echo $hupso_plugin_url.'/buttons/button100x23.png';?>" /><br/><br/>
422
  </td>
423
  </tr>
424
  <tr><td style="width:100px;"></td><td><hr style="height:1px; width:500px; float:left;"/></td></tr>
1298
  update_option( 'hupso_hide_categories', $hupso_hide_categories );
1299
  }
1300
 
 
 
 
 
 
 
1301
  /* save hupso_meta_box */
1302
  if ( $post ) {
1303
  $hupso_meta_box = sanitize_text_field(@$_POST[ 'hupso_meta_box' ]);
1326
 
1327
  /* keep Facebook likes */
1328
  if ( $post ) {
1329
+ $keep_likes = sanitize_text_field(@$_POST[ 'hupso_keep_likes' ]);
1330
  if ($keep_likes == '1') {
1331
  update_option( 'hupso_keep_likes', '1' );
1332
  }
1431
  /* default code */
1432
  $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="' . $hupso_p . '//static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" style="border:0px; padding-top:5px; float:left;" alt="Share"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
1433
 
1434
+ $code = hupso_generate_code();
1435
+
1436
  if ( $hupso_p == 'https:' ) {
1437
  $code = str_replace( 'src="http://static.hupso.com', 'src="https://static.hupso.com', $code );
1438
  }
1604
  return $new_content;
1605
  }
1606
 
1607
+ function hupso_generate_code() {
1608
+ global $hupso_p;
1609
+ $bsize = "button120x28";
1610
+ $bwidth = "120";
1611
+ $bheight = "28";
1612
+ $hupso_services = "";
1613
+ $icon_type = 'labels';
1614
+ $hupso_url = "";
1615
+ $hupso_title = "";
1616
+ $button_type = "share_button";
1617
+ $button_position = "left";
1618
+ $hupso_class = 'hupso_pop';
1619
+ $hupso_js = 'share.js';
1620
+ $hupso_float_left_f = false;
1621
+ $hupso_float_right_f = false;
1622
+ $toolbar_size = 'big';
1623
+ $toolbar_share = 'share';
1624
+ $share_image = 'show';
1625
+ $share_image_custom_url = '';
1626
+ $share_image_lang = '';
1627
+ $hupso_twitter_via = '';
1628
+ $hupso_counters_lang = 'en_US';
1629
+ $hupso_image_folder_url = '';
1630
+ $hupso_image_folder_local = '';
1631
+ $hupso_custom_icons = 'no';
1632
+ $hupso_email_button = '0';
1633
+ $hupso_print_button = '0';
1634
+ $prot = $hupso_p;
1635
+ $dir = '';
1636
+ $cdn = 'static';
1637
+ $hupso_float_left_f = false;
1638
+ $hupso_float_right_f = false;
1639
+ $hupso_button_image_custom_url = '';
1640
+ $hupso_share_image_lang = 'en';
1641
+
1642
+ $button_type = sanitize_text_field(get_option( 'hupso_button_type', $button_type ));
1643
+ $share_image = sanitize_text_field(get_option( 'hupso_share_image', $share_image ));
1644
+ $share_image_custom_url = sanitize_text_field(get_option( 'hupso_share_image_custom_url', $share_image_custom_url ));
1645
+ $hupso_button_image_custom_url = sanitize_text_field(get_option( 'hupso_button_image_custom_url', $hupso_button_image_custom_url ));
1646
+ $hupso_twitter_via = sanitize_text_field(get_option( 'hupso_twitter_via', $hupso_twitter_via ));
1647
+ $hupso_image_folder_url = sanitize_text_field(get_option( 'hupso_image_folder_url', $hupso_image_folder_url ));
1648
+ $hupso_image_folder_local = sanitize_text_field(get_option( 'hupso_image_folder_local', $hupso_image_folder_local ));
1649
+ $hupso_custom_icons = sanitize_text_field(get_option( 'hupso_custom_icons', $hupso_custom_icons ));
1650
+ $lang_code = sanitize_text_field(get_option( 'hupso_share_image_lang', $hupso_share_image_lang ));
1651
+ if ( $lang_code != 'en' && ctype_alnum($lang_code) ) {
1652
+ $share_image_lang = 'lang/' . $lang_code . '/';
1653
+ }
1654
+ else {
1655
+ $share_image_lang = '';
1656
+ }
1657
+
1658
+ $button_position = sanitize_text_field(get_option( 'hupso_button_position', 'below' ));
1659
+ $toolbar_size = sanitize_text_field(get_option( 'hupso_toolbar_size', 'medium' ));
1660
+ $icon_type = sanitize_text_field(get_option( 'hupso_menu_type', 'labels' ));
1661
+
1662
+ $hupso_button_size = sanitize_text_field(get_option( 'hupso_button_size', 'button100x23' ));
1663
+ $b_size = str_replace( 'button', '', $hupso_button_size );
1664
+ if ( $b_size != 'custom' ) {
1665
+ list( $bwidth, $bheight ) = explode( 'x', $b_size, 2 );
1666
+ }
1667
+ $bsize = $hupso_button_size;
1668
+ $hupso_url = esc_url(get_option( 'hupso_page_url', '' ));
1669
+ $hupso_title = sanitize_text_field(get_option( 'hupso_page_title', '' ));
1670
+ $hupso_counters_lang = sanitize_text_field(get_option( 'hupso_counters_lang', 'en_US' ));
1671
+
1672
+ /* background & border color */
1673
+ if ( function_exists( 'sanitize_hex_color_no_hash' ) ) {
1674
+ $hupso_background_color = sanitize_hex_color_no_hash(get_option( 'hupso_background_color', 'EAF4FF'));
1675
+ $hupso_border_color = sanitize_hex_color_no_hash(get_option( 'hupso_border_color', '66CCFF'));
1676
+ }
1677
+ else {
1678
+ $hupso_background_color = sanitize_text_field(get_option( 'hupso_background_color', 'EAF4FF'));
1679
+ $hupso_border_color = sanitize_text_field(get_option( 'hupso_border_color', '66CCFF'));
1680
+ }
1681
+
1682
+ switch ( $button_type ) {
1683
+ case 'share_button':
1684
+ $hupso_services = '<script type="text/javascript">var hupso_services=new Array(';
1685
+ break;
1686
+ case 'share_toolbar':
1687
+ $hupso_services = '<script type="text/javascript">var hupso_services_t=new Array(';
1688
+ break;
1689
+ case 'counters':
1690
+ $hupso_services = '<script type="text/javascript">var hupso_services_c=new Array(';
1691
+ break;
1692
+ }
1693
+
1694
+ if ( $button_type == 'counters' ) {
1695
+
1696
+ // twitter
1697
+ $twitter_tweet = sanitize_text_field(get_option( 'hupso_twitter_tweet', '1' ));
1698
+ if ($twitter_tweet == 1) {
1699
+ $hupso_services .= '"twitter"';
1700
+ }
1701
+
1702
+ // facebook
1703
+ $facebook_like = sanitize_text_field(get_option( 'hupso_facebook_like', '1' ));
1704
+ $facebook_send = sanitize_text_field(get_option( 'hupso_facebook_send', '1' ));
1705
+ if ($facebook_like == 1) {
1706
+ $hupso_services .= '"facebook_like"';
1707
+ if ($facebook_send == 1) {
1708
+ $hupso_services .= '"facebook_send"';
1709
+ }
1710
+ }
1711
+
1712
+ // google +1
1713
+ $google_plus_one = sanitize_text_field(get_option( 'hupso_google_plus_one', '1' ));
1714
+ if ($google_plus_one == 1) {
1715
+ $hupso_services .= '"google"';
1716
+ }
1717
+
1718
+ // pinterest
1719
+ $pinterest_pin = sanitize_text_field(get_option( 'hupso_pinterest_pin', '1' ));
1720
+ if ($pinterest_pin == 1) {
1721
+ $hupso_services .= '"pinterest"';
1722
+ }
1723
+
1724
+ // email button
1725
+ $hupso_email_button = sanitize_text_field(get_option( 'hupso_email_button', '0' ));
1726
+ if ($hupso_email_button == 1) {
1727
+ $hupso_services .= '"email"';
1728
+ }
1729
+
1730
+ // print button
1731
+ $hupso_print_button = sanitize_text_field(get_option( 'hupso_print_button', '0' ));
1732
+ if ($hupso_print_button == 1) {
1733
+ $hupso_services .= '"print"';
1734
+ }
1735
+
1736
+ // linkedin
1737
+ $linkedin_share = sanitize_text_field(get_option( 'hupso_linkedin_share', '0' ));
1738
+ if ($linkedin_share == 1) {
1739
+ $hupso_services .= '"linkedin"';
1740
+ }
1741
+
1742
+ $hupso_services = str_replace( '""', '","', $hupso_services);
1743
+ $hupso_services .= ');';
1744
+
1745
+ }
1746
+ else {
1747
+ if (sanitize_text_field(get_option( 'hupso_twitter', '1' )) == 1) {
1748
+ $hupso_services .= '"Twitter"';
1749
+ }
1750
+ if (sanitize_text_field(get_option( 'hupso_facebook', '1' )) == 1) {
1751
+ $hupso_services .= '"Facebook"';
1752
+ }
1753
+ if (sanitize_text_field(get_option( 'hupso_googleplus', '0' )) == 1) {
1754
+ $hupso_services .= '"Google Plus"';
1755
+ }
1756
+ if (sanitize_text_field(get_option( 'hupso_pinterest', '0' )) == 1) {
1757
+ $hupso_services .= '"Pinterest"';
1758
+ }
1759
+ if (sanitize_text_field(get_option( 'hupso_linkedin', '1' )) == 1) {
1760
+ $hupso_services .= '"Linkedin"';
1761
+ }
1762
+ if (sanitize_text_field(get_option( 'hupso_tumblr', '0' )) == 1) {
1763
+ $hupso_services .= '"Tumblr"';
1764
+ }
1765
+ if (sanitize_text_field(get_option( 'hupso_stumbleupon', '1' )) == 1) {
1766
+ $hupso_services .= '"StumbleUpon"';
1767
+ }
1768
+ if (sanitize_text_field(get_option( 'hupso_digg', '0' )) == 1) {
1769
+ $hupso_services .= '"Digg"';
1770
+ }
1771
+ if (sanitize_text_field(get_option( 'hupso_reddit', '1' )) == 1) {
1772
+ $hupso_services .= '"Reddit"';
1773
+ }
1774
+ if (sanitize_text_field(get_option( 'hupso_bebo', '0' )) == 1) {
1775
+ $hupso_services .= '"Bebo"';
1776
+ }
1777
+ if (sanitize_text_field(get_option( 'hupso_delicious', '0' )) == 1) {
1778
+ $hupso_services .= '"Delicious"';
1779
+ }
1780
+ if (sanitize_text_field(get_option( 'hupso_vkontakte', '0' )) == 1) {
1781
+ $hupso_services .= '"VKontakte"';
1782
+ }
1783
+ if (sanitize_text_field(get_option( 'hupso_odnoklassniki', '0' )) == 1) {
1784
+ $hupso_services .= '"Odnoklassniki"';
1785
+ }
1786
+ if (sanitize_text_field(get_option( 'hupso_sinaweibo', '0' )) == 1) {
1787
+ $hupso_services .= '"Sina Weibo"';
1788
+ }
1789
+ if (sanitize_text_field(get_option( 'hupso_qzone', '0' )) == 1) {
1790
+ $hupso_services .= '"QZone"';
1791
+ }
1792
+ if (sanitize_text_field(get_option( 'hupso_renren', '0' )) == 1) {
1793
+ $hupso_services .= '"Renren"';
1794
+ }
1795
+ if (sanitize_text_field(get_option( 'hupso_email', '0' )) == 1) {
1796
+ $hupso_services .= '"Email"';
1797
+ }
1798
+ if (sanitize_text_field(get_option( 'hupso_print', '1' )) == 1) {
1799
+ $hupso_services .= '"Print"';
1800
+ }
1801
+
1802
+ $hupso_services = str_replace( '""', '","', $hupso_services);
1803
+ $hupso_services .= ');';
1804
+ }
1805
+
1806
+
1807
+ if ( $button_type == 'share_button' ) {
1808
+ $hupso_services .= 'var hupso_icon_type = "' . esc_attr($icon_type) . '";';
1809
+ }
1810
+
1811
+ if ( $hupso_url != "" ) {
1812
+ if ( $prot == 'https:' ) {
1813
+ if ( stripos( $hupso_url, 'https://' ) === false ) {
1814
+ $hupso_url = 'https://' . $hupso_url;
1815
+ }
1816
+ }
1817
+ else {
1818
+ if ( stripos( $hupso_url, 'http://' ) === false ) {
1819
+ $hupso_url = 'http://' . $hupso_url;
1820
+ }
1821
+ }
1822
+ }
1823
+
1824
+ if ( $hupso_title != "" ) {
1825
+ switch ( $button_type ) {
1826
+ case 'share_button':
1827
+ $hupso_services .= 'var hupso_title="' . esc_attr(rawurlencode($hupso_title)) . '";';
1828
+ break;
1829
+ case 'share_toolbar':
1830
+ $hupso_services .= 'var hupso_title_t="' . esc_attr(rawurlencode($hupso_title)) . '";';
1831
+ break;
1832
+ case 'counters':
1833
+ $hupso_services .= 'var hupso_title_c="' . esc_attr(rawurlencode($hupso_title)) . '";';
1834
+ break;
1835
+ }
1836
+ }
1837
+
1838
+ if ( $hupso_background_color != '' ) {
1839
+ switch ( $button_type ) {
1840
+ case 'share_button':
1841
+ $hupso_services .= 'var hupso_background="#' . esc_attr(rawurlencode($hupso_background_color)) . '";';
1842
+ break;
1843
+ case 'share_toolbar':
1844
+ $hupso_services .= 'var hupso_background_t="#' . esc_attr(rawurlencode($hupso_background_color)) . '";';
1845
+ break;
1846
+ }
1847
+ }
1848
+
1849
+ if ( $hupso_border_color != '' ) {
1850
+ switch ( $button_type ) {
1851
+ case 'share_button':
1852
+ $hupso_services .= 'var hupso_border="#' . esc_attr(rawurlencode($hupso_border_color)) . '";';
1853
+ break;
1854
+ case 'share_toolbar':
1855
+ $hupso_services .= 'var hupso_border_t="#' . esc_attr(rawurlencode($hupso_border_color)) . '";';
1856
+ break;
1857
+ }
1858
+ }
1859
+
1860
+ ///////////////////////////////////////////
1861
+ if ( $button_type == 'share_button' ) {
1862
+ $hupso_class = 'hupso_pop';
1863
+ $hupso_js = 'share.js';
1864
+ }
1865
+ if ( $button_type == 'share_toolbar' ) {
1866
+ $hupso_class = 'hupso_toolbar';
1867
+ $hupso_js = 'share_toolbar.js';
1868
+
1869
+ switch ( $toolbar_size ) {
1870
+ case 'big':
1871
+ $hupso_services .= 'var hupso_toolbar_size_t="big";';
1872
+ $toolbar_share = 'share';
1873
+ break;
1874
+ case 'medium':
1875
+ $hupso_services .= 'var hupso_toolbar_size_t="medium";';
1876
+ $toolbar_share = 'share-medium';
1877
+ break;
1878
+ case 'small':
1879
+ $hupso_services .= 'var hupso_toolbar_size_t="small";';
1880
+ $toolbar_share = 'share-small';
1881
+ break;
1882
+ }
1883
+ }
1884
+
1885
+ if ( $button_type == 'counters' ) {
1886
+ $hupso_class = 'hupso_counters';
1887
+ $hupso_js = 'counters.js';
1888
+ }
1889
+
1890
+ $code = '<!-- Hupso Share Buttons - https://www.hupso.com/share/ -->';
1891
+ $code .= '<a class="' . $hupso_class . '" href="https://www.hupso.com/share/">'; // float: class="hupso_float"
1892
+
1893
+ switch ( $button_type ) {
1894
+ case 'share_button':
1895
+ if ($bsize != 'custom') {
1896
+ $code .= '<img src="' . esc_attr($prot) . '//static.hupso.com/share/buttons/' . esc_attr($bsize) . '.png" style="border:0px; width:' . intval($bwidth) . '; height: ' . intval($bheight) . '; " alt="Share Button" />';
1897
+ }
1898
+ else {
1899
+ $code .= '<img src="' . esc_url($hupso_button_image_custom_url) . '" style="border:0px" alt="Share" />';
1900
+ }
1901
+ break;
1902
+ case 'share_toolbar':
1903
+
1904
+ if ( $share_image == 'hide' ) {
1905
+ $toolbar_share = 'dot';
1906
+ $share_image_lang = '';
1907
+ }
1908
+ if ( $share_image == 'custom') {
1909
+ $code .= '<img src="' . esc_url($share_image_custom_url) . '" style="border:0px; padding-top:5px; float:left; padding-right:5px;" alt="Share Button"/>';
1910
+ }
1911
+ else {
1912
+ $code .= '<img src="' . esc_attr($prot) . '//static.hupso.com/share/buttons/' . esc_attr($share_image_lang) . esc_attr($toolbar_share) . '.png" style="border:0px; padding-top: 5px; float:left;" alt="Share Button"/>';
1913
+ }
1914
+ break;
1915
+ case 'counters':
1916
+ $share_url = 'share-small';
1917
+ if ( $share_image == 'hide' ) {
1918
+ $share_url = 'dot';
1919
+ $share_image_lang = '';
1920
+ }
1921
+ if ( $share_image == 'custom') {
1922
+ $code .= '<img src="' . esc_url($share_image_custom_url) . '" style="border:0px; padding-top:5px; float:left; padding-right:5px;" alt="Share Button"/>';
1923
+ }
1924
+ else {
1925
+ $code .= '<img src="' . esc_attr($prot) . '//static.hupso.com/share/buttons/' . esc_attr($share_image_lang) . esc_attr($share_url) . '.png" style="border:0px; padding-top:2px; float:left;" alt="Share Button"/>';
1926
+ }
1927
+ break;
1928
+ }
1929
+
1930
+ $code .= '</a>';
1931
+
1932
+ /*
1933
+ if ( $hupso_twitter_via != '' ) {
1934
+ $hupso_services .= 'var hupso_twitter_via = "' . $hupso_twitter_via . '";';
1935
+ }
1936
+ *
1937
+ */
1938
+
1939
+ if ( $button_type == 'counters' ) {
1940
+ $hupso_services .= 'var hupso_counters_lang = "' . esc_attr($hupso_counters_lang) . '";';
1941
+ }
1942
+
1943
+ $image_url = '';
1944
+ switch ( $hupso_custom_icons ) {
1945
+ case 'no':
1946
+ $image_url = '';
1947
+ $hupso_services .= 'var hupso_image_folder_url = "' . esc_url($image_url) . '";';
1948
+ break;
1949
+ case 'local':
1950
+ $image_url = $hupso_image_folder_local;
1951
+ $hupso_services .= 'var hupso_image_folder_url = "' . esc_url($image_url) . '";';
1952
+ break;
1953
+ case 'custom':
1954
+ $image_url = $hupso_image_folder_url;
1955
+ $hupso_services .= 'var hupso_image_folder_url = "' . esc_url($image_url) . '";';
1956
+ break;
1957
+ default:
1958
+ $image_url = '';
1959
+ $hupso_services .= 'var hupso_image_folder_url = "' . esc_url($image_url) . '";';
1960
+ }
1961
+
1962
+ $code .= $hupso_services;
1963
+
1964
+ return $code;
1965
+ }
1966
+
1967
  function hupso_the_content( $content ) {
1968
 
1969
  global $hupso_plugin_url, $wp_version, $hupso_dev, $hupso_state, $HUPSO_SHOW, $hupso_p, $post;
2145
  /* default code */
2146
  $share_code = '<!-- Hupso Share Buttons - http://www.hupso.com/share/ --><a class="hupso_toolbar" href="http://www.hupso.com/share/"><img src="' . $hupso_p . '//static.hupso.com/share' . $hupso_dev . '/buttons/share-medium.png" style="border:0px; padding-top:5px; float:left;" alt="Share"/></a><script type="text/javascript">var hupso_services_t=new Array("Twitter","Facebook","Linkedin","StumbleUpon","Digg","Reddit","Bebo","Delicious"); var hupso_toolbar_size_t="medium";';
2147
 
2148
+ $code = hupso_generate_code();
2149
+
2150
  if ( $hupso_p == 'https:' ) {
2151
  $code = str_replace( 'src="http://static.hupso.com', 'src="https://static.hupso.com', $code );
2152
  }
2190
  $code = str_replace( 'float:left', 'float:right', $code );
2191
  }
2192
 
2193
+
2194
  /* Twitter via @ */
2195
  if ( $hupso_twitter_via != '') {
2196
  $code .= 'var hupso_twitter_via="' . esc_attr($hupso_twitter_via) . '";';
2258
 
2259
  switch ( $button_type ) {
2260
  case 'share_button':
2261
+ $code .= 'var hupso_title="' . esc_attr(rawurlencode($new_title)) . '";';
2262
  break;
2263
  case 'share_toolbar':
2264
+ $code .= 'var hupso_title_t="' . esc_attr(rawurlencode($new_title)) . '";';
2265
  break;
2266
  case 'counters':
2267
+ $code .= 'var hupso_title_c="' . esc_attr(rawurlencode($new_title)) . '";';
2268
  break;
2269
  }
2270
  }