AddToAny Share Buttons - Version 1.4

Version Description

  • New: Share counters in the same style for Facebook, Twitter, Pinterest, Linkedin and Reddit!
    • In Settings > AddToAny > Standalone Buttons, click the down arrow and toggle the "Show count" checkbox for any supported service
  • Floating buttons do not display share counts in this release
  • Update CSS to support AddToAny share counters
Download this release

Release Info

Developer micropat
Plugin Icon 128x128 AddToAny Share Buttons
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.8.1 to 1.4

Files changed (4) hide show
  1. README.txt +14 -3
  2. add-to-any.php +14 -4
  3. addtoany.admin.php +60 -25
  4. addtoany.min.css +1 -1
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: micropat, addtoany
3
  Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, socialize, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, +1, plus 1, google +1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 4.1
6
- Stable tag: 1.3.8.1
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
9
 
@@ -15,11 +15,12 @@ AddToAny's customizable platform and social share icons let you optimize your si
15
 
16
  = Share Buttons =
17
 
18
- * **New**: Floating share buttonsresponsive & customizable, vertical & horizontal
 
19
  * Vector sharing buttons (SVG sharing icons)
20
  * Universal Share Button and Smart Menu
21
  * Sharing Kit for individual share links
22
- * Custom sharing icons
23
  * Choose from over 100 individual services
24
  * 3rd party buttons include the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button and Google +1 Button
25
  * Universal email sharing makes it easy to share via Gmail, Yahoo! Mail, Outlook.com (Hotmail), AOL Mail, and any other web and native apps
@@ -36,6 +37,7 @@ AddToAny's customizable platform and social share icons let you optimize your si
36
 
37
  * Automatic Google Analytics integration (<a href="https://www.addtoany.com/ext/google_analytics/">access guide</a>) for sharing analytics
38
  * Track shared links with bit.ly, awe.sm, goo.gl, and custom URL shorteners
 
39
 
40
  = WordPress Optimized =
41
 
@@ -290,6 +292,12 @@ Upload the plugin directory (including all files and directories within) to the
290
 
291
  == Changelog ==
292
 
 
 
 
 
 
 
293
  = 1.3.8.1 =
294
  * Add LINE icon (thanks tokyodev)
295
  * Add Mixi icon
@@ -1213,6 +1221,9 @@ Upload the plugin directory (including all files and directories within) to the
1213
 
1214
  == Upgrade Notice ==
1215
 
 
 
 
1216
  = 1.3.1 =
1217
  Floating share buttons are now responsive by default, ready for mobile & tablets. You can toggle responsiveness and set responsive breakpoints in the "Floating" tab of Settings > AddToAny.
1218
 
3
  Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, socialize, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, +1, plus 1, google +1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 4.1
6
+ Stable tag: 1.4
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
9
 
15
 
16
  = Share Buttons =
17
 
18
+ * **New**: AddToAny share countersfast & official counts in the same style
19
+ * Floating share buttons — responsive & customizable, vertical & horizontal
20
  * Vector sharing buttons (SVG sharing icons)
21
  * Universal Share Button and Smart Menu
22
  * Sharing Kit for individual share links
23
+ * Custom share icons
24
  * Choose from over 100 individual services
25
  * 3rd party buttons include the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button and Google +1 Button
26
  * Universal email sharing makes it easy to share via Gmail, Yahoo! Mail, Outlook.com (Hotmail), AOL Mail, and any other web and native apps
37
 
38
  * Automatic Google Analytics integration (<a href="https://www.addtoany.com/ext/google_analytics/">access guide</a>) for sharing analytics
39
  * Track shared links with bit.ly, awe.sm, goo.gl, and custom URL shorteners
40
+ * Display share counts on posts and pages
41
 
42
  = WordPress Optimized =
43
 
292
 
293
  == Changelog ==
294
 
295
+ = 1.4 =
296
+ * New: Share counters in the same style for Facebook, Twitter, Pinterest, Linkedin and Reddit!
297
+ * In Settings > AddToAny > Standalone Buttons, click the down arrow and toggle the "Show count" checkbox for any supported service
298
+ * Floating buttons do not display share counts in this release
299
+ * Update CSS to support AddToAny share counters
300
+
301
  = 1.3.8.1 =
302
  * Add LINE icon (thanks tokyodev)
303
  * Add Mixi icon
1221
 
1222
  == Upgrade Notice ==
1223
 
1224
+ = 1.4 =
1225
+ AddToAny share counters are now available for supported standalone buttons! For Facebook, Twitter, Pinterest, Reddit and Linkedin, click the down arrow and toggle the "Show count" checkbox.
1226
+
1227
  = 1.3.1 =
1228
  Floating share buttons are now responsive by default, ready for mobile & tablets. You can toggle responsiveness and set responsive breakpoints in the "Floating" tab of Settings > AddToAny.
1229
 
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.3.8.1
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  */
@@ -259,6 +259,14 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
259
  } else {
260
  $custom_service = false;
261
  }
 
 
 
 
 
 
 
 
262
 
263
  $icon_url = ( isset( $service['icon_url'] ) ) ? $service['icon_url'] : false;
264
  $icon = ( isset( $service['icon'] ) ) ? $service['icon'] : 'default'; // Just the icon filename
@@ -267,9 +275,10 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
267
 
268
  $url = ( $custom_service ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&amp;linkname=" . $linkname_enc;
269
  $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . ".png";
270
- $class_attr = ( $custom_service ) ? "" : " class=\"a2a_button_$safe_name\"";
 
271
 
272
- // Remove all dimention values if using custom icons
273
  if ( isset( $custom_icons ) ) {
274
  $width = '';
275
  $height = '';
@@ -559,6 +568,7 @@ function ADDTOANY_SHARE_SAVE_FLOATING( $args = array() ) {
559
  'linkurl_enc' => '',
560
  'use_current_page' => true,
561
  'output_later' => false,
 
562
  'is_kit' => true,
563
  'no_addtoany_list_classname' => true,
564
  'no_special_services' => true,
@@ -912,7 +922,7 @@ function A2A_SHARE_SAVE_stylesheet() {
912
  // Use stylesheet?
913
  if ( ! isset( $options['inline_css'] ) || $options['inline_css'] != '-1' && ! is_admin() ) {
914
 
915
- wp_enqueue_style( 'A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.7' );
916
 
917
  // wp_add_inline_style requires WP 3.3+
918
  if ( '3.3' <= get_bloginfo( 'version' ) ) {
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.4
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  */
259
  } else {
260
  $custom_service = false;
261
  }
262
+
263
+ // AddToAny counter enabled?
264
+ $counter_enabled = ( ! isset( $is_floating ) // Disable counters on floating buttons for now
265
+ && in_array( $active_service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) )
266
+ && isset( $options['special_' . $active_service . '_options'] )
267
+ && isset( $options['special_' . $active_service . '_options']['show_count'] )
268
+ && $options['special_' . $active_service . '_options']['show_count'] == '1'
269
+ ) ? true : false;
270
 
271
  $icon_url = ( isset( $service['icon_url'] ) ) ? $service['icon_url'] : false;
272
  $icon = ( isset( $service['icon'] ) ) ? $service['icon'] : 'default'; // Just the icon filename
275
 
276
  $url = ( $custom_service ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&amp;linkname=" . $linkname_enc;
277
  $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . ".png";
278
+ $counter = ( $counter_enabled ) ? ' a2a_counter' : '';
279
+ $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
280
 
281
+ // Remove all dimension values if using custom icons
282
  if ( isset( $custom_icons ) ) {
283
  $width = '';
284
  $height = '';
568
  'linkurl_enc' => '',
569
  'use_current_page' => true,
570
  'output_later' => false,
571
+ 'is_floating' => true,
572
  'is_kit' => true,
573
  'no_addtoany_list_classname' => true,
574
  'no_special_services' => true,
922
  // Use stylesheet?
923
  if ( ! isset( $options['inline_css'] ) || $options['inline_css'] != '-1' && ! is_admin() ) {
924
 
925
+ wp_enqueue_style( 'A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.8' );
926
 
927
  // wp_add_inline_style requires WP 3.3+
928
  if ( '3.3' <= get_bloginfo( 'version' ) ) {
addtoany.admin.php CHANGED
@@ -288,8 +288,18 @@ function A2A_SHARE_SAVE_options_page() {
288
  $active_services = array();
289
  if ( ! isset( $_POST['A2A_SHARE_SAVE_active_services'] ) )
290
  $_POST['A2A_SHARE_SAVE_active_services'] = array();
291
- foreach ( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename )
292
- $active_services[] = substr( $sitename, 7 );
 
 
 
 
 
 
 
 
 
 
293
  $new_options['active_services'] = $active_services;
294
 
295
  // Store special service options
@@ -411,32 +421,36 @@ function A2A_SHARE_SAVE_options_page() {
411
  </ul>
412
  <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", "add-to-any"); ?></p>
413
  <ul id="addtoany_services_selectable" class="addtoany_admin_list">
414
- <li id="a2a_wp_facebook_like" class="addtoany_special_service" title="Facebook Like button">
415
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
416
  </li>
417
- <li id="a2a_wp_twitter_tweet" class="addtoany_special_service" title="Twitter Tweet button">
418
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
419
  </li>
420
- <li id="a2a_wp_google_plusone" class="addtoany_special_service" title="Google +1 button">
421
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
422
  </li>
423
- <li id="a2a_wp_google_plus_share" class="addtoany_special_service" title="Google+ Share button">
424
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="56" height="20" alt="Google+ Share" /></span>
425
  </li>
426
- <li id="a2a_wp_pinterest_pin" class="addtoany_special_service" title="Pinterest Pin It button">
427
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
428
  </li>
429
  <?php
430
  // Show all services
431
  foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
432
- if (isset($site['href']))
433
  $custom_service = true;
434
  else
435
  $custom_service = false;
436
- if ( ! isset($site['icon']))
 
437
  $site['icon'] = 'default';
 
 
 
438
  ?>
439
- <li data-addtoany-icon-name="<?php echo $site['icon']; ?>" id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
440
  <span><img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url_path.'/icons/'.$site['icon'].'.png'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '16'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '16'; ?>" alt="" /><?php echo $site['name']; ?></span>
441
  </li>
442
  <?php
@@ -764,7 +778,7 @@ function A2A_SHARE_SAVE_admin_head() {
764
  jQuery('.addtoany_icon_size_large').show('fast', select_proper_radio);
765
 
766
  // Switch to large standalone icons
767
- jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
768
  return jQuery(this).data('a2a_32_icon_html');
769
  });
770
 
@@ -778,7 +792,7 @@ function A2A_SHARE_SAVE_admin_head() {
778
  jQuery('.addtoany_icon_size_small').show('fast', select_proper_radio);
779
 
780
  // Switch to small standalone icons
781
- jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
782
  return jQuery(this).data('a2a_16_icon_html');
783
  });
784
 
@@ -817,9 +831,9 @@ function A2A_SHARE_SAVE_admin_head() {
817
 
818
  var services_array = jQuery(this_sortable).sortable('toArray'),
819
  services_size = services_array.length;
820
- if(services_size<1) return;
821
 
822
- for(var i=0, service_name, show_count_value, fb_verb_value; i < services_size; i++){
823
  if(services_array[i]!='') { // Exclude dummy icon
824
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
825
 
@@ -835,6 +849,10 @@ function A2A_SHARE_SAVE_admin_head() {
835
  fb_verb_value = (jQuery('#' + services_array[i] + '_verb').val() == 'recommend') ? 'recommend' : 'like';
836
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
837
  }
 
 
 
 
838
  }
839
  }
840
  }
@@ -855,6 +873,7 @@ function A2A_SHARE_SAVE_admin_head() {
855
  this_service = jQuery(this),
856
  this_service_name = this_service.attr('id').substr(7),
857
  this_service_is_special = this_service.hasClass('addtoany_special_service'),
 
858
  checked = '',
859
  special_options_html = '';
860
 
@@ -888,12 +907,12 @@ function A2A_SHARE_SAVE_admin_head() {
888
 
889
  new_service.data('a2a_16_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
890
 
891
- if (this_service_is_special)
892
- // If special service, set the same HTML as used for '16px icon size'
893
  new_service.data( 'a2a_32_icon_html', new_service.data('a2a_16_icon_html') );
894
  else
895
  // Set HTML for 32px icon size
896
- new_service.data( 'a2a_32_icon_html', '<span class="a2a_svg a2a_s__default a2a_s_' + this_service.attr('data-addtoany-icon-name') + '"></span>' );
897
 
898
  new_service.html( new_service.data('a2a_' + icon_size + '_icon_html') )
899
  .click(function(){
@@ -947,19 +966,34 @@ function A2A_SHARE_SAVE_admin_head() {
947
  if($admin_services_saved)
948
  $active_services_last = substr($active_services_last, 7); // Remove a2a_wp_
949
  $active_services_quoted = '';
 
950
  foreach ($active_services as $service) {
951
- if($admin_services_saved)
952
- $service = substr($service, 7); // Remove a2a_wp_
953
  $active_services_quoted .= '"' . esc_js( $service ) . '"';
954
  if ( $service != $active_services_last )
955
  $active_services_quoted .= ',';
 
 
 
 
 
 
 
 
 
 
 
 
956
  }
957
  ?>
958
  var services = [<?php echo $active_services_quoted; ?>],
959
  service_options = {};
960
 
961
  <?php
962
- // Special service options
 
 
963
  if ( isset( $_POST['addtoany_facebook_like_verb'] ) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
964
  || ! isset( $_POST['addtoany_facebook_like_verb'] )
965
  && isset( $options['special_facebook_like_options'] ) && $options['special_facebook_like_options']['verb'] == 'recommend' ) {
@@ -1023,15 +1057,16 @@ function A2A_SHARE_SAVE_admin_head() {
1023
  #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
1024
  #addtoany_services_selectable li:active{border:1px solid #000;}
1025
  #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
1026
- #addtoany_services_selectable .addtoany_special_service{padding:3px 6px;}
1027
- #addtoany_services_selectable .addtoany_special_service img{width:auto;height:20px;}
1028
 
1029
- #addtoany_services_sortable li, #addtoany_services_sortable li.dummy:hover{cursor:move;float:left;padding:9px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;}
1030
  #addtoany_services_sortable li:hover{border:1px solid #AAA;background-color:#FFF;}
1031
  #addtoany_services_sortable li.dummy, #addtoany_services_sortable li.dummy:hover{cursor:auto;background-color:transparent;}
1032
  #addtoany_services_sortable img{width:16px;height:16px;border:0;vertical-align:middle;}
1033
- #addtoany_services_sortable .addtoany_special_service img{width:auto;height:20px;float:left;}
1034
- #addtoany_services_sortable .addtoany_special_service span.down_arrow{background:url(<?php echo admin_url( '/images/arrows.png' ); ?>) no-repeat 5px 9px;float:right;height:29px;;margin:-6px 0 -6px 4px;width:26px;}
 
1035
  #addtoany_services_sortable .addtoany_special_service div.special_options{display:none;font-size:11px;margin-top:9px;}
1036
  #addtoany_services_sortable .addtoany_special_service_options_selected{border:1px solid #AAA;background-color:#FFF;}
1037
  #addtoany_services_sortable .addtoany_special_service_options_selected span.down_arrow{display:none;}
288
  $active_services = array();
289
  if ( ! isset( $_POST['A2A_SHARE_SAVE_active_services'] ) )
290
  $_POST['A2A_SHARE_SAVE_active_services'] = array();
291
+ foreach ( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename ) {
292
+ $service = substr( $sitename, 7 );
293
+ $active_services[] = $service;
294
+
295
+ // AddToAny counter enabled?
296
+ if ( in_array( $service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) ) {
297
+ $new_options['special_' . $service . '_options'] = array(
298
+ 'show_count' => ( ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1') ? '1' : '-1' )
299
+ );
300
+ }
301
+ }
302
+
303
  $new_options['active_services'] = $active_services;
304
 
305
  // Store special service options
421
  </ul>
422
  <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", "add-to-any"); ?></p>
423
  <ul id="addtoany_services_selectable" class="addtoany_admin_list">
424
+ <li id="a2a_wp_facebook_like" class="addtoany_special_service addtoany_3p_button" title="Facebook Like button">
425
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
426
  </li>
427
+ <li id="a2a_wp_twitter_tweet" class="addtoany_special_service addtoany_3p_button" title="Twitter Tweet button">
428
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
429
  </li>
430
+ <li id="a2a_wp_google_plusone" class="addtoany_special_service addtoany_3p_button" title="Google +1 button">
431
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
432
  </li>
433
+ <li id="a2a_wp_google_plus_share" class="addtoany_special_service addtoany_3p_button" title="Google+ Share button">
434
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="56" height="20" alt="Google+ Share" /></span>
435
  </li>
436
+ <li id="a2a_wp_pinterest_pin" class="addtoany_special_service addtoany_3p_button" title="Pinterest Pin It button">
437
  <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
438
  </li>
439
  <?php
440
  // Show all services
441
  foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
442
+ if ( isset( $site['href'] ) )
443
  $custom_service = true;
444
  else
445
  $custom_service = false;
446
+
447
+ if ( ! isset( $site['icon'] ) )
448
  $site['icon'] = 'default';
449
+
450
+ $special_service = ( in_array( $service_safe_name, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) )
451
+ ? ' class="addtoany_special_service"' : '';
452
  ?>
453
+ <li data-addtoany-icon-name="<?php echo $site['icon']; ?>"<?php echo $special_service; ?> id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
454
  <span><img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url_path.'/icons/'.$site['icon'].'.png'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '16'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '16'; ?>" alt="" /><?php echo $site['name']; ?></span>
455
  </li>
456
  <?php
778
  jQuery('.addtoany_icon_size_large').show('fast', select_proper_radio);
779
 
780
  // Switch to large standalone icons
781
+ jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_3p_button, #addtoany_show_services').html(function() {
782
  return jQuery(this).data('a2a_32_icon_html');
783
  });
784
 
792
  jQuery('.addtoany_icon_size_small').show('fast', select_proper_radio);
793
 
794
  // Switch to small standalone icons
795
+ jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_3p_button, #addtoany_show_services').html(function() {
796
  return jQuery(this).data('a2a_16_icon_html');
797
  });
798
 
831
 
832
  var services_array = jQuery(this_sortable).sortable('toArray'),
833
  services_size = services_array.length;
834
+ if (services_size < 1) return;
835
 
836
+ for (var i=0, service_name, show_count_value, fb_verb_value; i < services_size; i++) {
837
  if(services_array[i]!='') { // Exclude dummy icon
838
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
839
 
849
  fb_verb_value = (jQuery('#' + services_array[i] + '_verb').val() == 'recommend') ? 'recommend' : 'like';
850
  jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
851
  }
852
+ // AddToAny counters
853
+ } else if ( jQuery.inArray( service_name, ['facebook', 'twitter', 'pinterest', 'linkedin', 'reddit'] ) > -1 ) {
854
+ show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
855
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
856
  }
857
  }
858
  }
873
  this_service = jQuery(this),
874
  this_service_name = this_service.attr('id').substr(7),
875
  this_service_is_special = this_service.hasClass('addtoany_special_service'),
876
+ this_service_is_3p = this_service.hasClass('addtoany_3p_button'),
877
  checked = '',
878
  special_options_html = '';
879
 
907
 
908
  new_service.data('a2a_16_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
909
 
910
+ if (this_service_is_3p)
911
+ // If special third party service, set the same HTML as used for '16px icon size'
912
  new_service.data( 'a2a_32_icon_html', new_service.data('a2a_16_icon_html') );
913
  else
914
  // Set HTML for 32px icon size
915
+ new_service.data( 'a2a_32_icon_html', '<span class="a2a_svg a2a_s__default a2a_s_' + this_service.attr('data-addtoany-icon-name') + '"></span>' + configurable_html );
916
 
917
  new_service.html( new_service.data('a2a_' + icon_size + '_icon_html') )
918
  .click(function(){
966
  if($admin_services_saved)
967
  $active_services_last = substr($active_services_last, 7); // Remove a2a_wp_
968
  $active_services_quoted = '';
969
+ $counters_enabled_js = '';
970
  foreach ($active_services as $service) {
971
+ if ( $admin_services_saved )
972
+ $service = substr( $service, 7 ); // Remove a2a_wp_
973
  $active_services_quoted .= '"' . esc_js( $service ) . '"';
974
  if ( $service != $active_services_last )
975
  $active_services_quoted .= ',';
976
+
977
+ // AddToAny counter enabled?
978
+ if ( in_array( $service, array( 'facebook', 'twitter', 'pinterest', 'linkedin', 'reddit' ) ) ) {
979
+ if ( isset( $_POST['addtoany_' . $service . '_show_count'] ) && $_POST['addtoany_' . $service . '_show_count'] == '1'
980
+ || ! isset( $_POST['addtoany_' . $service . '_show_count'] )
981
+ && isset( $options['special_' . $service . '_options'] )
982
+ && isset( $options['special_' . $service . '_options']['show_count'] )
983
+ && $options['special_' . $service . '_options']['show_count'] == '1'
984
+ ) {
985
+ $counters_enabled_js .= 'service_options.' . $service . ' = {show_count: 1};';
986
+ }
987
+ }
988
  }
989
  ?>
990
  var services = [<?php echo $active_services_quoted; ?>],
991
  service_options = {};
992
 
993
  <?php
994
+ // Special service options (enabled counters) if any
995
+ echo $counters_enabled_js;
996
+
997
  if ( isset( $_POST['addtoany_facebook_like_verb'] ) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
998
  || ! isset( $_POST['addtoany_facebook_like_verb'] )
999
  && isset( $options['special_facebook_like_options'] ) && $options['special_facebook_like_options']['verb'] == 'recommend' ) {
1057
  #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
1058
  #addtoany_services_selectable li:active{border:1px solid #000;}
1059
  #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
1060
+ #addtoany_services_selectable .addtoany_3p_button{padding:4px 6px;}
1061
+ #addtoany_services_selectable .addtoany_3p_button img{width:auto;height:20px;}
1062
 
1063
+ #addtoany_services_sortable li, #addtoany_services_sortable li.dummy:hover{cursor:move;float:left;padding:14px 10px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;}
1064
  #addtoany_services_sortable li:hover{border:1px solid #AAA;background-color:#FFF;}
1065
  #addtoany_services_sortable li.dummy, #addtoany_services_sortable li.dummy:hover{cursor:auto;background-color:transparent;}
1066
  #addtoany_services_sortable img{width:16px;height:16px;border:0;vertical-align:middle;}
1067
+ #addtoany_services_sortable .addtoany_3p_button img{width:auto;height:20px;float:left;}
1068
+ #addtoany_services_sortable .addtoany_special_service {position: relative;}
1069
+ #addtoany_services_sortable .addtoany_special_service span.down_arrow{background:url(<?php echo admin_url( '/images/arrows.png' ); ?>) no-repeat 2px 9px;bottom: -6px;left: 50%;margin:0 0 0 -10px;position:absolute;height:29px;width:14px;}
1070
  #addtoany_services_sortable .addtoany_special_service div.special_options{display:none;font-size:11px;margin-top:9px;}
1071
  #addtoany_services_sortable .addtoany_special_service_options_selected{border:1px solid #AAA;background-color:#FFF;}
1072
  #addtoany_services_sortable .addtoany_special_service_options_selected span.down_arrow{display:none;}
addtoany.min.css CHANGED
@@ -1 +1 @@
1
- .addtoany_share_save_container{clear:both;margin:16px 0}.addtoany_list{display:inline;line-height:16px}.addtoany_list a{display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle}.addtoany_list a img{border:0;height:auto;opacity:1;overflow:hidden;vertical-align:top;width:auto}.addtoany_list.a2a_kit_size_32 a{font-size:32px}.addtoany_list.a2a_kit_size_32 a span{border-radius:4px;display:inline-block;height:32px;line-height:32px;opacity:1;width:32px}.addtoany_list a:hover img,.addtoany_list a:hover span{opacity:.7}.addtoany_list a.addtoany_special_service:hover img,.addtoany_list a.addtoany_special_service:hover span{opacity:1}.addtoany_special_service{display:inline-block;vertical-align:middle}.addtoany_special_service a,.addtoany_special_service div,.addtoany_special_service iframe,.addtoany_special_service span{margin:0;vertical-align:baseline}.addtoany_special_service iframe{max-width:none}a.addtoany_share_save.addtoany_no_icon span.a2a_img_text{display:none}a.addtoany_share_save img{border:0;width:auto;height:auto}
1
+ .addtoany_share_save_container{clear:both;margin:16px 0}.addtoany_list{display:inline;line-height:16px}.addtoany_list a{display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle}.addtoany_list a img{border:0;height:auto;opacity:1;overflow:hidden;vertical-align:top;width:auto}.addtoany_list a span{display:inline-block;float:none}.addtoany_list.a2a_kit_size_32 a{font-size:32px}.addtoany_list.a2a_kit_size_32 a span{border-radius:4px;display:inline-block;height:32px;line-height:32px;opacity:1;width:32px}.addtoany_list a .a2a_count{position:relative;vertical-align:top}.addtoany_list a:hover img,.addtoany_list a:hover span{opacity:.7}.addtoany_list a.addtoany_special_service:hover img,.addtoany_list a.addtoany_special_service:hover span{opacity:1}.addtoany_special_service{display:inline-block;vertical-align:middle}.addtoany_special_service a,.addtoany_special_service div,.addtoany_special_service iframe,.addtoany_special_service span{margin:0;vertical-align:baseline}.addtoany_special_service iframe{max-width:none}a.addtoany_share_save.addtoany_no_icon span.a2a_img_text{display:none}a.addtoany_share_save img{border:0;width:auto;height:auto}