AddToAny Share Buttons - Version 0.9.9.7.5

Version Description

Download this release

Release Info

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

Code changes from version 0.9.9.7.4 to 0.9.9.7.5

Files changed (2) hide show
  1. README.txt +6 -1
  2. add-to-any.php +150 -80
README.txt CHANGED
@@ -3,7 +3,7 @@ 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, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, messenger, stumbleupon, technorati, sexybookmarks, sociable, sharedaddy, icon, icons, wpmu, addtoany, add
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
- Stable tag: 0.9.9.7.4
7
 
8
  Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more.
9
 
@@ -177,6 +177,11 @@ Please read <a href="http://www.addtoany.com/buttons/customize/show_over_embeds"
177
 
178
  == Changelog ==
179
 
 
 
 
 
 
180
  = .9.9.7.4 =
181
  * Major fix for some setups to fix PHP header error due to newline in services.php
182
 
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, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, messenger, stumbleupon, technorati, sexybookmarks, sociable, sharedaddy, icon, icons, wpmu, addtoany, add
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
+ Stable tag: 0.9.9.7.5
7
 
8
  Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more.
9
 
177
 
178
  == Changelog ==
179
 
180
+ = .9.9.7.5 =
181
+ * Improved inclusion method for services.php (thanks to bigorangemachine)
182
+ * Migrate option rows into one option row to improve backend efficiency
183
+ * Reset button in settings
184
+
185
  = .9.9.7.4 =
186
  * Major fix for some setups to fix PHP header error due to newline in services.php
187
 
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: AddToAny: Share/Bookmark/Email Button
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: .9.9.7.4
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -24,14 +24,18 @@ $A2A_SHARE_SAVE_plugin_url_path = WP_PLUGIN_URL.'/'.$A2A_SHARE_SAVE_plugin_basen
24
  if (is_ssl())
25
  $A2A_SHARE_SAVE_plugin_url_path = str_replace('http:', 'https:', $A2A_SHARE_SAVE_plugin_url_path);
26
 
27
- function A2A_SHARE_SAVE_textdomain() {
28
  global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_plugin_basename;
29
 
 
 
 
 
30
  load_plugin_textdomain('add-to-any',
31
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
32
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
33
  }
34
- add_filter('init', 'A2A_SHARE_SAVE_textdomain');
35
 
36
  function A2A_SHARE_SAVE_link_vars($linkname = FALSE, $linkurl = FALSE) {
37
  global $post;
@@ -44,7 +48,7 @@ function A2A_SHARE_SAVE_link_vars($linkname = FALSE, $linkurl = FALSE) {
44
  return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc' );
45
  }
46
 
47
- include_once('services.php');
48
 
49
  // Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
50
  function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
@@ -108,7 +112,9 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
108
  // Include Facebook Like and Twitter Tweet
109
  array_unshift($service_codes, 'facebook_like', 'twitter_tweet');
110
 
111
- $active_services = get_option('A2A_SHARE_SAVE_active_services');
 
 
112
 
113
  $ind_html = "" . $html_container_open;
114
 
@@ -193,25 +199,26 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
193
  $is_feed = is_feed();
194
  $button_target = '';
195
  $button_href_querystring = ($is_feed) ? '#url=' . $linkurl_enc . '&amp;title=' . $linkname_enc : '';
 
196
 
197
- if( !get_option('A2A_SHARE_SAVE_button') ) {
198
  $button_fname = 'share_save_171_16.png';
199
  $button_width = ' width="171"';
200
  $button_height = ' height="16"';
201
  $button_src = $A2A_SHARE_SAVE_plugin_url_path.'/'.$button_fname;
202
- } else if( get_option('A2A_SHARE_SAVE_button') == 'CUSTOM' ) {
203
- $button_src = get_option('A2A_SHARE_SAVE_button_custom');
204
  $button_width = '';
205
  $button_height = '';
206
- } else if( get_option('A2A_SHARE_SAVE_button') == 'TEXT' ) {
207
- $button_text = stripslashes(get_option('A2A_SHARE_SAVE_button_text'));
208
  } else {
209
- $button_attrs = explode( '|', get_option('A2A_SHARE_SAVE_button') );
210
  $button_fname = $button_attrs[0];
211
  $button_width = ' width="'.$button_attrs[1].'"';
212
  $button_height = ' height="'.$button_attrs[2].'"';
213
  $button_src = $A2A_SHARE_SAVE_plugin_url_path.'/'.$button_fname;
214
- $button_text = stripslashes(get_option('A2A_SHARE_SAVE_button_text'));
215
  }
216
 
217
  if( $button_fname == 'favicon.png' || $button_fname == 'share_16_16.png' ) {
@@ -239,16 +246,16 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
239
  global $A2A_SHARE_SAVE_external_script_called;
240
  if ( ! $A2A_SHARE_SAVE_external_script_called ) {
241
  // Use local cache?
242
- $cache = (get_option('A2A_SHARE_SAVE_cache')=='1') ? TRUE : FALSE;
243
  $upload_dir = wp_upload_dir();
244
  $static_server = ($cache) ? $upload_dir['baseurl'] . '/addtoany' : $http_or_https . '://static.addtoany.com/menu';
245
 
246
  // Enternal script call + initial JS + set-once variables
247
  $initial_js = 'var a2a_config = a2a_config || {};' . "\n";
248
- $additional_js = get_option('A2A_SHARE_SAVE_additional_js_variables');
249
  $external_script_call = (($cache) ? 'a2a_config.static_server="' . $static_server . '";' . "\n" : '' )
250
- . ((get_option('A2A_SHARE_SAVE_onclick')=='1') ? 'a2a_config.onclick=1;' . "\n" : '')
251
- . ((get_option('A2A_SHARE_SAVE_show_title')=='1') ? 'a2a_config.show_title=1;' . "\n" : '')
252
  . (($additional_js) ? stripslashes($additional_js) . "\n" : '')
253
  . "//-->" . '</script><script type="text/javascript" src="' . $static_server . '/page.js"></script>';
254
  $A2A_SHARE_SAVE_external_script_called = true;
@@ -379,8 +386,10 @@ function A2A_SHARE_SAVE_to_bottom_of_content_next_time($content) {
379
 
380
  function A2A_SHARE_SAVE_to_bottom_of_content($content) {
381
  global $A2A_SHARE_SAVE_auto_placement_ready;
382
- $is_feed = is_feed();
383
 
 
 
 
384
  if( ! $A2A_SHARE_SAVE_auto_placement_ready)
385
  return $content;
386
 
@@ -398,25 +407,25 @@ function A2A_SHARE_SAVE_to_bottom_of_content($content) {
398
  (
399
  // Posts
400
  // All posts
401
- ( ! is_page() && get_option('A2A_SHARE_SAVE_display_in_posts')=='-1' ) ||
402
  // Front page posts
403
- ( is_home() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
404
  // Category posts (same as Front page option)
405
- ( is_category() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
406
  // Tag Cloud posts (same as Front page option) - WP version 2.3+ only
407
- ( function_exists('is_tag') && is_tag() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
408
  // Date-based archives posts (same as Front page option)
409
- ( is_date() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
410
  // Author posts (same as Front page option)
411
- ( is_author() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
412
  // Search results posts (same as Front page option)
413
- ( is_search() && get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')=='-1' ) ||
414
  // Posts in feed
415
- ( $is_feed && (get_option('A2A_SHARE_SAVE_display_in_feed')=='-1' ) ||
416
 
417
  // Pages
418
  // Individual pages
419
- ( is_page() && get_option('A2A_SHARE_SAVE_display_in_pages')=='-1' ) ||
420
  // <!--nosharesave-->
421
  ( (strpos($content, '<!--nosharesave-->')!==false) )
422
  )
@@ -448,7 +457,7 @@ function A2A_SHARE_SAVE_to_bottom_of_content($content) {
448
  add_filter('the_title', 'A2A_SHARE_SAVE_auto_placement', 9);
449
  add_filter('the_content', 'A2A_SHARE_SAVE_to_bottom_of_content', 98);
450
 
451
- if (get_option('A2A_SHARE_SAVE_display_in_excerpts') != '-1') {
452
  // Excerpts use strip_tags() for the_content, so cancel if Excerpt and append to the_excerpt instead
453
  add_filter('get_the_excerpt', 'A2A_SHARE_SAVE_remove_from_content', 9);
454
  add_filter('the_excerpt', 'A2A_SHARE_SAVE_to_bottom_of_content', 98);
@@ -466,8 +475,10 @@ function A2A_SHARE_SAVE_button_css_IE() {
466
  <?php
467
  }
468
 
 
 
469
  // Use stylesheet?
470
- if (get_option('A2A_SHARE_SAVE_inline_css') != '-1' && ! is_admin()) {
471
  wp_enqueue_style('A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.3');
472
 
473
  // Conditional inline CSS stylesheet for IE
@@ -523,6 +534,49 @@ function A2A_SHARE_SAVE_unschedule_cache() {
523
  OPTIONS
524
  ******************************/
525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
 
527
  function A2A_SHARE_SAVE_options_page() {
528
 
@@ -532,26 +586,30 @@ function A2A_SHARE_SAVE_options_page() {
532
  if ( ! current_user_can('manage_options') )
533
  return false;
534
 
 
 
 
 
535
  // Make available services extensible via plugins, themes (functions.php), etc.
536
  $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
537
 
538
- if ( isset($_POST['Submit'])) {
539
 
540
  // Nonce verification
541
  check_admin_referer('add-to-any-update-options');
542
-
543
- update_option( 'A2A_SHARE_SAVE_display_in_posts_on_front_page', ($_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1' );
544
- update_option( 'A2A_SHARE_SAVE_display_in_excerpts', ($_POST['A2A_SHARE_SAVE_display_in_excerpts']=='1') ? '1':'-1' );
545
- update_option( 'A2A_SHARE_SAVE_display_in_posts', ($_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1' );
546
- update_option( 'A2A_SHARE_SAVE_display_in_pages', ($_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1' );
547
- update_option( 'A2A_SHARE_SAVE_display_in_feed', ($_POST['A2A_SHARE_SAVE_display_in_feed']=='1') ? '1':'-1' );
548
- update_option( 'A2A_SHARE_SAVE_show_title', ($_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1' );
549
- update_option( 'A2A_SHARE_SAVE_onclick', ($_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1' );
550
- update_option( 'A2A_SHARE_SAVE_button', $_POST['A2A_SHARE_SAVE_button'] );
551
- update_option( 'A2A_SHARE_SAVE_button_custom', $_POST['A2A_SHARE_SAVE_button_custom'] );
552
- update_option( 'A2A_SHARE_SAVE_additional_js_variables', trim($_POST['A2A_SHARE_SAVE_additional_js_variables']) );
553
- update_option( 'A2A_SHARE_SAVE_inline_css', ($_POST['A2A_SHARE_SAVE_inline_css']=='1') ? '1':'-1' );
554
- update_option( 'A2A_SHARE_SAVE_cache', ($_POST['A2A_SHARE_SAVE_cache']=='1') ? '1':'-1' );
555
 
556
  // Schedule cache refresh?
557
  if ($_POST['A2A_SHARE_SAVE_cache']=='1') {
@@ -562,12 +620,12 @@ function A2A_SHARE_SAVE_options_page() {
562
  }
563
 
564
  // Store desired text if 16 x 16px buttons or text-only is chosen:
565
- if( get_option('A2A_SHARE_SAVE_button') == 'favicon.png|16|16' )
566
- update_option( 'A2A_SHARE_SAVE_button_text', $_POST['A2A_SHARE_SAVE_button_favicon_16_16_text'] );
567
- elseif( get_option('A2A_SHARE_SAVE_button') == 'share_16_16.png|16|16' )
568
- update_option( 'A2A_SHARE_SAVE_button_text', $_POST['A2A_SHARE_SAVE_button_share_16_16_text'] );
569
  else
570
- update_option( 'A2A_SHARE_SAVE_button_text', ( trim($_POST['A2A_SHARE_SAVE_button_text']) != '' ) ? $_POST['A2A_SHARE_SAVE_button_text'] : __('Share/Bookmark','add-to-any') );
571
 
572
  // Store chosen individual services to make active
573
  $active_services = Array();
@@ -575,17 +633,23 @@ function A2A_SHARE_SAVE_options_page() {
575
  $_POST['A2A_SHARE_SAVE_active_services'] = Array();
576
  foreach( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename )
577
  $active_services[] = substr($sitename, 7);
578
- update_option('A2A_SHARE_SAVE_active_services', $active_services);
579
- // Delete then re-add to ensure sorting works (re-sorting doesn't effect associated array equality in PHP so update doesn't hit the dB for identical arrays
580
- delete_option('A2A_SHARE_SAVE_active_services', $active_services);
581
- add_option('A2A_SHARE_SAVE_active_services', $active_services);
582
 
 
 
583
  ?>
584
  <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
585
  <?php
586
 
 
 
 
 
 
587
  }
588
 
 
 
589
  ?>
590
 
591
  <?php A2A_wp_footer_check(); ?>
@@ -618,7 +682,7 @@ function A2A_SHARE_SAVE_options_page() {
618
  </li>
619
  <?php
620
  // Show all services
621
- $active_services = get_option('A2A_SHARE_SAVE_active_services');
622
  if( !$active_services )
623
  $active_services = Array();
624
 
@@ -643,53 +707,53 @@ function A2A_SHARE_SAVE_options_page() {
643
  <th scope="row"><?php _e("Button", "add-to-any"); ?></th>
644
  <td><fieldset>
645
  <label>
646
- <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" type="radio"<?php if(get_option('A2A_SHARE_SAVE_button')=='favicon.png|16|16') echo ' checked="checked"'; ?>
647
  style="margin:9px 0;vertical-align:middle">
648
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/favicon.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share/Bookmark','add-to-any'); ?>" title="+ <?php _e('Share/Bookmark','add-to-any'); ?>"
649
  onclick="this.parentNode.firstChild.checked=true"/>
650
  </label>
651
  <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px"
652
- value="<?php echo (get_option('A2A_SHARE_SAVE_button_text') !== FALSE) ? stripslashes(get_option('A2A_SHARE_SAVE_button_text')) : __('Share/Bookmark','add-to-any'); ?>" />
653
  <label style="padding-left:9px">
654
- <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if(get_option('A2A_SHARE_SAVE_button')=='share_16_16.png|16|16') echo ' checked="checked"'; ?>
655
  style="margin:9px 0;vertical-align:middle">
656
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_16_16.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share/Bookmark','add-to-any'); ?>" title="+ <?php _e('Share/Bookmark','add-to-any'); ?>"
657
  onclick="this.parentNode.firstChild.checked=true"/>
658
  </label>
659
  <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px"
660
- value="<?php echo (get_option('A2A_SHARE_SAVE_button_text') !== FALSE) ? stripslashes(get_option('A2A_SHARE_SAVE_button_text')) : __('Share/Bookmark','add-to-any'); ?>" /><br>
661
  <label>
662
- <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if(get_option('A2A_SHARE_SAVE_button' )=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?>
663
  style="margin:9px 0;vertical-align:middle">
664
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_120_16.png'; ?>" width="120" height="16" border="0" style="padding:9px;vertical-align:middle"
665
  onclick="this.parentNode.firstChild.checked=true"/>
666
  </label><br>
667
  <label>
668
- <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if( !get_option('A2A_SHARE_SAVE_button') || get_option('A2A_SHARE_SAVE_button')=='share_save_171_16.png|171|16' ) echo ' checked="checked"'; ?>
669
  style="margin:9px 0;vertical-align:middle">
670
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_171_16.png'; ?>" width="171" height="16" border="0" style="padding:9px;vertical-align:middle"
671
  onclick="this.parentNode.firstChild.checked=true"/>
672
  </label><br>
673
  <label>
674
- <input name="A2A_SHARE_SAVE_button" value="share_save_256_24.png|256|24" type="radio"<?php if(get_option('A2A_SHARE_SAVE_button')=='share_save_256_24.png|256|24') echo ' checked="checked"'; ?>
675
  style="margin:9px 0;vertical-align:middle">
676
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_256_24.png'; ?>" width="256" height="24" border="0" style="padding:9px;vertical-align:middle"
677
  onclick="this.parentNode.firstChild.checked=true"/>
678
  </label><br>
679
  <label>
680
- <input name="A2A_SHARE_SAVE_button" value="CUSTOM" type="radio"<?php if( get_option('A2A_SHARE_SAVE_button') == 'CUSTOM' ) echo ' checked="checked"'; ?>
681
  style="margin:9px 0;vertical-align:middle">
682
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
683
  </label>
684
  <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-2].checked=true" style="vertical-align:middle"
685
- value="<?php echo get_option('A2A_SHARE_SAVE_button_custom'); ?>" /><br>
686
  <label>
687
- <input name="A2A_SHARE_SAVE_button" value="TEXT" type="radio"<?php if( get_option('A2A_SHARE_SAVE_button') == 'TEXT' ) echo ' checked="checked"'; ?>
688
  style="margin:9px 0;vertical-align:middle">
689
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
690
  </label>
691
  <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-1].checked=true" style="vertical-align:middle;width:150px"
692
- value="<?php echo ( trim(get_option('A2A_SHARE_SAVE_button_text')) != '' ) ? stripslashes(get_option('A2A_SHARE_SAVE_button_text')) : __('Share/Bookmark','add-to-any'); ?>" />
693
 
694
  </fieldset></td>
695
  </tr>
@@ -698,33 +762,33 @@ function A2A_SHARE_SAVE_options_page() {
698
  <td><fieldset>
699
  <label>
700
  <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
701
- if(get_option('A2A_SHARE_SAVE_display_in_posts')!='-1') echo ' checked="checked"'; ?> value="1"/>
702
  <?php _e('Display at the bottom of posts', 'add-to-any'); ?> <strong>*</strong>
703
  </label><br/>
704
  <label>
705
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
706
- if(get_option('A2A_SHARE_SAVE_display_in_excerpts')!='-1') echo ' checked="checked"';
707
- if(get_option('A2A_SHARE_SAVE_display_in_posts')=='-1') echo ' disabled="disabled"';
708
  ?> value="1"/>
709
  <?php _e('Display at the bottom of post excerpts', 'add-to-any'); ?>
710
  </label><br/>
711
  <label>
712
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_front_page" type="checkbox"<?php
713
- if(get_option('A2A_SHARE_SAVE_display_in_posts_on_front_page')!='-1') echo ' checked="checked"';
714
- if(get_option('A2A_SHARE_SAVE_display_in_posts')=='-1') echo ' disabled="disabled"';
715
  ?> value="1"/>
716
  <?php _e('Display at the bottom of posts on the front page', 'add-to-any'); ?>
717
  </label><br/>
718
 
719
  <label>
720
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
721
- if(get_option('A2A_SHARE_SAVE_display_in_feed')!='-1') echo ' checked="checked"';
722
- if(get_option('A2A_SHARE_SAVE_display_in_posts')=='-1') echo ' disabled="disabled"';
723
  ?> value="1"/>
724
  <?php _e('Display at the bottom of posts in the feed', 'add-to-any'); ?>
725
  </label><br/>
726
  <label>
727
- <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if(get_option('A2A_SHARE_SAVE_display_in_pages')!='-1') echo ' checked="checked"'; ?> value="1"/>
728
  <?php _e('Display at the bottom of pages', 'add-to-any'); ?>
729
  </label>
730
  <br/><br/>
@@ -753,12 +817,12 @@ function A2A_SHARE_SAVE_options_page() {
753
  <td><fieldset>
754
  <label>
755
  <input name="A2A_SHARE_SAVE_onclick"
756
- type="checkbox"<?php if(get_option('A2A_SHARE_SAVE_onclick')=='1') echo ' checked="checked"'; ?> value="1"/>
757
  <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
758
  </label><br />
759
  <label>
760
  <input name="A2A_SHARE_SAVE_show_title"
761
- type="checkbox"<?php if(get_option('A2A_SHARE_SAVE_show_title')=='1') echo ' checked="checked"'; ?> value="1"/>
762
  <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
763
  </label>
764
  </fieldset></td>
@@ -776,9 +840,9 @@ function A2A_SHARE_SAVE_options_page() {
776
  <?php _e("Advanced users might want to explore AddToAny's <a href=\"http://www.addtoany.com/buttons/customize/\" target=\"_blank\">additional options</a>.", "add-to-any"); ?></p>
777
  </label>
778
  <p>
779
- <textarea name="A2A_SHARE_SAVE_additional_js_variables" id="A2A_SHARE_SAVE_additional_js_variables" class="code" style="width: 98%; font-size: 12px;" rows="6" cols="50"><?php echo stripslashes(get_option('A2A_SHARE_SAVE_additional_js_variables')); ?></textarea>
780
  </p>
781
- <?php if( get_option('A2A_SHARE_SAVE_additional_js_variables')!='' ) { ?>
782
  <label for="A2A_SHARE_SAVE_additional_js_variables" class="setting-description"><?php _e("<strong>Note</strong>: If you're adding new code, be careful not to accidentally overwrite any previous code.</label>", 'add-to-any'); ?>
783
  <?php } ?>
784
  </fieldset></td>
@@ -788,12 +852,12 @@ function A2A_SHARE_SAVE_options_page() {
788
  <td><fieldset>
789
  <label for="A2A_SHARE_SAVE_inline_css">
790
  <input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css"
791
- type="checkbox"<?php if(get_option('A2A_SHARE_SAVE_inline_css')!='-1') echo ' checked="checked"'; ?> value="1"/>
792
  <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
793
  </label><br/>
794
  <label for="A2A_SHARE_SAVE_cache">
795
  <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache"
796
- type="checkbox"<?php if(get_option('A2A_SHARE_SAVE_cache')=='1') echo ' checked="checked"'; ?> value="1"/>
797
  <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
798
  </label>
799
  <br/><br/>
@@ -806,6 +870,7 @@ function A2A_SHARE_SAVE_options_page() {
806
 
807
  <p class="submit">
808
  <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
 
809
  </p>
810
 
811
  </form>
@@ -831,6 +896,9 @@ function A2A_SHARE_SAVE_admin_head() {
831
  // Must be on WP 2.6+
832
  if ($wp_version < "2.6")
833
  return;
 
 
 
834
  ?>
835
  <script language="JavaScript" type="text/javascript"><!--
836
  jQuery(document).ready(function(){
@@ -911,7 +979,7 @@ function A2A_SHARE_SAVE_admin_head() {
911
  <?php
912
  $admin_services_saved = is_array($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
913
  $active_services = ( $admin_services_saved )
914
- ? $_POST['A2A_SHARE_SAVE_active_services'] : get_option('A2A_SHARE_SAVE_active_services');
915
  if( !$active_services )
916
  $active_services = Array();
917
  $active_services_last = end($active_services);
@@ -958,7 +1026,7 @@ function A2A_SHARE_SAVE_admin_head() {
958
  #addtoany_services_selectable li:hover, #addtoany_services_selectable li.addtoany_selected{border:1px solid #AAA;background-color:#FFF;}
959
  #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
960
  #addtoany_services_selectable li:active{border:1px solid #000;}
961
- #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
962
  #addtoany_services_selectable .addtoany_special_service{padding:3px 6px;}
963
  #addtoany_services_selectable .addtoany_special_service img{width:auto;height:20px;}
964
 
@@ -973,7 +1041,9 @@ function A2A_SHARE_SAVE_admin_head() {
973
  #addtoany_services_info{clear:left;display:none;}
974
 
975
  #addtoany_template_button_code, #addtoany_css_code{display:none;}
976
- </style>
 
 
977
  <?php
978
 
979
  }
3
  Plugin Name: AddToAny: Share/Bookmark/Email Button
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, Google Buzz, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: .9.9.7.5
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
24
  if (is_ssl())
25
  $A2A_SHARE_SAVE_plugin_url_path = str_replace('http:', 'https:', $A2A_SHARE_SAVE_plugin_url_path);
26
 
27
+ function A2A_SHARE_SAVE_init() {
28
  global $A2A_SHARE_SAVE_plugin_url_path, $A2A_SHARE_SAVE_plugin_basename;
29
 
30
+ if (get_option('A2A_SHARE_SAVE_button')) {
31
+ A2A_SHARE_SAVE_migrate_options();
32
+ }
33
+
34
  load_plugin_textdomain('add-to-any',
35
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
36
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
37
  }
38
+ add_filter('init', 'A2A_SHARE_SAVE_init');
39
 
40
  function A2A_SHARE_SAVE_link_vars($linkname = FALSE, $linkurl = FALSE) {
41
  global $post;
48
  return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc' );
49
  }
50
 
51
+ include_once(dirname(__FILE__).'/' . 'services.php');
52
 
53
  // Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
54
  function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
112
  // Include Facebook Like and Twitter Tweet
113
  array_unshift($service_codes, 'facebook_like', 'twitter_tweet');
114
 
115
+ $options = get_option('addtoany_options');
116
+
117
+ $active_services = $options['active_services'];
118
 
119
  $ind_html = "" . $html_container_open;
120
 
199
  $is_feed = is_feed();
200
  $button_target = '';
201
  $button_href_querystring = ($is_feed) ? '#url=' . $linkurl_enc . '&amp;title=' . $linkname_enc : '';
202
+ $options = get_option('addtoany_options');
203
 
204
+ if( ! $options['button'] ) {
205
  $button_fname = 'share_save_171_16.png';
206
  $button_width = ' width="171"';
207
  $button_height = ' height="16"';
208
  $button_src = $A2A_SHARE_SAVE_plugin_url_path.'/'.$button_fname;
209
+ } else if( $options['button'] == 'CUSTOM' ) {
210
+ $button_src = $options['button_custom'];
211
  $button_width = '';
212
  $button_height = '';
213
+ } else if( $options['button'] == 'TEXT' ) {
214
+ $button_text = stripslashes($options['button_text']);
215
  } else {
216
+ $button_attrs = explode( '|', $options['button'] );
217
  $button_fname = $button_attrs[0];
218
  $button_width = ' width="'.$button_attrs[1].'"';
219
  $button_height = ' height="'.$button_attrs[2].'"';
220
  $button_src = $A2A_SHARE_SAVE_plugin_url_path.'/'.$button_fname;
221
+ $button_text = stripslashes($options['button_text']);
222
  }
223
 
224
  if( $button_fname == 'favicon.png' || $button_fname == 'share_16_16.png' ) {
246
  global $A2A_SHARE_SAVE_external_script_called;
247
  if ( ! $A2A_SHARE_SAVE_external_script_called ) {
248
  // Use local cache?
249
+ $cache = ($options['cache']=='1') ? TRUE : FALSE;
250
  $upload_dir = wp_upload_dir();
251
  $static_server = ($cache) ? $upload_dir['baseurl'] . '/addtoany' : $http_or_https . '://static.addtoany.com/menu';
252
 
253
  // Enternal script call + initial JS + set-once variables
254
  $initial_js = 'var a2a_config = a2a_config || {};' . "\n";
255
+ $additional_js = $options['additional_js_variables'];
256
  $external_script_call = (($cache) ? 'a2a_config.static_server="' . $static_server . '";' . "\n" : '' )
257
+ . (($options['onclick']=='1') ? 'a2a_config.onclick=1;' . "\n" : '')
258
+ . (($options['show_title']=='1') ? 'a2a_config.show_title=1;' . "\n" : '')
259
  . (($additional_js) ? stripslashes($additional_js) . "\n" : '')
260
  . "//-->" . '</script><script type="text/javascript" src="' . $static_server . '/page.js"></script>';
261
  $A2A_SHARE_SAVE_external_script_called = true;
386
 
387
  function A2A_SHARE_SAVE_to_bottom_of_content($content) {
388
  global $A2A_SHARE_SAVE_auto_placement_ready;
 
389
 
390
+ $is_feed = is_feed();
391
+ $options = get_option('addtoany_options');
392
+
393
  if( ! $A2A_SHARE_SAVE_auto_placement_ready)
394
  return $content;
395
 
407
  (
408
  // Posts
409
  // All posts
410
+ ( ! is_page() && $options['display_in_posts']=='-1' ) ||
411
  // Front page posts
412
+ ( is_home() && $options['display_in_posts_on_front_page']=='-1' ) ||
413
  // Category posts (same as Front page option)
414
+ ( is_category() && $options['display_in_posts_on_front_page']=='-1' ) ||
415
  // Tag Cloud posts (same as Front page option) - WP version 2.3+ only
416
+ ( function_exists('is_tag') && is_tag() && $options['display_in_posts_on_front_page']=='-1' ) ||
417
  // Date-based archives posts (same as Front page option)
418
+ ( is_date() && $options['display_in_posts_on_front_page']=='-1' ) ||
419
  // Author posts (same as Front page option)
420
+ ( is_author() && $options['display_in_posts_on_front_page']=='-1' ) ||
421
  // Search results posts (same as Front page option)
422
+ ( is_search() && $options['display_in_posts_on_front_page']=='-1' ) ||
423
  // Posts in feed
424
+ ( $is_feed && ($options['display_in_feed']=='-1' ) ||
425
 
426
  // Pages
427
  // Individual pages
428
+ ( is_page() && $options['display_in_pages']=='-1' ) ||
429
  // <!--nosharesave-->
430
  ( (strpos($content, '<!--nosharesave-->')!==false) )
431
  )
457
  add_filter('the_title', 'A2A_SHARE_SAVE_auto_placement', 9);
458
  add_filter('the_content', 'A2A_SHARE_SAVE_to_bottom_of_content', 98);
459
 
460
+ if ($options['display_in_excerpts'] != '-1') {
461
  // Excerpts use strip_tags() for the_content, so cancel if Excerpt and append to the_excerpt instead
462
  add_filter('get_the_excerpt', 'A2A_SHARE_SAVE_remove_from_content', 9);
463
  add_filter('the_excerpt', 'A2A_SHARE_SAVE_to_bottom_of_content', 98);
475
  <?php
476
  }
477
 
478
+ $options = get_option('addtoany_options');
479
+
480
  // Use stylesheet?
481
+ if ($options['inline_css'] != '-1' && ! is_admin()) {
482
  wp_enqueue_style('A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.3');
483
 
484
  // Conditional inline CSS stylesheet for IE
534
  OPTIONS
535
  ******************************/
536
 
537
+
538
+ function A2A_SHARE_SAVE_migrate_options() {
539
+
540
+ $options = array(
541
+ 'inline_css' => '1', // Modernly used for "Use CSS Stylesheet?"
542
+ 'cache' => '-1',
543
+ 'display_in_posts_on_front_page' => '1',
544
+ 'display_in_posts' => '1',
545
+ 'display_in_pages' => '1',
546
+ 'display_in_feed' => '1',
547
+ 'show_title' => '-1',
548
+ 'onclick' => '-1',
549
+ 'button' => 'share_save_171_16.png|171|16',
550
+ 'button_custom' => '',
551
+ 'additional_js_variables' => '',
552
+ 'button_text' => 'Share/Bookmark',
553
+ 'display_in_excerpts' => '1',
554
+ 'active_services' => Array(),
555
+ );
556
+
557
+ $namespace = 'A2A_SHARE_SAVE_';
558
+
559
+ foreach ($options as $option_name => $option_value) {
560
+ $old_option_name = $namespace . $option_name;
561
+ $old_option_value = get_option($old_option_name);
562
+ if ($old_option_value !== FALSE) {
563
+ $options[$option_name] = $old_option_value;
564
+ delete_option($old_option_name);
565
+ }
566
+ }
567
+
568
+ update_option('addtoany_options', $options);
569
+
570
+ $deprecated_options = array(
571
+ 'button_opens_new_window',
572
+ 'hide_embeds',
573
+ );
574
+
575
+ foreach ($deprecated_options as $option_name) {
576
+ delete_option($namespace . $option_name);
577
+ }
578
+
579
+ }
580
 
581
  function A2A_SHARE_SAVE_options_page() {
582
 
586
  if ( ! current_user_can('manage_options') )
587
  return false;
588
 
589
+ $new_options = array();
590
+
591
+ $namespace = 'A2A_SHARE_SAVE_';
592
+
593
  // Make available services extensible via plugins, themes (functions.php), etc.
594
  $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
595
 
596
+ if (isset($_POST['Submit'])) {
597
 
598
  // Nonce verification
599
  check_admin_referer('add-to-any-update-options');
600
+
601
+ $new_options['display_in_posts_on_front_page'] = ($_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1';
602
+ $new_options['display_in_excerpts'] = ($_POST['A2A_SHARE_SAVE_display_in_excerpts']=='1') ? '1':'-1';
603
+ $new_options['display_in_posts'] = ($_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1';
604
+ $new_options['display_in_pages'] = ($_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1';
605
+ $new_options['display_in_feed'] = ($_POST['A2A_SHARE_SAVE_display_in_feed']=='1') ? '1':'-1';
606
+ $new_options['show_title'] = ($_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1';
607
+ $new_options['onclick'] = ($_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1';
608
+ $new_options['button'] = $_POST['A2A_SHARE_SAVE_button'];
609
+ $new_options['button_custom'] = $_POST['A2A_SHARE_SAVE_button_custom'];
610
+ $new_options['additional_js_variables'] = trim($_POST['A2A_SHARE_SAVE_additional_js_variables']);
611
+ $new_options['inline_css'] = ($_POST['A2A_SHARE_SAVE_inline_css']=='1') ? '1':'-1';
612
+ $new_options['cache'] = ($_POST['A2A_SHARE_SAVE_cache']=='1') ? '1':'-1';
613
 
614
  // Schedule cache refresh?
615
  if ($_POST['A2A_SHARE_SAVE_cache']=='1') {
620
  }
621
 
622
  // Store desired text if 16 x 16px buttons or text-only is chosen:
623
+ if( $new_options['button'] == 'favicon.png|16|16' )
624
+ $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_favicon_16_16_text'];
625
+ elseif( $new_options['button'] == 'share_16_16.png|16|16' )
626
+ $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_share_16_16_text'];
627
  else
628
+ $new_options['button_text'] = ( trim($_POST['A2A_SHARE_SAVE_button_text']) != '' ) ? $_POST['A2A_SHARE_SAVE_button_text'] : __('Share/Bookmark','add-to-any');
629
 
630
  // Store chosen individual services to make active
631
  $active_services = Array();
633
  $_POST['A2A_SHARE_SAVE_active_services'] = Array();
634
  foreach( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename )
635
  $active_services[] = substr($sitename, 7);
636
+ $new_options['active_services'] = $active_services;
 
 
 
637
 
638
+ update_option('addtoany_options', $new_options);
639
+
640
  ?>
641
  <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
642
  <?php
643
 
644
+ } else if (isset($_POST['Reset'])) {
645
+ // Nonce verification
646
+ check_admin_referer('add-to-any-update-options');
647
+
648
+ delete_option('addtoany_options');
649
  }
650
 
651
+ $options = get_option('addtoany_options');
652
+
653
  ?>
654
 
655
  <?php A2A_wp_footer_check(); ?>
682
  </li>
683
  <?php
684
  // Show all services
685
+ $active_services = $options['active_services'];
686
  if( !$active_services )
687
  $active_services = Array();
688
 
707
  <th scope="row"><?php _e("Button", "add-to-any"); ?></th>
708
  <td><fieldset>
709
  <label>
710
+ <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" type="radio"<?php if($options['button']=='favicon.png|16|16') echo ' checked="checked"'; ?>
711
  style="margin:9px 0;vertical-align:middle">
712
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/favicon.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share/Bookmark','add-to-any'); ?>" title="+ <?php _e('Share/Bookmark','add-to-any'); ?>"
713
  onclick="this.parentNode.firstChild.checked=true"/>
714
  </label>
715
  <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px"
716
+ value="<?php echo ($options['button_text'] !== FALSE) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" />
717
  <label style="padding-left:9px">
718
+ <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?>
719
  style="margin:9px 0;vertical-align:middle">
720
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_16_16.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share/Bookmark','add-to-any'); ?>" title="+ <?php _e('Share/Bookmark','add-to-any'); ?>"
721
  onclick="this.parentNode.firstChild.checked=true"/>
722
  </label>
723
  <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px"
724
+ value="<?php echo ($options['button_text'] !== FALSE) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" /><br>
725
  <label>
726
+ <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if($options['button']=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?>
727
  style="margin:9px 0;vertical-align:middle">
728
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_120_16.png'; ?>" width="120" height="16" border="0" style="padding:9px;vertical-align:middle"
729
  onclick="this.parentNode.firstChild.checked=true"/>
730
  </label><br>
731
  <label>
732
+ <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if( !$options['button'] || $options['button']=='share_save_171_16.png|171|16' ) echo ' checked="checked"'; ?>
733
  style="margin:9px 0;vertical-align:middle">
734
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_171_16.png'; ?>" width="171" height="16" border="0" style="padding:9px;vertical-align:middle"
735
  onclick="this.parentNode.firstChild.checked=true"/>
736
  </label><br>
737
  <label>
738
+ <input name="A2A_SHARE_SAVE_button" value="share_save_256_24.png|256|24" type="radio"<?php if($options['button']=='share_save_256_24.png|256|24') echo ' checked="checked"'; ?>
739
  style="margin:9px 0;vertical-align:middle">
740
  <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_256_24.png'; ?>" width="256" height="24" border="0" style="padding:9px;vertical-align:middle"
741
  onclick="this.parentNode.firstChild.checked=true"/>
742
  </label><br>
743
  <label>
744
+ <input name="A2A_SHARE_SAVE_button" value="CUSTOM" type="radio"<?php if( $options['button'] == 'CUSTOM' ) echo ' checked="checked"'; ?>
745
  style="margin:9px 0;vertical-align:middle">
746
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
747
  </label>
748
  <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-2].checked=true" style="vertical-align:middle"
749
+ value="<?php echo $options['button_custom']; ?>" /><br>
750
  <label>
751
+ <input name="A2A_SHARE_SAVE_button" value="TEXT" type="radio"<?php if( $options['button'] == 'TEXT' ) echo ' checked="checked"'; ?>
752
  style="margin:9px 0;vertical-align:middle">
753
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
754
  </label>
755
  <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-1].checked=true" style="vertical-align:middle;width:150px"
756
+ value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share/Bookmark','add-to-any'); ?>" />
757
 
758
  </fieldset></td>
759
  </tr>
762
  <td><fieldset>
763
  <label>
764
  <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
765
+ if($options['display_in_posts']!='-1') echo ' checked="checked"'; ?> value="1"/>
766
  <?php _e('Display at the bottom of posts', 'add-to-any'); ?> <strong>*</strong>
767
  </label><br/>
768
  <label>
769
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
770
+ if($options['display_in_excerpts']!='-1') echo ' checked="checked"';
771
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
772
  ?> value="1"/>
773
  <?php _e('Display at the bottom of post excerpts', 'add-to-any'); ?>
774
  </label><br/>
775
  <label>
776
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_front_page" type="checkbox"<?php
777
+ if($options['display_in_posts_on_front_page']!='-1') echo ' checked="checked"';
778
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
779
  ?> value="1"/>
780
  <?php _e('Display at the bottom of posts on the front page', 'add-to-any'); ?>
781
  </label><br/>
782
 
783
  <label>
784
  &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
785
+ if($options['display_in_feed']!='-1') echo ' checked="checked"';
786
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
787
  ?> value="1"/>
788
  <?php _e('Display at the bottom of posts in the feed', 'add-to-any'); ?>
789
  </label><br/>
790
  <label>
791
+ <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if($options['display_in_pages']!='-1') echo ' checked="checked"'; ?> value="1"/>
792
  <?php _e('Display at the bottom of pages', 'add-to-any'); ?>
793
  </label>
794
  <br/><br/>
817
  <td><fieldset>
818
  <label>
819
  <input name="A2A_SHARE_SAVE_onclick"
820
+ type="checkbox"<?php if($options['onclick']=='1') echo ' checked="checked"'; ?> value="1"/>
821
  <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
822
  </label><br />
823
  <label>
824
  <input name="A2A_SHARE_SAVE_show_title"
825
+ type="checkbox"<?php if($options['show_title']=='1') echo ' checked="checked"'; ?> value="1"/>
826
  <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
827
  </label>
828
  </fieldset></td>
840
  <?php _e("Advanced users might want to explore AddToAny's <a href=\"http://www.addtoany.com/buttons/customize/\" target=\"_blank\">additional options</a>.", "add-to-any"); ?></p>
841
  </label>
842
  <p>
843
+ <textarea name="A2A_SHARE_SAVE_additional_js_variables" id="A2A_SHARE_SAVE_additional_js_variables" class="code" style="width: 98%; font-size: 12px;" rows="6" cols="50"><?php echo stripslashes($options['additional_js_variables']); ?></textarea>
844
  </p>
845
+ <?php if( $options['additional_js_variables']!='' ) { ?>
846
  <label for="A2A_SHARE_SAVE_additional_js_variables" class="setting-description"><?php _e("<strong>Note</strong>: If you're adding new code, be careful not to accidentally overwrite any previous code.</label>", 'add-to-any'); ?>
847
  <?php } ?>
848
  </fieldset></td>
852
  <td><fieldset>
853
  <label for="A2A_SHARE_SAVE_inline_css">
854
  <input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css"
855
+ type="checkbox"<?php if($options['inline_css']!='-1') echo ' checked="checked"'; ?> value="1"/>
856
  <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
857
  </label><br/>
858
  <label for="A2A_SHARE_SAVE_cache">
859
  <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache"
860
+ type="checkbox"<?php if($options['cache']=='1') echo ' checked="checked"'; ?> value="1"/>
861
  <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
862
  </label>
863
  <br/><br/>
870
 
871
  <p class="submit">
872
  <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
873
+ <input id="A2A_SHARE_SAVE_reset_options" type="submit" name="Reset" onclick="return confirm('<?php _e('Are you sure you want to delete all AddToAny options?', 'add-to-any' ) ?>')" value="<?php _e('Reset', 'add-to-any' ) ?>" />
874
  </p>
875
 
876
  </form>
896
  // Must be on WP 2.6+
897
  if ($wp_version < "2.6")
898
  return;
899
+
900
+ $options = get_option('addtoany_options');
901
+
902
  ?>
903
  <script language="JavaScript" type="text/javascript"><!--
904
  jQuery(document).ready(function(){
979
  <?php
980
  $admin_services_saved = is_array($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
981
  $active_services = ( $admin_services_saved )
982
+ ? $_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
983
  if( !$active_services )
984
  $active_services = Array();
985
  $active_services_last = end($active_services);
1026
  #addtoany_services_selectable li:hover, #addtoany_services_selectable li.addtoany_selected{border:1px solid #AAA;background-color:#FFF;}
1027
  #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
1028
  #addtoany_services_selectable li:active{border:1px solid #000;}
1029
+ #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
1030
  #addtoany_services_selectable .addtoany_special_service{padding:3px 6px;}
1031
  #addtoany_services_selectable .addtoany_special_service img{width:auto;height:20px;}
1032
 
1041
  #addtoany_services_info{clear:left;display:none;}
1042
 
1043
  #addtoany_template_button_code, #addtoany_css_code{display:none;}
1044
+
1045
+ #A2A_SHARE_SAVE_reset_options{color:red;margin-left: 15px;}
1046
+ </style>
1047
  <?php
1048
 
1049
  }