AddToAny Share Buttons - Version 0.9.9.8

Version Description

Download this release

Release Info

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

Code changes from version 0.9.9.7.14 to 0.9.9.8

Files changed (3) hide show
  1. README.txt +21 -2
  2. add-to-any-wp-widget.php +65 -0
  3. add-to-any.php +39 -7
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
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
- Stable tag: 0.9.9.7.14
7
 
8
  Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.
9
 
@@ -48,7 +48,9 @@ See also:
48
 
49
  = Where are the options? =
50
 
51
- In your Admin panel, go to `Settings` > `AddToAny`. Among other options, you can choose which button, individual icons and advanced sharing buttons (Facebook Like Button and Twitter Tweet Button) to display, and where and how to display them.
 
 
52
 
53
  = Why isn't the drop-down menu appearing? =
54
 
@@ -163,6 +165,14 @@ Yes, AddToAny outputs 100% W3C valid XHTML and W3C valid CSS 3.0.
163
 
164
  If you move the plugin's CSS code to your theme's stylesheet, note that one proprietary vendor prefix (`filter`) is used. It's utilized for cross-browser compatibility with Internet Explorer. For more information about the W3C CSS Validator and the `filter` property, see <a href="http://www.websitedev.de/css/validator-faq#extensions">Why don't my scrollbar properties, filters, etc. validate?</a> If you feel compelled, you can move the line into an Internet Explorer-only stylesheet, or remove the line at the cost of the opacity hover effect in Internet Explorer.
165
 
 
 
 
 
 
 
 
 
166
  = How can I move the plugin's inline CSS into my theme's main external stylesheet? =
167
 
168
  Go to `Settings` > `AddToAny` > uncheck `Use inline CSS` and place the CSS code in your theme's main stylesheet.
@@ -181,6 +191,15 @@ Please read <a href="http://www.addtoany.com/buttons/customize/show_over_embeds"
181
 
182
  == Changelog ==
183
 
 
 
 
 
 
 
 
 
 
184
  = .9.9.7.14 =
185
  * Simplify plugin's option as "AddToAny"
186
  * Greek translation update (by Xaris from <a href="http://www.aggeliopolis.gr/">Aggeliopolis</a>)
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
4
  Requires at least: 2.8
5
  Tested up to: 3.1
6
+ Stable tag: 0.9.9.8
7
 
8
  Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.
9
 
48
 
49
  = Where are the options? =
50
 
51
+ In your Admin panel, go to `Settings` > `AddToAny`. Among other options, you can choose which button, individual icons and advanced sharing buttons (Facebook Like Button and Twitter Tweet Button) to display, and where and how to display them.
52
+
53
+ To place AddToAny as a "widget" in your theme (if your theme supports WordPress Widgets), go to `Appearance` > `Widgets`, then drag AddToAny to an available Widget Area and click `Save`.
54
 
55
  = Why isn't the drop-down menu appearing? =
56
 
165
 
166
  If you move the plugin's CSS code to your theme's stylesheet, note that one proprietary vendor prefix (`filter`) is used. It's utilized for cross-browser compatibility with Internet Explorer. For more information about the W3C CSS Validator and the `filter` property, see <a href="http://www.websitedev.de/css/validator-faq#extensions">Why don't my scrollbar properties, filters, etc. validate?</a> If you feel compelled, you can move the line into an Internet Explorer-only stylesheet, or remove the line at the cost of the opacity hover effect in Internet Explorer.
167
 
168
+ = Is there a shortcode for sharing? =
169
+
170
+ Yes, you can place AddToAny exactly where you want it by inserting the following shortcode in a post or page:
171
+ `[addtoany]`
172
+
173
+ You can also customize the shared URL like so:
174
+ `[addtoany url="http://www.example.com/page.html" title="Some Example Page"]`
175
+
176
  = How can I move the plugin's inline CSS into my theme's main external stylesheet? =
177
 
178
  Go to `Settings` > `AddToAny` > uncheck `Use inline CSS` and place the CSS code in your theme's main stylesheet.
191
 
192
  == Changelog ==
193
 
194
+ = .9.9.8 =
195
+ * WordPress widget for sharing
196
+ * In your Admin panel, go to `Appearance` > `Widgets`, then drag AddToAny to an available Widget Area (if your theme supports widgets) and click `Save`
197
+ * The widget will share the current page
198
+ * Shortcode for sharing
199
+ * Usage for sharing current post or page: `[addtoany]`
200
+ * Usage for sharing a specific URL: `[addtoany url="http://www.example.com/page.html" title="Some Example Page"]`
201
+ * Add use_current_page boolean argument to PHP template code (default is false)
202
+
203
  = .9.9.7.14 =
204
  * Simplify plugin's option as "AddToAny"
205
  * Greek translation update (by Xaris from <a href="http://www.aggeliopolis.gr/">Aggeliopolis</a>)
add-to-any-wp-widget.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class A2A_SHARE_SAVE_Widget extends WP_Widget {
4
+ /** constructor */
5
+ function A2A_SHARE_SAVE_Widget() {
6
+ parent::WP_Widget('', 'AddToAny Sharing', array('description' => 'Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.'), array('width' => 400));
7
+ }
8
+
9
+ /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */
10
+ function display( $args = false ) {
11
+ self::widget($args, NULL);
12
+ }
13
+
14
+ /** @see WP_Widget::widget */
15
+ function widget($args = array(), $instance) {
16
+
17
+ global $A2A_SUBSCRIBE_plugin_url_path;
18
+
19
+ $defaults = array(
20
+ 'before_widget' => '',
21
+ 'after_widget' => '',
22
+ 'before_title' => '',
23
+ 'after_title' => '',
24
+ );
25
+
26
+ $args = wp_parse_args( $args, $defaults );
27
+ extract( $args );
28
+ $title = apply_filters('widget_title', $instance['title']);
29
+
30
+ echo $before_widget;
31
+
32
+ if ($title) {
33
+ echo $before_title . $title . $after_title;
34
+ }
35
+
36
+ ADDTOANY_SHARE_SAVE_KIT(array(
37
+ "use_current_page" => TRUE
38
+ ));
39
+
40
+ echo $after_widget;
41
+ }
42
+
43
+ /** @see WP_Widget::update */
44
+ function update($new_instance, $old_instance) {
45
+ $instance = $old_instance;
46
+ $instance['title'] = strip_tags($new_instance['title']);
47
+ return $instance;
48
+ }
49
+
50
+ /** @see WP_Widget::form */
51
+ function form($instance) {
52
+ $title = (isset($instance) && isset($instance['title'])) ? esc_attr($instance['title']) : '';
53
+ ?>
54
+ <p>
55
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
56
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
57
+ </p>
58
+ <p>
59
+ <a href="options-general.php?page=add-to-any.php"><?php _e("Settings", "add-to-any"); ?>...</a>
60
+ </p>
61
+ <?php
62
+ }
63
+
64
+ }
65
+
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: AddToAny: Share/Bookmark/Email Buttons
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, StumbleUpon, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: .9.9.7.14
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -84,7 +84,7 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
84
 
85
  $kit_html .= ADDTOANY_SHARE_SAVE_BUTTON($args);
86
 
87
- if($args['output_later'])
88
  return $kit_html;
89
  else
90
  echo $kit_html;
@@ -205,6 +205,7 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
205
  'linkurl' => '',
206
  'linkname_enc' => '',
207
  'linkurl_enc' => '',
 
208
  'output_later' => FALSE,
209
  'html_container_open' => '',
210
  'html_container_close' => '',
@@ -288,11 +289,15 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
288
 
289
  $button_javascript = "\n" . '<script type="text/javascript">' . "<!--\n"
290
  . $initial_js
291
- . A2A_menu_locale()
292
- . 'a2a_config.linkname="' . esc_js($linkname) . '";' . "\n"
293
- . 'a2a_config.linkurl="' . $linkurl . '";' . "\n"
294
- . $external_script_call . "\n\n";
295
-
 
 
 
 
296
  $button_html .= $button_javascript;
297
 
298
  }
@@ -498,6 +503,24 @@ add_filter('the_title', 'A2A_SHARE_SAVE_auto_placement', 9);
498
  add_filter('the_content', 'A2A_SHARE_SAVE_add_to_content', 98);
499
 
500
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  function A2A_SHARE_SAVE_button_css_IE() {
502
  /* IE support for opacity: */ ?>
503
  <!--[if IE]>
@@ -1160,6 +1183,15 @@ function A2A_SHARE_SAVE_scripts() {
1160
  wp_enqueue_script('jquery-ui-sortable');
1161
  }
1162
 
 
 
 
 
 
 
 
 
 
1163
  add_filter('admin_menu', 'A2A_SHARE_SAVE_add_menu_link');
1164
 
1165
  // Place in Option List on Settings > Plugins page
3
  Plugin Name: AddToAny: Share/Bookmark/Email Buttons
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, StumbleUpon, Digg and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: .9.9.8
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
84
 
85
  $kit_html .= ADDTOANY_SHARE_SAVE_BUTTON($args);
86
 
87
+ if (isset($args['output_later']) && $args['output_later'])
88
  return $kit_html;
89
  else
90
  echo $kit_html;
205
  'linkurl' => '',
206
  'linkname_enc' => '',
207
  'linkurl_enc' => '',
208
+ 'use_current_page' => FALSE,
209
  'output_later' => FALSE,
210
  'html_container_open' => '',
211
  'html_container_close' => '',
289
 
290
  $button_javascript = "\n" . '<script type="text/javascript">' . "<!--\n"
291
  . $initial_js
292
+ . A2A_menu_locale();
293
+ if ($use_current_page) {
294
+ $button_javascript .= 'a2a_config.linkname=document.title;' . "\n"
295
+ . 'a2a_config.linkurl=location.href;' . "\n";
296
+ } else {
297
+ $button_javascript .= 'a2a_config.linkname="' . esc_js($linkname) . '";' . "\n"
298
+ . 'a2a_config.linkurl="' . $linkurl . '";' . "\n";
299
+ }
300
+ $button_javascript .= $external_script_call . "\n\n";
301
  $button_html .= $button_javascript;
302
 
303
  }
503
  add_filter('the_content', 'A2A_SHARE_SAVE_add_to_content', 98);
504
 
505
 
506
+ // [addtoany url="http://example.com/page.html" title="Some Example Page"]
507
+ function A2A_SHARE_SAVE_shortcode( $attributes ) {
508
+ extract( shortcode_atts( array(
509
+ 'url' => 'something',
510
+ 'title' => 'something else',
511
+ ), $attributes ) );
512
+
513
+ $linkname = (isset($attributes['title'])) ? $attributes['title'] : FALSE;
514
+ $linkurl = (isset($attributes['url'])) ? $attributes['url'] : FALSE;
515
+ $output_later = TRUE;
516
+
517
+ return ADDTOANY_SHARE_SAVE_KIT( compact('linkname', 'linkurl', 'output_later') );
518
+ }
519
+
520
+ add_shortcode( 'addtoany', 'A2A_SHARE_SAVE_shortcode' );
521
+
522
+
523
+
524
  function A2A_SHARE_SAVE_button_css_IE() {
525
  /* IE support for opacity: */ ?>
526
  <!--[if IE]>
1183
  wp_enqueue_script('jquery-ui-sortable');
1184
  }
1185
 
1186
+
1187
+ function A2A_SHARE_SAVE_widget_init() {
1188
+ require_once('add-to-any-wp-widget.php');
1189
+ register_widget('A2A_SHARE_SAVE_Widget');
1190
+ }
1191
+
1192
+ add_action('widgets_init', 'A2A_SHARE_SAVE_widget_init');
1193
+
1194
+
1195
  add_filter('admin_menu', 'A2A_SHARE_SAVE_add_menu_link');
1196
 
1197
  // Place in Option List on Settings > Plugins page