Version Description
Please update to version 2.0.8 for a critical fix causing server errors.
Download this release
Release Info
Developer | MarijnRongen |
Plugin | Social Sharing Toolkit |
Version | 2.0.8 |
Comparing to | |
See all releases |
Code changes from version 2.0.7 to 2.0.8
- images/buttons/pinterest.png +0 -0
- images/icons_large/pinterest.png +0 -0
- images/icons_medium/pinterest.png +0 -0
- images/icons_small/pinterest.png +0 -0
- pinterest.js +0 -20
- readme.txt +11 -1
- social_sharing_toolkit.php +29 -58
- style.css +3 -0
images/buttons/pinterest.png
CHANGED
Binary file
|
images/icons_large/pinterest.png
CHANGED
Binary file
|
images/icons_medium/pinterest.png
CHANGED
Binary file
|
images/icons_small/pinterest.png
CHANGED
Binary file
|
pinterest.js
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
(function() {
|
2 |
-
window.PinIt = window.PinIt || { loaded:false };
|
3 |
-
if (window.PinIt.loaded) return;
|
4 |
-
window.PinIt.loaded = true;
|
5 |
-
function async_load(){
|
6 |
-
var s = document.createElement("script");
|
7 |
-
s.type = "text/javascript";
|
8 |
-
s.async = true;
|
9 |
-
if (window.location.protocol == "https:")
|
10 |
-
s.src = "https://assets.pinterest.com/js/pinit.js";
|
11 |
-
else
|
12 |
-
s.src = "http://assets.pinterest.com/js/pinit.js";
|
13 |
-
var x = document.getElementsByTagName("script")[0];
|
14 |
-
x.parentNode.insertBefore(s, x);
|
15 |
-
}
|
16 |
-
if (window.attachEvent)
|
17 |
-
window.attachEvent("onload", async_load);
|
18 |
-
else
|
19 |
-
window.addEventListener("load", async_load, false);
|
20 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P8ZVN
|
|
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.3.1
|
7 |
-
Stable tag: 2.0.
|
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.
|
@@ -163,6 +163,10 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
|
|
163 |
|
164 |
== Upgrade Notice ==
|
165 |
|
|
|
|
|
|
|
|
|
166 |
= 2.0.7 =
|
167 |
|
168 |
Please update to version 2.0.7 for several critical fixes and enhancements to the Pinterest buttons.
|
@@ -212,6 +216,12 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
|
|
212 |
|
213 |
== Changelog ==
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
= 2.0.7 =
|
216 |
* Included an option to specify a default image for the Pinterest button
|
217 |
* Fixed some major issues with shortcodes and excerpts
|
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.3.1
|
7 |
+
Stable tag: 2.0.8
|
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.
|
163 |
|
164 |
== Upgrade Notice ==
|
165 |
|
166 |
+
= 2.0.8 =
|
167 |
+
|
168 |
+
Please update to version 2.0.8 for a critical fix causing server errors.
|
169 |
+
|
170 |
= 2.0.7 =
|
171 |
|
172 |
Please update to version 2.0.7 for several critical fixes and enhancements to the Pinterest buttons.
|
216 |
|
217 |
== Changelog ==
|
218 |
|
219 |
+
= 2.0.8 =
|
220 |
+
* Fixed issue with combinations of excerpt and Read more tags resulting in errors
|
221 |
+
* Fixed a bug with urls and StumbleUpon counters
|
222 |
+
* Fixed issue with Bitly for high traffic sites
|
223 |
+
* Updated Pinterest buttons and icons
|
224 |
+
|
225 |
= 2.0.7 =
|
226 |
* Included an option to specify a default image for the Pinterest button
|
227 |
* Fixed some major issues with shortcodes and excerpts
|
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.0.
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
@@ -90,7 +90,7 @@ class MR_Social_Sharing_Toolkit {
|
|
90 |
$follow_order[] = $key;
|
91 |
}
|
92 |
$pinterest_options = array('default_image' => '', 'fixed_image' => 0);
|
93 |
-
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '');
|
94 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
95 |
$this->options = array('mr_social_sharing_buttons' => $buttons, 'mr_social_sharing_shortcode_buttons' => $shortcodes, 'mr_social_sharing_widget_buttons' => $widgets, 'mr_social_sharing_follow_buttons' => $followers, 'mr_social_sharing_display' => 'span', 'mr_social_sharing_shortcode_display' => 'span', 'mr_social_sharing_widget_display' => 'span', 'mr_social_sharing_follow_display' => 'span', 'mr_social_sharing_align' => '', 'mr_social_sharing_shortcode_align' => '', 'mr_social_sharing_widget_align' => '', 'mr_social_sharing_follow_align' => '', 'mr_social_sharing_position' => 'none', 'mr_social_sharing_types' => array('post', 'page'), 'mr_social_sharing_enable_shortcode' => 1, 'mr_social_sharing_include_excerpts' => 1, 'mr_social_sharing_button_order' => $button_order, 'mr_social_sharing_shortcode_button_order' => $shortcode_order, 'mr_social_sharing_widget_button_order' => $widget_order, 'mr_social_sharing_follow_button_order' => $follow_order, 'mr_social_sharing_linkify_content' => 0, 'mr_social_sharing_linkify_comments' => 0, 'mr_social_sharing_linkify_new' => 1, 'mr_social_sharing_twitter_handles' => 0, 'mr_social_sharing_twitter_hashtags' => 0, 'mr_social_sharing_js_footer' => 1, 'mr_social_sharing_no_follow' => 0, 'mr_social_sharing_pinterest' => $pinterest_options, 'mr_social_sharing_bitly' => $bitly_options, 'mr_social_sharing_opengraph' => $opengraph_options);
|
96 |
foreach ($this->options as $key => $val) {
|
@@ -477,7 +477,7 @@ class MR_Social_Sharing_Toolkit {
|
|
477 |
/* Output functions */
|
478 |
|
479 |
function print_opengraph() {
|
480 |
-
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.
|
481 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
482 |
if (is_single() || is_page()) {
|
483 |
$excerpt = get_the_excerpt();
|
@@ -726,9 +726,9 @@ class MR_Social_Sharing_Toolkit {
|
|
726 |
}
|
727 |
if ($pinit_script) {
|
728 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
729 |
-
|
730 |
} else {
|
731 |
-
wp_enqueue_script('Pinterest',
|
732 |
}
|
733 |
}
|
734 |
if ($xing_script) {
|
@@ -749,7 +749,7 @@ class MR_Social_Sharing_Toolkit {
|
|
749 |
}
|
750 |
$bookmarks = '
|
751 |
<div class="mr_social_sharing_wrapper">
|
752 |
-
<!-- Social Sharing Toolkit v2.0.
|
753 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
754 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
755 |
$id = array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button]) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
@@ -765,7 +765,7 @@ class MR_Social_Sharing_Toolkit {
|
|
765 |
function create_followers() {
|
766 |
$followers = '
|
767 |
<div class="mr_social_sharing_wrapper">
|
768 |
-
<!-- Social Sharing Toolkit v2.0.
|
769 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
770 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
771 |
$id = array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button]) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
@@ -884,13 +884,20 @@ class MR_Social_Sharing_Toolkit {
|
|
884 |
function get_tw_tweet($url, $title, $type, $id) {
|
885 |
$count_url = '';
|
886 |
if ($this->options['mr_social_sharing_bitly']['enable'] == 1 && $this->options['mr_social_sharing_bitly']['username'] != '' && $this->options['mr_social_sharing_bitly']['key'] != '') {
|
887 |
-
|
888 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
889 |
-
if ($short_url = curl_exec($ch)) {
|
890 |
$count_url = $url;
|
891 |
-
$url =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
892 |
}
|
893 |
-
}
|
894 |
switch ($type) {
|
895 |
case 'horizontal':
|
896 |
$retval = '<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="'.$url.'"';
|
@@ -970,13 +977,13 @@ class MR_Social_Sharing_Toolkit {
|
|
970 |
$pin_url = 'http://pinterest.com/pin/create/button/?url='.urlencode($url).'&media='.urlencode($media).'&description='.urlencode($title);
|
971 |
switch ($type) {
|
972 |
case 'horizontal':
|
973 |
-
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="horizontal"
|
974 |
break;
|
975 |
case 'vertical':
|
976 |
-
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="vertical"
|
977 |
break;
|
978 |
case 'none':
|
979 |
-
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="none"
|
980 |
break;
|
981 |
default:
|
982 |
$title = __('Pin it on','mr_social_sharing_toolkit').' Pinterest';
|
@@ -1060,10 +1067,10 @@ class MR_Social_Sharing_Toolkit {
|
|
1060 |
function get_su_stumble($url, $title, $type, $id) {
|
1061 |
switch ($type) {
|
1062 |
case 'horizontal':
|
1063 |
-
$retval = '<su:badge layout="1" location="'
|
1064 |
break;
|
1065 |
case 'vertical':
|
1066 |
-
$retval = '<su:badge layout="5" location="'
|
1067 |
break;
|
1068 |
default:
|
1069 |
$url = 'http://www.stumbleupon.com/submit?url='.urlencode($url);
|
@@ -1421,41 +1428,6 @@ class MR_Social_Sharing_Toolkit {
|
|
1421 |
}
|
1422 |
return $content;
|
1423 |
}
|
1424 |
-
|
1425 |
-
function share_more_link($link) {
|
1426 |
-
$media = '';
|
1427 |
-
if ($this->options['mr_social_sharing_pinterest']['default_image'] != '' && $this->options['mr_social_sharing_pinterest']['fixed_image'] == 1) {
|
1428 |
-
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1429 |
-
} else {
|
1430 |
-
if (current_theme_supports('post-thumbnails')) {
|
1431 |
-
if ($media = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()))) {
|
1432 |
-
if (is_array($media)) {
|
1433 |
-
$media = $media[0];
|
1434 |
-
} else {
|
1435 |
-
$media = '';
|
1436 |
-
}
|
1437 |
-
}
|
1438 |
-
}
|
1439 |
-
if ($media == '') {
|
1440 |
-
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
|
1441 |
-
$img = $matches[1][0];
|
1442 |
-
if($img != '') {
|
1443 |
-
$media = $img;
|
1444 |
-
}
|
1445 |
-
}
|
1446 |
-
if ($media == '' && $this->options['mr_social_sharing_pinterest']['default_image'] != '') {
|
1447 |
-
$media = $this->options['mr_social_sharing_pinterest']['default_image'];
|
1448 |
-
}
|
1449 |
-
}
|
1450 |
-
$type = get_post_type();
|
1451 |
-
if (in_array($type, $this->options['mr_social_sharing_types'])) {
|
1452 |
-
if (in_array($this->options['mr_social_sharing_position'], array('bottom','both'))) {
|
1453 |
-
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), '', $media);
|
1454 |
-
$link = $bookmarks.$link;
|
1455 |
-
}
|
1456 |
-
}
|
1457 |
-
return $link;
|
1458 |
-
}
|
1459 |
|
1460 |
function share_excerpt($content) {
|
1461 |
$media = '';
|
@@ -1557,14 +1529,14 @@ class MR_Social_Sharing_Toolkit {
|
|
1557 |
function linkify($content) {
|
1558 |
if ($this->options['mr_social_sharing_linkify_new'] == 1) {
|
1559 |
if ($this->options['mr_social_sharing_twitter_handles'] == 1) {
|
1560 |
-
$content = preg_replace("/(^|\s)+(@([a-zA-Z0-
|
1561 |
}
|
1562 |
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) {
|
1563 |
$content = preg_replace("/(^|\s)+((?:(?<!&))#([a-zA-Z0-9]+^[-|;]))([^|\n|\r|\t|\s|\.|\<|\&]*)/i", "$1<a href=\"http://twitter.com/search/$3\" target=\"_BLANK\">$2</a>$4", $content);
|
1564 |
}
|
1565 |
} else {
|
1566 |
if ($this->options['mr_social_sharing_twitter_handles'] == 1) {
|
1567 |
-
$content = preg_replace("/(^|\s)+(@([a-zA-Z0-
|
1568 |
}
|
1569 |
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) {
|
1570 |
$content = preg_replace("/(^|\s)+((?:(?<!&))#([a-zA-Z0-9]+^[-|;]))([^|\n|\r|\t|\s|\.|\<|\&]*)/i", "$1<a href=\"http://twitter.com/search/$3\">$2</a>$4", $content);
|
@@ -1697,13 +1669,12 @@ if ($MR_Social_Sharing_Toolkit->should_linkify_content()) {
|
|
1697 |
if ($MR_Social_Sharing_Toolkit->should_linkify_comments()) {
|
1698 |
add_filter('comment_text', array($MR_Social_Sharing_Toolkit, 'linkify'));
|
1699 |
}
|
1700 |
-
if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
1701 |
-
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
1702 |
-
}
|
1703 |
if ($MR_Social_Sharing_Toolkit->should_share_excerpt()) {
|
1704 |
-
add_filter('the_content_more_link', array($MR_Social_Sharing_Toolkit, 'share_more_link'));
|
1705 |
add_filter('the_excerpt', array($MR_Social_Sharing_Toolkit, 'share_excerpt'));
|
1706 |
}
|
|
|
|
|
|
|
1707 |
if ($MR_Social_Sharing_Toolkit->should_use_shortcode()) {
|
1708 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'));
|
1709 |
}
|
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.0.8
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
90 |
$follow_order[] = $key;
|
91 |
}
|
92 |
$pinterest_options = array('default_image' => '', 'fixed_image' => 0);
|
93 |
+
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '', 'cache' => array());
|
94 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
95 |
$this->options = array('mr_social_sharing_buttons' => $buttons, 'mr_social_sharing_shortcode_buttons' => $shortcodes, 'mr_social_sharing_widget_buttons' => $widgets, 'mr_social_sharing_follow_buttons' => $followers, 'mr_social_sharing_display' => 'span', 'mr_social_sharing_shortcode_display' => 'span', 'mr_social_sharing_widget_display' => 'span', 'mr_social_sharing_follow_display' => 'span', 'mr_social_sharing_align' => '', 'mr_social_sharing_shortcode_align' => '', 'mr_social_sharing_widget_align' => '', 'mr_social_sharing_follow_align' => '', 'mr_social_sharing_position' => 'none', 'mr_social_sharing_types' => array('post', 'page'), 'mr_social_sharing_enable_shortcode' => 1, 'mr_social_sharing_include_excerpts' => 1, 'mr_social_sharing_button_order' => $button_order, 'mr_social_sharing_shortcode_button_order' => $shortcode_order, 'mr_social_sharing_widget_button_order' => $widget_order, 'mr_social_sharing_follow_button_order' => $follow_order, 'mr_social_sharing_linkify_content' => 0, 'mr_social_sharing_linkify_comments' => 0, 'mr_social_sharing_linkify_new' => 1, 'mr_social_sharing_twitter_handles' => 0, 'mr_social_sharing_twitter_hashtags' => 0, 'mr_social_sharing_js_footer' => 1, 'mr_social_sharing_no_follow' => 0, 'mr_social_sharing_pinterest' => $pinterest_options, 'mr_social_sharing_bitly' => $bitly_options, 'mr_social_sharing_opengraph' => $opengraph_options);
|
96 |
foreach ($this->options as $key => $val) {
|
477 |
/* Output functions */
|
478 |
|
479 |
function print_opengraph() {
|
480 |
+
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0.8 -->
|
481 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
482 |
if (is_single() || is_page()) {
|
483 |
$excerpt = get_the_excerpt();
|
726 |
}
|
727 |
if ($pinit_script) {
|
728 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
729 |
+
wp_enqueue_script('Pinterest', 'http://assets.pinterest.com/js/pinit.js', array(), false, true);
|
730 |
} else {
|
731 |
+
wp_enqueue_script('Pinterest', 'http://assets.pinterest.com/js/pinit.js');
|
732 |
}
|
733 |
}
|
734 |
if ($xing_script) {
|
749 |
}
|
750 |
$bookmarks = '
|
751 |
<div class="mr_social_sharing_wrapper">
|
752 |
+
<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
753 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
754 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
755 |
$id = array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button]) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
765 |
function create_followers() {
|
766 |
$followers = '
|
767 |
<div class="mr_social_sharing_wrapper">
|
768 |
+
<!-- Social Sharing Toolkit v2.0.8 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
769 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
770 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
771 |
$id = array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button]) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
884 |
function get_tw_tweet($url, $title, $type, $id) {
|
885 |
$count_url = '';
|
886 |
if ($this->options['mr_social_sharing_bitly']['enable'] == 1 && $this->options['mr_social_sharing_bitly']['username'] != '' && $this->options['mr_social_sharing_bitly']['key'] != '') {
|
887 |
+
if (is_array($this->options['mr_social_sharing_bitly']['cache']) && array_key_exists($url, $this->options['mr_social_sharing_bitly']['cache'])) {
|
|
|
|
|
888 |
$count_url = $url;
|
889 |
+
$url = $this->options['mr_social_sharing_bitly']['cache'][$url];
|
890 |
+
} else {
|
891 |
+
$ch = curl_init('https://api-ssl.bitly.com/v3/shorten?login='.$this->options['mr_social_sharing_bitly']['username'].'&apiKey='.$this->options['mr_social_sharing_bitly']['key'].'&longUrl='.urlencode($url).'&format=txt');
|
892 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
893 |
+
if ($short_url = curl_exec($ch)) {
|
894 |
+
$count_url = $url;
|
895 |
+
$url = trim($short_url);
|
896 |
+
$this->options['mr_social_sharing_bitly']['cache'][$count_url] = $url;
|
897 |
+
update_option( 'mr_social_sharing_bitly', $this->options['mr_social_sharing_bitly']);
|
898 |
+
}
|
899 |
}
|
900 |
+
}
|
901 |
switch ($type) {
|
902 |
case 'horizontal':
|
903 |
$retval = '<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-url="'.$url.'"';
|
977 |
$pin_url = 'http://pinterest.com/pin/create/button/?url='.urlencode($url).'&media='.urlencode($media).'&description='.urlencode($title);
|
978 |
switch ($type) {
|
979 |
case 'horizontal':
|
980 |
+
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>';
|
981 |
break;
|
982 |
case 'vertical':
|
983 |
+
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="vertical"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>';
|
984 |
break;
|
985 |
case 'none':
|
986 |
+
$retval = '<a href="'.$pin_url.'" class="pin-it-button" count-layout="none"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>';
|
987 |
break;
|
988 |
default:
|
989 |
$title = __('Pin it on','mr_social_sharing_toolkit').' Pinterest';
|
1067 |
function get_su_stumble($url, $title, $type, $id) {
|
1068 |
switch ($type) {
|
1069 |
case 'horizontal':
|
1070 |
+
$retval = '<span class="stumble_horizontal"><su:badge layout="1" location="'.$url.'"></su:badge></span>';
|
1071 |
break;
|
1072 |
case 'vertical':
|
1073 |
+
$retval = '<span class="stumble_vertical"><su:badge layout="5" location="'.$url.'"></su:badge></span>';
|
1074 |
break;
|
1075 |
default:
|
1076 |
$url = 'http://www.stumbleupon.com/submit?url='.urlencode($url);
|
1428 |
}
|
1429 |
return $content;
|
1430 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1431 |
|
1432 |
function share_excerpt($content) {
|
1433 |
$media = '';
|
1529 |
function linkify($content) {
|
1530 |
if ($this->options['mr_social_sharing_linkify_new'] == 1) {
|
1531 |
if ($this->options['mr_social_sharing_twitter_handles'] == 1) {
|
1532 |
+
$content = preg_replace("/(^|\s)+(@([a-zA-Z0-9_-]{1,15}))(\.*[^|\n|\r|\t|\s|\<|\&]*)/i", "$1<a href=\"http://twitter.com/$3\" target=\"_BLANK\">$2</a>$4", $content);
|
1533 |
}
|
1534 |
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) {
|
1535 |
$content = preg_replace("/(^|\s)+((?:(?<!&))#([a-zA-Z0-9]+^[-|;]))([^|\n|\r|\t|\s|\.|\<|\&]*)/i", "$1<a href=\"http://twitter.com/search/$3\" target=\"_BLANK\">$2</a>$4", $content);
|
1536 |
}
|
1537 |
} else {
|
1538 |
if ($this->options['mr_social_sharing_twitter_handles'] == 1) {
|
1539 |
+
$content = preg_replace("/(^|\s)+(@([a-zA-Z0-9_-]{1,15}))(\.*[^|\n|\r|\t|\s|\<|\&]*)/i", "$1<a href=\"http://twitter.com/$3\">$2</a>$4", $content);
|
1540 |
}
|
1541 |
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) {
|
1542 |
$content = preg_replace("/(^|\s)+((?:(?<!&))#([a-zA-Z0-9]+^[-|;]))([^|\n|\r|\t|\s|\.|\<|\&]*)/i", "$1<a href=\"http://twitter.com/search/$3\">$2</a>$4", $content);
|
1669 |
if ($MR_Social_Sharing_Toolkit->should_linkify_comments()) {
|
1670 |
add_filter('comment_text', array($MR_Social_Sharing_Toolkit, 'linkify'));
|
1671 |
}
|
|
|
|
|
|
|
1672 |
if ($MR_Social_Sharing_Toolkit->should_share_excerpt()) {
|
|
|
1673 |
add_filter('the_excerpt', array($MR_Social_Sharing_Toolkit, 'share_excerpt'));
|
1674 |
}
|
1675 |
+
if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
1676 |
+
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
1677 |
+
}
|
1678 |
if ($MR_Social_Sharing_Toolkit->should_use_shortcode()) {
|
1679 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'));
|
1680 |
}
|
style.css
CHANGED
@@ -8,6 +8,9 @@ a.mr_social_sharing_popup_link, a.mr_social_sharing_popup_link:HOVER {display: i
|
|
8 |
.mr_social_sharing_top a.mr_social_sharing_popup_link, .mr_social_sharing_top div, .mr_social_sharing_top span, .mr_social_sharing_top iframe, .mr_social_sharing_top img {line-height: 0; vertical-align: top;}
|
9 |
.mr_social_sharing span.mr_small_icon, .mr_social_sharing span.mr_medium_icon, .mr_social_sharing_top span.mr_small_icon, .mr_social_sharing_top span.mr_medium_icon {display: inline-block; font-family: 'Droid Sans',arial,sans-serif; vertical-align: bottom; font-size:10px; font-weight: 200; line-height: 10px; margin: 0 0 0 4px; padding: 0;}
|
10 |
.mr_social_sharing span.mr_medium_icon, .mr_social_sharing_top span.mr_medium_icon {font-size:12px; line-height: 12px;}
|
|
|
|
|
|
|
11 |
/* Digg fix */
|
12 |
span.db-count {line-height: 16px; vertical-align: baseline;}
|
13 |
/* LinkedIn fix */
|
8 |
.mr_social_sharing_top a.mr_social_sharing_popup_link, .mr_social_sharing_top div, .mr_social_sharing_top span, .mr_social_sharing_top iframe, .mr_social_sharing_top img {line-height: 0; vertical-align: top;}
|
9 |
.mr_social_sharing span.mr_small_icon, .mr_social_sharing span.mr_medium_icon, .mr_social_sharing_top span.mr_small_icon, .mr_social_sharing_top span.mr_medium_icon {display: inline-block; font-family: 'Droid Sans',arial,sans-serif; vertical-align: bottom; font-size:10px; font-weight: 200; line-height: 10px; margin: 0 0 0 4px; padding: 0;}
|
10 |
.mr_social_sharing span.mr_medium_icon, .mr_social_sharing_top span.mr_medium_icon {font-size:12px; line-height: 12px;}
|
11 |
+
/* Stumble Upon fix */
|
12 |
+
.mr_social_sharing span.stumble_vertical iframe, .mr_social_sharing_top span.stumble_vertical iframe {width: 50px;}
|
13 |
+
.mr_social_sharing span.stumble_horizontal iframe, .mr_social_sharing_top span.stumble_horizontal iframe {width: 74px;}
|
14 |
/* Digg fix */
|
15 |
span.db-count {line-height: 16px; vertical-align: baseline;}
|
16 |
/* LinkedIn fix */
|