AddToAny Share Buttons - Version 1.1.4

Version Description

  • Fix admin panel display of 3rd party button options after saving changes
  • Fix debug mode notices
Download this release

Release Info

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

Code changes from version 1.1.3 to 1.1.4

Files changed (2) hide show
  1. README.txt +8 -3
  2. add-to-any.php +28 -17
README.txt CHANGED
@@ -3,14 +3,15 @@ Contributors: micropat
3
  Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, email, e-mail, seo, button, delicious, google buzz, buzz, google, linkedin, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, wpmu, addtoany
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
- Stable tag: 1.1.3
7
 
8
  Sharing buttons for your pages from the universal sharing platform, including Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
10
  == Description ==
11
 
12
  The WordPress plugin to help people **share**, **bookmark**, and **email** your posts and pages using any service, such as Facebook, Twitter, Pinterest, Google, Reddit, StumbleUpon, LinkedIn, and well over 100 more sharing and social bookmarking sites.
13
- Advanced buttons include the **Facebook Like Button**, **Twitter Tweet Button**, **Google+ Share Button**, **Google+ Share Button** and **Google +1 Button**.
 
14
 
15
  This sharing plugin lets you customize the AddToAny universal Smart Menu, which places the services visitors use at the top of the menu, based on each visitor's usage history.
16
 
@@ -28,7 +29,7 @@ Standalone **share icons** let you optimize your blog posts & pages for specific
28
  * Easily customizable for beginners or advanced users, and highly extensible for developers and designers
29
  * Many more publisher and user features!
30
 
31
- After **years of active development**, over **2.4 million downloads**, and **ongoing support from the community**, this plugin still strives to be the best WordPress plugin for sharing. We love feedback.
32
 
33
  <a href="http://www.addtoany.com/share_save" title="Share">Share this</a> plugin
34
 
@@ -219,6 +220,10 @@ Upload the plugin directory (including all files and directories within) to the
219
 
220
  == Changelog ==
221
 
 
 
 
 
222
  = 1.1.3 =
223
  * Fix validation and semantics of script tag placement, particularly when button is contained in a list element
224
 
3
  Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, email, e-mail, seo, button, delicious, google buzz, buzz, google, linkedin, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, wpmu, addtoany
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
+ Stable tag: 1.1.4
7
 
8
  Sharing buttons for your pages from the universal sharing platform, including Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
10
  == Description ==
11
 
12
  The WordPress plugin to help people **share**, **bookmark**, and **email** your posts and pages using any service, such as Facebook, Twitter, Pinterest, Google, Reddit, StumbleUpon, LinkedIn, and well over 100 more sharing and social bookmarking sites.
13
+
14
+ 3rd party buttons include the **Facebook Like Button**, **Twitter Tweet Button**, **Google+ Share Button**, **Google+ Share Button** and **Google +1 Button**.
15
 
16
  This sharing plugin lets you customize the AddToAny universal Smart Menu, which places the services visitors use at the top of the menu, based on each visitor's usage history.
17
 
29
  * Easily customizable for beginners or advanced users, and highly extensible for developers and designers
30
  * Many more publisher and user features!
31
 
32
+ After **years of active development**, over **2.5 million downloads**, and **ongoing support from the community**, this plugin still strives to be the best WordPress plugin for sharing. Thanks for your feedback!
33
 
34
  <a href="http://www.addtoany.com/share_save" title="Share">Share this</a> plugin
35
 
220
 
221
  == Changelog ==
222
 
223
+ = 1.1.4 =
224
+ * Fix admin panel display of 3rd party button options after saving changes
225
+ * Fix debug mode notices
226
+
227
  = 1.1.3 =
228
  * Fix validation and semantics of script tag placement, particularly when button is contained in a list element
229
 
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Sharing buttons for your pages from the universal sharing platform, including Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.1.3
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -958,7 +958,7 @@ function A2A_SHARE_SAVE_options_page() {
958
  $site['icon'] = 'default';
959
  ?>
960
  <li id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
961
- <span><img src="<?php echo ($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>
962
  </li>
963
  <?php
964
  } ?>
@@ -1183,24 +1183,30 @@ function A2A_SHARE_SAVE_admin_head() {
1183
  });
1184
 
1185
  var to_input = function(this_sortable){
1186
- // Clear any previous services stored as hidden inputs
1187
- jQuery('input[name="A2A_SHARE_SAVE_active_services[]"]').remove();
 
1188
 
1189
  var services_array = jQuery(this_sortable).sortable('toArray'),
1190
  services_size = services_array.length;
1191
  if(services_size<1) return;
1192
 
1193
- for(var i=0, service_name; i < services_size; i++){
1194
  if(services_array[i]!='') { // Exclude dummy icon
1195
- jQuery('#addtoany_admin_form').append('<input name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
1196
 
1197
  // Special service options?
1198
  service_name = services_array[i].substr(7);
1199
  if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share') {
1200
- if ((service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share') && jQuery('#' + services_array[i] + '_show_count').is(':checked'))
1201
- jQuery('#addtoany_admin_form').append('<input name="addtoany_' + service_name + '_show_count" type="hidden" value="1"/>');
1202
- if ((service_name == 'facebook_like') && jQuery('#' + services_array[i] + '_verb').val() == 'recommend')
1203
- jQuery('#addtoany_admin_form').append('<input name="addtoany_' + service_name + '_verb" type="hidden" value="recommend"/>');
 
 
 
 
 
1204
  }
1205
  }
1206
  }
@@ -1221,7 +1227,7 @@ function A2A_SHARE_SAVE_admin_head() {
1221
  this_service = jQuery(this),
1222
  this_service_name = this_service.attr('id').substr(7),
1223
  checked = '',
1224
- special_options = '';
1225
 
1226
  if (jQuery('#addtoany_services_sortable li').not('.dummy').length == 0)
1227
  jQuery('#addtoany_services_sortable').find('.dummy').hide();
@@ -1236,8 +1242,9 @@ function A2A_SHARE_SAVE_admin_head() {
1236
  + '</select>';
1237
  } else {
1238
  // twitter_tweet & google_plusone & google_plus_share
1239
- if (service_options[this_service_name] && service_options[this_service_name].show_count)
1240
  checked = ' checked="checked"';
 
1241
  special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
1242
  }
1243
 
@@ -1285,7 +1292,7 @@ function A2A_SHARE_SAVE_admin_head() {
1285
 
1286
  // Auto-select active services
1287
  <?php
1288
- $admin_services_saved = is_array($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1289
  $active_services = ( $admin_services_saved )
1290
  ? $_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1291
  if( ! $active_services )
@@ -1307,16 +1314,20 @@ function A2A_SHARE_SAVE_admin_head() {
1307
 
1308
  <?php
1309
  // Special service options
1310
- if ( $_POST['addtoany_facebook_like_verb'] == 'recommend' || $options['special_facebook_like_options']['verb'] == 'recommend') {
 
1311
  ?>service_options.facebook_like = {verb: 'recommend'};<?php
1312
  }
1313
- if ( $_POST['addtoany_twitter_tweet_show_count'] == '1' || $options['special_twitter_tweet_options']['show_count'] == '1') {
 
1314
  ?>service_options.twitter_tweet = {show_count: 1};<?php
1315
  }
1316
- if ( $_POST['addtoany_google_plusone_show_count'] == '1' || $options['special_google_plusone_options']['show_count'] == '1') {
 
1317
  ?>service_options.google_plusone = {show_count: 1};<?php
1318
  }
1319
- if ( $_POST['addtoany_google_plus_share_show_count'] == '1' || $options['special_google_plus_share_options']['show_count'] == '1') {
 
1320
  ?>service_options.google_plus_share = {show_count: 1};<?php
1321
  }
1322
  ?>
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Sharing buttons for your pages from the universal sharing platform, including Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.1.4
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
958
  $site['icon'] = 'default';
959
  ?>
960
  <li id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
961
+ <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>
962
  </li>
963
  <?php
964
  } ?>
1183
  });
1184
 
1185
  var to_input = function(this_sortable){
1186
+ // Clear any previous hidden inputs for storing chosen services
1187
+ // and special service options
1188
+ jQuery('input.addtoany_hidden_options').remove();
1189
 
1190
  var services_array = jQuery(this_sortable).sortable('toArray'),
1191
  services_size = services_array.length;
1192
  if(services_size<1) return;
1193
 
1194
+ for(var i=0, service_name, show_count_value, fb_verb_value; i < services_size; i++){
1195
  if(services_array[i]!='') { // Exclude dummy icon
1196
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
1197
 
1198
  // Special service options?
1199
  service_name = services_array[i].substr(7);
1200
  if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share') {
1201
+ if (service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share') {
1202
+ show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
1203
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
1204
+ }
1205
+
1206
+ if (service_name == 'facebook_like') {
1207
+ fb_verb_value = (jQuery('#' + services_array[i] + '_verb').val() == 'recommend') ? 'recommend' : 'like';
1208
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
1209
+ }
1210
  }
1211
  }
1212
  }
1227
  this_service = jQuery(this),
1228
  this_service_name = this_service.attr('id').substr(7),
1229
  checked = '',
1230
+ special_options_html = '';
1231
 
1232
  if (jQuery('#addtoany_services_sortable li').not('.dummy').length == 0)
1233
  jQuery('#addtoany_services_sortable').find('.dummy').hide();
1242
  + '</select>';
1243
  } else {
1244
  // twitter_tweet & google_plusone & google_plus_share
1245
+ if (service_options[this_service_name] && service_options[this_service_name].show_count) {
1246
  checked = ' checked="checked"';
1247
+ }
1248
  special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
1249
  }
1250
 
1292
 
1293
  // Auto-select active services
1294
  <?php
1295
+ $admin_services_saved = isset($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1296
  $active_services = ( $admin_services_saved )
1297
  ? $_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1298
  if( ! $active_services )
1314
 
1315
  <?php
1316
  // Special service options
1317
+ if ( isset($_POST['addtoany_facebook_like_verb']) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
1318
+ || ! isset($_POST['addtoany_facebook_like_verb']) && $options['special_facebook_like_options']['verb'] == 'recommend') {
1319
  ?>service_options.facebook_like = {verb: 'recommend'};<?php
1320
  }
1321
+ if ( isset($_POST['addtoany_twitter_tweet_show_count']) && $_POST['addtoany_twitter_tweet_show_count'] == '1'
1322
+ || ! isset($_POST['addtoany_twitter_tweet_show_count']) && $options['special_twitter_tweet_options']['show_count'] == '1') {
1323
  ?>service_options.twitter_tweet = {show_count: 1};<?php
1324
  }
1325
+ if ( isset($_POST['addtoany_google_plusone_show_count']) && $_POST['addtoany_google_plusone_show_count'] == '1'
1326
+ || ! isset($_POST['addtoany_google_plusone_show_count']) && $options['special_google_plusone_options']['show_count'] == '1') {
1327
  ?>service_options.google_plusone = {show_count: 1};<?php
1328
  }
1329
+ if ( isset($_POST['addtoany_google_plus_share_show_count']) && $_POST['addtoany_google_plus_share_show_count'] == '1'
1330
+ || ! isset($_POST['addtoany_google_plus_share_show_count']) && $options['special_google_plus_share_options']['show_count'] == '1') {
1331
  ?>service_options.google_plus_share = {show_count: 1};<?php
1332
  }
1333
  ?>