Version Description
Download this release
Release Info
Developer | micropat |
Plugin | AddToAny Share Buttons |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 0.6
- README.txt +6 -4
- add-to-any.php +38 -3
README.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Add to Any Bookmark Button ===
|
2 |
Contributors: micropat
|
3 |
-
Donate link:
|
4 |
-
Tags: bookmarking, social bookmarking, bookmark, sharing, share, saving, save,
|
5 |
Requires at least: 2.0
|
6 |
-
Tested up to: 2.
|
7 |
-
Stable tag: 0.
|
8 |
|
9 |
Lets readers share, save, and bookmark your posts using any service.
|
10 |
|
@@ -23,6 +23,8 @@ Within the menu, users are additionally given a link to bookmark in-browser (Int
|
|
23 |
|
24 |
Demo: <a href="http://www.addtoany.com/">http://www.addtoany.com/</a>
|
25 |
|
|
|
|
|
26 |
== Installation ==
|
27 |
|
28 |
1. Upload 'add-to-any.php' to the '/wp-content/plugins/' directory
|
1 |
=== Add to Any Bookmark Button ===
|
2 |
Contributors: micropat
|
3 |
+
Donate link: http://www.addtoany.com/contact/
|
4 |
+
Tags: bookmarking, social bookmarking, bookmark, sharing, share, saving, save, Post, posts, links, plugin, widget, e-mail, email, button, delicious, Google, digg, reddit, facebook, myspace, addtoany, add, any
|
5 |
Requires at least: 2.0
|
6 |
+
Tested up to: 2.5
|
7 |
+
Stable tag: 0.6
|
8 |
|
9 |
Lets readers share, save, and bookmark your posts using any service.
|
10 |
|
23 |
|
24 |
Demo: <a href="http://www.addtoany.com/">http://www.addtoany.com/</a>
|
25 |
|
26 |
+
See also, the <a href="/extend/plugins/add-to-any-subscribe/">Subscribe button</a> plugin.
|
27 |
+
|
28 |
== Installation ==
|
29 |
|
30 |
1. Upload 'add-to-any.php' to the '/wp-content/plugins/' directory
|
add-to-any.php
CHANGED
@@ -3,17 +3,52 @@
|
|
3 |
Plugin Name: Add to Any: Bookmark Button
|
4 |
Plugin URI: http://www.addtoany.com/buttons/
|
5 |
Description: Lets readers share, save and bookmark your posts using any service and browser.
|
6 |
-
Version: .
|
7 |
Author: MicroPat
|
8 |
Author URI: http://www.addtoany.com/contact/
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
function add_to_any_link() {
|
12 |
ob_start();
|
13 |
|
14 |
$sitename_enc = rawurlencode( get_bloginfo('name') );
|
15 |
$siteurl_enc = rawurlencode( trailingslashit( get_bloginfo('url') ) );
|
16 |
-
$linkname =
|
17 |
$linkname_enc = rawurlencode( $linkname );
|
18 |
$linkurl = get_permalink($post->ID);
|
19 |
$linkurl_enc = rawurlencode( $linkurl );
|
@@ -22,7 +57,7 @@ function add_to_any_link() {
|
|
22 |
<a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=<?=$sitename_enc?>&siteurl=<?=$siteurl_enc?>&linkname=<?=$linkname_enc?>&linkurl=<?=$linkurl_enc?>">
|
23 |
<img src="<?=trailingslashit(get_option('siteurl')).PLUGINDIR.'/add-to-any/bookmark.gif'?>" width="91" height="16" border="0" alt="Bookmark"/>
|
24 |
</a>
|
25 |
-
<script type="text/javascript">a2a_linkname="
|
26 |
<script type="text/javascript" src="http://www.addtoany.com/js.dropdown.js?type=page"></script>
|
27 |
|
28 |
<?
|
3 |
Plugin Name: Add to Any: Bookmark Button
|
4 |
Plugin URI: http://www.addtoany.com/buttons/
|
5 |
Description: Lets readers share, save and bookmark your posts using any service and browser.
|
6 |
+
Version: .6
|
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('add_to_any_code2utf')) {
|
14 |
+
function add_to_any_code2utf($num)
|
15 |
+
{
|
16 |
+
if ($num < 128) return chr($num);
|
17 |
+
if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
|
18 |
+
if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
|
19 |
+
if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
|
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('add_to_any_html_entity_decode_utf8')) {
|
25 |
+
function add_to_any_html_entity_decode_utf8($string)
|
26 |
+
{
|
27 |
+
static $trans_tbl;
|
28 |
+
|
29 |
+
// replace numeric entities
|
30 |
+
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'add_to_any_code2utf(hexdec("\\1"))', $string);
|
31 |
+
$string = preg_replace('~&#([0-9]+);~e', 'add_to_any_code2utf(\\1)', $string);
|
32 |
+
|
33 |
+
// replace literal entities
|
34 |
+
if (!isset($trans_tbl))
|
35 |
+
{
|
36 |
+
$trans_tbl = array();
|
37 |
+
|
38 |
+
foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key)
|
39 |
+
$trans_tbl[$key] = utf8_encode($val);
|
40 |
+
}
|
41 |
+
|
42 |
+
return strtr($string, $trans_tbl);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
function add_to_any_link() {
|
47 |
ob_start();
|
48 |
|
49 |
$sitename_enc = rawurlencode( get_bloginfo('name') );
|
50 |
$siteurl_enc = rawurlencode( trailingslashit( get_bloginfo('url') ) );
|
51 |
+
$linkname = add_to_any_html_entity_decode_utf8( get_the_title() );
|
52 |
$linkname_enc = rawurlencode( $linkname );
|
53 |
$linkurl = get_permalink($post->ID);
|
54 |
$linkurl_enc = rawurlencode( $linkurl );
|
57 |
<a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=<?=$sitename_enc?>&siteurl=<?=$siteurl_enc?>&linkname=<?=$linkname_enc?>&linkurl=<?=$linkurl_enc?>">
|
58 |
<img src="<?=trailingslashit(get_option('siteurl')).PLUGINDIR.'/add-to-any/bookmark.gif'?>" width="91" height="16" border="0" alt="Bookmark"/>
|
59 |
</a>
|
60 |
+
<script type="text/javascript">a2a_linkname="<?=str_replace('"', '\\"', $linkname)?>";a2a_linkurl="<?=$linkurl?>";</script>
|
61 |
<script type="text/javascript" src="http://www.addtoany.com/js.dropdown.js?type=page"></script>
|
62 |
|
63 |
<?
|