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

Version Description

Download this release

Release Info

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

Code changes from version 3.4 to 3.5

Files changed (3) hide show
  1. js/create_button.js +14 -2
  2. readme.txt +11 -2
  3. share-buttons-hupso.php +269 -60
js/create_button.js CHANGED
@@ -28,10 +28,13 @@ function hupso_create_code() {
28
  var share_image = 'show';
29
  var share_image_custom_url = '';
30
  var share_image_lang = '';
 
 
31
 
32
  dir = "";
33
  cdn = "static";
34
-
 
35
  hupso_float_left_f = false;
36
  hupso_float_right_f = false;
37
 
@@ -93,6 +96,7 @@ function hupso_create_code() {
93
 
94
  share_image = $("input:radio[name=hupso_share_image]:checked").val();
95
  share_image_custom_url = $.trim($("input:text[name=hupso_share_image_custom_url]").val());
 
96
 
97
  var lang_code = $("#share_image_lang option:selected").val();
98
  if ( lang_code != 'en' ) {
@@ -132,6 +136,7 @@ function hupso_create_code() {
132
 
133
  hupso_url = $.trim($("input:text[name=page_url]").val());
134
  hupso_title = $.trim($("input:text[name=page_title]").val());
 
135
 
136
  hupso_background_color = $.trim($("input:text[name=background_color]").val()).toUpperCase();
137
  hupso_border_color = $.trim($("input:text[name=border_color]").val()).toUpperCase();
@@ -380,16 +385,23 @@ switch ( button_type ) {
380
  break;
381
  }
382
 
383
-
384
  code += '</a>';
 
 
 
 
 
 
385
  code += hupso_services;
386
 
 
387
  // save button code
388
  $("input[name=code]").val(code);
389
 
390
  code += '</script>';
391
  code += '<script type="text/javascript" src="http://'+cdn+'.hupso.com/share/js/'+dir+hupso_js+'"></script>';
392
  code += "<!-- Hupso Share Buttons -->";
 
393
 
394
  // remove float code
395
  for (var i = 0; i < 10; i++ ) {
28
  var share_image = 'show';
29
  var share_image_custom_url = '';
30
  var share_image_lang = '';
31
+ var hupso_twitter_via = '';
32
+ var hupso_counters_lang = 'en_US';
33
 
34
  dir = "";
35
  cdn = "static";
36
+
37
+
38
  hupso_float_left_f = false;
39
  hupso_float_right_f = false;
40
 
96
 
97
  share_image = $("input:radio[name=hupso_share_image]:checked").val();
98
  share_image_custom_url = $.trim($("input:text[name=hupso_share_image_custom_url]").val());
99
+ hupso_twitter_via = $.trim($("input:text[name=hupso_twitter_via]").val());
100
 
101
  var lang_code = $("#share_image_lang option:selected").val();
102
  if ( lang_code != 'en' ) {
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();
142
  hupso_border_color = $.trim($("input:text[name=border_color]").val()).toUpperCase();
385
  break;
386
  }
387
 
 
388
  code += '</a>';
389
+
390
+ if (hupso_twitter_via != '') {
391
+ hupso_services += 'var hupso_twitter_via = "'+hupso_twitter_via+'";';
392
+ }
393
+ hupso_services += 'var hupso_counters_lang = "'+hupso_counters_lang+'";';
394
+
395
  code += hupso_services;
396
 
397
+
398
  // save button code
399
  $("input[name=code]").val(code);
400
 
401
  code += '</script>';
402
  code += '<script type="text/javascript" src="http://'+cdn+'.hupso.com/share/js/'+dir+hupso_js+'"></script>';
403
  code += "<!-- Hupso Share Buttons -->";
404
+
405
 
406
  // remove float code
407
  for (var i = 0; i < 10; i++ ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -28,6 +28,8 @@ These services are used by millions of people every day, so sharing your content
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 / pages (see Shortcodes below)
30
  * Hide or show buttons for posts / pages / front page / categories
 
 
31
  * Hide share buttons for specific categories
32
  * Hide "Share" image or use translated image (20+ languages available)
33
 
@@ -72,7 +74,7 @@ If you still have problems then send bug report [using this feedback form](http:
72
 
73
  = Buttons are not working with one post. Only "Share" image in shown, but no social icons. They work correctly on other posts. What can I do? =
74
 
75
- HTML of your post in not valid. You need to fix the text inside the post. Perhaps you forgot to close a <p> or <div> tag at the end. Perhaps you have some other HTML error in it. Use HTML validator if you cannot find an error.
76
 
77
  = What settings are available? =
78
 
@@ -113,6 +115,13 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
113
 
114
  == Changelog ==
115
 
 
 
 
 
 
 
 
116
  = 3.4 =
117
  * Option to hide "Share" image
118
  * Option to use translated "Share" image (20 languages)
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.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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 / pages (see Shortcodes below)
30
  * Hide or show buttons for posts / pages / front page / categories
31
+ * Option to add "via @yourprofile" to tweets (Twitter)
32
+ * Localized counters: Tweet, Facebook Like, Facebook Share, Google +1 buttons can use translated versions (support for 73 languages)
33
  * Hide share buttons for specific categories
34
  * Hide "Share" image or use translated image (20+ languages available)
35
 
74
 
75
  = Buttons are not working with one post. Only "Share" image in shown, but no social icons. They work correctly on other posts. What can I do? =
76
 
77
+ HTML of your post in not valid. You need to fix the text inside the post. Perhaps you forgot to close a p or div tag at the end. Perhaps you have some other HTML error in it. Use HTML validator if you cannot find an error.
78
 
79
  = What settings are available? =
80
 
115
 
116
  == Changelog ==
117
 
118
+ = 3.5
119
+ * Option to add "via @yourprofile" to tweets (Twitter)
120
+ * Localized counters: Tweet, Facebook Like, Facebook Share, Google +1 buttons can now use translated versions (support for 73 languages)
121
+ * Chinese "Share" image
122
+ * Fix for Facebook Like in Internet Explorer 8
123
+ * Option to add CSS style to share buttons
124
+
125
  = 3.4 =
126
  * Option to hide "Share" image
127
  * Option to use translated "Share" image (20 languages)
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.4
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -60,6 +60,7 @@ function hupso_plugin_uninstall() {
60
  delete_option( 'hupso_facebook_send' );
61
  delete_option( 'hupso_google_plus_one' );
62
  delete_option( 'hupso_linkedin_share' );
 
63
  delete_option( 'hupso_share_buttons_code' );
64
  delete_option( 'hupso_twitter' );
65
  delete_option( 'hupso_facebook' );
@@ -70,6 +71,9 @@ function hupso_plugin_uninstall() {
70
  delete_option( 'hupso_reddit' );
71
  delete_option( 'hupso_bebo' );
72
  delete_option( 'hupso_delicious' );
 
 
 
73
  }
74
 
75
  function hupso_plugin_activation() {
@@ -113,6 +117,8 @@ function hupso_get_the_excerpt($content) {
113
  function hupso_admin_settings_show() {
114
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
115
 
 
 
116
  $hupso_share_image = __('Share', 'share_buttons_hupso');
117
  $hupso_excerpts = __('Excerpts', 'share_buttons_hupso');
118
  $hupso_feeds = __('Feeds', 'share_buttons_hupso');
@@ -122,10 +128,11 @@ function hupso_admin_settings_show() {
122
  }
123
 
124
  /* save settings */
125
- if ( $_POST[ 'button_type' ] != '' ) {
126
  hupso_admin_settings_save();
127
  }
128
-
 
129
  echo '<div class="wrap" style="padding-bottom:100px;"><div class="icon32" id="icon-users"></div>';
130
  echo '<h2>'. __('Hupso Share Buttons for Twitter, Facebook & Google+ (Settings)', 'share_buttons_hupso').'</h2>';
131
  echo '<form name="hupso_settings_form" method="post" action="">';
@@ -165,6 +172,11 @@ function hupso_admin_settings_show() {
165
 
166
  $checked = 'checked="checked"';
167
  $current_button_size = get_option( 'hupso_button_size' , 'button100x23' );
 
 
 
 
 
168
  switch ( $current_button_size ) {
169
  case 'button60x14' : $button60_checked = $checked; break;
170
  case 'button80x19' : $button80_checked = $checked; break;
@@ -187,6 +199,9 @@ function hupso_admin_settings_show() {
187
  <?php
188
  $hupso_button_type = get_option( 'hupso_button_type', 'share_toolbar' );
189
  $checked = ' checked="checked" ';
 
 
 
190
  switch ( $hupso_button_type ) {
191
  case 'share_button': $hupso_share_button_checked = $checked; break;
192
  case 'share_toolbar': $hupso_share_toolbar_checked = $checked; break;
@@ -199,7 +214,7 @@ function hupso_admin_settings_show() {
199
  <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/>
200
  </td>
201
  </tr>
202
- <tr><td style="width:100px;"></td><td><hr style="height:1px; width:300px; float:left;"/></td></tr>
203
  </table>
204
  </div>
205
 
@@ -215,7 +230,7 @@ function hupso_admin_settings_show() {
215
  <tr><td><input type="radio" name="size" value="button120x28" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $button120_checked; ?>/></td><td style="padding-right:10px;"><?php echo $button_120_img ?></td></tr>
216
  <tr><td><input type="radio" name="size" value="button160x37" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $button160_checked; ?>/></td><td style="padding-right:20px;"><?php echo $button_160_img ?></td></tr>
217
  </table>
218
- <hr style="height:1px; width:300px;"/>
219
  </td>
220
  </tr>
221
  </table>
@@ -228,6 +243,9 @@ function hupso_admin_settings_show() {
228
  <td style="width:100px">
229
  <?php
230
  $hupso_toolbar_size = get_option( 'hupso_toolbar_size', 'medium' );
 
 
 
231
  $checked = ' checked="checked" ';
232
  switch ( $hupso_toolbar_size ) {
233
  case 'big': $hupso_toolbar_size_big_checked = $checked; break;
@@ -239,7 +257,7 @@ function hupso_admin_settings_show() {
239
  <input type="radio" name="select_toolbar_size" value="big" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_big_checked; ?> /> <?php _e( 'Big', 'share_buttons_hupso');?> <br/>
240
  <input type="radio" name="select_toolbar_size" value="medium" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_medium_checked; ?> /> <?php _e( 'Medium', 'share_buttons_hupso');?> <br/>
241
  <input type="radio" name="select_toolbar_size" value="small" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_small_checked; ?> /> <?php _e( 'Small', 'share_buttons_hupso');?> <br/>
242
- <hr style="height:1px; width:300px;"/>
243
  </td>
244
  </tr>
245
  </table>
@@ -250,12 +268,15 @@ function hupso_admin_settings_show() {
250
  <table border="0">
251
  <tr>
252
  <td style="width:100px;"><?php _e('Share image', 'share_buttons_hupso'); ?></td>
253
- <td style="width:300px">
254
  <?php
255
 
256
  /* hupso_share_image */
257
  $checked = ' checked="checked" ';
258
  $hupso_share_image = get_option( 'hupso_share_image', 'normal' );
 
 
 
259
  switch ( $hupso_share_image ) {
260
  case '':
261
  case 'show': $hupso_share_image_show_checked = $checked; break;
@@ -269,29 +290,30 @@ function hupso_admin_settings_show() {
269
  <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');?>:
270
  <select id="share_image_lang" name="share_image_lang" onclick="hupso_create_code()" onchange="hupso_create_code()">
271
  <option value="en" <?php if ( ($hupso_share_image_lang == 'en') || ($hupso_share_image_lang == '') ) echo ' selected ';?>>English</option>
272
- <option value="fr" <?php if ($hupso_share_image_lang == 'fr') echo ' selected ';?>><?php _e('French', 'share_buttons_hupso');?></option>
273
- <option value="de" <?php if ($hupso_share_image_lang == 'de') echo ' selected ';?>><?php _e('German', 'share_buttons_hupso');?></option>
274
- <option value="it" <?php if ($hupso_share_image_lang == 'it') echo ' selected ';?>><?php _e('Italian', 'share_buttons_hupso');?></option>
275
- <option value="pt" <?php if ($hupso_share_image_lang == 'pt') echo ' selected ';?>><?php _e('Portuguese', 'share_buttons_hupso');?></option>
276
- <option value="es" <?php if ($hupso_share_image_lang == 'es') echo ' selected ';?>><?php _e('Spanish', 'share_buttons_hupso');?></option>
277
- <option value="id" <?php if ($hupso_share_image_lang == 'id') echo ' selected ';?>><?php _e('Indonesian', 'share_buttons_hupso');?></option>
278
- <option value="da" <?php if ($hupso_share_image_lang == 'da') echo ' selected ';?>><?php _e('Danish', 'share_buttons_hupso');?></option>
279
- <option value="nl" <?php if ($hupso_share_image_lang == 'nl') echo ' selected ';?>><?php _e('Dutch', 'share_buttons_hupso');?></option>
280
- <option value="sv" <?php if ($hupso_share_image_lang == 'sv') echo ' selected ';?>><?php _e('Swedish', 'share_buttons_hupso');?></option>
281
- <option value="no" <?php if ($hupso_share_image_lang == 'no') echo ' selected ';?>><?php _e('Norwegian', 'share_buttons_hupso');?></option>
282
- <option value="sr" <?php if ($hupso_share_image_lang == 'sr') echo ' selected ';?>><?php _e('Serbian', 'share_buttons_hupso');?></option>
283
- <option value="hr" <?php if ($hupso_share_image_lang == 'hr') echo ' selected ';?>><?php _e('Croatian', 'share_buttons_hupso');?></option>
284
- <option value="et" <?php if ($hupso_share_image_lang == 'et') echo ' selected ';?>><?php _e('Estonian', 'share_buttons_hupso');?></option>
285
- <option value="ro" <?php if ($hupso_share_image_lang == 'ro') echo ' selected ';?>><?php _e('Romanian', 'share_buttons_hupso');?></option>
286
- <option value="ga" <?php if ($hupso_share_image_lang == 'ga') echo ' selected ';?>><?php _e('Irish', 'share_buttons_hupso');?></option>
287
- <option value="af" <?php if ($hupso_share_image_lang == 'af') echo ' selected ';?>><?php _e('Afrikaans', 'share_buttons_hupso');?></option>
288
- <option value="sl" <?php if ($hupso_share_image_lang == 'sl') echo ' selected ';?>><?php _e('Slovenian', 'share_buttons_hupso');?></option>
289
- <option value="pl" <?php if ($hupso_share_image_lang == 'pl') echo ' selected ';?>><?php _e('Polish', 'share_buttons_hupso');?></option>
290
- <option value="bs" <?php if ($hupso_share_image_lang == 'bs') echo ' selected ';?>><?php _e('Bosnian', 'share_buttons_hupso');?></option>
291
- <option value="ms" <?php if ($hupso_share_image_lang == 'ms') echo ' selected ';?>><?php _e('Malay', 'share_buttons_hupso');?></option>
 
292
  </select><br/>
293
  <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/>
294
- <hr style="height:1px; width:300px;"/>
295
  </td>
296
  </tr>
297
  </table>
@@ -308,6 +330,11 @@ function hupso_admin_settings_show() {
308
  </div>
309
  <?php
310
  $checked = ' checked="checked" ';
 
 
 
 
 
311
 
312
  $twitter_tweet = get_option( 'hupso_twitter_tweet', '1' );
313
  if ( $twitter_tweet == 1 ) $twitter_tweet_checked = $checked;
@@ -355,12 +382,22 @@ function hupso_admin_settings_show() {
355
  <td><input type="checkbox" name="linkedin_share" onclick="hupso_create_code()" value="1" <?php echo $linkedin_share_checked;?> /></td>
356
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/linkedin_share.png" /></td>
357
  <td></td>
358
- </tr>
 
 
 
 
 
 
 
 
 
359
  </table>
360
 
361
  </td>
362
  </tr>
363
  </table>
 
364
  </div>
365
  <div id="show_icons">
366
  <table border="0">
@@ -369,6 +406,8 @@ function hupso_admin_settings_show() {
369
  <?php
370
  $menu_type = get_option( 'hupso_menu_type', 'labels' );
371
  $checked = ' checked="checked" ';
 
 
372
  switch ( $menu_type ) {
373
  case 'labels': $hupso_labels_checked = $checked; break;
374
  case 'icons' : $hupso_icons_checked = $checked; break;
@@ -376,7 +415,7 @@ function hupso_admin_settings_show() {
376
  }
377
 
378
  ?>
379
- <td><hr style="height:1px; width:300px;"/><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/>
380
  <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>
381
  </tr>
382
  </table>
@@ -388,21 +427,27 @@ function hupso_admin_settings_show() {
388
  <?php
389
  $button_position = get_option( 'hupso_button_position', 'below' );
390
  $checked = ' checked="checked" ';
 
 
391
  switch ( $button_position ) {
392
  case 'below': $hupso_below_checked = $checked; break;
393
  case 'above' : $hupso_above_checked = $checked; break;
394
  default: $hupso_below_checked = $checked;
395
  }
396
  ?>
397
- <td><hr style="height:1px; width:300px;" align="left"/>
398
  <input type="radio" name="hupso_button_position" value="above" <?php echo $hupso_above_checked; ?> /> <?php _e('Above the post', 'share_buttons_hupso'); ?><br/>
399
  <input type="radio" name="hupso_button_position" value="below" <?php echo $hupso_below_checked; ?> /> <?php _e('Below the post', 'share_buttons_hupso'); ?><br/></td>
400
  </tr>
401
  <tr>
402
  <td style="width:100px;"><?php _e('Show buttons on', 'share_buttons_hupso'); ?></td>
403
- <td><hr style="height:1px; width:300px;" align="left"/>
404
  <?php
405
  $checked = ' checked="checked" ';
 
 
 
 
406
 
407
  /* posts */
408
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
@@ -440,7 +485,7 @@ function hupso_admin_settings_show() {
440
  </tr>
441
  <tr>
442
  <td style="width:100px;"><?php _e('Hide buttons for specific categories', 'share_buttons_hupso'); ?></td>
443
- <td><hr style="height:1px; width:300px;" align="left"/>
444
  <?php
445
  /* hidden categories */
446
  $hupso_hide_categories = get_option( 'hupso_hide_categories', array() );
@@ -470,9 +515,11 @@ function hupso_admin_settings_show() {
470
  </tr>
471
  <tr>
472
  <td style="width:100px;"><?php _e('Get share text from', 'share_buttons_hupso'); ?></td>
473
- <td><hr style="height:1px; width:300px;" align="left"/>
474
  <?php
475
  $checked = ' checked="checked" ';
 
 
476
 
477
  /* posts */
478
  $hupso_title_text = get_option( 'hupso_title_text', 'post' );
@@ -481,10 +528,41 @@ function hupso_admin_settings_show() {
481
  else
482
  $hupso_title_text_post_checked = $checked;
483
  ?>
484
- <input type="radio" name="hupso_title_text" value="post" <?php echo $hupso_title_text_post_checked; ?> /> <?php _e('Title of post/page in Wordpress', 'share_buttons_hupso'); ?><br/>
485
  <input type="radio" name="hupso_title_text" value="page" <?php echo $hupso_title_text_page_checked; ?> /> <?php _e('Title of current web page', 'share_buttons_hupso'); ?>
486
  </td>
487
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  </table>
489
  <br/><br/><input class="button-primary" name="submit" type="submit" onclick="hupso_create_code()" value="<?php _e('Save Settings', 'share_buttons_hupso'); ?>" />
490
  </form>
@@ -502,14 +580,14 @@ function hupso_admin_settings_save() {
502
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
503
  update_option( 'hupso_custom', '1' );
504
 
505
- if ( $_POST[ 'button_type' ] != '' )
506
  $post = true;
507
  else
508
  $post = false;
509
 
510
  /* save button type */
511
  if ( $post ) {
512
- $hupso_button_type = $_POST[ 'button_type' ];
513
  update_option( 'hupso_button_type', $hupso_button_type );
514
  } else {
515
  $hupso_button_type = get_option ( 'hupso_button_type', 'share_toolbar');
@@ -517,7 +595,7 @@ function hupso_admin_settings_save() {
517
 
518
  /* save button size */
519
  if ( $post ) {
520
- $hupso_button_size = $_POST[ 'size' ];
521
  update_option( 'hupso_button_size', $hupso_button_size );
522
  } else {
523
  $hupso_button_size = get_option ( 'hupso_button_size', 'button100x23');
@@ -527,7 +605,7 @@ function hupso_admin_settings_save() {
527
 
528
  /* save toolbar size */
529
  if ( $post ) {
530
- $hupso_toolbar_size = $_POST[ 'select_toolbar_size' ];
531
  update_option( 'hupso_toolbar_size', $hupso_toolbar_size );
532
  } else {
533
  $hupso_button_size = get_option ( 'hupso_toolbar_size', 'medium');
@@ -535,7 +613,7 @@ function hupso_admin_settings_save() {
535
 
536
  /* save share_image */
537
  if ( $post ) {
538
- $hupso_share_image = $_POST[ 'hupso_share_image' ];
539
  update_option( 'hupso_share_image', $hupso_share_image );
540
  } else {
541
  $hupso_share_image = get_option ( 'hupso_share_image', 'normal');
@@ -543,7 +621,7 @@ function hupso_admin_settings_save() {
543
 
544
  /* save share_image_lang */
545
  if ( $post ) {
546
- $hupso_share_image_lang = $_POST[ 'share_image_lang' ];
547
  update_option( 'hupso_share_image_lang', $hupso_share_image_lang );
548
  } else {
549
  $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '');
@@ -555,7 +633,7 @@ function hupso_admin_settings_save() {
555
  $service_name = strtolower( $service_text );
556
  $service_name = str_replace( ' ', '', $service_name );
557
  if ( $post ) {
558
- $value = $_POST[ $service_name ];
559
  update_option( 'hupso_' . $service_name, $value );
560
  }
561
  else {
@@ -568,9 +646,15 @@ function hupso_admin_settings_save() {
568
  $hupso_vars .= ');';
569
  $hupso_vars = str_replace( ',)', ')', $hupso_vars );
570
 
 
 
 
 
 
 
571
  /* save menu type */
572
  if ( $post ) {
573
- $hupso_menu_type = $_POST[ 'menu_type' ];
574
  update_option( 'hupso_menu_type', $hupso_menu_type );
575
  }
576
  else {
@@ -580,7 +664,7 @@ function hupso_admin_settings_save() {
580
 
581
  /* save button position */
582
  if ( $post ) {
583
- $hupso_button_position = $_POST[ 'hupso_button_position' ];
584
  update_option( 'hupso_button_position', $hupso_button_position );
585
  }
586
  else {
@@ -589,52 +673,64 @@ function hupso_admin_settings_save() {
589
 
590
  /* save display options */
591
  if ( $post ) {
592
- $hupso_show_posts = $_POST[ 'hupso_show_posts' ];
593
  update_option( 'hupso_show_posts', $hupso_show_posts );
594
 
595
- $hupso_show_pages = $_POST[ 'hupso_show_pages' ];
596
  update_option( 'hupso_show_pages', $hupso_show_pages );
597
 
598
- $hupso_show_frontpage = $_POST[ 'hupso_show_frontpage' ];
599
  update_option( 'hupso_show_frontpage', $hupso_show_frontpage );
600
 
601
- $hupso_show_category = $_POST[ 'hupso_show_category' ];
602
  update_option( 'hupso_show_category', $hupso_show_category );
603
  }
604
 
605
  /* save options for counters */
606
  if ( $post ) {
607
- $twitter_tweet = $_POST[ 'twitter_tweet' ];
608
  update_option( 'hupso_twitter_tweet', $twitter_tweet );
609
 
610
- $facebook_like = $_POST[ 'facebook_like' ];
611
  update_option( 'hupso_facebook_like', $facebook_like );
612
 
613
- $facebook_send = $_POST[ 'facebook_send' ];
614
  update_option( 'hupso_facebook_send', $facebook_send );
615
 
616
- $google_plus_one = $_POST[ 'google_plus_one' ];
617
  update_option( 'hupso_google_plus_one', $google_plus_one );
618
 
619
- $linkedin_share = $_POST[ 'linkedin_share' ];
620
  update_option( 'hupso_linkedin_share', $linkedin_share );
621
  }
622
 
623
  /* Get title for sharing from */
624
  if ( $post ) {
625
- $hupso_title_text = $_POST[ 'hupso_title_text' ];
626
  update_option( 'hupso_title_text', $hupso_title_text );
627
  }
628
 
 
 
 
 
 
 
 
 
 
 
 
 
629
  /* save hupso_hide_categories */
630
  if ( $post ) {
631
- $hupso_hide_categories = $_POST['hupso_hide_categories'];
632
  update_option( 'hupso_hide_categories', $hupso_hide_categories );
633
  }
634
 
635
  /* save button code */
636
  if ( $post ) {
637
- $code = stripslashes($_POST[ 'code' ]);
638
  update_option( 'hupso_share_buttons_code', $code );
639
  }
640
 
@@ -704,6 +800,8 @@ function hupso_the_content( $content ) {
704
  }
705
 
706
  $hupso_title_text = get_option( 'hupso_title_text' , 'post' );
 
 
707
  $post_url = get_permalink($GLOBALS['post']->ID);
708
  $post_title = $GLOBALS['post']->post_title;
709
 
@@ -752,6 +850,14 @@ function hupso_the_content( $content ) {
752
  }
753
 
754
 
 
 
 
 
 
 
 
 
755
  if ( ( is_home() && $hupso_show_frontpage == 1 ) || ( is_archive() && $hupso_show_category == 1 ) ) {
756
  switch ( $button_type ) {
757
  case 'share_button':
@@ -800,15 +906,23 @@ function hupso_the_content( $content ) {
800
 
801
  $position = get_option( 'hupso_button_position', 'below' );
802
 
 
 
 
 
 
 
 
 
803
  if ( stripos($content, '[hupso]') !== false) {
804
- $new_content = str_ireplace('[hupso]', '<p>' . $code . '</p>', $content);
805
  }
806
  else {
807
  if ( $position == 'below' ) {
808
- $new_content = $content . '<p>' . $code . '</p>';
809
  }
810
  else {
811
- $new_content = '<p>' . $code . '</p>' . $content;
812
  }
813
  }
814
 
@@ -850,6 +964,101 @@ function hupso_plugin_action_links( $links, $file ) {
850
  }
851
 
852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
 
854
 
855
  ?>
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.5
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
60
  delete_option( 'hupso_facebook_send' );
61
  delete_option( 'hupso_google_plus_one' );
62
  delete_option( 'hupso_linkedin_share' );
63
+ delete_option( 'hupso_counters_lang' );
64
  delete_option( 'hupso_share_buttons_code' );
65
  delete_option( 'hupso_twitter' );
66
  delete_option( 'hupso_facebook' );
71
  delete_option( 'hupso_reddit' );
72
  delete_option( 'hupso_bebo' );
73
  delete_option( 'hupso_delicious' );
74
+ delete_option( 'hupso_title_text' );
75
+ delete_option( 'hupso_twitter_via' );
76
+ delete_option( 'hupso_css_style' );
77
  }
78
 
79
  function hupso_plugin_activation() {
117
  function hupso_admin_settings_show() {
118
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
119
 
120
+ $hupso_lang_code = __('en_US', 'share_buttons_hupso');
121
+ $hupso_language = __('English', 'share_buttons_hupso');
122
  $hupso_share_image = __('Share', 'share_buttons_hupso');
123
  $hupso_excerpts = __('Excerpts', 'share_buttons_hupso');
124
  $hupso_feeds = __('Feeds', 'share_buttons_hupso');
128
  }
129
 
130
  /* save settings */
131
+ if ( @$_POST[ 'button_type' ] != '' ) {
132
  hupso_admin_settings_save();
133
  }
134
+
135
+
136
  echo '<div class="wrap" style="padding-bottom:100px;"><div class="icon32" id="icon-users"></div>';
137
  echo '<h2>'. __('Hupso Share Buttons for Twitter, Facebook & Google+ (Settings)', 'share_buttons_hupso').'</h2>';
138
  echo '<form name="hupso_settings_form" method="post" action="">';
172
 
173
  $checked = 'checked="checked"';
174
  $current_button_size = get_option( 'hupso_button_size' , 'button100x23' );
175
+ $button60_checked = '';
176
+ $button80_checked = '';
177
+ $button100_checked = '';
178
+ $button120_checked = '';
179
+ $button160_checked = '';
180
  switch ( $current_button_size ) {
181
  case 'button60x14' : $button60_checked = $checked; break;
182
  case 'button80x19' : $button80_checked = $checked; break;
199
  <?php
200
  $hupso_button_type = get_option( 'hupso_button_type', 'share_toolbar' );
201
  $checked = ' checked="checked" ';
202
+ $hupso_share_button_checked = '';
203
+ $hupso_share_toolbar_checked = '';
204
+ $hupso_share_counters_checked = '';
205
  switch ( $hupso_button_type ) {
206
  case 'share_button': $hupso_share_button_checked = $checked; break;
207
  case 'share_toolbar': $hupso_share_toolbar_checked = $checked; break;
214
  <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/>
215
  </td>
216
  </tr>
217
+ <tr><td style="width:100px;"></td><td><hr style="height:1px; width:500px; float:left;"/></td></tr>
218
  </table>
219
  </div>
220
 
230
  <tr><td><input type="radio" name="size" value="button120x28" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $button120_checked; ?>/></td><td style="padding-right:10px;"><?php echo $button_120_img ?></td></tr>
231
  <tr><td><input type="radio" name="size" value="button160x37" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $button160_checked; ?>/></td><td style="padding-right:20px;"><?php echo $button_160_img ?></td></tr>
232
  </table>
233
+ <hr style="height:1px; width:500px;"/>
234
  </td>
235
  </tr>
236
  </table>
243
  <td style="width:100px">
244
  <?php
245
  $hupso_toolbar_size = get_option( 'hupso_toolbar_size', 'medium' );
246
+ $hupso_toolbar_size_big_checked = '';
247
+ $hupso_toolbar_size_medium_checked = '';
248
+ $hupso_toolbar_size_small_checked = '';
249
  $checked = ' checked="checked" ';
250
  switch ( $hupso_toolbar_size ) {
251
  case 'big': $hupso_toolbar_size_big_checked = $checked; break;
257
  <input type="radio" name="select_toolbar_size" value="big" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_big_checked; ?> /> <?php _e( 'Big', 'share_buttons_hupso');?> <br/>
258
  <input type="radio" name="select_toolbar_size" value="medium" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_medium_checked; ?> /> <?php _e( 'Medium', 'share_buttons_hupso');?> <br/>
259
  <input type="radio" name="select_toolbar_size" value="small" onclick="hupso_create_code()" onchange="hupso_create_code()" <?php echo $hupso_toolbar_size_small_checked; ?> /> <?php _e( 'Small', 'share_buttons_hupso');?> <br/>
260
+ <hr style="height:1px; width:500px;"/>
261
  </td>
262
  </tr>
263
  </table>
268
  <table border="0">
269
  <tr>
270
  <td style="width:100px;"><?php _e('Share image', 'share_buttons_hupso'); ?></td>
271
+ <td style="width:500px">
272
  <?php
273
 
274
  /* hupso_share_image */
275
  $checked = ' checked="checked" ';
276
  $hupso_share_image = get_option( 'hupso_share_image', 'normal' );
277
+ $hupso_share_image_show_checked = '';
278
+ $hupso_share_image_hide_checked = '';
279
+ $hupso_share_image_lang_checked = '';
280
  switch ( $hupso_share_image ) {
281
  case '':
282
  case 'show': $hupso_share_image_show_checked = $checked; break;
290
  <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');?>:
291
  <select id="share_image_lang" name="share_image_lang" onclick="hupso_create_code()" onchange="hupso_create_code()">
292
  <option value="en" <?php if ( ($hupso_share_image_lang == 'en') || ($hupso_share_image_lang == '') ) echo ' selected ';?>>English</option>
293
+ <option value="fr" <?php if ($hupso_share_image_lang == 'fr') echo ' selected ';?>>French</option>
294
+ <option value="de" <?php if ($hupso_share_image_lang == 'de') echo ' selected ';?>>German</option>
295
+ <option value="it" <?php if ($hupso_share_image_lang == 'it') echo ' selected ';?>>Italian</option>
296
+ <option value="pt" <?php if ($hupso_share_image_lang == 'pt') echo ' selected ';?>>Portuguese</option>
297
+ <option value="es" <?php if ($hupso_share_image_lang == 'es') echo ' selected ';?>>Spanish</option>
298
+ <option value="id" <?php if ($hupso_share_image_lang == 'id') echo ' selected ';?>>Indonesian</option>
299
+ <option value="da" <?php if ($hupso_share_image_lang == 'da') echo ' selected ';?>>Danish</option>
300
+ <option value="nl" <?php if ($hupso_share_image_lang == 'nl') echo ' selected ';?>>Dutch</option>
301
+ <option value="sv" <?php if ($hupso_share_image_lang == 'sv') echo ' selected ';?>>Swedish</option>
302
+ <option value="no" <?php if ($hupso_share_image_lang == 'no') echo ' selected ';?>>Norwegian</option>
303
+ <option value="sr" <?php if ($hupso_share_image_lang == 'sr') echo ' selected ';?>>Serbian</option>
304
+ <option value="hr" <?php if ($hupso_share_image_lang == 'hr') echo ' selected ';?>>Croatian</option>
305
+ <option value="et" <?php if ($hupso_share_image_lang == 'et') echo ' selected ';?>>Estonian</option>
306
+ <option value="ro" <?php if ($hupso_share_image_lang == 'ro') echo ' selected ';?>>Romanian</option>
307
+ <option value="ga" <?php if ($hupso_share_image_lang == 'ga') echo ' selected ';?>>Irish</option>
308
+ <option value="af" <?php if ($hupso_share_image_lang == 'af') echo ' selected ';?>>Afrikaans</option>
309
+ <option value="sl" <?php if ($hupso_share_image_lang == 'sl') echo ' selected ';?>>Slovenian</option>
310
+ <option value="pl" <?php if ($hupso_share_image_lang == 'pl') echo ' selected ';?>>Polish</option>
311
+ <option value="bs" <?php if ($hupso_share_image_lang == 'bs') echo ' selected ';?>>Bosnian</option>
312
+ <option value="ms" <?php if ($hupso_share_image_lang == 'ms') echo ' selected ';?>>Malay</option>
313
+ <option value="zh" <?php if ($hupso_share_image_lang == 'zh') echo ' selected ';?>>Chinese</option>
314
  </select><br/>
315
  <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/>
316
+ <hr style="height:1px; width:500px;"/>
317
  </td>
318
  </tr>
319
  </table>
330
  </div>
331
  <?php
332
  $checked = ' checked="checked" ';
333
+ $twitter_tweet_checked = '';
334
+ $facebook_like_checked = '';
335
+ $facebook_send_checked = '';
336
+ $google_plus_one_checked = '';
337
+ $linkedin_share_checked = '';
338
 
339
  $twitter_tweet = get_option( 'hupso_twitter_tweet', '1' );
340
  if ( $twitter_tweet == 1 ) $twitter_tweet_checked = $checked;
382
  <td><input type="checkbox" name="linkedin_share" onclick="hupso_create_code()" value="1" <?php echo $linkedin_share_checked;?> /></td>
383
  <td><img src="<?php echo $hupso_plugin_url; ?>/img/counters/linkedin_share.png" /></td>
384
  <td></td>
385
+ </tr>
386
+ <tr>
387
+ <td style="padding-top:70px;">&nbsp;</td>
388
+ <td><? _e('Show counters in language', 'share_buttons_hupso');?>:
389
+ <select id="hupso_counters_lang" name="hupso_counters_lang" onchange="hupso_create_code()" onclick="hupso_create_code()">
390
+ <?php hupso_counters_lang_list(); ?>
391
+ </select><br/><br/>
392
+ (<?php _e('Language changes will not show in preview', 'share_buttons_hupso');?>)
393
+ </td><td><?php _e('Select which language to use for Counters (Tweet, Facebook Like, Facebook Share...)', 'share_buttons_hupso');?>.<?php _e('Some social networks support more languages than others, so some buttons might get translated, while some might stay in English', 'share_buttons_hupso');?>.</td>
394
+ </tr>
395
  </table>
396
 
397
  </td>
398
  </tr>
399
  </table>
400
+
401
  </div>
402
  <div id="show_icons">
403
  <table border="0">
406
  <?php
407
  $menu_type = get_option( 'hupso_menu_type', 'labels' );
408
  $checked = ' checked="checked" ';
409
+ $hupso_labels_checked = '';
410
+ $hupso_icons_checked = '';
411
  switch ( $menu_type ) {
412
  case 'labels': $hupso_labels_checked = $checked; break;
413
  case 'icons' : $hupso_icons_checked = $checked; break;
415
  }
416
 
417
  ?>
418
+ <td><hr style="height:1px; width:500px;"/><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/>
419
  <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>
420
  </tr>
421
  </table>
427
  <?php
428
  $button_position = get_option( 'hupso_button_position', 'below' );
429
  $checked = ' checked="checked" ';
430
+ $hupso_below_checked = '';
431
+ $hupso_above_checked = '';
432
  switch ( $button_position ) {
433
  case 'below': $hupso_below_checked = $checked; break;
434
  case 'above' : $hupso_above_checked = $checked; break;
435
  default: $hupso_below_checked = $checked;
436
  }
437
  ?>
438
+ <td><hr style="height:1px; width:500px;" align="left"/>
439
  <input type="radio" name="hupso_button_position" value="above" <?php echo $hupso_above_checked; ?> /> <?php _e('Above the post', 'share_buttons_hupso'); ?><br/>
440
  <input type="radio" name="hupso_button_position" value="below" <?php echo $hupso_below_checked; ?> /> <?php _e('Below the post', 'share_buttons_hupso'); ?><br/></td>
441
  </tr>
442
  <tr>
443
  <td style="width:100px;"><?php _e('Show buttons on', 'share_buttons_hupso'); ?></td>
444
+ <td><hr style="height:1px; width:500px;" align="left"/>
445
  <?php
446
  $checked = ' checked="checked" ';
447
+ $hupso_show_posts_checked = '';
448
+ $hupso_show_pages_checked = '';
449
+ $hupso_show_frontpage_checked = '';
450
+ $hupso_show_category_checked = '';
451
 
452
  /* posts */
453
  $hupso_show_posts = get_option( 'hupso_show_posts', '1' );
485
  </tr>
486
  <tr>
487
  <td style="width:100px;"><?php _e('Hide buttons for specific categories', 'share_buttons_hupso'); ?></td>
488
+ <td><hr style="height:1px; width:500px;" align="left"/>
489
  <?php
490
  /* hidden categories */
491
  $hupso_hide_categories = get_option( 'hupso_hide_categories', array() );
515
  </tr>
516
  <tr>
517
  <td style="width:100px;"><?php _e('Get share text from', 'share_buttons_hupso'); ?></td>
518
+ <td><hr style="height:1px; width:500px;" align="left"/>
519
  <?php
520
  $checked = ' checked="checked" ';
521
+ $hupso_title_text_page_checked = '';
522
+ $hupso_title_text_post_checked = '';
523
 
524
  /* posts */
525
  $hupso_title_text = get_option( 'hupso_title_text', 'post' );
528
  else
529
  $hupso_title_text_post_checked = $checked;
530
  ?>
531
+ <input type="radio" name="hupso_title_text" value="post" <?php echo $hupso_title_text_post_checked; ?> /> <?php _e('Title of post in Wordpress', 'share_buttons_hupso'); ?><br/>
532
  <input type="radio" name="hupso_title_text" value="page" <?php echo $hupso_title_text_page_checked; ?> /> <?php _e('Title of current web page', 'share_buttons_hupso'); ?>
533
  </td>
534
+ </tr>
535
+
536
+ <tr>
537
+ <td style="width:100px;"><?php _e('Twitter via', 'share_buttons_hupso'); ?></td>
538
+ <td><hr style="height:1px; width:500px;" align="left"/>
539
+ <?php
540
+
541
+ /* Twitter via */
542
+ $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
543
+
544
+ ?>
545
+ @<input type="text" name="hupso_twitter_via" onclick="hupso_create_code()" onchange="hupso_create_code()" onmouseout="hupso_create_code()" value="<?php echo $hupso_twitter_via; ?>" /> <span style="padding-left:30px;"><?php _e('Add "via @yourprofile" to tweets', 'share_buttons_hupso');?>.</span><br/>
546
+ </td>
547
+ </tr>
548
+
549
+ <tr>
550
+ <td style="width:100px;"><?php _e('CSS style', 'share_buttons_hupso'); ?></td>
551
+ <td><hr style="height:1px; width:400px;" align="left"/>
552
+ <?php
553
+
554
+ /* CSS Style */
555
+ $hupso_css_style = get_option( 'hupso_css_style', 'padding-bottom:20px; padding-top:10px;');
556
+
557
+ ?>
558
+ <input type="text" name="hupso_css_style" style="width:400px;" value="<?php echo $hupso_css_style;?>" /><br/><span><?php _e('Use CSS to style share buttons. For example: you can increase padding to have more free space above or below the buttons', 'share_buttons_hupso');?>.</span><br/>
559
+ </td>
560
+ </tr>
561
+
562
+
563
+
564
+
565
+
566
  </table>
567
  <br/><br/><input class="button-primary" name="submit" type="submit" onclick="hupso_create_code()" value="<?php _e('Save Settings', 'share_buttons_hupso'); ?>" />
568
  </form>
580
  global $hupso_all_services, $hupso_default_services, $hupso_plugin_url;
581
  update_option( 'hupso_custom', '1' );
582
 
583
+ if ( @$_POST[ 'button_type' ] != '' )
584
  $post = true;
585
  else
586
  $post = false;
587
 
588
  /* save button type */
589
  if ( $post ) {
590
+ $hupso_button_type = @$_POST[ 'button_type' ];
591
  update_option( 'hupso_button_type', $hupso_button_type );
592
  } else {
593
  $hupso_button_type = get_option ( 'hupso_button_type', 'share_toolbar');
595
 
596
  /* save button size */
597
  if ( $post ) {
598
+ $hupso_button_size = @$_POST[ 'size' ];
599
  update_option( 'hupso_button_size', $hupso_button_size );
600
  } else {
601
  $hupso_button_size = get_option ( 'hupso_button_size', 'button100x23');
605
 
606
  /* save toolbar size */
607
  if ( $post ) {
608
+ $hupso_toolbar_size = @$_POST[ 'select_toolbar_size' ];
609
  update_option( 'hupso_toolbar_size', $hupso_toolbar_size );
610
  } else {
611
  $hupso_button_size = get_option ( 'hupso_toolbar_size', 'medium');
613
 
614
  /* save share_image */
615
  if ( $post ) {
616
+ $hupso_share_image = @$_POST[ 'hupso_share_image' ];
617
  update_option( 'hupso_share_image', $hupso_share_image );
618
  } else {
619
  $hupso_share_image = get_option ( 'hupso_share_image', 'normal');
621
 
622
  /* save share_image_lang */
623
  if ( $post ) {
624
+ $hupso_share_image_lang = @$_POST[ 'share_image_lang' ];
625
  update_option( 'hupso_share_image_lang', $hupso_share_image_lang );
626
  } else {
627
  $hupso_share_image_lang = get_option ( 'hupso_share_image_lang', '');
633
  $service_name = strtolower( $service_text );
634
  $service_name = str_replace( ' ', '', $service_name );
635
  if ( $post ) {
636
+ $value = @$_POST[ $service_name ];
637
  update_option( 'hupso_' . $service_name, $value );
638
  }
639
  else {
646
  $hupso_vars .= ');';
647
  $hupso_vars = str_replace( ',)', ')', $hupso_vars );
648
 
649
+ /* save hupso_counters_lang*/
650
+ if ( $post ) {
651
+ $hupso_counters_lang = @$_POST[ 'hupso_counters_lang' ];
652
+ update_option( 'hupso_counters_lang', $hupso_counters_lang );
653
+ }
654
+
655
  /* save menu type */
656
  if ( $post ) {
657
+ $hupso_menu_type = @$_POST[ 'menu_type' ];
658
  update_option( 'hupso_menu_type', $hupso_menu_type );
659
  }
660
  else {
664
 
665
  /* save button position */
666
  if ( $post ) {
667
+ $hupso_button_position = @$_POST[ 'hupso_button_position' ];
668
  update_option( 'hupso_button_position', $hupso_button_position );
669
  }
670
  else {
673
 
674
  /* save display options */
675
  if ( $post ) {
676
+ $hupso_show_posts = @$_POST[ 'hupso_show_posts' ];
677
  update_option( 'hupso_show_posts', $hupso_show_posts );
678
 
679
+ $hupso_show_pages = @$_POST[ 'hupso_show_pages' ];
680
  update_option( 'hupso_show_pages', $hupso_show_pages );
681
 
682
+ $hupso_show_frontpage = @$_POST[ 'hupso_show_frontpage' ];
683
  update_option( 'hupso_show_frontpage', $hupso_show_frontpage );
684
 
685
+ $hupso_show_category = @$_POST[ 'hupso_show_category' ];
686
  update_option( 'hupso_show_category', $hupso_show_category );
687
  }
688
 
689
  /* save options for counters */
690
  if ( $post ) {
691
+ $twitter_tweet = @$_POST[ 'twitter_tweet' ];
692
  update_option( 'hupso_twitter_tweet', $twitter_tweet );
693
 
694
+ $facebook_like = @$_POST[ 'facebook_like' ];
695
  update_option( 'hupso_facebook_like', $facebook_like );
696
 
697
+ $facebook_send = @$_POST[ 'facebook_send' ];
698
  update_option( 'hupso_facebook_send', $facebook_send );
699
 
700
+ $google_plus_one = @$_POST[ 'google_plus_one' ];
701
  update_option( 'hupso_google_plus_one', $google_plus_one );
702
 
703
+ $linkedin_share = @$_POST[ 'linkedin_share' ];
704
  update_option( 'hupso_linkedin_share', $linkedin_share );
705
  }
706
 
707
  /* Get title for sharing from */
708
  if ( $post ) {
709
+ $hupso_title_text = @$_POST[ 'hupso_title_text' ];
710
  update_option( 'hupso_title_text', $hupso_title_text );
711
  }
712
 
713
+ /* Save twitter_via */
714
+ if ( $post ) {
715
+ $hupso_twitter_via = @$_POST[ 'hupso_twitter_via' ];
716
+ update_option( 'hupso_twitter_via', $hupso_twitter_via );
717
+ }
718
+
719
+ /* Save CSS style */
720
+ if ( $post ) {
721
+ $hupso_css_style = @$_POST[ 'hupso_css_style' ];
722
+ update_option( 'hupso_css_style', $hupso_css_style );
723
+ }
724
+
725
  /* save hupso_hide_categories */
726
  if ( $post ) {
727
+ $hupso_hide_categories = @$_POST['hupso_hide_categories'];
728
  update_option( 'hupso_hide_categories', $hupso_hide_categories );
729
  }
730
 
731
  /* save button code */
732
  if ( $post ) {
733
+ $code = stripslashes(@$_POST[ 'code' ]);
734
  update_option( 'hupso_share_buttons_code', $code );
735
  }
736
 
800
  }
801
 
802
  $hupso_title_text = get_option( 'hupso_title_text' , 'post' );
803
+ $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
804
+ $hupso_counters_lang = get_option( 'hupso_counters_lang', 'en_US' );
805
  $post_url = get_permalink($GLOBALS['post']->ID);
806
  $post_title = $GLOBALS['post']->post_title;
807
 
850
  }
851
 
852
 
853
+ /* hupso_counters_lang */
854
+ $code .= 'var hupso_counters_lang="' . $hupso_counters_lang . '";';
855
+
856
+ /* Twitter via @ */
857
+ if ( $hupso_twitter_via != '') {
858
+ $code .= 'var hupso_twitter_via="' . $hupso_twitter_via . '";';
859
+ }
860
+
861
  if ( ( is_home() && $hupso_show_frontpage == 1 ) || ( is_archive() && $hupso_show_category == 1 ) ) {
862
  switch ( $button_type ) {
863
  case 'share_button':
906
 
907
  $position = get_option( 'hupso_button_position', 'below' );
908
 
909
+ $hupso_css_style = get_option( 'hupso_css_style', 'padding-bottom:20px; padding-top:10px;');
910
+ if ($hupso_css_style != '') {
911
+ $hupso_css_out = ' style="' . $hupso_css_style . '" ';
912
+ }
913
+ else {
914
+ $hupso_css_out = '';
915
+ }
916
+
917
  if ( stripos($content, '[hupso]') !== false) {
918
+ $new_content = str_ireplace('[hupso]', '<div' . $hupso_css_out. '>' . $code . '</div>', $content);
919
  }
920
  else {
921
  if ( $position == 'below' ) {
922
+ $new_content = $content . '<div' . $hupso_css_out. '>' . $code . '</div>';
923
  }
924
  else {
925
+ $new_content = '<div' . $hupso_css_out. '>' . $code . '</div>' . $content;
926
  }
927
  }
928
 
964
  }
965
 
966
 
967
+ function hupso_counters_lang_list() {
968
+ $languages = array (
969
+ 'af_ZA' => 'Afrikaans',
970
+ 'ar_AR' => 'Arabic',
971
+ 'az_AZ' => 'Azerbaijani',
972
+ 'be_BY' => 'Belarusian',
973
+ 'bg_BG' => 'Bulgarian',
974
+ 'bn_IN' => 'Bengali',
975
+ 'bs_BA' => 'Bosnian',
976
+ 'ca_ES' => 'Catalan',
977
+ 'cs_CZ' => 'Czech',
978
+ 'cy_GB' => 'Welsh',
979
+ 'da_DK' => 'Danish',
980
+ 'de_DE' => 'German',
981
+ 'el_GR' => 'Greek',
982
+ 'en_GB' => 'English (UK)',
983
+ 'eo_EO' => 'Esperanto',
984
+ 'es_ES' => 'Spanish (Spain)',
985
+ 'es_LA' => 'Spanish',
986
+ 'et_EE' => 'Estonian',
987
+ 'eu_ES' => 'Basque',
988
+ 'fa_IR' => 'Persian',
989
+ 'fi_FI' => 'Finnish',
990
+ 'fo_FO' => 'Faroese',
991
+ 'fr_CA' => 'French (Canada)',
992
+ 'fr_FR' => 'French (France)',
993
+ 'fy_NL' => 'Frisian',
994
+ 'ga_IE' => 'Irish',
995
+ 'gl_ES' => 'Galician',
996
+ 'he_IL' => 'Hebrew',
997
+ 'hi_IN' => 'Hindi',
998
+ 'hr_HR' => 'Croatian',
999
+ 'hu_HU' => 'Hungarian',
1000
+ 'hy_AM' => 'Armenian',
1001
+ 'id_ID' => 'Indonesian',
1002
+ 'is_IS' => 'Icelandic',
1003
+ 'it_IT' => 'Italian',
1004
+ 'ja_JP' => 'Japanese',
1005
+ 'ka_GE' => 'Georgian',
1006
+ 'km_KH' => 'Khmer',
1007
+ 'ko_KR' => 'Korean',
1008
+ 'ku_TR' => 'Kurdish',
1009
+ 'la_VA' => 'Latin',
1010
+ 'lt_LT' => 'Lithuanian',
1011
+ 'lv_LV' => 'Latvian',
1012
+ 'mk_MK' => 'Macedonian',
1013
+ 'ml_IN' => 'Malayalam',
1014
+ 'ms_MY' => 'Malay',
1015
+ 'nb_NO' => 'Norwegian (bokmal)',
1016
+ 'ne_NP' => 'Nepali',
1017
+ 'nl_NL' => 'Dutch',
1018
+ 'nn_NO' => 'Norwegian (nynorsk)',
1019
+ 'pa_IN' => 'Punjabi',
1020
+ 'pl_PL' => 'Polish',
1021
+ 'ps_AF' => 'Pashto',
1022
+ 'pt_BR' => 'Portuguese (Brazil)',
1023
+ 'pt_PT' => 'Portuguese (Portugal)',
1024
+ 'ro_RO' => 'Romanian',
1025
+ 'ru_RU' => 'Russian',
1026
+ 'sk_SK' => 'Slovak',
1027
+ 'sl_SI' => 'Slovenian',
1028
+ 'sq_AL' => 'Albanian',
1029
+ 'sr_RS' => 'Serbian',
1030
+ 'sv_SE' => 'Swedish',
1031
+ 'sw_KE' => 'Swahili',
1032
+ 'ta_IN' => 'Tamil',
1033
+ 'te_IN' => 'Telugu',
1034
+ 'th_TH' => 'Thai',
1035
+ 'tl_PH' => 'Filipino',
1036
+ 'tr_TR' => 'Turkish',
1037
+ 'uk_UA' => 'Ukrainian',
1038
+ 'vi_VN' => 'Vietnamese',
1039
+ 'zh_CN' => 'Chinese - Simplified (China)',
1040
+ 'zh_HK' => 'Chinese - Traditional (Hong Kong)',
1041
+ 'zh_TW' => 'Chinese - Traditional (Taiwan)',
1042
+ );
1043
+
1044
+ asort($languages);
1045
+ echo '<option value="en_US">English (US)</option>';
1046
+ $hupso_counters_lang = get_option( 'hupso_counters_lang', 'en_US' );
1047
+ if ($hupso_counters_lang == '') {
1048
+ $hupso_counters_lang = 'en_US';
1049
+ }
1050
+
1051
+ foreach ($languages as $lang_code => $lang_name ) {
1052
+ if ($lang_code == $hupso_counters_lang)
1053
+ $sel_lang = ' selected ';
1054
+ else
1055
+ $sel_lang = '';
1056
+ echo '<option value="' . $lang_code . '"'. $sel_lang .'>' . $lang_name . '</option>';
1057
+ }
1058
+
1059
+ }
1060
+
1061
+
1062
 
1063
 
1064
  ?>