Settings] Version: .9.4 Author: MicroPat Author URI: http://www.addtoany.com/contact/ */ // Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv) if (!function_exists('A2A_SHARE_SAVE_code2utf')) { function A2A_SHARE_SAVE_code2utf($num) { if ($num < 128) return chr($num); if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); return ''; } } // Since UTF-8 does not work in PHP4 ( http://us2.php.net/manual/en/function.html-entity-decode.php ) : if (!function_exists('A2A_SHARE_SAVE_html_entity_decode_utf8')) { function A2A_SHARE_SAVE_html_entity_decode_utf8($string) { static $trans_tbl; // replace numeric entities $string = preg_replace('~&#x([0-9a-f]+);~ei', 'A2A_SHARE_SAVE_code2utf(hexdec("\\1"))', $string); $string = preg_replace('~&#([0-9]+);~e', 'A2A_SHARE_SAVE_code2utf(\\1)', $string); // replace literal entities if (!isset($trans_tbl)) { $trans_tbl = array(); foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key) $trans_tbl[$key] = utf8_encode($val); } return strtr($string, $trans_tbl); } } function ADDTOANY_SHARE_SAVE_BUTTON($output_buffering=false) { if($output_buffering)ob_start(); $sitename_enc = rawurlencode( get_bloginfo('name') ); $siteurl_enc = rawurlencode( trailingslashit( get_bloginfo('url') ) ); $linkname = A2A_SHARE_SAVE_html_entity_decode_utf8( get_the_title() ); $linkname_enc = rawurlencode( $linkname ); $linkurl = get_permalink($post->ID); $linkurl_enc = rawurlencode( $linkurl ); if( !get_option('A2A_SHARE_SAVE_button') ) { $button_fname = 'share_save_120_16.gif'; $button_width = '120'; $button_height = "16"; } else { $button_attrs = explode( '|', get_option('A2A_SHARE_SAVE_button') ); $button_fname = $button_attrs[0]; $button_width = $button_attrs[1]; $button_height = $button_attrs[2]; } if( $button_attrs[0] == 'favicon.png' ) { $style_bg = 'background:url('.trailingslashit(get_option('siteurl')).PLUGINDIR.'/add-to-any/'.$button_fname.') no-repeat scroll 0px 0px'; $style_bg = ';' . $style_bg . ' !important;'; $style = ' style="'.$style_bg.'padding:1px 5px 5px 22px"'; $button = 'Share/Save'; } else $button = 'Share/Save/Bookmark'; ?> onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=&siteurl=&linkname=&linkurl="> ')===false) ) && ( // ( !is_page() && get_option('A2A_SHARE_SAVE_display_in_posts')=='-1' ) || // All posts ( !is_page() && !is_single() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) || // Front page posts ( is_page() && get_option('A2A_SHARE_SAVE_display_in_pages')=='-1' ) || // Pages ( (strpos($content, '')!==false ) ) // ) ) return $content; $content .= '

'.ADDTOANY_SHARE_SAVE_BUTTON(true).'

'; return $content; } add_action('the_content', 'A2A_SHARE_SAVE_to_bottom_of_content'); /***************************** OPTIONS ******************************/ function A2A_SHARE_SAVE_options_page() { if( $_POST[ 'A2A_SHARE_SAVE_submit_hidden' ] == 'Y' ) { update_option( 'A2A_SHARE_SAVE_display_in_posts_on_front_page', ($_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_display_in_posts', ($_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_display_in_pages', ($_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_hide_embeds', ($_POST['A2A_SHARE_SAVE_hide_embeds']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_show_title', ($_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_onclick', ($_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1' ); update_option( 'A2A_SHARE_SAVE_button', $_POST['A2A_SHARE_SAVE_button'] ); update_option( 'A2A_SHARE_SAVE_additional_js_variables', trim($_POST['A2A_SHARE_SAVE_additional_js_variables']) ); ?>

Button



Button Placement




* If unchecked, be sure to place the following code in your template pages (within index.php, single.php, and/or page.php):
<?php if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) { ADDTOANY_SHARE_SAVE_BUTTON(); } ?>
Menu Style
Using Add to Any's Menu Styler, you can customize the colors of your Share/Save menu! When you're done, be sure to paste the generated code in the Additional Options box below.

Open Menu Styler

Menu Options


Additional Options