Version Description
Please update to version 2.1.2 immediately for several crucial fixes.
Download this release
Release Info
Developer | MarijnRongen |
Plugin | Social Sharing Toolkit |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- admin_2.1.1.css → admin_2.1.2.css +0 -0
- admin_2.1.1.js → admin_2.1.2.js +0 -0
- images/buttons/appnet.png +0 -0
- images/icons_large/appnet.png +0 -0
- images/icons_medium/appnet.png +0 -0
- images/icons_small/appnet.png +0 -0
- includes/buttons/button.appnet.php +23 -0
- includes/buttons/button.lastfmmusic.php +16 -0
- includes/buttons/button.spotifyalbum.php +16 -0
- includes/buttons/button.twitter.php +3 -3
- includes/buttons/button.youtubechannel.php +16 -0
- includes/class.button.php +1 -1
- readme.txt +20 -3
- script_2.1.1.js → script_2.1.2.js +0 -0
- script_no_follow_2.1.1.js → script_no_follow_2.1.2.js +0 -0
- social_sharing_toolkit.php +38 -15
- style_2.1.1.css → style_2.1.2.css +0 -0
admin_2.1.1.css → admin_2.1.2.css
RENAMED
File without changes
|
admin_2.1.1.js → admin_2.1.2.js
RENAMED
File without changes
|
images/buttons/appnet.png
ADDED
Binary file
|
images/icons_large/appnet.png
ADDED
Binary file
|
images/icons_medium/appnet.png
ADDED
Binary file
|
images/icons_small/appnet.png
ADDED
Binary file
|
includes/buttons/button.appnet.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MR_Social_Sharing_Toolkit_AppNet extends MR_Social_Sharing_Toolkit_Button {
|
3 |
+
function __construct() {
|
4 |
+
$this->share_buttons[] = array('name' => 'ap_share', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
5 |
+
$this->follow_buttons[] = array('name' => 'follow_app_net', 'id' => '@', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
6 |
+
$this->title = 'App.net';
|
7 |
+
$this->icon = 'appnet';
|
8 |
+
}
|
9 |
+
|
10 |
+
function ap_share($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
|
11 |
+
$url = 'https://alpha.app.net/intent/post?text='.urlencode($url).'%20'.urlencode($title);
|
12 |
+
$text = ($text == '') ? __('Share on','mr_social_sharing_toolkit').' App.net' : $text;
|
13 |
+
return $this->get_icon($type, $url, $text, $icon, true);
|
14 |
+
}
|
15 |
+
|
16 |
+
function follow_app_net($type, $id, $text = '', $icon = '') {
|
17 |
+
$url = 'https://alpha.app.net/'.$id;
|
18 |
+
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' App.net' : $text;
|
19 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
20 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
21 |
+
}
|
22 |
+
}
|
23 |
+
?>
|
includes/buttons/button.lastfmmusic.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MR_Social_Sharing_Toolkit_LastfmMusic extends MR_Social_Sharing_Toolkit_Button {
|
3 |
+
function __construct() {
|
4 |
+
$this->follow_buttons[] = array('name' => 'follow_lastfm_music', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
5 |
+
$this->title = 'Last.fm Music';
|
6 |
+
$this->icon = 'lastfm';
|
7 |
+
}
|
8 |
+
|
9 |
+
function follow_lastfm_music($type, $id, $text = '', $icon = '') {
|
10 |
+
$url = 'http://www.last.fm/music/'.$id;
|
11 |
+
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Last.fm' : $text;
|
12 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
13 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
?>
|
includes/buttons/button.spotifyalbum.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MR_Social_Sharing_Toolkit_SpotifyAlbum extends MR_Social_Sharing_Toolkit_Button {
|
3 |
+
function __construct() {
|
4 |
+
$this->follow_buttons[] = array('name' => 'follow_spotify_album', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
5 |
+
$this->title = 'Spotify Album';
|
6 |
+
$this->icon = 'spotify';
|
7 |
+
}
|
8 |
+
|
9 |
+
function follow_spotify_album($type, $id, $text = '', $icon = '') {
|
10 |
+
$url = 'http://open.spotify.com/album/'.$id;
|
11 |
+
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Spotify' : $text;
|
12 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
13 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
?>
|
includes/buttons/button.twitter.php
CHANGED
@@ -36,7 +36,7 @@ class MR_Social_Sharing_Toolkit_Twitter extends MR_Social_Sharing_Toolkit_Button
|
|
36 |
if ($count_url != '') {
|
37 |
$retval .= ' data-counturl="'.$count_url.'"';
|
38 |
}
|
39 |
-
$retval .= ' data-text="'.$title.'"
|
40 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
41 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
42 |
break;
|
@@ -48,7 +48,7 @@ class MR_Social_Sharing_Toolkit_Twitter extends MR_Social_Sharing_Toolkit_Button
|
|
48 |
if ($count_url != '') {
|
49 |
$retval .= ' data-counturl="'.$count_url.'"';
|
50 |
}
|
51 |
-
$retval .= ' data-text="'.$title.'"
|
52 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
53 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
54 |
break;
|
@@ -60,7 +60,7 @@ class MR_Social_Sharing_Toolkit_Twitter extends MR_Social_Sharing_Toolkit_Button
|
|
60 |
if ($count_url != '') {
|
61 |
$retval .= ' data-counturl="'.$count_url.'"';
|
62 |
}
|
63 |
-
$retval .= ' data-text="'.$title.'"
|
64 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
65 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
66 |
break;
|
36 |
if ($count_url != '') {
|
37 |
$retval .= ' data-counturl="'.$count_url.'"';
|
38 |
}
|
39 |
+
$retval .= ' data-text="'.$title.'"></a>';
|
40 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
41 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
42 |
break;
|
48 |
if ($count_url != '') {
|
49 |
$retval .= ' data-counturl="'.$count_url.'"';
|
50 |
}
|
51 |
+
$retval .= ' data-text="'.$title.'"></a>';
|
52 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
53 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
54 |
break;
|
60 |
if ($count_url != '') {
|
61 |
$retval .= ' data-counturl="'.$count_url.'"';
|
62 |
}
|
63 |
+
$retval .= ' data-text="'.$title.'"></a>';
|
64 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
65 |
$this->enqueue_script('Social_sharing_twitter', 'https://platform.twitter.com/widgets.js', $footer);
|
66 |
break;
|
includes/buttons/button.youtubechannel.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MR_Social_Sharing_Toolkit_YoutubeChannel extends MR_Social_Sharing_Toolkit_Button {
|
3 |
+
function __construct() {
|
4 |
+
$this->follow_buttons[] = array('name' => 'follow_youtube_channel', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
5 |
+
$this->title = 'Youtube Channel';
|
6 |
+
$this->icon = 'youtube';
|
7 |
+
}
|
8 |
+
|
9 |
+
function follow_youtube_channel($type, $id, $text = '', $icon = '') {
|
10 |
+
$url = 'http://www.youtube.com/channel/'.$id;
|
11 |
+
$text = ($text == '') ? __('Watch my channel on','mr_social_sharing_toolkit').' YouTube' : $text;
|
12 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
13 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
?>
|
includes/class.button.php
CHANGED
@@ -77,7 +77,7 @@ class MR_Social_Sharing_Toolkit_Button {
|
|
77 |
$icon = ($icon == '') ? str_replace('includes/', '', plugins_url('/images/icons_small/'.$this->icon.'.png', __FILE__)) : $icon;
|
78 |
break;
|
79 |
}
|
80 |
-
$retval = '<a href="'.$url.'"><img src="'.$icon.'" alt="'.$title.'" title="'.$title.'"/>'.$text.'</a>';
|
81 |
return $retval;
|
82 |
}
|
83 |
|
77 |
$icon = ($icon == '') ? str_replace('includes/', '', plugins_url('/images/icons_small/'.$this->icon.'.png', __FILE__)) : $icon;
|
78 |
break;
|
79 |
}
|
80 |
+
$retval = '<a href="'.$url.'"><img src="'.$icon.'" class="nopin" alt="'.$title.'" title="'.$title.'"/>'.$text.'</a>';
|
81 |
return $retval;
|
82 |
}
|
83 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Social Sharing Toolkit ===
|
2 |
Contributors: MarijnRongen
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P8ZVNC57E58FE&lc=NL&item_name=WordPress%20plugins%20by%20Marijn%20Rongen&item_number=Social%20Sharing%20Toolkit¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
-
Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
|
@@ -28,6 +28,7 @@ The plugin currently supports the following networks for sharing your content:
|
|
28 |
* Reddit
|
29 |
* Myspace
|
30 |
* Hyves
|
|
|
31 |
|
32 |
On Tweet and Buffer buttons you can specify a Twitter handle which is then appended to the tweet a visitor sends (like "... via @WordPress"). An email send button is also included.
|
33 |
|
@@ -57,6 +58,8 @@ In version 2.0.4 three dividers were added to each list. These might be useful i
|
|
57 |
|
58 |
It is also possible to only let the buttons appear where you want by using shortcode. The shortcode function has it's own list of buttons with the same possibilities as the list for content. Use the shortcode [social_share/] in the content where you would like to display the buttons.
|
59 |
|
|
|
|
|
60 |
= Widget =
|
61 |
|
62 |
The widget has it's own list of buttons with the same possibilities as the list for posts & pages. You can however specify a fixed title and url to use for the buttons in the widget.
|
@@ -85,6 +88,7 @@ The networks currently supported for the Follow Widget are:
|
|
85 |
* Last.fm
|
86 |
* Spotify
|
87 |
* Soundcloud
|
|
|
88 |
|
89 |
A button for an RSS feed is also included. Of course the type, order and orientation of the buttons is also configurable for the Follow Widget. Each button for the Follow Widget supports the following types:
|
90 |
|
@@ -166,6 +170,10 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
|
|
166 |
|
167 |
== Upgrade Notice ==
|
168 |
|
|
|
|
|
|
|
|
|
169 |
= 2.1.1 =
|
170 |
|
171 |
Please update to version 2.1.1 to remove unwanted bookmarks and follow text.
|
@@ -231,6 +239,15 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
|
|
231 |
|
232 |
== Changelog ==
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
= 2.1.1 =
|
235 |
* Minor fix removing some unwanted text
|
236 |
|
1 |
=== Social Sharing Toolkit ===
|
2 |
Contributors: MarijnRongen
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P8ZVNC57E58FE&lc=NL&item_name=WordPress%20plugins%20by%20Marijn%20Rongen&item_number=Social%20Sharing%20Toolkit¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
+
Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Pinterest, Google+, Twitter, Tweet, Buffer, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, 500px, Picasa, deaviantART, App.net, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon, bitly, Open Graph
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 3.5.1
|
7 |
+
Stable tag: 2.1.2
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Easy sharing and connecting on social networks. Display on posts or use widgets or shortcode. Also Twitter name/hashtag to link converter.
|
28 |
* Reddit
|
29 |
* Myspace
|
30 |
* Hyves
|
31 |
+
* App.net
|
32 |
|
33 |
On Tweet and Buffer buttons you can specify a Twitter handle which is then appended to the tweet a visitor sends (like "... via @WordPress"). An email send button is also included.
|
34 |
|
58 |
|
59 |
It is also possible to only let the buttons appear where you want by using shortcode. The shortcode function has it's own list of buttons with the same possibilities as the list for content. Use the shortcode [social_share/] in the content where you would like to display the buttons.
|
60 |
|
61 |
+
Since version 2.1.2: Use one or both of the url and title attributes to override these settings with your own information. Example: [social_share url="http://www.mywebsite.com" title="My Website"/]
|
62 |
+
|
63 |
= Widget =
|
64 |
|
65 |
The widget has it's own list of buttons with the same possibilities as the list for posts & pages. You can however specify a fixed title and url to use for the buttons in the widget.
|
88 |
* Last.fm
|
89 |
* Spotify
|
90 |
* Soundcloud
|
91 |
+
* App.net
|
92 |
|
93 |
A button for an RSS feed is also included. Of course the type, order and orientation of the buttons is also configurable for the Follow Widget. Each button for the Follow Widget supports the following types:
|
94 |
|
170 |
|
171 |
== Upgrade Notice ==
|
172 |
|
173 |
+
= 2.1.2 =
|
174 |
+
|
175 |
+
Please update to version 2.1.2 immediately for several crucial fixes.
|
176 |
+
|
177 |
= 2.1.1 =
|
178 |
|
179 |
Please update to version 2.1.1 to remove unwanted bookmarks and follow text.
|
239 |
|
240 |
== Changelog ==
|
241 |
|
242 |
+
= 2.1.2 =
|
243 |
+
* Several minor fixes
|
244 |
+
* Added url and title attribute to shortcode function
|
245 |
+
* Added button for Youtube Channels
|
246 |
+
* Added button for Spotify Albums
|
247 |
+
* Added button for Last.fm music (artists)
|
248 |
+
* Added buttons for App.net
|
249 |
+
* Fixed possible script injection vulnerability
|
250 |
+
|
251 |
= 2.1.1 =
|
252 |
* Minor fix removing some unwanted text
|
253 |
|
script_2.1.1.js → script_2.1.2.js
RENAMED
File without changes
|
script_no_follow_2.1.1.js → script_no_follow_2.1.2.js
RENAMED
File without changes
|
social_sharing_toolkit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.active-bits.nl/support/social-sharing-toolkit/
|
5 |
Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
|
6 |
-
Version: 2.1.
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
@@ -147,9 +147,26 @@ class MR_Social_Sharing_Toolkit {
|
|
147 |
|
148 |
/* Admin functions */
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
function save_options($new_options) {
|
151 |
foreach ($this->options as $key => $val) {
|
152 |
if (array_key_exists($key, $new_options)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
update_option( $key, $new_options[$key] );
|
154 |
$this->options[$key] = $new_options[$key] ;
|
155 |
} else {
|
@@ -175,8 +192,8 @@ class MR_Social_Sharing_Toolkit {
|
|
175 |
add_filter('plugin_row_meta', array('MR_Social_Sharing_Toolkit', 'plugin_links'),10,2);
|
176 |
wp_enqueue_script('jquery-ui-tabs');
|
177 |
wp_enqueue_script('jquery-ui-sortable');
|
178 |
-
wp_enqueue_style('mr_social_sharing-admin', plugins_url('/admin_2.1.
|
179 |
-
wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin_2.1.
|
180 |
}
|
181 |
|
182 |
function plugin_links($links, $file) {
|
@@ -504,7 +521,7 @@ class MR_Social_Sharing_Toolkit {
|
|
504 |
/* Output functions */
|
505 |
|
506 |
function print_opengraph() {
|
507 |
-
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.1.
|
508 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
509 |
if (is_single() || is_page()) {
|
510 |
$excerpt = get_the_excerpt();
|
@@ -563,7 +580,7 @@ class MR_Social_Sharing_Toolkit {
|
|
563 |
}
|
564 |
|
565 |
function prepare_styles() {
|
566 |
-
wp_enqueue_style('mr_social_sharing', plugins_url('/style_2.1.
|
567 |
$upload = wp_upload_dir();
|
568 |
if (file_exists($upload['basedir'].'/social_sharing_custom.css') && $this->options['mr_social_sharing_custom_css'] != '') {
|
569 |
wp_enqueue_style('mr_social_sharing_custom', $upload['baseurl'].'/social_sharing_custom.css');
|
@@ -573,15 +590,15 @@ class MR_Social_Sharing_Toolkit {
|
|
573 |
function prepare_scripts() {
|
574 |
if ($this->options['mr_social_sharing_no_follow'] == 1) {
|
575 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
576 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/script_no_follow_2.1.
|
577 |
} else {
|
578 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/script_no_follow_2.1.
|
579 |
}
|
580 |
} else {
|
581 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
582 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/script_2.1.
|
583 |
} else {
|
584 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/script_2.1.
|
585 |
}
|
586 |
}
|
587 |
$this->load_scripts();
|
@@ -637,7 +654,7 @@ class MR_Social_Sharing_Toolkit {
|
|
637 |
}
|
638 |
$bookmarks = '
|
639 |
<div class="mr_social_sharing_wrapper">
|
640 |
-
<!-- Social Sharing Toolkit v2.1.
|
641 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
642 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
643 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
@@ -655,7 +672,7 @@ class MR_Social_Sharing_Toolkit {
|
|
655 |
function create_followers() {
|
656 |
$followers = '
|
657 |
<div class="mr_social_sharing_wrapper">
|
658 |
-
<!-- Social Sharing Toolkit v2.1.
|
659 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
660 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
661 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
@@ -811,7 +828,11 @@ class MR_Social_Sharing_Toolkit {
|
|
811 |
}
|
812 |
}
|
813 |
|
814 |
-
function share_shortcode() {
|
|
|
|
|
|
|
|
|
815 |
if (is_feed()) {
|
816 |
return '';
|
817 |
} else {
|
@@ -842,7 +863,9 @@ class MR_Social_Sharing_Toolkit {
|
|
842 |
$type = get_post_type();
|
843 |
$bookmarks = '';
|
844 |
if ((is_single() || $type == 'page') || $this->options['mr_social_sharing_include_excerpts'] == 1) {
|
845 |
-
$
|
|
|
|
|
846 |
}
|
847 |
return $bookmarks;
|
848 |
}
|
@@ -909,8 +932,8 @@ if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
|
909 |
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
910 |
}
|
911 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'), 15);
|
912 |
-
add_action('
|
913 |
-
add_action('
|
914 |
include 'includes/share.widget.php';
|
915 |
include 'includes/follow.widget.php';
|
916 |
?>
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.active-bits.nl/support/social-sharing-toolkit/
|
5 |
Description: This plugin enables sharing of your content via popular social networks and can also convert Twitter names and hashtags to links. Easy & configurable.
|
6 |
+
Version: 2.1.2
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
147 |
|
148 |
/* Admin functions */
|
149 |
|
150 |
+
// Simple input sanitizing to prevent script injections:
|
151 |
+
function sanitize_value($val) {
|
152 |
+
$val = str_replace('"', '', html_entity_decode($val, ENT_QUOTES));
|
153 |
+
$val = strtr($val, "&;<>'", ";;;;;");
|
154 |
+
return str_replace(";", "", $val);
|
155 |
+
}
|
156 |
+
|
157 |
function save_options($new_options) {
|
158 |
foreach ($this->options as $key => $val) {
|
159 |
if (array_key_exists($key, $new_options)) {
|
160 |
+
if (is_array($new_options[$key])) {
|
161 |
+
foreach ($new_options[$key] as $sub_key => $val) {
|
162 |
+
if (is_array($new_options[$key][$sub_key]) && array_key_exists('id', $new_options[$key][$sub_key])) {
|
163 |
+
$new_options[$key][$sub_key]['id'] = $this->sanitize_value($new_options[$key][$sub_key]['id']);
|
164 |
+
}
|
165 |
+
if (is_array($new_options[$key][$sub_key]) && array_key_exists('text', $new_options[$key][$sub_key])) {
|
166 |
+
$new_options[$key][$sub_key]['text'] = $this->sanitize_value($new_options[$key][$sub_key]['text']);
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
update_option( $key, $new_options[$key] );
|
171 |
$this->options[$key] = $new_options[$key] ;
|
172 |
} else {
|
192 |
add_filter('plugin_row_meta', array('MR_Social_Sharing_Toolkit', 'plugin_links'),10,2);
|
193 |
wp_enqueue_script('jquery-ui-tabs');
|
194 |
wp_enqueue_script('jquery-ui-sortable');
|
195 |
+
wp_enqueue_style('mr_social_sharing-admin', plugins_url('/admin_2.1.2.css', __FILE__));
|
196 |
+
wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin_2.1.2.js', __FILE__));
|
197 |
}
|
198 |
|
199 |
function plugin_links($links, $file) {
|
521 |
/* Output functions */
|
522 |
|
523 |
function print_opengraph() {
|
524 |
+
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.1.2 -->
|
525 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
526 |
if (is_single() || is_page()) {
|
527 |
$excerpt = get_the_excerpt();
|
580 |
}
|
581 |
|
582 |
function prepare_styles() {
|
583 |
+
wp_enqueue_style('mr_social_sharing', plugins_url('/style_2.1.2.css', __FILE__));
|
584 |
$upload = wp_upload_dir();
|
585 |
if (file_exists($upload['basedir'].'/social_sharing_custom.css') && $this->options['mr_social_sharing_custom_css'] != '') {
|
586 |
wp_enqueue_style('mr_social_sharing_custom', $upload['baseurl'].'/social_sharing_custom.css');
|
590 |
function prepare_scripts() {
|
591 |
if ($this->options['mr_social_sharing_no_follow'] == 1) {
|
592 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
593 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_no_follow_2.1.2.js', __FILE__), array('jquery'), false, true);
|
594 |
} else {
|
595 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_no_follow_2.1.2.js', __FILE__), array('jquery'));
|
596 |
}
|
597 |
} else {
|
598 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
599 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_2.1.2.js', __FILE__), array('jquery'), false, true);
|
600 |
} else {
|
601 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_2.1.2.js', __FILE__), array('jquery'));
|
602 |
}
|
603 |
}
|
604 |
$this->load_scripts();
|
654 |
}
|
655 |
$bookmarks = '
|
656 |
<div class="mr_social_sharing_wrapper">
|
657 |
+
<!-- Social Sharing Toolkit v2.1.2 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
658 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
659 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
660 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
672 |
function create_followers() {
|
673 |
$followers = '
|
674 |
<div class="mr_social_sharing_wrapper">
|
675 |
+
<!-- Social Sharing Toolkit v2.1.2 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
676 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
677 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
678 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
828 |
}
|
829 |
}
|
830 |
|
831 |
+
function share_shortcode($atts) {
|
832 |
+
extract( shortcode_atts( array(
|
833 |
+
'url' => '',
|
834 |
+
'title' => ''
|
835 |
+
), $atts ) );
|
836 |
if (is_feed()) {
|
837 |
return '';
|
838 |
} else {
|
863 |
$type = get_post_type();
|
864 |
$bookmarks = '';
|
865 |
if ((is_single() || $type == 'page') || $this->options['mr_social_sharing_include_excerpts'] == 1) {
|
866 |
+
$url = ($url == '') ? get_permalink() : $url;
|
867 |
+
$title = ($title == '') ? the_title('','',false) : $title;
|
868 |
+
$bookmarks = $this->create_bookmarks($url, $title, 'shortcode_', $media, '');
|
869 |
}
|
870 |
return $bookmarks;
|
871 |
}
|
932 |
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
933 |
}
|
934 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'), 15);
|
935 |
+
add_action('wp_enqueue_styles', array($MR_Social_Sharing_Toolkit, 'prepare_styles'), 50);
|
936 |
+
add_action('wp_enqueue_scripts', array($MR_Social_Sharing_Toolkit, 'prepare_scripts'), 50);
|
937 |
include 'includes/share.widget.php';
|
938 |
include 'includes/follow.widget.php';
|
939 |
?>
|
style_2.1.1.css → style_2.1.2.css
RENAMED
File without changes
|