Version Description
Please update to version 2.1.0 immediately for several crucial fixes.
Download this release
Release Info
Developer | MarijnRongen |
Plugin | Social Sharing Toolkit |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.9 to 2.1.0
- admin.css → admin_2.1.0.css +3 -3
- admin.js → admin_2.1.0.js +0 -0
- images/buttons/twitter.png +0 -0
- images/icons_large/instagram.png +0 -0
- images/icons_large/twitter.png +0 -0
- images/icons_medium/instagram.png +0 -0
- images/icons_medium/twitter.png +0 -0
- images/icons_small/instagram.png +0 -0
- images/icons_small/twitter.png +0 -0
- includes/buttons/button.500px.php +2 -1
- includes/buttons/button.buffer.php +1 -1
- includes/buttons/button.deviantart.php +2 -1
- includes/buttons/button.facebook.php +10 -10
- includes/buttons/button.flickr.php +2 -1
- includes/buttons/button.goodreads.php +2 -1
- includes/buttons/button.googleplus.php +2 -2
- includes/buttons/button.hyves.php +2 -1
- includes/buttons/button.instagram.php +16 -0
- includes/buttons/button.lastfm.php +2 -1
- includes/buttons/button.linkedin.php +6 -3
- includes/buttons/button.myspace.php +2 -1
- includes/buttons/button.picasa.php +2 -1
- includes/buttons/button.pinterest.php +2 -1
- includes/buttons/button.rss.php +2 -1
- includes/buttons/button.soundcloud.php +2 -1
- includes/buttons/button.spotify.php +2 -1
- includes/buttons/button.tumblr.php +2 -1
- includes/buttons/button.twitter.php +14 -1
- includes/buttons/button.xing.php +3 -2
- includes/buttons/button.youtube.php +2 -1
- includes/class.button.php +7 -5
- readme.txt +16 -2
- script.js → script_2.1.0.js +5 -1
- script_no_follow.js → script_no_follow_2.1.0.js +4 -0
- social_sharing_toolkit.php +80 -43
- style.css → style_2.1.0.css +2 -0
admin.css → admin_2.1.0.css
RENAMED
@@ -93,7 +93,7 @@ ul#mr_social_sharing_networks li, ul#mr_social_sharing_shortcode_networks li, ul
|
|
93 |
box-shadow: white 0px 1px 0px 0px inset;
|
94 |
cursor: move;
|
95 |
display: block;
|
96 |
-
margin:
|
97 |
outline-color: #222;
|
98 |
outline-style: none;
|
99 |
outline-width: 0px;
|
@@ -166,7 +166,7 @@ span.mr_social_sharing_custom {
|
|
166 |
border: 1px solid #DFDFDF;
|
167 |
border-radius: 3px;
|
168 |
margin: 2px 0;
|
169 |
-
padding:
|
170 |
}
|
171 |
|
172 |
ul#mr_social_sharing_networks li span.mr_social_sharing_custom input.text {
|
@@ -175,7 +175,7 @@ ul#mr_social_sharing_networks li span.mr_social_sharing_custom input.text {
|
|
175 |
}
|
176 |
|
177 |
ul#mr_social_sharing_networks li span.mr_social_sharing_custom label.text {
|
178 |
-
margin: 0 4px 0
|
179 |
padding: 2px 0 0 0;
|
180 |
}
|
181 |
|
93 |
box-shadow: white 0px 1px 0px 0px inset;
|
94 |
cursor: move;
|
95 |
display: block;
|
96 |
+
margin: 3px 0 0 0;
|
97 |
outline-color: #222;
|
98 |
outline-style: none;
|
99 |
outline-width: 0px;
|
166 |
border: 1px solid #DFDFDF;
|
167 |
border-radius: 3px;
|
168 |
margin: 2px 0;
|
169 |
+
padding: 2px 18px 2px 0;
|
170 |
}
|
171 |
|
172 |
ul#mr_social_sharing_networks li span.mr_social_sharing_custom input.text {
|
175 |
}
|
176 |
|
177 |
ul#mr_social_sharing_networks li span.mr_social_sharing_custom label.text {
|
178 |
+
margin: 0 4px 0 8px;
|
179 |
padding: 2px 0 0 0;
|
180 |
}
|
181 |
|
admin.js → admin_2.1.0.js
RENAMED
File without changes
|
images/buttons/twitter.png
DELETED
Binary file
|
images/icons_large/instagram.png
ADDED
Binary file
|
images/icons_large/twitter.png
CHANGED
Binary file
|
images/icons_medium/instagram.png
ADDED
Binary file
|
images/icons_medium/twitter.png
CHANGED
Binary file
|
images/icons_small/instagram.png
ADDED
Binary file
|
images/icons_small/twitter.png
CHANGED
Binary file
|
includes/buttons/button.500px.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_500px extends MR_Social_Sharing_Toolkit_Button {
|
|
9 |
function follow_500px($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://500px.com/'.$id;
|
11 |
$text = ($text == '') ? __('My portfolio on','mr_social_sharing_toolkit').' 500px' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_500px($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://500px.com/'.$id;
|
11 |
$text = ($text == '') ? __('My portfolio on','mr_social_sharing_toolkit').' 500px' : $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.buffer.php
CHANGED
@@ -44,7 +44,7 @@ class MR_Social_Sharing_Toolkit_Buffer extends MR_Social_Sharing_Toolkit_Button
|
|
44 |
$retval = $this->get_icon($type, $url, $text, $icon, true);
|
45 |
break;
|
46 |
}
|
47 |
-
return $retval;
|
48 |
}
|
49 |
}
|
50 |
?>
|
44 |
$retval = $this->get_icon($type, $url, $text, $icon, true);
|
45 |
break;
|
46 |
}
|
47 |
+
return $retval.' <span>'.get_option('mr_social_sharing_js_footer').'</span>';
|
48 |
}
|
49 |
}
|
50 |
?>
|
includes/buttons/button.deviantart.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Deviantart extends MR_Social_Sharing_Toolkit_But
|
|
9 |
function follow_deviant($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://'.$id.'.deviantart.com/';
|
11 |
$text = ($text == '') ? __('My deviantArt','mr_social_sharing_toolkit') : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_deviant($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://'.$id.'.deviantart.com/';
|
11 |
$text = ($text == '') ? __('My deviantArt','mr_social_sharing_toolkit') : $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.facebook.php
CHANGED
@@ -68,36 +68,35 @@ class MR_Social_Sharing_Toolkit_Facebook extends MR_Social_Sharing_Toolkit_Butto
|
|
68 |
$retval .= ' data-show-faces="false"></div>';
|
69 |
$lang = __('en_US','mr_social_sharing_toolkit');
|
70 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
71 |
-
$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
|
72 |
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/'.$lang.'/all.js#xfbml=1', $footer);
|
73 |
-
return
|
74 |
}
|
75 |
|
76 |
function fb_share($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
|
77 |
-
$lang = __('en_US','mr_social_sharing_toolkit');
|
78 |
switch ($type) {
|
79 |
case 'vertical':
|
80 |
$retval = '<fb:share-button type="box_count" href="'.$url.'"></fb:share-button>';
|
81 |
//$retval = '<a name="fb_share" type="box_count" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
82 |
-
|
83 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
84 |
-
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/
|
85 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
86 |
break;
|
87 |
case 'horizontal':
|
88 |
$retval = '<fb:share-button type="button_count" href="'.$url.'"></fb:share-button>';
|
89 |
//$retval = '<a name="fb_share" type="button_count" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
90 |
-
|
91 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
92 |
-
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/
|
93 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
94 |
break;
|
95 |
case 'none':
|
96 |
$retval = '<fb:share-button type="button" href="'.$url.'"></fb:share-button>';
|
97 |
//$retval = '<a name="fb_share" type="button" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
98 |
-
|
99 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
100 |
-
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/
|
101 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
102 |
break;
|
103 |
default:
|
@@ -122,7 +121,8 @@ class MR_Social_Sharing_Toolkit_Facebook extends MR_Social_Sharing_Toolkit_Butto
|
|
122 |
function follow_facebook($type, $id, $text = '', $icon = '') {
|
123 |
$url = 'http://www.facebook.com/'.$id;
|
124 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Facebook' : $text;
|
125 |
-
|
|
|
126 |
}
|
127 |
}
|
128 |
?>
|
68 |
$retval .= ' data-show-faces="false"></div>';
|
69 |
$lang = __('en_US','mr_social_sharing_toolkit');
|
70 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
71 |
+
$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__), $footer);
|
72 |
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/'.$lang.'/all.js#xfbml=1', $footer);
|
73 |
+
return '<span style="display: inline-block; width: '.$width.'px; height: '.$height.'px; overflow: hidden;">'.$retval.'</span>';
|
74 |
}
|
75 |
|
76 |
function fb_share($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
|
|
|
77 |
switch ($type) {
|
78 |
case 'vertical':
|
79 |
$retval = '<fb:share-button type="box_count" href="'.$url.'"></fb:share-button>';
|
80 |
//$retval = '<a name="fb_share" type="box_count" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
81 |
+
$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
|
82 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
83 |
+
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
|
84 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
85 |
break;
|
86 |
case 'horizontal':
|
87 |
$retval = '<fb:share-button type="button_count" href="'.$url.'"></fb:share-button>';
|
88 |
//$retval = '<a name="fb_share" type="button_count" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
89 |
+
$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
|
90 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
91 |
+
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
|
92 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
93 |
break;
|
94 |
case 'none':
|
95 |
$retval = '<fb:share-button type="button" href="'.$url.'"></fb:share-button>';
|
96 |
//$retval = '<a name="fb_share" type="button" share_url="'.$url.'" href="http://www.facebook.com/sharer.php">Share</a>';
|
97 |
+
$this->enqueue_script('Social_sharing_facebook_root', plugins_url('/button.facebook.js', __FILE__));
|
98 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
99 |
+
$this->enqueue_script('Social_sharing_facebook_xfbml', 'http://connect.facebook.net/en_US/all.js#xfbml=1', $footer);
|
100 |
//$this->enqueue_script('Social_sharing_facebook_share', 'http://static.ak.fbcdn.net/connect.php/js/FB.Share', $footer);
|
101 |
break;
|
102 |
default:
|
121 |
function follow_facebook($type, $id, $text = '', $icon = '') {
|
122 |
$url = 'http://www.facebook.com/'.$id;
|
123 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Facebook' : $text;
|
124 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
125 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
126 |
}
|
127 |
}
|
128 |
?>
|
includes/buttons/button.flickr.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Flickr extends MR_Social_Sharing_Toolkit_Button
|
|
9 |
function follow_flickr($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.flickr.com/photos/'.$id;
|
11 |
$text = ($text == '') ? __('My photostream on','mr_social_sharing_toolkit').' Flickr' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_flickr($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.flickr.com/photos/'.$id;
|
11 |
$text = ($text == '') ? __('My photostream on','mr_social_sharing_toolkit').' Flickr' : $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.goodreads.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Goodreads extends MR_Social_Sharing_Toolkit_Butt
|
|
9 |
function follow_goodreads($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://goodreads.com/profile/'.$id;
|
11 |
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Goodreads' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_goodreads($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://goodreads.com/profile/'.$id;
|
11 |
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Goodreads' : $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.googleplus.php
CHANGED
@@ -8,7 +8,6 @@ class MR_Social_Sharing_Toolkit_GooglePlus extends MR_Social_Sharing_Toolkit_But
|
|
8 |
}
|
9 |
|
10 |
function gl_plus($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
|
11 |
-
$retval = '<g:plusone';
|
12 |
switch ($type) {
|
13 |
case 'horizontal':
|
14 |
$retval = '<div class="g-plusone" data-size="medium" data-href="'.$url.'"></div>';
|
@@ -37,7 +36,8 @@ class MR_Social_Sharing_Toolkit_GooglePlus extends MR_Social_Sharing_Toolkit_But
|
|
37 |
function follow_plus($type, $id, $text = '', $icon = '') {
|
38 |
$url = 'http://plus.google.com/'.$id;
|
39 |
$text = ($text == '') ? __('Add me to your circles','mr_social_sharing_toolkit') : $text;
|
40 |
-
|
|
|
41 |
}
|
42 |
}
|
43 |
?>
|
8 |
}
|
9 |
|
10 |
function gl_plus($url, $title, $type, $id, $media = '', $description = '', $text = '', $icon = '') {
|
|
|
11 |
switch ($type) {
|
12 |
case 'horizontal':
|
13 |
$retval = '<div class="g-plusone" data-size="medium" data-href="'.$url.'"></div>';
|
36 |
function follow_plus($type, $id, $text = '', $icon = '') {
|
37 |
$url = 'http://plus.google.com/'.$id;
|
38 |
$text = ($text == '') ? __('Add me to your circles','mr_social_sharing_toolkit') : $text;
|
39 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
40 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
41 |
}
|
42 |
}
|
43 |
?>
|
includes/buttons/button.hyves.php
CHANGED
@@ -15,7 +15,8 @@ class MR_Social_Sharing_Toolkit_Hyves extends MR_Social_Sharing_Toolkit_Button {
|
|
15 |
function follow_hyves($type, $id, $text = '', $icon = '') {
|
16 |
$url = 'http://'.$id.'.hyves.nl';
|
17 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Hyves' : $text;
|
18 |
-
|
|
|
19 |
}
|
20 |
}
|
21 |
?>
|
15 |
function follow_hyves($type, $id, $text = '', $icon = '') {
|
16 |
$url = 'http://'.$id.'.hyves.nl';
|
17 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Hyves' : $text;
|
18 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
19 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
20 |
}
|
21 |
}
|
22 |
?>
|
includes/buttons/button.instagram.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class MR_Social_Sharing_Toolkit_instagram extends MR_Social_Sharing_Toolkit_Button {
|
3 |
+
function __construct() {
|
4 |
+
$this->follow_buttons[] = array('name' => 'follow_webstagram', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
5 |
+
$this->title = 'Instagram';
|
6 |
+
$this->icon = 'instagram';
|
7 |
+
}
|
8 |
+
|
9 |
+
function follow_webstagram($type, $id, $text = '', $icon = '') {
|
10 |
+
$url = 'http://web.stagram.com/n/'.$id;
|
11 |
+
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Instagram' : $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.lastfm.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Lastfm extends MR_Social_Sharing_Toolkit_Button
|
|
9 |
function follow_lastfm($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.last.fm/user/'.$id;
|
11 |
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Last.fm' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_lastfm($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.last.fm/user/'.$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.linkedin.php
CHANGED
@@ -38,19 +38,22 @@ class MR_Social_Sharing_Toolkit_Linkedin extends MR_Social_Sharing_Toolkit_Butto
|
|
38 |
function follow_linked($type, $id, $text = '', $icon = '') {
|
39 |
$url = 'http://www.linkedin.com/in/'.$id;
|
40 |
$text = ($text == '') ? __('Join my network on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
41 |
-
|
|
|
42 |
}
|
43 |
|
44 |
function follow_linked_co($type, $id, $text = '', $icon = '') {
|
45 |
$url = 'http://www.linkedin.com/company/'.$id;
|
46 |
$text = ($text == '') ? __('Follow my company on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
47 |
-
|
|
|
48 |
}
|
49 |
|
50 |
function follow_linked_group($type, $id, $text = '', $icon = '') {
|
51 |
$url = 'http://www.linkedin.com/groups?gid='.$id;
|
52 |
$text = ($text == '') ? __('Join my group on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
53 |
-
|
|
|
54 |
}
|
55 |
}
|
56 |
?>
|
38 |
function follow_linked($type, $id, $text = '', $icon = '') {
|
39 |
$url = 'http://www.linkedin.com/in/'.$id;
|
40 |
$text = ($text == '') ? __('Join my network on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
41 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
42 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
43 |
}
|
44 |
|
45 |
function follow_linked_co($type, $id, $text = '', $icon = '') {
|
46 |
$url = 'http://www.linkedin.com/company/'.$id;
|
47 |
$text = ($text == '') ? __('Follow my company on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
48 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
49 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
50 |
}
|
51 |
|
52 |
function follow_linked_group($type, $id, $text = '', $icon = '') {
|
53 |
$url = 'http://www.linkedin.com/groups?gid='.$id;
|
54 |
$text = ($text == '') ? __('Join my group on','mr_social_sharing_toolkit').' LinkedIn' : $text;
|
55 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
56 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
57 |
}
|
58 |
}
|
59 |
?>
|
includes/buttons/button.myspace.php
CHANGED
@@ -16,7 +16,8 @@ class MR_Social_Sharing_Toolkit_Myspace extends MR_Social_Sharing_Toolkit_Button
|
|
16 |
function follow_myspace($type, $id, $text = '', $icon = '') {
|
17 |
$url = 'http://www.myspace.com/'.$id;
|
18 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Myspace' : $text;
|
19 |
-
|
|
|
20 |
}
|
21 |
}
|
22 |
?>
|
16 |
function follow_myspace($type, $id, $text = '', $icon = '') {
|
17 |
$url = 'http://www.myspace.com/'.$id;
|
18 |
$text = ($text == '') ? __('Friend me on','mr_social_sharing_toolkit').' Myspace' : $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.picasa.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Picasa extends MR_Social_Sharing_Toolkit_Button
|
|
9 |
function follow_picasa($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://picasaweb.google.com/'.$id;
|
11 |
$text = ($text == '') ? __('My Picasa Web Albums','mr_social_sharing_toolkit') : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_picasa($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://picasaweb.google.com/'.$id;
|
11 |
$text = ($text == '') ? __('My Picasa Web Albums','mr_social_sharing_toolkit') : $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.pinterest.php
CHANGED
@@ -36,7 +36,8 @@ class MR_Social_Sharing_Toolkit_Pinterest extends MR_Social_Sharing_Toolkit_Butt
|
|
36 |
function follow_pinterest($type, $id, $text = '', $icon = '') {
|
37 |
$url = 'http://pinterest.com/'.$id.'/';
|
38 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Pinterest' : $text;
|
39 |
-
|
|
|
40 |
}
|
41 |
}
|
42 |
?>
|
36 |
function follow_pinterest($type, $id, $text = '', $icon = '') {
|
37 |
$url = 'http://pinterest.com/'.$id.'/';
|
38 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Pinterest' : $text;
|
39 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
40 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
41 |
}
|
42 |
}
|
43 |
?>
|
includes/buttons/button.rss.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Rss extends MR_Social_Sharing_Toolkit_Button {
|
|
9 |
function follow_rss($type, $id, $text = '', $icon = '') {
|
10 |
$url = $id;
|
11 |
$text = ($text == '') ? 'RSS Feed' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_rss($type, $id, $text = '', $icon = '') {
|
10 |
$url = $id;
|
11 |
$text = ($text == '') ? 'RSS Feed' : $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.soundcloud.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Soundcloud extends MR_Social_Sharing_Toolkit_But
|
|
9 |
function follow_soundcloud($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://soundcloud.com/'.$id;
|
11 |
$text = ($text == '') ? __('My sounds on','mr_social_sharing_toolkit').' Soundcloud' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_soundcloud($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://soundcloud.com/'.$id;
|
11 |
$text = ($text == '') ? __('My sounds on','mr_social_sharing_toolkit').' Soundcloud' : $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.spotify.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Spotify extends MR_Social_Sharing_Toolkit_Button
|
|
9 |
function follow_spotify($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://open.spotify.com/user/'.$id;
|
11 |
$text = ($text == '') ? __('My profile on','mr_social_sharing_toolkit').' Spotify' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_spotify($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://open.spotify.com/user/'.$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.tumblr.php
CHANGED
@@ -16,7 +16,8 @@ class MR_Social_Sharing_Toolkit_Tumblr extends MR_Social_Sharing_Toolkit_Button
|
|
16 |
function follow_tumblr($type, $id, $text = '', $icon = '') {
|
17 |
$url = 'http://'.$id.'.tumblr.com';
|
18 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Tumblr' : $text;
|
19 |
-
|
|
|
20 |
}
|
21 |
}
|
22 |
?>
|
16 |
function follow_tumblr($type, $id, $text = '', $icon = '') {
|
17 |
$url = 'http://'.$id.'.tumblr.com';
|
18 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Tumblr' : $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.twitter.php
CHANGED
@@ -52,6 +52,18 @@ class MR_Social_Sharing_Toolkit_Twitter extends MR_Social_Sharing_Toolkit_Button
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
default:
|
56 |
$url = 'https://twitter.com/share?url='.urlencode($url).'&text='.urlencode($title);
|
57 |
if ($id != '') {
|
@@ -82,7 +94,8 @@ class MR_Social_Sharing_Toolkit_Twitter extends MR_Social_Sharing_Toolkit_Button
|
|
82 |
default:
|
83 |
$url = 'https://twitter.com/'.$id;
|
84 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Twitter' : $text;
|
85 |
-
$
|
|
|
86 |
break;
|
87 |
}
|
88 |
return $retval;
|
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;
|
55 |
+
case 'none':
|
56 |
+
$retval = '<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="'.$url.'"';
|
57 |
+
if ($id != '') {
|
58 |
+
$retval .= ' data-via="'.$id.'"';
|
59 |
+
}
|
60 |
+
if ($count_url != '') {
|
61 |
+
$retval .= ' data-counturl="'.$count_url.'"';
|
62 |
+
}
|
63 |
+
$retval .= ' data-text="'.$title.'">Tweet</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;
|
67 |
default:
|
68 |
$url = 'https://twitter.com/share?url='.urlencode($url).'&text='.urlencode($title);
|
69 |
if ($id != '') {
|
94 |
default:
|
95 |
$url = 'https://twitter.com/'.$id;
|
96 |
$text = ($text == '') ? __('Follow me on','mr_social_sharing_toolkit').' Twitter' : $text;
|
97 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
98 |
+
$retval = $this->get_icon($type, $url, $text, $icon, false, $blank);
|
99 |
break;
|
100 |
}
|
101 |
return $retval;
|
includes/buttons/button.xing.php
CHANGED
@@ -12,7 +12,7 @@ class MR_Social_Sharing_Toolkit_Xing extends MR_Social_Sharing_Toolkit_Button {
|
|
12 |
case 'horizontal':
|
13 |
$retval = '<script type="XING/Share" data-counter="right" data-lang="en" data-url="'.$url.'"></script>';
|
14 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
15 |
-
$this->enqueue_script('Social_sharing_xing', 'https://www.xing-share.com/js/external/share.js',
|
16 |
break;
|
17 |
case 'vertical':
|
18 |
$retval = '<script type="XING/Share" data-counter="top" data-lang="en" data-url="'.$url.'"></script>';
|
@@ -36,7 +36,8 @@ class MR_Social_Sharing_Toolkit_Xing extends MR_Social_Sharing_Toolkit_Button {
|
|
36 |
function follow_xing($type, $id, $text = '', $icon = '') {
|
37 |
$url = 'http://www.xing.com/profile/'.$id;
|
38 |
$text = ($text == '') ? __('Join my network on','mr_social_sharing_toolkit').' Xing' : $text;
|
39 |
-
|
|
|
40 |
}
|
41 |
}
|
42 |
?>
|
12 |
case 'horizontal':
|
13 |
$retval = '<script type="XING/Share" data-counter="right" data-lang="en" data-url="'.$url.'"></script>';
|
14 |
$footer = (get_option('mr_social_sharing_js_footer') == 1) ? true : false;
|
15 |
+
$this->enqueue_script('Social_sharing_xing', 'https://www.xing-share.com/js/external/share.js', false);
|
16 |
break;
|
17 |
case 'vertical':
|
18 |
$retval = '<script type="XING/Share" data-counter="top" data-lang="en" data-url="'.$url.'"></script>';
|
36 |
function follow_xing($type, $id, $text = '', $icon = '') {
|
37 |
$url = 'http://www.xing.com/profile/'.$id;
|
38 |
$text = ($text == '') ? __('Join my network on','mr_social_sharing_toolkit').' Xing' : $text;
|
39 |
+
$blank = (get_option('mr_social_sharing_follow_new') == 1) ? true : false;
|
40 |
+
return $this->get_icon($type, $url, $text, $icon, false, $blank);
|
41 |
}
|
42 |
}
|
43 |
?>
|
includes/buttons/button.youtube.php
CHANGED
@@ -9,7 +9,8 @@ class MR_Social_Sharing_Toolkit_Youtube extends MR_Social_Sharing_Toolkit_Button
|
|
9 |
function follow_youtube($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.youtube.com/user/'.$id;
|
11 |
$text = ($text == '') ? __('Watch me on','mr_social_sharing_toolkit').' YouTube' : $text;
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
9 |
function follow_youtube($type, $id, $text = '', $icon = '') {
|
10 |
$url = 'http://www.youtube.com/user/'.$id;
|
11 |
$text = ($text == '') ? __('Watch me 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
@@ -4,12 +4,14 @@ class MR_Social_Sharing_Toolkit_Button {
|
|
4 |
protected $follow_buttons;
|
5 |
protected $title;
|
6 |
protected $icon;
|
|
|
7 |
|
8 |
function MR_Social_Sharing_Toolkit_Button() {
|
9 |
$this->share_buttons = array();
|
10 |
$this->follow_buttons = array();
|
11 |
$this->title = '';
|
12 |
$this->icon = '';
|
|
|
13 |
}
|
14 |
|
15 |
function getTitle() {
|
@@ -80,11 +82,11 @@ class MR_Social_Sharing_Toolkit_Button {
|
|
80 |
}
|
81 |
|
82 |
function enqueue_script($name, $src, $footer = false) {
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
}
|
90 |
?>
|
4 |
protected $follow_buttons;
|
5 |
protected $title;
|
6 |
protected $icon;
|
7 |
+
protected $scripts;
|
8 |
|
9 |
function MR_Social_Sharing_Toolkit_Button() {
|
10 |
$this->share_buttons = array();
|
11 |
$this->follow_buttons = array();
|
12 |
$this->title = '';
|
13 |
$this->icon = '';
|
14 |
+
$this->scripts = array();
|
15 |
}
|
16 |
|
17 |
function getTitle() {
|
82 |
}
|
83 |
|
84 |
function enqueue_script($name, $src, $footer = false) {
|
85 |
+
$this->scripts[] = array('name' => $name, 'src' => $src, 'in_footer' => $footer);
|
86 |
+
}
|
87 |
+
|
88 |
+
function get_enqueued_scripts() {
|
89 |
+
return $this->scripts;
|
90 |
}
|
91 |
}
|
92 |
?>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ 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.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.
|
@@ -80,6 +80,7 @@ The networks currently supported for the Follow Widget are:
|
|
80 |
* Flickr
|
81 |
* 500px
|
82 |
* Picasa
|
|
|
83 |
* DeviantArt
|
84 |
* Last.fm
|
85 |
* Spotify
|
@@ -165,6 +166,10 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
|
|
165 |
|
166 |
== Upgrade Notice ==
|
167 |
|
|
|
|
|
|
|
|
|
168 |
= 2.0.9 =
|
169 |
|
170 |
Please update to version 2.0.9 for several fixes, more features and extra networks.
|
@@ -222,6 +227,15 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
|
|
222 |
|
223 |
== Changelog ==
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
= 2.0.9 =
|
226 |
* Added the possibility to use custom text and images for (most) buttons
|
227 |
* Added possibility to create custom css within the plugin
|
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.4.1
|
7 |
+
Stable tag: 2.1.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.
|
80 |
* Flickr
|
81 |
* 500px
|
82 |
* Picasa
|
83 |
+
* Instagram
|
84 |
* DeviantArt
|
85 |
* Last.fm
|
86 |
* Spotify
|
166 |
|
167 |
== Upgrade Notice ==
|
168 |
|
169 |
+
= 2.1.0 =
|
170 |
+
|
171 |
+
Please update to version 2.1.0 immediately for several crucial fixes.
|
172 |
+
|
173 |
= 2.0.9 =
|
174 |
|
175 |
Please update to version 2.0.9 for several fixes, more features and extra networks.
|
227 |
|
228 |
== Changelog ==
|
229 |
|
230 |
+
= 2.1.0 =
|
231 |
+
* Includes a fix for intrusive p-tag inclusion by some themes (thanks to Pia and Patrick for helping to debug this)
|
232 |
+
* Replaced the Twitter icons
|
233 |
+
* Included link to settings page in Plugins page of WP Admin
|
234 |
+
* Added Instagram buttons (using Webstagram)
|
235 |
+
* Added possibility to force follow links to open in new window / tab
|
236 |
+
* Fixed slight overlap in WP admin when using IE8
|
237 |
+
* Removed some redundant functions
|
238 |
+
|
239 |
= 2.0.9 =
|
240 |
* Added the possibility to use custom text and images for (most) buttons
|
241 |
* Added possibility to create custom css within the plugin
|
script.js → script_2.1.0.js
RENAMED
@@ -9,5 +9,9 @@ jQuery(document).ready(function($) {
|
|
9 |
popup.focus();
|
10 |
}
|
11 |
});
|
12 |
-
});
|
|
|
|
|
|
|
|
|
13 |
});
|
9 |
popup.focus();
|
10 |
}
|
11 |
});
|
12 |
+
});
|
13 |
+
// Remove pesky <p> tags:
|
14 |
+
$(".mr_social_sharing_wrapper p").each(function(){
|
15 |
+
$(this).remove();
|
16 |
+
});
|
17 |
});
|
script_no_follow.js → script_no_follow_2.1.0.js
RENAMED
@@ -10,6 +10,10 @@ jQuery(document).ready(function($) {
|
|
10 |
}
|
11 |
});
|
12 |
});
|
|
|
|
|
|
|
|
|
13 |
// Don't share links
|
14 |
$(".mr_social_sharing_wrapper a").attr("rel", "nofollow");
|
15 |
});
|
10 |
}
|
11 |
});
|
12 |
});
|
13 |
+
// Remove pesky <p> tags:
|
14 |
+
$(".mr_social_sharing_wrapper p").each(function(){
|
15 |
+
$(this).remove();
|
16 |
+
});
|
17 |
// Don't share links
|
18 |
$(".mr_social_sharing_wrapper a").attr("rel", "nofollow");
|
19 |
});
|
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 |
*/
|
@@ -16,10 +16,12 @@ class MR_Social_Sharing_Toolkit {
|
|
16 |
var $share_buttons;
|
17 |
var $follow_buttons;
|
18 |
var $error;
|
|
|
19 |
|
20 |
function MR_Social_Sharing_Toolkit() {
|
21 |
$this->count = 0;
|
22 |
$this->error = '';
|
|
|
23 |
load_plugin_textdomain( 'mr_social_sharing_toolkit', false, dirname(plugin_basename(__FILE__)).'/languages/');
|
24 |
/* Declare button types */
|
25 |
$this->types['none'] = __('Button','mr_social_sharing_toolkit');
|
@@ -88,7 +90,7 @@ class MR_Social_Sharing_Toolkit {
|
|
88 |
$pinterest_options = array('default_image' => '', 'fixed_image' => 0);
|
89 |
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '', 'cache' => array());
|
90 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
91 |
-
$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, 'mr_social_sharing_custom_css' => '');
|
92 |
foreach ($this->options as $key => $val) {
|
93 |
$this->options[$key] = get_option( $key, $val );
|
94 |
}
|
@@ -171,15 +173,16 @@ class MR_Social_Sharing_Toolkit {
|
|
171 |
function plugin_menu() {
|
172 |
add_options_page('Social Sharing', 'Social Sharing Toolkit', 'manage_options', 'mr_social_sharing', array($this, 'plugin_admin_page'));
|
173 |
add_filter('plugin_row_meta', array('MR_Social_Sharing_Toolkit', 'plugin_links'),10,2);
|
174 |
-
wp_enqueue_style('mr_social_sharing-admin', plugins_url('/admin.css', __FILE__));
|
175 |
-
wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin.js', __FILE__));
|
176 |
wp_enqueue_script('jquery-ui-tabs');
|
177 |
wp_enqueue_script('jquery-ui-sortable');
|
|
|
|
|
178 |
}
|
179 |
|
180 |
function plugin_links($links, $file) {
|
181 |
if ($file == plugin_basename(__FILE__)) {
|
182 |
$links[] = '<a target="_blank" href="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">'.__('Donate','mr_social_sharing_toolkit').'</a>';
|
|
|
183 |
}
|
184 |
return $links;
|
185 |
}
|
@@ -255,9 +258,7 @@ class MR_Social_Sharing_Toolkit {
|
|
255 |
}
|
256 |
echo '
|
257 |
<br/>
|
258 |
-
<
|
259 |
-
if ($this->options['mr_social_sharing_enable_shortcode'] == 1) { echo ' checked="checked"';}
|
260 |
-
echo ' value="1" /> '.__('Enable shortcode').'</label><br/>
|
261 |
<p><span class="description"> '.__('Use the shortcode [social_share/] where you want the buttons to appear', 'mr_social_sharing_toolkit').'</span></p>
|
262 |
<label for="mr_social_sharing_include_excerpts" class="check"><input type="checkbox" name="mr_social_sharing_include_excerpts" id="mr_social_sharing_include_excerpts"';
|
263 |
if ($this->options['mr_social_sharing_include_excerpts'] == 1) { echo ' checked="checked"';}
|
@@ -305,9 +306,12 @@ class MR_Social_Sharing_Toolkit {
|
|
305 |
</p>';
|
306 |
$this->showListAdmin($this->follow_buttons, 'follow_');
|
307 |
echo '
|
|
|
|
|
|
|
308 |
</div>
|
309 |
<div id="tab_5" class="mr_social_sharing_networks">
|
310 |
-
<h3>'.__('Advanced settings','mr_social_sharing_toolkit').'</h3>
|
311 |
<h4>'.__('Automatic Twitter links','mr_social_sharing_toolkit').'</h4>
|
312 |
<p>'.__('Select what you want to convert:','mr_social_sharing_toolkit').'</p>
|
313 |
<label for="mr_social_sharing_twitter_handles" class="check"><input type="checkbox" name="mr_social_sharing_twitter_handles" id="mr_social_sharing_twitter_handles"';
|
@@ -471,15 +475,13 @@ class MR_Social_Sharing_Toolkit {
|
|
471 |
function getBanner() {
|
472 |
$banners = array();
|
473 |
// ElegantThemes:
|
474 |
-
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=
|
475 |
-
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=
|
476 |
-
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=
|
477 |
-
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=
|
478 |
// WooThemes:
|
479 |
-
$banners[] = '<a href="http://
|
480 |
-
$banners[] = '<a href="http://
|
481 |
-
$banners[] = '<a href="http://www.woothemes.com/woomember/go?r=188860&i=l44" target="_blank"><img src="http://woothemes.com/ads/468x60c.jpg" /></a>';
|
482 |
-
$banners[] = '<a href="http://www.woothemes.com/woomember/go?r=188860&i=l43" target="_blank"><img src="http://woothemes.com/ads/468x60b.jpg" /></a>';
|
483 |
// Mojo Themes:
|
484 |
$banners[] = '<a href="http://www.mojo-themes.com/categories/wordpress/?r=mrongen" target="_blank"><img src="'.plugins_url('/banners/mojo_1.jpg', __FILE__).'" /></a>';
|
485 |
$banners[] = '<a href="http://www.mojo-themes.com/?r=mrongen" target="_blank"><img src="'.plugins_url('/banners/mojo_1.jpg', __FILE__).'" /></a>';
|
@@ -502,7 +504,7 @@ class MR_Social_Sharing_Toolkit {
|
|
502 |
/* Output functions */
|
503 |
|
504 |
function print_opengraph() {
|
505 |
-
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.0
|
506 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
507 |
if (is_single() || is_page()) {
|
508 |
$excerpt = get_the_excerpt();
|
@@ -530,7 +532,7 @@ class MR_Social_Sharing_Toolkit {
|
|
530 |
if ($this->options['mr_social_sharing_opengraph']['fixed_image']) {
|
531 |
if ($this->options['mr_social_sharing_opengraph']['default_image'] != '') {
|
532 |
echo '
|
533 |
-
|
534 |
}
|
535 |
} else {
|
536 |
$media = '';
|
@@ -552,37 +554,79 @@ class MR_Social_Sharing_Toolkit {
|
|
552 |
}
|
553 |
if ($media != '') {
|
554 |
echo '
|
555 |
-
|
556 |
} elseif ($this->options['mr_social_sharing_opengraph']['default_image'] != '') {
|
557 |
echo '
|
558 |
-
|
559 |
}
|
560 |
}
|
561 |
}
|
562 |
|
563 |
function prepare_styles() {
|
564 |
-
wp_enqueue_style('mr_social_sharing', plugins_url('/
|
565 |
$upload = wp_upload_dir();
|
566 |
if (file_exists($upload['basedir'].'/social_sharing_custom.css') && $this->options['mr_social_sharing_custom_css'] != '') {
|
567 |
wp_enqueue_style('mr_social_sharing_custom', $upload['baseurl'].'/social_sharing_custom.css');
|
568 |
}
|
569 |
}
|
570 |
|
571 |
-
function prepare_scripts() {
|
572 |
if ($this->options['mr_social_sharing_no_follow'] == 1) {
|
573 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
574 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/
|
575 |
} else {
|
576 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/
|
577 |
}
|
578 |
} else {
|
579 |
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
580 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/
|
581 |
} else {
|
582 |
-
wp_enqueue_script('mr_social_sharing', plugins_url('/
|
583 |
}
|
584 |
}
|
585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
|
587 |
function create_bookmarks($url = '', $title = '', $type = '', $media = '', $description = '') {
|
588 |
$url = trim($url);
|
@@ -593,7 +637,7 @@ class MR_Social_Sharing_Toolkit {
|
|
593 |
}
|
594 |
$bookmarks = '
|
595 |
<div class="mr_social_sharing_wrapper">
|
596 |
-
<!-- Social Sharing Toolkit v2.0
|
597 |
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
598 |
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
599 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
@@ -605,13 +649,14 @@ class MR_Social_Sharing_Toolkit {
|
|
605 |
$bookmarks .= '</div>';
|
606 |
$bookmarks = str_replace('<div class="mr_social_sharing_wrapper"></div>', '', $bookmarks);
|
607 |
$this->count++;
|
|
|
608 |
return $bookmarks;
|
609 |
}
|
610 |
|
611 |
function create_followers() {
|
612 |
$followers = '
|
613 |
<div class="mr_social_sharing_wrapper">
|
614 |
-
<!-- Social Sharing Toolkit v2.0
|
615 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
616 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
617 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
@@ -622,6 +667,7 @@ class MR_Social_Sharing_Toolkit {
|
|
622 |
}
|
623 |
$followers .= '</div>';
|
624 |
$followers = str_replace('<div class="mr_social_sharing_wrapper"></div>', '', $followers);
|
|
|
625 |
return $followers;
|
626 |
}
|
627 |
|
@@ -647,7 +693,7 @@ class MR_Social_Sharing_Toolkit {
|
|
647 |
foreach ($this->buttons as $tmp) {
|
648 |
if (method_exists($tmp, $button)) {
|
649 |
$retval = '<'.$display.' class="mr_social_sharing'.$align.'">'.$tmp->$button($type, $id, $text, $icon).'</'.$display.'>';
|
650 |
-
}
|
651 |
}
|
652 |
}
|
653 |
return $retval;
|
@@ -767,13 +813,6 @@ class MR_Social_Sharing_Toolkit {
|
|
767 |
}
|
768 |
}
|
769 |
|
770 |
-
function should_use_shortcode() {
|
771 |
-
if ($this->options['mr_social_sharing_enable_shortcode'] == 1) {
|
772 |
-
return true;
|
773 |
-
}
|
774 |
-
return false;
|
775 |
-
}
|
776 |
-
|
777 |
function share_shortcode() {
|
778 |
if (is_feed()) {
|
779 |
return '';
|
@@ -804,7 +843,7 @@ class MR_Social_Sharing_Toolkit {
|
|
804 |
}
|
805 |
$type = get_post_type();
|
806 |
$bookmarks = '';
|
807 |
-
if (
|
808 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), 'shortcode_', $media, '');
|
809 |
}
|
810 |
return $bookmarks;
|
@@ -856,8 +895,6 @@ unset($buttons);
|
|
856 |
//global $MR_Social_Sharing_Toolkit;
|
857 |
$MR_Social_Sharing_Toolkit = new MR_Social_Sharing_Toolkit();
|
858 |
add_action('admin_menu', array($MR_Social_Sharing_Toolkit, 'plugin_menu'));
|
859 |
-
add_action('wp_print_styles', array($MR_Social_Sharing_Toolkit, 'prepare_styles'));
|
860 |
-
add_action('wp_print_scripts', array($MR_Social_Sharing_Toolkit, 'prepare_scripts'));
|
861 |
if ($MR_Social_Sharing_Toolkit->should_print_opengraph()) {
|
862 |
add_action('wp_head', array($MR_Social_Sharing_Toolkit, 'print_opengraph'), 1);
|
863 |
}
|
@@ -873,9 +910,9 @@ if ($MR_Social_Sharing_Toolkit->should_share_excerpt()) {
|
|
873 |
if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
874 |
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
875 |
}
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
include 'includes/share.widget.php';
|
880 |
include 'includes/follow.widget.php';
|
881 |
?>
|
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.0
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.active-bits.nl
|
9 |
*/
|
16 |
var $share_buttons;
|
17 |
var $follow_buttons;
|
18 |
var $error;
|
19 |
+
var $scripts;
|
20 |
|
21 |
function MR_Social_Sharing_Toolkit() {
|
22 |
$this->count = 0;
|
23 |
$this->error = '';
|
24 |
+
$this->scripts = array();
|
25 |
load_plugin_textdomain( 'mr_social_sharing_toolkit', false, dirname(plugin_basename(__FILE__)).'/languages/');
|
26 |
/* Declare button types */
|
27 |
$this->types['none'] = __('Button','mr_social_sharing_toolkit');
|
90 |
$pinterest_options = array('default_image' => '', 'fixed_image' => 0);
|
91 |
$bitly_options = array('enable' => 0, 'username' => '', 'key' => '', 'cache' => array());
|
92 |
$opengraph_options = array('enable' => 0, 'default_image' => '', 'fixed_image' => 0);
|
93 |
+
$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_follow_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, 'mr_social_sharing_custom_css' => '');
|
94 |
foreach ($this->options as $key => $val) {
|
95 |
$this->options[$key] = get_option( $key, $val );
|
96 |
}
|
173 |
function plugin_menu() {
|
174 |
add_options_page('Social Sharing', 'Social Sharing Toolkit', 'manage_options', 'mr_social_sharing', array($this, 'plugin_admin_page'));
|
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.0.css', __FILE__));
|
179 |
+
wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin_2.1.0.js', __FILE__));
|
180 |
}
|
181 |
|
182 |
function plugin_links($links, $file) {
|
183 |
if ($file == plugin_basename(__FILE__)) {
|
184 |
$links[] = '<a target="_blank" href="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">'.__('Donate','mr_social_sharing_toolkit').'</a>';
|
185 |
+
$links[] = '<a href="/wp-admin/options-general.php?page=mr_social_sharing">'.__('Settings').'</a>';
|
186 |
}
|
187 |
return $links;
|
188 |
}
|
258 |
}
|
259 |
echo '
|
260 |
<br/>
|
261 |
+
<input type="hidden" name="mr_social_sharing_enable_shortcode" value="1" />
|
|
|
|
|
262 |
<p><span class="description"> '.__('Use the shortcode [social_share/] where you want the buttons to appear', 'mr_social_sharing_toolkit').'</span></p>
|
263 |
<label for="mr_social_sharing_include_excerpts" class="check"><input type="checkbox" name="mr_social_sharing_include_excerpts" id="mr_social_sharing_include_excerpts"';
|
264 |
if ($this->options['mr_social_sharing_include_excerpts'] == 1) { echo ' checked="checked"';}
|
306 |
</p>';
|
307 |
$this->showListAdmin($this->follow_buttons, 'follow_');
|
308 |
echo '
|
309 |
+
<label for="mr_social_sharing_follow_new" class="check"><input type="checkbox" name="mr_social_sharing_follow_new" id="mr_social_sharing_follow_new"';
|
310 |
+
if ($this->options['mr_social_sharing_follow_new'] == 1) { echo ' checked="checked"';}
|
311 |
+
echo ' value="1" /> '.__("Open links in new window or tab", 'mr_social_sharing_toolkit').'</label>
|
312 |
</div>
|
313 |
<div id="tab_5" class="mr_social_sharing_networks">
|
314 |
+
<h3>'.__('Advanced settings','mr_social_sharing_toolkit').'</h3>
|
315 |
<h4>'.__('Automatic Twitter links','mr_social_sharing_toolkit').'</h4>
|
316 |
<p>'.__('Select what you want to convert:','mr_social_sharing_toolkit').'</p>
|
317 |
<label for="mr_social_sharing_twitter_handles" class="check"><input type="checkbox" name="mr_social_sharing_twitter_handles" id="mr_social_sharing_twitter_handles"';
|
475 |
function getBanner() {
|
476 |
$banners = array();
|
477 |
// ElegantThemes:
|
478 |
+
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=14757" target="_blank"><img border="0" src="http://www.elegantthemes.com/affiliates/banners/468x60.gif" width="468" height="60"></a>';
|
479 |
+
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=14757" target="_blank"><img border="0" src="http://www.elegantthemes.com/affiliates/banners/468x60.gif" width="468" height="60"></a>';
|
480 |
+
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=14757" target="_blank"><img border="0" src="http://www.elegantthemes.com/affiliates/banners/468x60.gif" width="468" height="60"></a>';
|
481 |
+
$banners[] = '<a href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=14757" target="_blank"><img border="0" src="http://www.elegantthemes.com/affiliates/banners/468x60.gif" width="468" height="60"></a>';
|
482 |
// WooThemes:
|
483 |
+
$banners[] = '<a href="http://woothemes.zferral.com/l/53/33738" title=""><img src="http://woothemes.zferral.com/m/53" alt="" title="" style="border: none" /></a>';
|
484 |
+
$banners[] = '<a href="http://woothemes.zferral.com/l/32/33738" title=""><img src="http://woothemes.zferral.com/m/32" alt="" title="" style="border: none" /></a>';
|
|
|
|
|
485 |
// Mojo Themes:
|
486 |
$banners[] = '<a href="http://www.mojo-themes.com/categories/wordpress/?r=mrongen" target="_blank"><img src="'.plugins_url('/banners/mojo_1.jpg', __FILE__).'" /></a>';
|
487 |
$banners[] = '<a href="http://www.mojo-themes.com/?r=mrongen" target="_blank"><img src="'.plugins_url('/banners/mojo_1.jpg', __FILE__).'" /></a>';
|
504 |
/* Output functions */
|
505 |
|
506 |
function print_opengraph() {
|
507 |
+
echo '<!-- Open Graph tags provided by Social Sharing Toolkit v2.1.0 -->
|
508 |
<meta property="og:locale" content="'.str_replace('-', '_', get_bloginfo('language')).'"/>';
|
509 |
if (is_single() || is_page()) {
|
510 |
$excerpt = get_the_excerpt();
|
532 |
if ($this->options['mr_social_sharing_opengraph']['fixed_image']) {
|
533 |
if ($this->options['mr_social_sharing_opengraph']['default_image'] != '') {
|
534 |
echo '
|
535 |
+
<meta property="og:image" content="'.$this->options['mr_social_sharing_opengraph']['default_image'].'"/>';
|
536 |
}
|
537 |
} else {
|
538 |
$media = '';
|
554 |
}
|
555 |
if ($media != '') {
|
556 |
echo '
|
557 |
+
<meta property="og:image" content="'.$media.'"/>';
|
558 |
} elseif ($this->options['mr_social_sharing_opengraph']['default_image'] != '') {
|
559 |
echo '
|
560 |
+
<meta property="og:image" content="'.$this->options['mr_social_sharing_opengraph']['default_image'].'"/>';
|
561 |
}
|
562 |
}
|
563 |
}
|
564 |
|
565 |
function prepare_styles() {
|
566 |
+
wp_enqueue_style('mr_social_sharing', plugins_url('/style_2.1.0.css', __FILE__));
|
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');
|
570 |
}
|
571 |
}
|
572 |
|
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.0.js', __FILE__), array('jquery'), false, true);
|
577 |
} else {
|
578 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_no_follow_2.1.0.js', __FILE__), array('jquery'));
|
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.0.js', __FILE__), array('jquery'), false, true);
|
583 |
} else {
|
584 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('/script_2.1.0.js', __FILE__), array('jquery'));
|
585 |
}
|
586 |
}
|
587 |
+
$this->load_scripts();
|
588 |
+
if (is_array($this->scripts) && count($this->scripts) > 0) {
|
589 |
+
foreach ($this->scripts as $script) {
|
590 |
+
wp_enqueue_script($script['name'], $script['src'], array(), false, $script['in_footer']);
|
591 |
+
}
|
592 |
+
}
|
593 |
+
}
|
594 |
+
|
595 |
+
function load_scripts() {
|
596 |
+
$types = array('', 'shortcode_', 'widget_');
|
597 |
+
foreach ($types as $type) {
|
598 |
+
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
599 |
+
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
600 |
+
$id = (array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
601 |
+
$text = (array_key_exists('text', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? stripslashes($this->options['mr_social_sharing_'.$type.'buttons'][$button]['text']) : '';
|
602 |
+
$icon = (array_key_exists('icon', $this->options['mr_social_sharing_'.$type.'buttons'][$button])) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['icon'] : '';
|
603 |
+
foreach ($this->buttons as $tmp) {
|
604 |
+
if (method_exists($tmp, $button)) {
|
605 |
+
$tmp->$button('','', $this->options['mr_social_sharing_'.$type.'buttons'][$button]['type'], $id, '', '', $text, $icon);
|
606 |
+
if (is_array($tmp->get_enqueued_scripts())) {
|
607 |
+
$this->scripts = array_merge($this->scripts, $tmp->get_enqueued_scripts());
|
608 |
+
}
|
609 |
+
}
|
610 |
+
}
|
611 |
+
}
|
612 |
+
}
|
613 |
+
}
|
614 |
+
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
615 |
+
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
616 |
+
$id = (array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
617 |
+
$text = (array_key_exists('text', $this->options['mr_social_sharing_follow_buttons'][$button])) ? stripslashes($this->options['mr_social_sharing_follow_buttons'][$button]['text']) : '';
|
618 |
+
$icon = (array_key_exists('icon', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['icon'] : '';
|
619 |
+
foreach ($this->buttons as $tmp) {
|
620 |
+
if (method_exists($tmp, $button)) {
|
621 |
+
$tmp->$button($this->options['mr_social_sharing_follow_buttons'][$button]['type'], $id, $text, $icon);
|
622 |
+
if (is_array($tmp->get_enqueued_scripts())) {
|
623 |
+
$this->scripts = array_merge($this->scripts, $tmp->get_enqueued_scripts());
|
624 |
+
}
|
625 |
+
}
|
626 |
+
}
|
627 |
+
}
|
628 |
+
}
|
629 |
+
}
|
630 |
|
631 |
function create_bookmarks($url = '', $title = '', $type = '', $media = '', $description = '') {
|
632 |
$url = trim($url);
|
637 |
}
|
638 |
$bookmarks = '
|
639 |
<div class="mr_social_sharing_wrapper">
|
640 |
+
<!-- Social Sharing Toolkit v2.1.0 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
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'] : '';
|
649 |
$bookmarks .= '</div>';
|
650 |
$bookmarks = str_replace('<div class="mr_social_sharing_wrapper"></div>', '', $bookmarks);
|
651 |
$this->count++;
|
652 |
+
echo 'bookmarks';
|
653 |
return $bookmarks;
|
654 |
}
|
655 |
|
656 |
function create_followers() {
|
657 |
$followers = '
|
658 |
<div class="mr_social_sharing_wrapper">
|
659 |
+
<!-- Social Sharing Toolkit v2.1.0 | http://www.active-bits.nl/support/social-sharing-toolkit/ -->';
|
660 |
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
661 |
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
662 |
$id = (array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button])) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
667 |
}
|
668 |
$followers .= '</div>';
|
669 |
$followers = str_replace('<div class="mr_social_sharing_wrapper"></div>', '', $followers);
|
670 |
+
echo 'follow';
|
671 |
return $followers;
|
672 |
}
|
673 |
|
693 |
foreach ($this->buttons as $tmp) {
|
694 |
if (method_exists($tmp, $button)) {
|
695 |
$retval = '<'.$display.' class="mr_social_sharing'.$align.'">'.$tmp->$button($type, $id, $text, $icon).'</'.$display.'>';
|
696 |
+
}
|
697 |
}
|
698 |
}
|
699 |
return $retval;
|
813 |
}
|
814 |
}
|
815 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
816 |
function share_shortcode() {
|
817 |
if (is_feed()) {
|
818 |
return '';
|
843 |
}
|
844 |
$type = get_post_type();
|
845 |
$bookmarks = '';
|
846 |
+
if ((is_single() || $type == 'page') || $this->options['mr_social_sharing_include_excerpts'] == 1) {
|
847 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false), 'shortcode_', $media, '');
|
848 |
}
|
849 |
return $bookmarks;
|
895 |
//global $MR_Social_Sharing_Toolkit;
|
896 |
$MR_Social_Sharing_Toolkit = new MR_Social_Sharing_Toolkit();
|
897 |
add_action('admin_menu', array($MR_Social_Sharing_Toolkit, 'plugin_menu'));
|
|
|
|
|
898 |
if ($MR_Social_Sharing_Toolkit->should_print_opengraph()) {
|
899 |
add_action('wp_head', array($MR_Social_Sharing_Toolkit, 'print_opengraph'), 1);
|
900 |
}
|
910 |
if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
911 |
add_filter('the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
912 |
}
|
913 |
+
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'), 15);
|
914 |
+
add_action('wp_print_styles', array($MR_Social_Sharing_Toolkit, 'prepare_styles'), 50);
|
915 |
+
add_action('wp_print_scripts', array($MR_Social_Sharing_Toolkit, 'prepare_scripts'), 50);
|
916 |
include 'includes/share.widget.php';
|
917 |
include 'includes/follow.widget.php';
|
918 |
?>
|
style.css → style_2.1.0.css
RENAMED
@@ -2,6 +2,8 @@ div.mr_social_sharing_wrapper {height: auto; width: 100%; margin: 4px 0; padding
|
|
2 |
div.mr_social_sharing, span.mr_social_sharing, div.mr_social_sharing_top, span.mr_social_sharing_top {display: block; width: auto; height: auto; margin: 2px; padding: 0; vertical-align: bottom;}
|
3 |
span.mr_social_sharing, span.mr_social_sharing_top {display: inline-block;}
|
4 |
div.mr_social_sharing_top, span.mr_social_sharing_top {vertical-align: top;}
|
|
|
|
|
5 |
a.mr_social_sharing_popup_link, a.mr_social_sharing_popup_link:HOVER {display: inline-block; margin: 0; padding: 0; border: 0; vertical-align: bottom;}
|
6 |
.mr_social_sharing img, .mr_social_sharing_top img {display: inline-block; margin: 0 !important; padding: 0 !important; border: 0 !important; vertical-align: bottom; max-width: 100%;}
|
7 |
.mr_social_sharing a.mr_social_sharing_popup_link, .mr_social_sharing div, .mr_social_sharing span, .mr_social_sharing iframe, .mr_social_sharing img {line-height: 0; vertical-align: bottom;}
|
2 |
div.mr_social_sharing, span.mr_social_sharing, div.mr_social_sharing_top, span.mr_social_sharing_top {display: block; width: auto; height: auto; margin: 2px; padding: 0; vertical-align: bottom;}
|
3 |
span.mr_social_sharing, span.mr_social_sharing_top {display: inline-block;}
|
4 |
div.mr_social_sharing_top, span.mr_social_sharing_top {vertical-align: top;}
|
5 |
+
div.mr_social_sharing div, span.mr_social_sharing div {vertical-align: bottom !important;}
|
6 |
+
div.mr_social_sharing_top div, span.mr_social_sharing_top div {vertical-align: top !important;}
|
7 |
a.mr_social_sharing_popup_link, a.mr_social_sharing_popup_link:HOVER {display: inline-block; margin: 0; padding: 0; border: 0; vertical-align: bottom;}
|
8 |
.mr_social_sharing img, .mr_social_sharing_top img {display: inline-block; margin: 0 !important; padding: 0 !important; border: 0 !important; vertical-align: bottom; max-width: 100%;}
|
9 |
.mr_social_sharing a.mr_social_sharing_popup_link, .mr_social_sharing div, .mr_social_sharing span, .mr_social_sharing iframe, .mr_social_sharing img {line-height: 0; vertical-align: bottom;}
|