AddToAny Share Buttons - Version 0.9.6

Version Description

Download this release

Release Info

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

Code changes from version 0.9.5.2 to 0.9.6

Files changed (2) hide show
  1. README.txt +6 -2
  2. add-to-any.php +32 -11
README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: micropat
3
  Donate link: http://www.addtoany.com/contact/
4
  Tags: bookmarking, social, social bookmarking, bookmark, bookmarks, sharing, share, saving, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, e-mail, email, seo, button, delicious, google, digg, reddit, facebook, myspace, addtoany, add, any
5
  Requires at least: 2.0
6
- Tested up to: 2.6
7
- Stable tag: 0.9.5.2
8
 
9
  Helps readers share, save, and bookmark your posts and pages using any service, such as Delicious, Digg, Facebook, MySpace, and all the rest.
10
 
@@ -59,6 +59,10 @@ This is done to overcome browser limitations that prevent the drop-down menu fro
59
 
60
  == Changelog ==
61
 
 
 
 
 
62
  .9.5.2:
63
 
64
  * Fixed bug in Internet Explorer 6 that caused custom buttons to have a height and width of 0
3
  Donate link: http://www.addtoany.com/contact/
4
  Tags: bookmarking, social, social bookmarking, bookmark, bookmarks, sharing, share, saving, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, widget, e-mail, email, seo, button, delicious, google, digg, reddit, facebook, myspace, addtoany, add, any
5
  Requires at least: 2.0
6
+ Tested up to: 2.6.2
7
+ Stable tag: 0.9.6
8
 
9
  Helps readers share, save, and bookmark your posts and pages using any service, such as Delicious, Digg, Facebook, MySpace, and all the rest.
10
 
59
 
60
  == Changelog ==
61
 
62
+ .9.6:
63
+
64
+ * Moved external JavaScript to bottom so that content is prioritized over HTTP requests to static.addtoany.com
65
+
66
  .9.5.2:
67
 
68
  * Fixed bug in Internet Explorer 6 that caused custom buttons to have a height and width of 0
add-to-any.php CHANGED
@@ -3,12 +3,16 @@
3
  Plugin Name: Add to Any: Share/Save/Bookmark Button
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Helps readers share, save, and bookmark your posts and pages using any service. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: .9.5.2
7
  Author: MicroPat
8
  Author URI: http://www.addtoany.com/contact/
9
  */
10
 
11
 
 
 
 
 
12
  // Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
13
  if (!function_exists('A2A_SHARE_SAVE_code2utf')) {
14
  function A2A_SHARE_SAVE_code2utf($num)
@@ -20,6 +24,7 @@ if (!function_exists('A2A_SHARE_SAVE_code2utf')) {
20
  return '';
21
  }
22
  }
 
23
  // Since UTF-8 does not work in PHP4 ( http://us2.php.net/manual/en/function.html-entity-decode.php ) :
24
  if (!function_exists('A2A_SHARE_SAVE_html_entity_decode_utf8')) {
25
  function A2A_SHARE_SAVE_html_entity_decode_utf8($string)
@@ -81,16 +86,27 @@ function ADDTOANY_SHARE_SAVE_BUTTON($output_buffering=false) {
81
  ?>
82
 
83
  <a class="a2a_dd addtoany_share_save" <?php echo (get_option('A2A_SHARE_SAVE_onclick')=='1') ? 'onclick="a2a_show_dropdown(this);return false"' : 'onmouseover="a2a_show_dropdown(this)"'; ?> onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=<?php echo $sitename_enc; ?>&amp;siteurl=<?php echo $siteurl_enc; ?>&amp;linkname=<?php echo $linkname_enc; ?>&amp;linkurl=<?php echo $linkurl_enc; ?>"<?php echo $style; ?>><?php echo $button; ?></a>
84
- <script type="text/javascript">
85
- a2a_linkname="<?php echo str_replace('"', '\\"', $linkname); ?>";
86
- a2a_linkurl="<?php echo $linkurl; ?>";
87
- <?php echo (get_option('A2A_SHARE_SAVE_hide_embeds')=='-1') ? 'a2a_hide_embeds=0;' : ''; ?>
88
- <?php echo (get_option('A2A_SHARE_SAVE_show_title')=='1') ? 'a2a_show_title=1;' : ''; ?>
89
- <?php echo stripslashes(get_option('A2A_SHARE_SAVE_additional_js_variables')); ?>
90
- </script>
91
- <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>
92
 
93
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  if($output_buffering) {
95
  $button = ob_get_contents();
96
  ob_end_clean();
@@ -98,6 +114,13 @@ function ADDTOANY_SHARE_SAVE_BUTTON($output_buffering=false) {
98
  }
99
  }
100
 
 
 
 
 
 
 
 
101
 
102
  function A2A_SHARE_SAVE_to_bottom_of_content($content) {
103
  if (
@@ -127,8 +150,6 @@ add_action('wp_head', 'A2A_SHARE_SAVE_button_css');
127
 
128
 
129
 
130
-
131
-
132
  /*****************************
133
  OPTIONS
134
  ******************************/
3
  Plugin Name: Add to Any: Share/Save/Bookmark Button
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Helps readers share, save, and bookmark your posts and pages using any service. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: .9.6
7
  Author: MicroPat
8
  Author URI: http://www.addtoany.com/contact/
9
  */
10
 
11
 
12
+ if( !isset($A2A_javascript) )
13
+ $A2A_javascript = '';
14
+
15
+
16
  // Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
17
  if (!function_exists('A2A_SHARE_SAVE_code2utf')) {
18
  function A2A_SHARE_SAVE_code2utf($num)
24
  return '';
25
  }
26
  }
27
+
28
  // Since UTF-8 does not work in PHP4 ( http://us2.php.net/manual/en/function.html-entity-decode.php ) :
29
  if (!function_exists('A2A_SHARE_SAVE_html_entity_decode_utf8')) {
30
  function A2A_SHARE_SAVE_html_entity_decode_utf8($string)
86
  ?>
87
 
88
  <a class="a2a_dd addtoany_share_save" <?php echo (get_option('A2A_SHARE_SAVE_onclick')=='1') ? 'onclick="a2a_show_dropdown(this);return false"' : 'onmouseover="a2a_show_dropdown(this)"'; ?> onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=<?php echo $sitename_enc; ?>&amp;siteurl=<?php echo $siteurl_enc; ?>&amp;linkname=<?php echo $linkname_enc; ?>&amp;linkurl=<?php echo $linkurl_enc; ?>"<?php echo $style; ?>><?php echo $button; ?></a>
 
 
 
 
 
 
 
 
89
 
90
  <?php
91
+ global $A2A_javascript, $A2A_SHARE_SAVE_external_script_called;
92
+ if( $A2A_javascript == '' || !$A2A_SHARE_SAVE_external_script_called ) {
93
+ $external_script_call = '</script><script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>';
94
+ $A2A_SHARE_SAVE_external_script_called = true;
95
+ }
96
+ else
97
+ $external_script_call = 'a2a_init("page");</script>';
98
+ $A2A_javascript .= '<script type="text/javascript">' . "\n"
99
+ . 'a2a_linkname="' . str_replace('"', '\\"', $linkname) . '";' . "\n"
100
+ . 'a2a_linkurl="' . $linkurl . '";' . "\n"
101
+ . ((get_option('A2A_SHARE_SAVE_hide_embeds')=='-1') ? 'a2a_hide_embeds=0;' . "\n" : '')
102
+ . ((get_option('A2A_SHARE_SAVE_show_title')=='1') ? 'a2a_show_title=1;' . "\n" : '')
103
+ . stripslashes(get_option('A2A_SHARE_SAVE_additional_js_variables')) . "\n"
104
+ . $external_script_call . "\n\n";
105
+
106
+
107
+ remove_action('wp_footer', 'A2A_menu_javascript');
108
+ add_action('wp_footer', 'A2A_menu_javascript');
109
+
110
  if($output_buffering) {
111
  $button = ob_get_contents();
112
  ob_end_clean();
114
  }
115
  }
116
 
117
+ if (!function_exists('A2A_menu_javascript')) {
118
+ function A2A_menu_javascript() {
119
+ global $A2A_javascript;
120
+ echo $A2A_javascript;
121
+ }
122
+ }
123
+
124
 
125
  function A2A_SHARE_SAVE_to_bottom_of_content($content) {
126
  if (
150
 
151
 
152
 
 
 
153
  /*****************************
154
  OPTIONS
155
  ******************************/