Version Description
Version 2.0.1 is a major update with more possibilities. You will have to reconfigure the plugin because of this (it's gotten much better, I promise).
Download this release
Release Info
Developer | MarijnRongen |
Plugin | Social Sharing Toolkit |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 2.0.1
- admin.css +115 -0
- admin.js +5 -0
- images/buttons/delicious.png +0 -0
- images/buttons/digg.png +0 -0
- images/buttons/email.png +0 -0
- images/buttons/myspace.png +0 -0
- images/buttons/reddit.png +0 -0
- images/buttons/stumbleupon.png +0 -0
- images/buttons/tumblr.png +0 -0
- images/buttons/twitter.png +0 -0
- images/delicious_counters.png +0 -0
- images/icons_large/delicious.png +0 -0
- images/icons_large/deviantart.png +0 -0
- images/icons_large/digg.png +0 -0
- images/icons_large/email.png +0 -0
- images/icons_large/facebook.png +0 -0
- images/icons_large/flickr.png +0 -0
- images/icons_large/googleplus.png +0 -0
- images/icons_large/hyves.png +0 -0
- images/icons_large/linkedin.png +0 -0
- images/icons_large/myspace.png +0 -0
- images/icons_large/picasa.png +0 -0
- images/icons_large/reddit.png +0 -0
- images/icons_large/rss.png +0 -0
- images/icons_large/stumbleupon.png +0 -0
- images/icons_large/tumblr.png +0 -0
- images/icons_large/twitter.png +0 -0
- images/icons_large/youtube.png +0 -0
- images/icons_medium/delicious.png +0 -0
- images/icons_medium/deviantart.png +0 -0
- images/icons_medium/digg.png +0 -0
- images/icons_medium/email.png +0 -0
- images/icons_medium/facebook.png +0 -0
- images/icons_medium/flickr.png +0 -0
- images/icons_medium/googleplus.png +0 -0
- images/icons_medium/hyves.png +0 -0
- images/icons_medium/linkedin.png +0 -0
- images/icons_medium/myspace.png +0 -0
- images/icons_medium/picasa.png +0 -0
- images/icons_medium/reddit.png +0 -0
- images/icons_medium/rss.png +0 -0
- images/icons_medium/stumbleupon.png +0 -0
- images/icons_medium/tumblr.png +0 -0
- images/icons_medium/twitter.png +0 -0
- images/icons_medium/youtube.png +0 -0
- images/icons_small/delicious.png +0 -0
- images/icons_small/deviantart.png +0 -0
- images/icons_small/digg.png +0 -0
- images/icons_small/email.png +0 -0
- images/icons_small/facebook.png +0 -0
- images/icons_small/flickr.png +0 -0
- images/icons_small/googleplus.png +0 -0
- images/icons_small/hyves.png +0 -0
- images/icons_small/linkedin.png +0 -0
- images/icons_small/myspace.png +0 -0
- images/icons_small/picasa.png +0 -0
- images/icons_small/reddit.png +0 -0
- images/icons_small/rss.png +0 -0
- images/icons_small/stumbleupon.png +0 -0
- images/icons_small/tumblr.png +0 -0
- images/icons_small/twitter.png +0 -0
- images/icons_small/youtube.png +0 -0
- images/move.png +0 -0
- readme.txt +81 -23
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- script.js +37 -0
- social_sharing_toolkit.php +810 -354
- style.css +93 -38
admin.css
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div.mr_social_sharing_networks {
|
2 |
+
-webkit-box-shadow: white 0px 1px 0px 0px inset;
|
3 |
+
-webkit-user-select: none;
|
4 |
+
background-attachment: scroll;
|
5 |
+
background-clip: border-box;
|
6 |
+
background-color: #FEFEFE;
|
7 |
+
background-image: -webkit-linear-gradient(top, #F9F9F9, #FEFEFE);
|
8 |
+
background-origin: padding-box;
|
9 |
+
border-color: #DFDFDF;
|
10 |
+
border-radius: 3px;
|
11 |
+
border-style: solid;
|
12 |
+
border-width: 1px;
|
13 |
+
box-shadow: white 0px 1px 0px 0px inset;
|
14 |
+
display: block;
|
15 |
+
margin: 1px 0 8px 0;
|
16 |
+
outline-color: #222;
|
17 |
+
outline-style: none;
|
18 |
+
outline-width: 0px;
|
19 |
+
width: 540px;
|
20 |
+
padding: 0 0 10px 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
.mr_social_sharing_networks h3, .mr_social_sharing_networks p {
|
24 |
+
padding: 0 0 0 10px;
|
25 |
+
}
|
26 |
+
|
27 |
+
.mr_social_sharing_networks label {
|
28 |
+
display: inline-block;
|
29 |
+
width: 130px;
|
30 |
+
padding: 0 0 0 10px;
|
31 |
+
}
|
32 |
+
|
33 |
+
ul#mr_social_sharing_networks, ul#mr_social_sharing_widget_networks, ul#mr_social_sharing_follow_networks {
|
34 |
+
width: 520px;
|
35 |
+
padding: 10px;
|
36 |
+
}
|
37 |
+
|
38 |
+
ul#mr_social_sharing_networks li, ul#mr_social_sharing_widget_networks li, ul#mr_social_sharing_follow_networks li {
|
39 |
+
-webkit-box-shadow: white 0px 1px 0px 0px inset;
|
40 |
+
-webkit-user-select: none;
|
41 |
+
background-attachment: scroll;
|
42 |
+
background-clip: border-box;
|
43 |
+
background-color: whiteSmoke;
|
44 |
+
background-image: -webkit-linear-gradient(top, #F9F9F9, whiteSmoke);
|
45 |
+
background-origin: padding-box;
|
46 |
+
border-color: #DFDFDF;
|
47 |
+
border-radius: 3px;
|
48 |
+
border-style: solid;
|
49 |
+
border-width: 1px;
|
50 |
+
box-shadow: white 0px 1px 0px 0px inset;
|
51 |
+
cursor: move;
|
52 |
+
display: block;
|
53 |
+
margin: 1px 0 0 0;
|
54 |
+
outline-color: #222;
|
55 |
+
outline-style: none;
|
56 |
+
outline-width: 0px;
|
57 |
+
padding: 3px 10px 0 10px;
|
58 |
+
text-shadow: white 0px 1px 0px;
|
59 |
+
width: 500px;
|
60 |
+
height: 24px;
|
61 |
+
}
|
62 |
+
|
63 |
+
ul#mr_social_sharing_networks li img, ul#mr_social_sharing_widget_networks li img, ul#mr_social_sharing_follow_networks li img {
|
64 |
+
width: 16px;
|
65 |
+
height: 16px;
|
66 |
+
margin: 2px 10px 2px 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
ul#mr_social_sharing_networks li img.right, ul#mr_social_sharing_widget_networks li img.right, ul#mr_social_sharing_follow_networks li img.right {
|
70 |
+
float: right;
|
71 |
+
margin: 2px -4px 2px 5px;
|
72 |
+
}
|
73 |
+
|
74 |
+
ul#mr_social_sharing_networks li label, ul#mr_social_sharing_widget_networks li label, ul#mr_social_sharing_follow_networks li label {
|
75 |
+
display: inline-block;
|
76 |
+
margin: -10px 10px 0 0;
|
77 |
+
width: auto;
|
78 |
+
height: 20px;
|
79 |
+
padding: 0;
|
80 |
+
}
|
81 |
+
|
82 |
+
ul#mr_social_sharing_networks li input, ul#mr_social_sharing_widget_networks li input, ul#mr_social_sharing_follow_networks li input {
|
83 |
+
margin: 0 10px 0 0;
|
84 |
+
padding: 0;
|
85 |
+
}
|
86 |
+
|
87 |
+
ul#mr_social_sharing_networks li input.text, ul#mr_social_sharing_widget_networks li input.text, ul#mr_social_sharing_follow_networks li input.text {
|
88 |
+
display: inline-block;
|
89 |
+
float: right;
|
90 |
+
width: 140px;
|
91 |
+
height: 20px;
|
92 |
+
margin: 0 10px 0 0;
|
93 |
+
padding: 0;
|
94 |
+
}
|
95 |
+
|
96 |
+
ul#mr_social_sharing_networks li label.text, ul#mr_social_sharing_widget_networks li label.text, ul#mr_social_sharing_follow_networks li label.text {
|
97 |
+
display: inline-block;
|
98 |
+
float: right;
|
99 |
+
width: auto;
|
100 |
+
height: 20px;
|
101 |
+
margin: 0 6px 0 0;
|
102 |
+
padding: 0;
|
103 |
+
}
|
104 |
+
|
105 |
+
ul#mr_social_sharing_networks li select, ul#mr_social_sharing_widget_networks li select, ul#mr_social_sharing_follow_networks li select {
|
106 |
+
display: inline-block;
|
107 |
+
float: right;
|
108 |
+
width: 160px;
|
109 |
+
height: 20px;
|
110 |
+
padding: 0;
|
111 |
+
}
|
112 |
+
|
113 |
+
label.check {
|
114 |
+
width: 400px;
|
115 |
+
}
|
admin.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready( function($) {
|
2 |
+
$( "#mr_social_sharing_networks" ).sortable();
|
3 |
+
$( "#mr_social_sharing_widget_networks" ).sortable();
|
4 |
+
$( "#mr_social_sharing_follow_networks" ).sortable();
|
5 |
+
});
|
images/buttons/delicious.png
ADDED
Binary file
|
images/buttons/digg.png
ADDED
Binary file
|
images/buttons/email.png
ADDED
Binary file
|
images/buttons/myspace.png
ADDED
Binary file
|
images/buttons/reddit.png
ADDED
Binary file
|
images/buttons/stumbleupon.png
ADDED
Binary file
|
images/buttons/tumblr.png
ADDED
Binary file
|
images/buttons/twitter.png
ADDED
Binary file
|
images/delicious_counters.png
ADDED
Binary file
|
images/icons_large/delicious.png
ADDED
Binary file
|
images/icons_large/deviantart.png
ADDED
Binary file
|
images/icons_large/digg.png
ADDED
Binary file
|
images/icons_large/email.png
ADDED
Binary file
|
images/icons_large/facebook.png
ADDED
Binary file
|
images/icons_large/flickr.png
ADDED
Binary file
|
images/icons_large/googleplus.png
ADDED
Binary file
|
images/icons_large/hyves.png
ADDED
Binary file
|
images/icons_large/linkedin.png
ADDED
Binary file
|
images/icons_large/myspace.png
ADDED
Binary file
|
images/icons_large/picasa.png
ADDED
Binary file
|
images/icons_large/reddit.png
ADDED
Binary file
|
images/icons_large/rss.png
ADDED
Binary file
|
images/icons_large/stumbleupon.png
ADDED
Binary file
|
images/icons_large/tumblr.png
ADDED
Binary file
|
images/icons_large/twitter.png
ADDED
Binary file
|
images/icons_large/youtube.png
ADDED
Binary file
|
images/icons_medium/delicious.png
ADDED
Binary file
|
images/icons_medium/deviantart.png
ADDED
Binary file
|
images/icons_medium/digg.png
ADDED
Binary file
|
images/icons_medium/email.png
ADDED
Binary file
|
images/icons_medium/facebook.png
ADDED
Binary file
|
images/icons_medium/flickr.png
ADDED
Binary file
|
images/icons_medium/googleplus.png
ADDED
Binary file
|
images/icons_medium/hyves.png
ADDED
Binary file
|
images/icons_medium/linkedin.png
ADDED
Binary file
|
images/icons_medium/myspace.png
ADDED
Binary file
|
images/icons_medium/picasa.png
ADDED
Binary file
|
images/icons_medium/reddit.png
ADDED
Binary file
|
images/icons_medium/rss.png
ADDED
Binary file
|
images/icons_medium/stumbleupon.png
ADDED
Binary file
|
images/icons_medium/tumblr.png
ADDED
Binary file
|
images/icons_medium/twitter.png
ADDED
Binary file
|
images/icons_medium/youtube.png
ADDED
Binary file
|
images/icons_small/delicious.png
ADDED
Binary file
|
images/icons_small/deviantart.png
ADDED
Binary file
|
images/icons_small/digg.png
ADDED
Binary file
|
images/icons_small/email.png
ADDED
Binary file
|
images/icons_small/facebook.png
ADDED
Binary file
|
images/icons_small/flickr.png
ADDED
Binary file
|
images/icons_small/googleplus.png
ADDED
Binary file
|
images/icons_small/hyves.png
ADDED
Binary file
|
images/icons_small/linkedin.png
ADDED
Binary file
|
images/icons_small/myspace.png
ADDED
Binary file
|
images/icons_small/picasa.png
ADDED
Binary file
|
images/icons_small/reddit.png
ADDED
Binary file
|
images/icons_small/rss.png
ADDED
Binary file
|
images/icons_small/stumbleupon.png
ADDED
Binary file
|
images/icons_small/tumblr.png
ADDED
Binary file
|
images/icons_small/twitter.png
ADDED
Binary file
|
images/icons_small/youtube.png
ADDED
Binary file
|
images/move.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -1,32 +1,51 @@
|
|
1 |
=== Social Sharing Toolkit ===
|
2 |
Contributors: MarijnRongen
|
3 |
-
Donate link:
|
4 |
-
Tags: Facebook, Like, LinkedIn, Share, Google, Plus, +1, Twitter, Tweet, StumbleUpon, Stumble, Tumblr, Digg, Reddit,
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.2.1
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
|
|
|
|
17 |
* Twitter
|
18 |
* Google +1
|
19 |
* LinkedIn
|
20 |
* Tumblr
|
21 |
* StumbleUpon
|
|
|
22 |
* Digg
|
23 |
* Reddit
|
24 |
-
*
|
25 |
-
* Hyves
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
= Shortcode =
|
32 |
|
@@ -34,20 +53,35 @@ It is also possible to only let the buttons appear where you want by using short
|
|
34 |
|
35 |
= Widget =
|
36 |
|
37 |
-
|
38 |
-
You can however choose a different button layout for the widget. For example you can have wide buttons below your posts and high buttons in your sidebar.
|
39 |
|
40 |
-
=
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
45 |
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
= Automatic Twitter links =
|
53 |
|
@@ -56,7 +90,7 @@ Twitter names will link to their Twitter profile and hashtags will link to the T
|
|
56 |
|
57 |
== Frequently Asked Questions ==
|
58 |
|
59 |
-
= My excerpts aren't displaying the buttons but some text is displayed =
|
60 |
|
61 |
You must disable the option "Include buttons in excerpts", it is enabled by default but some themes use custom excerpts which do not correctly parse the buttons.
|
62 |
|
@@ -72,6 +106,15 @@ If you want to display the buttons somewhere else on your site you can use the f
|
|
72 |
echo $social_sharing_toolkit->create_bookmarks();
|
73 |
?>`
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
== Installation ==
|
77 |
|
@@ -79,13 +122,19 @@ Upload the Social Sharing Toolkit plugin to the `/wp-content/plugins/` folder on
|
|
79 |
|
80 |
== Screenshots ==
|
81 |
|
82 |
-
1. Plugin configuration
|
83 |
-
2.
|
84 |
-
3.
|
85 |
-
4.
|
|
|
|
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
|
|
|
|
|
|
|
|
89 |
= 1.3.1 =
|
90 |
|
91 |
Version 1.3.1 includes an option to display buttons in excerpts.
|
@@ -107,6 +156,15 @@ Please update to version 1.0.1 to prevent an unexpected printing of the page tit
|
|
107 |
|
108 |
== Changelog ==
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
= 1.3.2 =
|
111 |
* Added FAQ to readme
|
112 |
* Enabled "Include buttons in excerpts" option by default
|
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, Google+, Twitter, Tweet, Follow, StumbleUpon, Stumble, Tumblr, Delicious, Digg, Reddit, Myspace, Hyves, YouTube, Flickr, Picasa, deaviantART, mail, RSS, feed, connect, recommend, social, sharing, widget, shortcode, page, post, button, counter, icon
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.2.1
|
7 |
+
Stable tag: 2.0.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.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
= Sharing posts & pages =
|
15 |
|
16 |
+
The plugin currently supports the following networks for sharing:
|
17 |
+
|
18 |
+
* Facebook (like and send buttons)
|
19 |
* Twitter
|
20 |
* Google +1
|
21 |
* LinkedIn
|
22 |
* Tumblr
|
23 |
* StumbleUpon
|
24 |
+
* Delicious
|
25 |
* Digg
|
26 |
* Reddit
|
27 |
+
* Myspace
|
28 |
+
* Hyves
|
29 |
+
|
30 |
+
On Tweet 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.
|
31 |
+
|
32 |
+
You can decide which networks to support on your blog, where the buttons will appear (either above or below the content). Through drag and drop you can easily change the order in which the buttons appear.
|
33 |
+
|
34 |
+
For each button you can choose a different type (not all types are available for each button):
|
35 |
|
36 |
+
* button
|
37 |
+
* button with counter on the side
|
38 |
+
* button with counter on top
|
39 |
+
* small icon
|
40 |
+
* small icon with text
|
41 |
+
* medium icon
|
42 |
+
* medium icon with text
|
43 |
+
* large icon
|
44 |
|
45 |
+
You can also choose the orientation of the buttons:
|
46 |
+
|
47 |
+
* horizontal (buttons are placed side by side)
|
48 |
+
* vertical (buttons are placed below each other)
|
49 |
|
50 |
= Shortcode =
|
51 |
|
53 |
|
54 |
= Widget =
|
55 |
|
56 |
+
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.
|
|
|
57 |
|
58 |
+
= Follow Widget =
|
59 |
|
60 |
+
Since version 2.0.0 an extra widget is added with the possibility to provide easy links to your profiles on other social networks.
|
61 |
|
62 |
+
The networks currently supported for the Follow Widget are:
|
63 |
|
64 |
+
* Facebook
|
65 |
+
* Twitter
|
66 |
+
* Google+
|
67 |
+
* LinkedIn
|
68 |
+
* Tumblr
|
69 |
+
* Myspace
|
70 |
+
* Hyves
|
71 |
+
* YouTube
|
72 |
+
* Flickr
|
73 |
+
* Picasa
|
74 |
+
* DeviantArt
|
75 |
|
76 |
+
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:
|
77 |
|
78 |
+
* small icon
|
79 |
+
* small icon with text
|
80 |
+
* medium icon
|
81 |
+
* medium icon with text
|
82 |
+
* large icon
|
83 |
+
|
84 |
+
To use a button you must enter your user id or username for the network. To use the RSS feed button you must enter the full url.
|
85 |
|
86 |
= Automatic Twitter links =
|
87 |
|
90 |
|
91 |
== Frequently Asked Questions ==
|
92 |
|
93 |
+
= My excerpts aren't displaying the buttons but some strange text is displayed =
|
94 |
|
95 |
You must disable the option "Include buttons in excerpts", it is enabled by default but some themes use custom excerpts which do not correctly parse the buttons.
|
96 |
|
106 |
echo $social_sharing_toolkit->create_bookmarks();
|
107 |
?>`
|
108 |
|
109 |
+
You can also supply an url and title to use on the buttons:
|
110 |
+
` echo $social_sharing_toolkit->create_bookmarks('{YOUR URL}', '{YOUR TITLE}');`
|
111 |
+
|
112 |
+
To display the follow buttons somewhere else you can use the following code:
|
113 |
+
`<?php
|
114 |
+
$social_sharing_toolkit = new MR_Social_Sharing_Toolkit();
|
115 |
+
echo $social_sharing_toolkit->create_followers();
|
116 |
+
?>`
|
117 |
+
|
118 |
|
119 |
== Installation ==
|
120 |
|
122 |
|
123 |
== Screenshots ==
|
124 |
|
125 |
+
1. Plugin configuration for posts and pages
|
126 |
+
2. Plugin configuration for Share Widget
|
127 |
+
3. Plugin configuration for Follow Widget
|
128 |
+
4. Automatic Twitter links configuration
|
129 |
+
5. Some buttons
|
130 |
+
6. Some other buttons
|
131 |
|
132 |
== Upgrade Notice ==
|
133 |
|
134 |
+
= 2.0.1 =
|
135 |
+
|
136 |
+
Version 2.0.1 is a major update with more possibilities. You will have to reconfigure the plugin because of this (it's gotten much better, I promise).
|
137 |
+
|
138 |
= 1.3.1 =
|
139 |
|
140 |
Version 1.3.1 includes an option to display buttons in excerpts.
|
156 |
|
157 |
== Changelog ==
|
158 |
|
159 |
+
= 2.0.0 =
|
160 |
+
* Added Follow Widget
|
161 |
+
* Added icon buttons
|
162 |
+
* Added possibility to control order of buttons
|
163 |
+
* Added choice between horizontal and vertical button orientation
|
164 |
+
* Share Widget now has it's own list of buttons
|
165 |
+
* Added support for Delicious and sending though email
|
166 |
+
* Several minor fixes
|
167 |
+
|
168 |
= 1.3.2 =
|
169 |
* Added FAQ to readme
|
170 |
* Enabled "Include buttons in excerpts" option by default
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
ADDED
Binary file
|
screenshot-6.png
ADDED
Binary file
|
script.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
// Delicious:
|
3 |
+
$.each($("span.delicious_hash"), function () {
|
4 |
+
var elem = $(this);
|
5 |
+
$.ajax({ type: "GET",
|
6 |
+
dataType: "jsonp",
|
7 |
+
url: "http://feeds.delicious.com/v2/json/urlinfo/"+$(this).html(),
|
8 |
+
success: function(data){
|
9 |
+
if (data.length > 0) {
|
10 |
+
var posts = parseInt(data[0].total_posts);
|
11 |
+
if (posts > 1000000) {
|
12 |
+
var txt = parseInt(posts/1000000);
|
13 |
+
elem.next().prepend(txt + 'M');
|
14 |
+
} else if (posts > 1000) {
|
15 |
+
var txt = parseInt(posts/1000);
|
16 |
+
elem.next().prepend(txt + 'K');
|
17 |
+
} else {
|
18 |
+
elem.next().prepend(posts);
|
19 |
+
}
|
20 |
+
} else {
|
21 |
+
elem.next().prepend('0');
|
22 |
+
}
|
23 |
+
}
|
24 |
+
});
|
25 |
+
});
|
26 |
+
// Link popup handler:
|
27 |
+
$.each($("a.mr_social_sharing_popup_link"), function() {
|
28 |
+
var elem = $(this);
|
29 |
+
elem.click( function (event) {
|
30 |
+
event.preventDefault();
|
31 |
+
var popup = window.open(elem.attr('href'),'mr_social_sharing','height=400,width=650');
|
32 |
+
if (popup) {
|
33 |
+
popup.focus();
|
34 |
+
}
|
35 |
+
});
|
36 |
+
});
|
37 |
+
});
|
social_sharing_toolkit.php
CHANGED
@@ -3,23 +3,95 @@
|
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.marijnrongen.com/wordpress-plugins/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:
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.marijnrongen.com
|
9 |
*/
|
10 |
|
11 |
class MR_Social_Sharing_Toolkit {
|
12 |
var $options;
|
|
|
|
|
|
|
13 |
|
14 |
function MR_Social_Sharing_Toolkit() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
$this->get_options();
|
16 |
}
|
17 |
|
18 |
function get_options() {
|
19 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
foreach ($this->options as $key => $val) {
|
21 |
$this->options[$key] = get_option( $key, $val );
|
22 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
return $this->options;
|
24 |
}
|
25 |
|
@@ -39,13 +111,24 @@ class MR_Social_Sharing_Toolkit {
|
|
39 |
|
40 |
function plugin_menu() {
|
41 |
add_options_page('Social Sharing', 'Social Sharing Toolkit', 'manage_options', 'mr_social_sharing', array($this, 'plugin_admin_page'));
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
function plugin_admin_page() {
|
45 |
if (!current_user_can('manage_options')) {
|
46 |
wp_die( __('You do not have sufficient permissions to access this page.') );
|
47 |
}
|
48 |
-
if( isset($_POST['
|
49 |
$this->save_options($_POST);
|
50 |
echo '
|
51 |
<div class="updated"><p><strong>'.__('settings saved.', 'mr_social_sharing' ).'</strong></p></div>';
|
@@ -53,170 +136,257 @@ class MR_Social_Sharing_Toolkit {
|
|
53 |
echo '
|
54 |
<div class="wrap">
|
55 |
<form method="post" action="">
|
56 |
-
<input type="hidden" name="
|
57 |
<h2>Social Sharing Toolkit</h2>
|
58 |
-
<
|
59 |
-
|
60 |
-
<
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
echo '>Do not display social bookmarks</option>
|
70 |
<option value="top"';
|
71 |
-
if ($this->options['
|
72 |
echo '>Display above content</option>
|
73 |
<option value="bottom"';
|
74 |
-
if ($this->options['
|
75 |
echo '>Display below content</option>
|
76 |
<option value="shortcode"';
|
77 |
-
if ($this->options['
|
78 |
echo '>Let me decide by using shortcode</option>
|
79 |
-
</select
|
80 |
-
if ($this->options['
|
81 |
-
echo '<span class="description"> '.__("Use the shortcode [social_share/] where you want the buttons to appear", 'mr_social_sharing').'</span
|
82 |
}
|
83 |
echo '
|
84 |
-
|
85 |
-
|
86 |
-
<
|
87 |
-
|
88 |
-
<label for="types">Place buttons on</label>
|
89 |
-
</th>
|
90 |
-
<td>
|
91 |
-
<select name="types" id="types">
|
92 |
-
<option value="both"';
|
93 |
-
if ($this->options['types'] == 'both') { echo ' selected="selected"';}
|
94 |
echo '>On posts and pages</option>
|
95 |
-
|
96 |
-
if ($this->options['
|
97 |
echo '>Only on posts</option>
|
98 |
-
|
99 |
-
if ($this->options['
|
100 |
echo '>Only on pages</option>
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
echo '
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
if ($this->options['
|
114 |
-
echo '
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
echo '
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
echo '
|
168 |
-
<label for="myspace"><input type="checkbox" name="myspace" id="myspace"';
|
169 |
-
if ($this->options['myspace'] == 1) { echo ' checked="checked"';}
|
170 |
-
echo ' value="1" /> MySpace</label><span class="description"> '.__("Only available without counters", 'mr_social_sharing').'</span><br/>
|
171 |
-
<label for="hyves"><input type="checkbox" name="hyves" id="hyves"';
|
172 |
-
if ($this->options['hyves'] == 1) { echo ' checked="checked"';}
|
173 |
-
echo ' value="1" /> Hyves</label><span class="description"> '.__("Only available with horizontal counters", 'mr_social_sharing').'</span>
|
174 |
-
</td>
|
175 |
-
</tr>
|
176 |
-
<tr valign="top">
|
177 |
-
<th scope="row">
|
178 |
-
<label for="twitter_handle">Attribute tweets to:</label>
|
179 |
-
</th>
|
180 |
-
<td>
|
181 |
-
@<input type="text" name="twitter_handle" id="twitter_handle" value="'.$this->options['twitter_handle'].'"/>
|
182 |
-
</td>
|
183 |
-
</tr>
|
184 |
-
</tbody>
|
185 |
-
</table>
|
186 |
-
<h3>Automatic Twitter links</h3>
|
187 |
-
<table class="form-table">
|
188 |
-
<tbody>
|
189 |
-
<tr valign="top">
|
190 |
-
<th scope="row">
|
191 |
-
<label>Select what you want to convert...</label>
|
192 |
-
</th>
|
193 |
-
<td>
|
194 |
-
<label><input type="checkbox" name="twitter_handles" id="twitter_handles"';
|
195 |
-
if ($this->options['twitter_handles'] == 1) { echo ' checked="checked"';}
|
196 |
echo ' value="1" /> '.__("Convert Twitter usernames", 'mr_social_sharing').'</label><br/>
|
197 |
-
|
198 |
-
if ($this->options['
|
199 |
echo ' value="1" /> '.__("Convert hashtags", 'mr_social_sharing').'</label>
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
<th scope="row">
|
204 |
-
<label>... and where it should be converted</label>
|
205 |
-
</th>
|
206 |
-
<td>
|
207 |
-
<label><input type="checkbox" name="linkify_content" id="linkify_content"';
|
208 |
-
if ($this->options['linkify_content'] == 1) { echo ' checked="checked"';}
|
209 |
echo ' value="1" /> '.__("Convert in posts and pages", 'mr_social_sharing').'</label><br/>
|
210 |
-
|
211 |
-
if ($this->options['
|
212 |
echo ' value="1" /> '.__("Convert in comments", 'mr_social_sharing').'</label>
|
213 |
-
|
214 |
-
</tr>
|
215 |
-
</tbody>
|
216 |
-
</table>
|
217 |
<p class="submit">
|
218 |
<input type="submit" name="Submit" class="button-primary" value="'.esc_attr__('Save Changes').'" />
|
219 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
</form>
|
221 |
</div>';
|
222 |
}
|
@@ -225,232 +395,483 @@ class MR_Social_Sharing_Toolkit {
|
|
225 |
|
226 |
function should_share_content() {
|
227 |
wp_enqueue_style('mr_social_sharing', plugins_url('/style.css', __FILE__));
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
}
|
231 |
-
if ($this->options['
|
232 |
-
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
-
if ($this->options['
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
-
if ($this->options['
|
238 |
return false;
|
239 |
}
|
240 |
return true;
|
241 |
}
|
242 |
|
243 |
-
function create_bookmarks($url = '', $title = '', $
|
244 |
$url = trim($url);
|
245 |
$title = trim($title);
|
246 |
if ($url == '') {
|
247 |
$url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
248 |
}
|
249 |
-
$
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
<li class="'.$class.'">
|
257 |
-
<iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='.urlencode($url).'&layout=';
|
258 |
-
switch ($layout) {
|
259 |
-
case 'horizontal':
|
260 |
-
$bookmarks .= 'button_count';
|
261 |
-
$width = '90px';
|
262 |
-
$height = '20px';
|
263 |
-
break;
|
264 |
-
case 'vertical':
|
265 |
-
$bookmarks .= 'box_count';
|
266 |
-
$width = '55px';
|
267 |
-
$height = '65px';
|
268 |
-
break;
|
269 |
-
default:
|
270 |
-
$bookmarks .= 'standard';
|
271 |
-
$width = '225%';
|
272 |
-
$height = '35px';
|
273 |
-
break;
|
274 |
}
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
default:
|
290 |
-
$bookmarks .= 'none"';
|
291 |
-
break;
|
292 |
-
}
|
293 |
-
if ($this->options['twitter_handle'] != '') {
|
294 |
-
$bookmarks .= ' data-text="'.$title.'" data-via="'.$this->options['twitter_handle'].'"';
|
295 |
}
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
}
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
<g:plusone';
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
}
|
314 |
-
$bookmarks .= ' href="'.$url.'"></g:plusone>
|
315 |
-
</li>';
|
316 |
-
}
|
317 |
-
if ($this->options['share'] == 1) {
|
318 |
-
$bookmarks .= '
|
319 |
-
<li class="'.$class.'">
|
320 |
-
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/Share" data-url="'.$url.'"';
|
321 |
-
switch ($layout) {
|
322 |
-
case 'horizontal':
|
323 |
-
$bookmarks .= ' data-counter="right"';
|
324 |
-
break;
|
325 |
-
case 'vertical':
|
326 |
-
$bookmarks .= ' data-counter="top"';
|
327 |
-
break;
|
328 |
-
default:
|
329 |
-
$bookmarks .= '';
|
330 |
-
break;
|
331 |
-
}
|
332 |
-
$bookmarks .= '></script>
|
333 |
-
</li>';
|
334 |
}
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
}
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
}
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
}
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
<script type="text/javascript">
|
396 |
reddit_url = "'.$url.'";
|
397 |
reddit_title = "'.$title.'";
|
398 |
</script>
|
399 |
<script type="text/javascript" src="http://www.reddit.com/static/button/button1.js"></script>';
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
<script type="text/javascript">
|
404 |
reddit_url = "'.$url.'";
|
405 |
reddit_title = "'.$title.'";
|
406 |
</script>
|
407 |
<script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>';
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
}
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
}
|
434 |
-
if ($
|
435 |
-
$
|
436 |
-
<li class="'.$class.'">
|
437 |
-
<iframe src="http://www.hyves.nl/respect/button?url='.urlencode($url).'&title='.urlencode($title).'" style="border: medium none; overflow:hidden; width:150px; height:21px;" scrolling="no" frameborder="0" allowTransparency="true" ></iframe>
|
438 |
-
</li>';
|
439 |
}
|
440 |
-
$
|
441 |
-
|
442 |
-
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
}
|
445 |
|
446 |
function share($content) {
|
447 |
$type = get_post_type().'s';
|
448 |
-
if (($this->options['
|
449 |
-
if ($this->options['
|
450 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
451 |
$content = $bookmarks.$content;
|
452 |
}
|
453 |
-
if ($this->options['
|
454 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
455 |
$content .= $bookmarks;
|
456 |
}
|
@@ -460,31 +881,31 @@ class MR_Social_Sharing_Toolkit {
|
|
460 |
|
461 |
function share_shortcode() {
|
462 |
$bookmarks = '';
|
463 |
-
if ($this->options['
|
464 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
465 |
}
|
466 |
return $bookmarks;
|
467 |
}
|
468 |
|
469 |
function should_linkify_content() {
|
470 |
-
if ($this->options['
|
471 |
return true;
|
472 |
}
|
473 |
return false;
|
474 |
}
|
475 |
|
476 |
function should_linkify_comments() {
|
477 |
-
if ($this->options['
|
478 |
return true;
|
479 |
}
|
480 |
return false;
|
481 |
}
|
482 |
|
483 |
function linkify($content) {
|
484 |
-
if ($this->options['
|
485 |
$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);
|
486 |
}
|
487 |
-
if ($this->options['
|
488 |
$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);
|
489 |
}
|
490 |
return $content;
|
@@ -494,15 +915,16 @@ class MR_Social_Sharing_Toolkit_Widget extends WP_Widget {
|
|
494 |
function MR_Social_Sharing_Toolkit_Widget() {
|
495 |
$widget_ops = array( 'classname' => 'MR_Social_Sharing_Toolkit_Widget', 'description' => '' );
|
496 |
$control_ops = array( 'id_base' => 'mr-social-sharing-toolkit-widget' );
|
497 |
-
$this->WP_Widget( 'mr-social-sharing-toolkit-widget', 'Social Sharing Toolkit Widget', $widget_ops, $control_ops );
|
498 |
}
|
499 |
|
500 |
function widget ( $args, $instance) {
|
501 |
extract( $args );
|
502 |
$MR_Social_Sharing_Toolkit = new MR_Social_Sharing_Toolkit();
|
503 |
-
$widget_layout = empty($instance['widget_layout']) ? 'none' : $instance['widget_layout'];
|
504 |
$widget_title = empty($instance['widget_title']) ? '' : $instance['widget_title'];
|
505 |
-
$
|
|
|
|
|
506 |
echo $before_widget;
|
507 |
if ($widget_title != '') {
|
508 |
echo $before_title . $widget_title . $after_title;
|
@@ -513,34 +935,67 @@ class MR_Social_Sharing_Toolkit_Widget extends WP_Widget {
|
|
513 |
|
514 |
function update($new_instance, $old_instance) {
|
515 |
$instance = $old_instance;
|
516 |
-
$instance['widget_layout'] = $new_instance['widget_layout'];
|
517 |
$instance['widget_title'] = $new_instance['widget_title'];
|
|
|
|
|
518 |
return $instance;
|
519 |
}
|
520 |
|
521 |
function form($instance) {
|
522 |
-
$instance = wp_parse_args((array) $instance, array( 'widget_title' => '', '
|
523 |
echo '
|
524 |
<p>
|
525 |
<label for="'.$this->get_field_id( 'widget_title' ).'">Title:</label>
|
526 |
<input class="widefat" id="'.$this->get_field_id( 'widget_title' ).'" name="'.$this->get_field_name( 'widget_title' ).'" value="'.$instance['widget_title'].'" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
</p>
|
528 |
<p>
|
529 |
-
<
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
541 |
</p>
|
542 |
<p>
|
543 |
-
Further configuration is done via the plugin admin screen
|
544 |
</p>';
|
545 |
}
|
546 |
}
|
@@ -555,7 +1010,8 @@ if ($MR_Social_Sharing_Toolkit->should_share_content()) {
|
|
555 |
add_filter( 'the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
556 |
}
|
557 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'));
|
558 |
-
/* Register
|
559 |
add_action('widgets_init', create_function('', 'return register_widget("MR_Social_Sharing_Toolkit_Widget");'));
|
|
|
560 |
/* Register plugin admin page */
|
561 |
add_action('admin_menu', array($MR_Social_Sharing_Toolkit, 'plugin_menu'));
|
3 |
Plugin Name: Social Sharing Toolkit
|
4 |
Plugin URI: http://www.marijnrongen.com/wordpress-plugins/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.1
|
7 |
Author: Marijn Rongen
|
8 |
Author URI: http://www.marijnrongen.com
|
9 |
*/
|
10 |
|
11 |
class MR_Social_Sharing_Toolkit {
|
12 |
var $options;
|
13 |
+
var $types;
|
14 |
+
var $share_buttons;
|
15 |
+
var $follow_buttons;
|
16 |
|
17 |
function MR_Social_Sharing_Toolkit() {
|
18 |
+
/* Declare button types */
|
19 |
+
$this->types['none'] = 'Button';
|
20 |
+
$this->types['horizontal'] = 'Button + side counter';
|
21 |
+
$this->types['vertical'] = 'Button + top counter';
|
22 |
+
$this->types['icon_small'] = 'Small icon';
|
23 |
+
$this->types['icon_small_text'] = 'Small icon + text';
|
24 |
+
$this->types['icon_medium'] = 'Medium icon';
|
25 |
+
$this->types['icon_medium_text'] = 'Medium icon + text';
|
26 |
+
$this->types['icon_large'] = 'Large icon';
|
27 |
+
/* Declare bookmark buttons with options */
|
28 |
+
$this->share_buttons['fb_like'] = array('icon' => 'facebook', 'title' => 'Facebook Like', 'types' => array('none', 'horizontal', 'vertical'));
|
29 |
+
$this->share_buttons['fb_send'] = array('icon' => 'facebook', 'title' => 'Facebook Send', 'types' => array('none'));
|
30 |
+
$this->share_buttons['tw_tweet'] = array('icon' => 'twitter', 'title' => 'Twitter', 'id' => '@', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
31 |
+
$this->share_buttons['gl_plus'] = array('icon' => 'googleplus', 'title' => 'Google+', 'types' => array('none', 'horizontal', 'vertical'));
|
32 |
+
$this->share_buttons['li_share'] = array('icon' => 'linkedin', 'title' => 'LinkedIn', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large', 'horizontal', 'vertical'));
|
33 |
+
$this->share_buttons['tu_tumblr'] = array('icon' => 'tumblr', 'title' => 'Tumblr', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
34 |
+
$this->share_buttons['su_stumble'] = array('icon' => 'stumbleupon', 'title' => 'StumbleUpon', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
35 |
+
$this->share_buttons['dl_delicious'] = array('icon' => 'delicious', 'title' => 'Delicious', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
36 |
+
$this->share_buttons['dg_digg'] = array('icon' => 'digg', 'title' => 'Digg', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
37 |
+
$this->share_buttons['rd_reddit'] = array('icon' => 'reddit', 'title' => 'Reddit', 'types' => array('none', 'horizontal', 'vertical', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
38 |
+
$this->share_buttons['ms_myspace'] = array('icon' => 'myspace', 'title' => 'Myspace', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
39 |
+
$this->share_buttons['hv_respect'] = array('icon' => 'hyves', 'title' => 'Hyves Respect', 'types' => array('horizontal'));
|
40 |
+
$this->share_buttons['ml_send'] = array('icon' => 'email', 'title' => 'Send email', 'types' => array('none', 'icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
41 |
+
/* Declare follow buttons with options */
|
42 |
+
$this->follow_buttons['follow_facebook'] = array('icon' => 'facebook', 'title' => 'Facebook', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
43 |
+
$this->follow_buttons['follow_twitter'] = array('icon' => 'twitter', 'title' => 'Twitter', 'id' => '@', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
44 |
+
$this->follow_buttons['follow_plus'] = array('icon' => 'googleplus', 'title' => 'Google+', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
45 |
+
$this->follow_buttons['follow_linked'] = array('icon' => 'linkedin', 'title' => 'LinkedIn', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
46 |
+
$this->follow_buttons['follow_tumblr'] = array('icon' => 'tumblr', 'title' => 'Tumblr', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
47 |
+
$this->follow_buttons['follow_myspace'] = array('icon' => 'myspace', 'title' => 'Myspace', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
48 |
+
$this->follow_buttons['follow_hyves'] = array('icon' => 'hyves', 'title' => 'Hyves', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
49 |
+
$this->follow_buttons['follow_youtube'] = array('icon' => 'youtube', 'title' => 'YouTube', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
50 |
+
$this->follow_buttons['follow_flickr'] = array('icon' => 'flickr', 'title' => 'Flickr', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
51 |
+
$this->follow_buttons['follow_picasa'] = array('icon' => 'picasa', 'title' => 'Picasa', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
52 |
+
$this->follow_buttons['follow_deviant'] = array('icon' => 'deviantart', 'title' => 'deviantArt', 'id' => 'id:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
53 |
+
$this->follow_buttons['follow_rss'] = array('icon' => 'rss', 'title' => 'RSS Feed', 'id' => 'url:', 'types' => array('icon_small', 'icon_small_text', 'icon_medium', 'icon_medium_text', 'icon_large'));
|
54 |
+
/* Set defaults and load user options */
|
55 |
$this->get_options();
|
56 |
}
|
57 |
|
58 |
function get_options() {
|
59 |
+
foreach ($this->share_buttons as $key => $val) {
|
60 |
+
$buttons[$key] = array('enable' => 1, 'type' => $val['types'][0]);
|
61 |
+
$widgets[$key] = array('enable' => 1, 'type' => $val['types'][0]);
|
62 |
+
$button_order[] = $key;
|
63 |
+
$widget_order[] = $key;
|
64 |
+
}
|
65 |
+
foreach ($this->follow_buttons as $key => $val) {
|
66 |
+
$followers[$key] = array('enable' => 1, 'type' => $val['types'][0], 'id' => '');
|
67 |
+
$follow_order[] = $key;
|
68 |
+
}
|
69 |
+
$this->options = array('mr_social_sharing_buttons' => $buttons, 'mr_social_sharing_widget_buttons' => $widgets, 'mr_social_sharing_follow_buttons' => $followers, 'mr_social_sharing_display' => 'span', 'mr_social_sharing_widget_display' => 'span', 'mr_social_sharing_follow_display' => 'span', 'mr_social_sharing_align' => '', 'mr_social_sharing_widget_align' => '', 'mr_social_sharing_follow_align' => '', 'mr_social_sharing_position' => 'none', 'mr_social_sharing_types' => 'both', 'mr_social_sharing_include_excerpts' => 1, 'mr_social_sharing_button_order' => $button_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_twitter_handles' => 0, 'mr_social_sharing_twitter_hashtags' => 0, 'mr_social_sharing_js_footer' => 0);
|
70 |
foreach ($this->options as $key => $val) {
|
71 |
$this->options[$key] = get_option( $key, $val );
|
72 |
}
|
73 |
+
foreach ($this->share_buttons as $key => $val) {
|
74 |
+
if (!array_key_exists($key, $this->options['mr_social_sharing_buttons'])) {
|
75 |
+
$this->options['mr_social_sharing_buttons'][$key] = array('enable' => 1, 'type' => $val['types'][0]);
|
76 |
+
}
|
77 |
+
if (!array_key_exists($key, $this->options['mr_social_sharing_widget_buttons'])) {
|
78 |
+
$this->options['mr_social_sharing_widget_buttons'][$key] = array('enable' => 1, 'type' => $val['types'][0]);
|
79 |
+
}
|
80 |
+
if (!in_array($key, $this->options['mr_social_sharing_button_order'])) {
|
81 |
+
$this->options['mr_social_sharing_button_order'][] = $key;
|
82 |
+
}
|
83 |
+
if (!in_array($key, $this->options['mr_social_sharing_widget_button_order'])) {
|
84 |
+
$this->options['mr_social_sharing_widget_button_order'][] = $key;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
foreach ($this->follow_buttons as $key => $val) {
|
88 |
+
if (!array_key_exists($key, $this->options['mr_social_sharing_follow_buttons'])) {
|
89 |
+
$this->options['mr_social_sharing_follow_buttons'][$key] = array('enable' => 1, 'type' => $val['types'][0], 'id' => '');
|
90 |
+
}
|
91 |
+
if (!in_array($key, $this->options['mr_social_sharing_follow_button_order'])) {
|
92 |
+
$this->options['mr_social_sharing_follow_button_order'][] = $key;
|
93 |
+
}
|
94 |
+
}
|
95 |
return $this->options;
|
96 |
}
|
97 |
|
111 |
|
112 |
function plugin_menu() {
|
113 |
add_options_page('Social Sharing', 'Social Sharing Toolkit', 'manage_options', 'mr_social_sharing', array($this, 'plugin_admin_page'));
|
114 |
+
add_filter('plugin_row_meta', array('MR_Social_Sharing_Toolkit', 'plugin_links'),10,2);
|
115 |
+
wp_enqueue_style('mr_social_sharing-admin', plugins_url('/admin.css', __FILE__));
|
116 |
+
wp_enqueue_script('mr_social_sharing-admin', plugins_url('/admin.js', __FILE__));
|
117 |
+
wp_enqueue_script('jquery-ui-sortable');
|
118 |
}
|
119 |
|
120 |
+
function plugin_links($links, $file) {
|
121 |
+
if ($file == plugin_basename(__FILE__)) {
|
122 |
+
$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</a>';
|
123 |
+
}
|
124 |
+
return $links;
|
125 |
+
}
|
126 |
+
|
127 |
function plugin_admin_page() {
|
128 |
if (!current_user_can('manage_options')) {
|
129 |
wp_die( __('You do not have sufficient permissions to access this page.') );
|
130 |
}
|
131 |
+
if( isset($_POST['mr_social_sharing_save_options']) && $_POST['mr_social_sharing_save_options'] == 'Y' ) {
|
132 |
$this->save_options($_POST);
|
133 |
echo '
|
134 |
<div class="updated"><p><strong>'.__('settings saved.', 'mr_social_sharing' ).'</strong></p></div>';
|
136 |
echo '
|
137 |
<div class="wrap">
|
138 |
<form method="post" action="">
|
139 |
+
<input type="hidden" name="mr_social_sharing_save_options" value="Y"/>
|
140 |
<h2>Social Sharing Toolkit</h2>
|
141 |
+
<p>
|
142 |
+
Jump to: <a href="#mr_social_sharing_widget_networks">Posts & pages</a> | <a href="#mr_social_sharing_widget_networks">Share Widget</a> | <a href="#mr_social_sharing_follow_networks">Follow Widget</a> | <a href="#mr_twitter_links">Automatic Twitter links</a><br/>
|
143 |
+
<br/>
|
144 |
+
<label for="mr_social_sharing_js_footer" class="check"><input type="checkbox" name="mr_social_sharing_js_footer" id="mr_social_sharing_js_footer"';
|
145 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) { echo ' checked="checked"';}
|
146 |
+
echo ' value="1" /> Load JavaScript in footer</label><br/>
|
147 |
+
<span class="description"> '.__("Improves performance but may not work on some themes", 'mr_social_sharing').'</span>
|
148 |
+
</p>
|
149 |
+
<div class="mr_social_sharing_networks">
|
150 |
+
<h3>Posts & pages:</h3>
|
151 |
+
<p>
|
152 |
+
Check the boxes to display the button on your website. For each button you can select a separate style from the dropdown box. You can change the order of the buttons by dragging them to the desired location in the list. For the tweet button you can also fill in your Twitter username which will then be appended to the tweet (like via @WordPress).
|
153 |
+
</p>
|
154 |
+
<ul id="mr_social_sharing_networks">';
|
155 |
+
foreach ($this->options['mr_social_sharing_button_order'] as $button) {
|
156 |
+
echo '
|
157 |
+
<li>
|
158 |
+
<img src="'.plugins_url('/images/icons_small/'.$this->share_buttons[$button]['icon'].'.png', __FILE__).'" title="'.$this->share_buttons[$button]['title'].'" alt="'.$this->share_buttons[$button]['title'].'"/>
|
159 |
+
<label for="mr_social_sharing_'.$button.'"><input type="checkbox" name="mr_social_sharing_buttons['.$button.'][enable]" id="mr_social_sharing_'.$button.'"';
|
160 |
+
if ($this->options['mr_social_sharing_buttons'][$button]['enable'] == 1) { echo ' checked="checked"';}
|
161 |
+
echo ' value="1" />'.$this->share_buttons[$button]['title'].'</label>
|
162 |
+
<img class="right" src="'.plugins_url('/images/move.png', __FILE__).'" title="Change button order" alt="Change button order"/>
|
163 |
+
<select name="mr_social_sharing_buttons['.$button.'][type]" id="mr_social_sharing_'.$button.'_type">';
|
164 |
+
foreach ($this->share_buttons[$button]['types'] as $type) {
|
165 |
+
echo '<option value="'.$type.'"';
|
166 |
+
if ($this->options['mr_social_sharing_buttons'][$button]['type'] == $type) { echo ' selected="selected"';}
|
167 |
+
echo '>'.$this->types[$type].'</option>';
|
168 |
+
}
|
169 |
+
if (array_key_exists('id', $this->share_buttons[$button])) {
|
170 |
+
echo '
|
171 |
+
<input type="text" class="text" name="mr_social_sharing_buttons['.$button.'][id]" id="mr_social_sharing_'.$button.'_id" value="'.$this->options['mr_social_sharing_buttons'][$button]['id'].'"/>
|
172 |
+
<label for="mr_social_sharing_'.$button.'_id" class="text">'.$this->share_buttons[$button]['id'].'</label>';
|
173 |
+
}
|
174 |
+
echo '
|
175 |
+
<input type="hidden" name="mr_social_sharing_button_order[]" value="'.$button.'"/>
|
176 |
+
</li>';
|
177 |
+
}
|
178 |
+
echo '
|
179 |
+
</ul>
|
180 |
+
<p>
|
181 |
+
Choose button orientation horizontal to display the buttons side by side, vertical will place them below each other. You can also select an alignment to better suit your theme.
|
182 |
+
</p>
|
183 |
+
<label for="mr_social_sharing_display">Button orientation</label>
|
184 |
+
<select name="mr_social_sharing_display" id="mr_social_sharing_display">
|
185 |
+
<option value="span"';
|
186 |
+
if ($this->options['mr_social_sharing_display'] == 'span') { echo ' selected="selected"';}
|
187 |
+
echo '>Horizontal</option>
|
188 |
+
<option value="div"';
|
189 |
+
if ($this->options['mr_social_sharing_display'] == 'div') { echo ' selected="selected"';}
|
190 |
+
echo '>Vertical</option>
|
191 |
+
</select><br/>
|
192 |
+
<label for="mr_social_sharing_align">Button alignment</label>
|
193 |
+
<select name="mr_social_sharing_align" id="mr_social_sharing_align">
|
194 |
+
<option value=""';
|
195 |
+
if ($this->options['mr_social_sharing_align'] == '') { echo ' selected="selected"';}
|
196 |
+
echo '>Align to bottom</option>
|
197 |
+
<option value="_top"';
|
198 |
+
if ($this->options['mr_social_sharing_align'] == '_top') { echo ' selected="selected"';}
|
199 |
+
echo '>Align to top</option>
|
200 |
+
</select>
|
201 |
+
<p>
|
202 |
+
Choose where the buttons must be displayed and if the buttons should be displayed on posts, pages or both.
|
203 |
+
</p>
|
204 |
+
<label for="mr_social_sharing_position">Button location</label>
|
205 |
+
<select name="mr_social_sharing_position" id="mr_social_sharing_position">
|
206 |
+
<option value="none"';
|
207 |
+
if ($this->options['mr_social_sharing_position'] == 'none') { echo ' selected="selected"';}
|
208 |
echo '>Do not display social bookmarks</option>
|
209 |
<option value="top"';
|
210 |
+
if ($this->options['mr_social_sharing_position'] == 'top') { echo ' selected="selected"';}
|
211 |
echo '>Display above content</option>
|
212 |
<option value="bottom"';
|
213 |
+
if ($this->options['mr_social_sharing_position'] == 'bottom') { echo ' selected="selected"';}
|
214 |
echo '>Display below content</option>
|
215 |
<option value="shortcode"';
|
216 |
+
if ($this->options['mr_social_sharing_position'] == 'shortcode') { echo ' selected="selected"';}
|
217 |
echo '>Let me decide by using shortcode</option>
|
218 |
+
</select><br/>';
|
219 |
+
if ($this->options['mr_social_sharing_position'] == 'shortcode') {
|
220 |
+
echo '<span class="description"> '.__("Use the shortcode [social_share/] where you want the buttons to appear", 'mr_social_sharing').'</span><br/>';
|
221 |
}
|
222 |
echo '
|
223 |
+
<label for="mr_social_sharing_types">Place buttons on</label>
|
224 |
+
<select name="mr_social_sharing_types" id="mr_social_sharing_types">
|
225 |
+
<option value="both"';
|
226 |
+
if ($this->options['mr_social_sharing_types'] == 'both') { echo ' selected="selected"';}
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
echo '>On posts and pages</option>
|
228 |
+
<option value="posts"';
|
229 |
+
if ($this->options['mr_social_sharing_types'] == 'posts') { echo ' selected="selected"';}
|
230 |
echo '>Only on posts</option>
|
231 |
+
<option value="pages"';
|
232 |
+
if ($this->options['mr_social_sharing_types'] == 'pages') { echo ' selected="selected"';}
|
233 |
echo '>Only on pages</option>
|
234 |
+
</select>
|
235 |
+
<p>
|
236 |
+
Uncheck this box if you are having issues displaying the buttons with excerpts (some themes have custom excerpt functions which do not play nice with the plugin).
|
237 |
+
</p>
|
238 |
+
<label for="mr_social_sharing_include_excerpts" class="check"><input type="checkbox" name="mr_social_sharing_include_excerpts" id="mr_social_sharing_include_excerpts"';
|
239 |
+
if ($this->options['mr_social_sharing_include_excerpts'] == 1) { echo ' checked="checked"';}
|
240 |
+
echo ' value="1" /> Include buttons in excerpts</label>
|
241 |
+
</div>
|
242 |
+
<p class="submit">
|
243 |
+
<input type="submit" name="Submit" class="button-primary" value="'.esc_attr__('Save Changes').'" />
|
244 |
+
</p>
|
245 |
+
<div class="mr_social_sharing_networks">
|
246 |
+
<h3>Share Widget:</h3>
|
247 |
+
<p>
|
248 |
+
Check the boxes to display the button on Social Sharing Toolkit Share widget. For each button you can select a separate style from the dropdown box. You can change the order of the buttons by dragging them to the desired location in the list. For the tweet button you can also fill in your Twitter username which will then be appended to the tweet (like via @WordPress).<br/>
|
249 |
+
<br/>
|
250 |
+
For each widget you can enter a fixed url and title for the buttons, to do this <a href="widgets.php">go to the widget configuration page</a>.
|
251 |
+
</p>
|
252 |
+
<ul id="mr_social_sharing_widget_networks">';
|
253 |
+
foreach ($this->options['mr_social_sharing_widget_button_order'] as $button) {
|
254 |
+
echo '
|
255 |
+
<li>
|
256 |
+
<img src="'.plugins_url('/images/icons_small/'.$this->share_buttons[$button]['icon'].'.png', __FILE__).'" title="'.$this->share_buttons[$button]['title'].'" alt="'.$this->share_buttons[$button]['title'].'"/>
|
257 |
+
<label for="mr_social_sharing_widget_'.$button.'"><input type="checkbox" name="mr_social_sharing_widget_buttons['.$button.'][enable]" id="mr_social_sharing_widget_'.$button.'"';
|
258 |
+
if ($this->options['mr_social_sharing_widget_buttons'][$button]['enable'] == 1) { echo ' checked="checked"';}
|
259 |
+
echo ' value="1" />'.$this->share_buttons[$button]['title'].'</label>
|
260 |
+
<img class="right" src="'.plugins_url('/images/move.png', __FILE__).'" title="Change button order" alt="Change button order"/>
|
261 |
+
<select name="mr_social_sharing_widget_buttons['.$button.'][type]" id="mr_social_sharing_widget_'.$button.'_type">';
|
262 |
+
foreach ($this->share_buttons[$button]['types'] as $type) {
|
263 |
+
echo '<option value="'.$type.'"';
|
264 |
+
if ($this->options['mr_social_sharing_widget_buttons'][$button]['type'] == $type) { echo ' selected="selected"';}
|
265 |
+
echo '>'.$this->types[$type].'</option>';
|
266 |
+
}
|
267 |
+
if (array_key_exists('id', $this->share_buttons[$button])) {
|
268 |
+
echo '
|
269 |
+
<input type="text" class="text" name="mr_social_sharing_widget_buttons['.$button.'][id]" id="mr_social_sharing_widget_'.$button.'_id" value="'.$this->options['mr_social_sharing_widget_buttons'][$button]['id'].'"/>
|
270 |
+
<label for="mr_social_sharing_widget_'.$button.'_id" class="text">'.$this->share_buttons[$button]['id'].'</label>';
|
271 |
+
}
|
272 |
+
echo '
|
273 |
+
<input type="hidden" name="mr_social_sharing_widget_button_order[]" value="'.$button.'"/>
|
274 |
+
</li>';
|
275 |
+
}
|
276 |
echo '
|
277 |
+
</ul>
|
278 |
+
<p>
|
279 |
+
Choose button orientation horizontal to display the buttons side by side, vertical will place them below each other. You can also select an alignment to better suit your theme.
|
280 |
+
</p>
|
281 |
+
<label for="mr_social_sharing_widget_display">Button orientation</label>
|
282 |
+
<select name="mr_social_sharing_widget_display" id="mr_social_sharing_widget_display">
|
283 |
+
<option value="span"';
|
284 |
+
if ($this->options['mr_social_sharing_widget_display'] == 'span') { echo ' selected="selected"';}
|
285 |
+
echo '>Horizontal</option>
|
286 |
+
<option value="div"';
|
287 |
+
if ($this->options['mr_social_sharing_widget_display'] == 'div') { echo ' selected="selected"';}
|
288 |
+
echo '>Vertical</option>
|
289 |
+
</select><br/>
|
290 |
+
<label for="mr_social_sharing_widget_align">Button alignment</label>
|
291 |
+
<select name="mr_social_sharing_widget_align" id="mr_social_widget_sharing_align">
|
292 |
+
<option value=""';
|
293 |
+
if ($this->options['mr_social_sharing_widget_align'] == '') { echo ' selected="selected"';}
|
294 |
+
echo '>Align to bottom</option>
|
295 |
+
<option value="_top"';
|
296 |
+
if ($this->options['mr_social_sharing_widget_align'] == '_top') { echo ' selected="selected"';}
|
297 |
+
echo '>Align to top</option>
|
298 |
+
</select>
|
299 |
+
</div>
|
300 |
+
<p class="submit">
|
301 |
+
<input type="submit" name="Submit" class="button-primary" value="'.esc_attr__('Save Changes').'" />
|
302 |
+
</p>
|
303 |
+
<div class="mr_social_sharing_networks">
|
304 |
+
<h3>Follow Widget:</h3>
|
305 |
+
<p>
|
306 |
+
Check the boxes to display the button on Social Sharing Toolkit Follow widget. For each button you can select a separate style from the dropdown box. You can change the order of the buttons by dragging them to the desired location in the list.<br/>
|
307 |
+
<br/>
|
308 |
+
For each button you only have to enter your id or username of the network as it appears in the url of your profile page. You will need to enter the complete url for the RSS Feed (including the http:// part) if you wish to display this button.<br/>
|
309 |
+
<br/>
|
310 |
+
To add the widget to your website <a href="widgets.php">go to the widget configuration page</a>.
|
311 |
+
</p>
|
312 |
+
<ul id="mr_social_sharing_follow_networks">';
|
313 |
+
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
314 |
+
echo '
|
315 |
+
<li>
|
316 |
+
<img src="'.plugins_url('/images/icons_small/'.$this->follow_buttons[$button]['icon'].'.png', __FILE__).'" title="'.$this->follow_buttons[$button]['title'].'" alt="'.$this->follow_buttons[$button]['title'].'"/>
|
317 |
+
<label for="mr_social_sharing_follow_'.$button.'"><input type="checkbox" name="mr_social_sharing_follow_buttons['.$button.'][enable]" id="mr_social_sharing_follow_'.$button.'"';
|
318 |
+
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) { echo ' checked="checked"';}
|
319 |
+
echo ' value="1" />'.$this->follow_buttons[$button]['title'].'</label>
|
320 |
+
<img class="right" src="'.plugins_url('/images/move.png', __FILE__).'" title="Change button order" alt="Change button order"/>
|
321 |
+
<select name="mr_social_sharing_follow_buttons['.$button.'][type]" id="mr_social_sharing_follow_'.$button.'_type">';
|
322 |
+
foreach ($this->follow_buttons[$button]['types'] as $type) {
|
323 |
+
echo '<option value="'.$type.'"';
|
324 |
+
if ($this->options['mr_social_sharing_follow_buttons'][$button]['type'] == $type) { echo ' selected="selected"';}
|
325 |
+
echo '>'.$this->types[$type].'</option>';
|
326 |
+
}
|
327 |
+
if (array_key_exists('id', $this->follow_buttons[$button])) {
|
328 |
+
echo '
|
329 |
+
<input type="text" class="text" name="mr_social_sharing_follow_buttons['.$button.'][id]" id="mr_social_sharing_follow_'.$button.'_id" value="'.$this->options['mr_social_sharing_follow_buttons'][$button]['id'].'"/>
|
330 |
+
<label for="mr_social_sharing_follow_'.$button.'_id" class="text">'.$this->follow_buttons[$button]['id'].'</label>';
|
331 |
+
}
|
332 |
+
echo '
|
333 |
+
<input type="hidden" name="mr_social_sharing_follow_button_order[]" value="'.$button.'"/>
|
334 |
+
</li>';
|
335 |
+
}
|
336 |
echo '
|
337 |
+
</ul>
|
338 |
+
<p>
|
339 |
+
Choose button orientation horizontal to display the buttons side by side, vertical will place them below each other. You can also select an alignment to better suit your theme.
|
340 |
+
</p>
|
341 |
+
<label for="mr_social_sharing_follow_display">Button orientation</label>
|
342 |
+
<select name="mr_social_sharing_follow_display" id="mr_social_sharing_follow_display">
|
343 |
+
<option value="span"';
|
344 |
+
if ($this->options['mr_social_sharing_follow_display'] == 'span') { echo ' selected="selected"';}
|
345 |
+
echo '>Horizontal</option>
|
346 |
+
<option value="div"';
|
347 |
+
if ($this->options['mr_social_sharing_follow_display'] == 'div') { echo ' selected="selected"';}
|
348 |
+
echo '>Vertical</option>
|
349 |
+
</select><br/>
|
350 |
+
<label for="mr_social_sharing_follow_align">Button alignment</label>
|
351 |
+
<select name="mr_social_sharing_follow_align" id="mr_social_widget_sharing_align">
|
352 |
+
<option value=""';
|
353 |
+
if ($this->options['mr_social_sharing_follow_align'] == '') { echo ' selected="selected"';}
|
354 |
+
echo '>Align to bottom</option>
|
355 |
+
<option value="_top"';
|
356 |
+
if ($this->options['mr_social_sharing_follow_align'] == '_top') { echo ' selected="selected"';}
|
357 |
+
echo '>Align to top</option>
|
358 |
+
</select>
|
359 |
+
</div>
|
360 |
+
<p class="submit">
|
361 |
+
<input type="submit" name="Submit" class="button-primary" value="'.esc_attr__('Save Changes').'" />
|
362 |
+
</p>
|
363 |
+
<div class="mr_social_sharing_networks" id="mr_twitter_links">
|
364 |
+
<h3>Automatic Twitter links</h3>
|
365 |
+
<p>Select what you want to convert…</p>
|
366 |
+
<label for="mr_social_sharing_twitter_handles" class="check"><input type="checkbox" name="mr_social_sharing_twitter_handles" id="mr_social_sharing_twitter_handles"';
|
367 |
+
if ($this->options['mr_social_sharing_twitter_handles'] == 1) { echo ' checked="checked"';}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
echo ' value="1" /> '.__("Convert Twitter usernames", 'mr_social_sharing').'</label><br/>
|
369 |
+
<label for="mr_social_sharing_twitter_hashtags" class="check"><input type="checkbox" name="mr_social_sharing_twitter_hashtags" id="mr_social_sharing_twitter_hashtags"';
|
370 |
+
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) { echo ' checked="checked"';}
|
371 |
echo ' value="1" /> '.__("Convert hashtags", 'mr_social_sharing').'</label>
|
372 |
+
<p>... and where it should be converted</p>
|
373 |
+
<label for="mr_social_sharing_linkify_content" class="check"><input type="checkbox" name="mr_social_sharing_linkify_content" id="mr_social_sharing_linkify_content"';
|
374 |
+
if ($this->options['mr_social_sharing_linkify_content'] == 1) { echo ' checked="checked"';}
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
echo ' value="1" /> '.__("Convert in posts and pages", 'mr_social_sharing').'</label><br/>
|
376 |
+
<label for="mr_social_sharing_linkify_comments" class="check"><input type="checkbox" name="mr_social_sharing_linkify_comments" id="mr_social_sharing_linkify_comments"';
|
377 |
+
if ($this->options['mr_social_sharing_linkify_comments'] == 1) { echo ' checked="checked"';}
|
378 |
echo ' value="1" /> '.__("Convert in comments", 'mr_social_sharing').'</label>
|
379 |
+
</div>
|
|
|
|
|
|
|
380 |
<p class="submit">
|
381 |
<input type="submit" name="Submit" class="button-primary" value="'.esc_attr__('Save Changes').'" />
|
382 |
</p>
|
383 |
+
<div class="mr_social_sharing_networks">
|
384 |
+
<h3>Thank you for using the Social Sharing Toolkit!</h3>
|
385 |
+
<p>
|
386 |
+
For questions or requests about this plugin please use the <a href="http://www.marijnrongen.com/wordpress-plugins/social-sharing-toolkit/" target="_blank">official plugin page</a>.
|
387 |
+
If you like the plugin I would appreciate it if you provide a rating of the <a href="http://wordpress.org/extend/plugins/social-sharing-toolkit/" target="_blank">plugin on WordPress.org</a>. If you really like the plugin you can also <a 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" target="_blank">donate here</a>.
|
388 |
+
</p>
|
389 |
+
</div>
|
390 |
</form>
|
391 |
</div>';
|
392 |
}
|
395 |
|
396 |
function should_share_content() {
|
397 |
wp_enqueue_style('mr_social_sharing', plugins_url('/style.css', __FILE__));
|
398 |
+
wp_enqueue_script('mr_social_sharing', plugins_url('script.js', __FILE__), array('jquery'), array(), false, true);
|
399 |
+
if ($this->options['mr_social_sharing_buttons']['gl_plus']['enable'] == 1 || $this->options['mr_social_sharing_widget_buttons']['gl_plus']['enable'] == 1) {
|
400 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
401 |
+
wp_enqueue_script('GooglePlus', 'http://apis.google.com/js/plusone.js', array(), false, true);
|
402 |
+
} else {
|
403 |
+
wp_enqueue_script('GooglePlus', 'http://apis.google.com/js/plusone.js');
|
404 |
+
}
|
405 |
+
}
|
406 |
+
if ($this->options['mr_social_sharing_buttons']['dg_digg']['enable'] == 1 || $this->options['mr_social_sharing_widget_buttons']['dg_digg']['enable'] == 1) {
|
407 |
+
if ($this->options['mr_social_sharing_buttons']['dg_digg']['type'] == 'horizontal' || $this->options['mr_social_sharing_buttons']['dg_digg']['type'] == 'vertical' || $this->options['mr_social_sharing_widget_buttons']['dg_digg']['type'] == 'horizontal' || $this->options['mr_social_sharing_widget_buttons']['dg_digg']['type'] == 'vertical') {
|
408 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
409 |
+
wp_enqueue_script('Digg', plugins_url('/digg.js', __FILE__), array(), false, true);
|
410 |
+
} else {
|
411 |
+
wp_enqueue_script('Digg', plugins_url('/digg.js', __FILE__));
|
412 |
+
}
|
413 |
+
}
|
414 |
+
}
|
415 |
+
if ($this->options['mr_social_sharing_buttons']['li_share']['enable'] == 1 || $this->options['mr_social_sharing_widget_buttons']['li_share']['enable'] == 1) {
|
416 |
+
if ($this->options['mr_social_sharing_buttons']['li_share']['type'] == 'horizontal' || $this->options['mr_social_sharing_buttons']['li_share']['type'] == 'vertical' || $this->options['mr_social_sharing_buttons']['li_share']['type'] == 'none' || $this->options['mr_social_sharing_widget_buttons']['li_share']['type'] == 'horizontal' || $this->options['mr_social_sharing_widget_buttons']['li_share']['type'] == 'vertical' || $this->options['mr_social_sharing_widget_buttons']['li_share']['type'] == 'none') {
|
417 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
418 |
+
wp_enqueue_script('LinkedIn', 'http://platform.linkedin.com/in.js', array(), false, true);
|
419 |
+
} else {
|
420 |
+
wp_enqueue_script('LinkedIn', 'http://platform.linkedin.com/in.js');
|
421 |
+
}
|
422 |
+
}
|
423 |
}
|
424 |
+
if ($this->options['mr_social_sharing_buttons']['fb_send']['enable'] == 1 || $this->options['mr_social_sharing_widget_buttons']['fb_send']['enable'] == 1) {
|
425 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
426 |
+
wp_enqueue_script('FacebookSend', 'http://connect.facebook.net/en_US/all.js#xfbml=1', array(), false, true);
|
427 |
+
} else {
|
428 |
+
wp_enqueue_script('FacebookSend', 'http://connect.facebook.net/en_US/all.js#xfbml=1');
|
429 |
+
}
|
430 |
}
|
431 |
+
if ($this->options['mr_social_sharing_buttons']['tw_tweet']['enable'] == 1 || $this->options['mr_social_sharing_widget_buttons']['tw_tweet']['enable'] == 1) {
|
432 |
+
if ($this->options['mr_social_sharing_buttons']['tw_tweet']['type'] == 'horizontal' || $this->options['mr_social_sharing_buttons']['tw_tweet']['type'] == 'vertical' || $this->options['mr_social_sharing_widget_buttons']['tw_tweet']['type'] == 'horizontal' || $this->options['mr_social_sharing_widget_buttons']['tw_tweet']['type'] == 'vertical') {
|
433 |
+
if ($this->options['mr_social_sharing_js_footer'] == 1) {
|
434 |
+
wp_enqueue_script('Twitter', 'http://platform.twitter.com/widgets.js', array(), false, true);
|
435 |
+
} else {
|
436 |
+
wp_enqueue_script('Twitter', 'http://platform.twitter.com/widgets.js');
|
437 |
+
}
|
438 |
+
}
|
439 |
}
|
440 |
+
if ($this->options['mr_social_sharing_position'] == 'none' || $this->options['mr_social_sharing_position'] == 'shortcode') {
|
441 |
return false;
|
442 |
}
|
443 |
return true;
|
444 |
}
|
445 |
|
446 |
+
function create_bookmarks($url = '', $title = '', $type = '') {
|
447 |
$url = trim($url);
|
448 |
$title = trim($title);
|
449 |
if ($url == '') {
|
450 |
$url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
|
451 |
}
|
452 |
+
$bookmarks = '
|
453 |
+
<!-- Social Sharing Toolkit v2.0.1 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
|
454 |
+
<div class="mr_social_sharing_wrapper">';
|
455 |
+
foreach ($this->options['mr_social_sharing_'.$type.'button_order'] as $button) {
|
456 |
+
if ($this->options['mr_social_sharing_'.$type.'buttons'][$button]['enable'] == 1) {
|
457 |
+
$id = array_key_exists('id', $this->options['mr_social_sharing_'.$type.'buttons'][$button]) ? $this->options['mr_social_sharing_'.$type.'buttons'][$button]['id'] : '';
|
458 |
+
$bookmarks .= $this->get_bookmark_button($button, $url, $title, $this->options['mr_social_sharing_'.$type.'buttons'][$button]['type'], $this->options['mr_social_sharing_'.$type.'display'], $this->options['mr_social_sharing_'.$type.'align'], $id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
}
|
460 |
+
}
|
461 |
+
$bookmarks .= '
|
462 |
+
</div>';
|
463 |
+
return $bookmarks;
|
464 |
+
}
|
465 |
+
|
466 |
+
function create_followers() {
|
467 |
+
$followers = '
|
468 |
+
<!-- Social Sharing Toolkit v2.0.1 | http://www.marijnrongen.com/wordpress-plugins/social_sharing_toolkit/ -->
|
469 |
+
<div class="mr_social_sharing_wrapper">';
|
470 |
+
foreach ($this->options['mr_social_sharing_follow_button_order'] as $button) {
|
471 |
+
if ($this->options['mr_social_sharing_follow_buttons'][$button]['enable'] == 1) {
|
472 |
+
$id = array_key_exists('id', $this->options['mr_social_sharing_follow_buttons'][$button]) ? $this->options['mr_social_sharing_follow_buttons'][$button]['id'] : '';
|
473 |
+
$followers .= $this->get_follow_button($button, $this->options['mr_social_sharing_follow_buttons'][$button]['type'], $this->options['mr_social_sharing_follow_display'], $this->options['mr_social_sharing_follow_align'], $id);
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
}
|
475 |
+
}
|
476 |
+
$followers .= '
|
477 |
+
</div>';
|
478 |
+
return $followers;
|
479 |
+
}
|
480 |
+
|
481 |
+
function get_bookmark_button($button, $url, $title, $type, $display = 'span', $align = '', $id = '') {
|
482 |
+
$button = 'get_'.$button;
|
483 |
+
$retval = '
|
484 |
+
<'.$display.' class="mr_social_sharing'.$align.'">'.$this->$button($url, $title, $type, $id).'
|
485 |
+
</'.$display.'>';
|
486 |
+
return $retval;
|
487 |
+
}
|
488 |
+
|
489 |
+
function get_follow_button($button, $type, $display = 'span', $align = '', $id = '') {
|
490 |
+
$button = 'get_'.$button;
|
491 |
+
$retval = '
|
492 |
+
<'.$display.' class="mr_social_sharing'.$align.'">'.$this->$button($type, $id).'
|
493 |
+
</'.$display.'>';
|
494 |
+
return $retval;
|
495 |
+
}
|
496 |
+
|
497 |
+
function get_fb_like($url, $title, $type, $id) {
|
498 |
+
$retval = '
|
499 |
+
<iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='.urlencode($url).'&layout=';
|
500 |
+
switch ($type) {
|
501 |
+
case 'horizontal':
|
502 |
+
$retval .= 'button_count';
|
503 |
+
$width = 'auto';
|
504 |
+
$height = '20px';
|
505 |
+
break;
|
506 |
+
case 'vertical':
|
507 |
+
$retval .= 'box_count';
|
508 |
+
$width = '55px';
|
509 |
+
$height = '65px';
|
510 |
+
break;
|
511 |
+
default:
|
512 |
+
$retval .= 'standard';
|
513 |
+
$width = 'auto';
|
514 |
+
$height = '24px';
|
515 |
+
break;
|
516 |
}
|
517 |
+
$retval .= '&show_faces=false&width='.$width.'&height='.$height.'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:'.$width.'; height:'.$height.';" allowTransparency="true"></iframe>';
|
518 |
+
return $retval;
|
519 |
+
}
|
520 |
+
|
521 |
+
function get_fb_send($url, $title, $type, $id) {
|
522 |
+
$retval = '
|
523 |
+
<div id="fb-root"></div>
|
524 |
+
<fb:send href="'.$url.'" font=""></fb:send>';
|
525 |
+
return $retval;
|
526 |
+
}
|
527 |
+
|
528 |
+
function get_tw_tweet($url, $title, $type, $id) {
|
529 |
+
switch ($type) {
|
530 |
+
case 'horizontal':
|
531 |
+
$retval = '
|
532 |
+
<a href="http://twitter.com/share" class="twitter-share-button" data-url="'.$url.'" data-count="horizontal"';
|
533 |
+
if ($id != '') {
|
534 |
+
$retval .= ' data-via="'.$id.'"';
|
535 |
+
}
|
536 |
+
$retval .= ' data-text="'.$title.'">Tweet</a>';
|
537 |
+
break;
|
538 |
+
case 'vertical':
|
539 |
+
$retval = '
|
540 |
+
<a href="http://twitter.com/share" class="twitter-share-button" data-url="'.$url.'" data-count="vertical"';
|
541 |
+
if ($id != '') {
|
542 |
+
$retval .= ' data-via="'.$id.'"';
|
543 |
+
}
|
544 |
+
$retval .= ' data-text="'.$title.'">Tweet</a>';
|
545 |
+
break;
|
546 |
+
default:
|
547 |
+
$url = 'http://twitter.com/share?url='.urlencode($url).'&text='.urlencode($title);
|
548 |
+
if ($id != '') {
|
549 |
+
$url .= '&via='.$id;
|
550 |
+
}
|
551 |
+
$title = 'Share on Twitter';
|
552 |
+
$text = 'Share on Twitter';
|
553 |
+
$icon = 'twitter';
|
554 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
555 |
+
break;
|
556 |
+
}
|
557 |
+
return $retval;
|
558 |
+
}
|
559 |
+
|
560 |
+
function get_gl_plus($url, $title, $type, $id) {
|
561 |
+
$retval = '
|
562 |
<g:plusone';
|
563 |
+
switch ($type) {
|
564 |
+
case 'horizontal':
|
565 |
+
$retval .= ' size="medium"';
|
566 |
+
break;
|
567 |
+
case 'vertical':
|
568 |
+
$retval .= ' size="tall"';
|
569 |
+
break;
|
570 |
+
default:
|
571 |
+
$retval .= ' size="medium" count="false"';
|
572 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
573 |
}
|
574 |
+
$retval .= ' href="'.$url.'"></g:plusone>';
|
575 |
+
return $retval;
|
576 |
+
}
|
577 |
+
|
578 |
+
function get_li_share($url, $title, $type, $id) {
|
579 |
+
switch ($type) {
|
580 |
+
case 'horizontal':
|
581 |
+
$retval = '
|
582 |
+
<script type="IN/Share" data-url="'.$url.'" data-counter="right"></script>';
|
583 |
+
break;
|
584 |
+
case 'vertical':
|
585 |
+
$retval = '
|
586 |
+
<script type="IN/Share" data-url="'.$url.'" data-counter="top"></script>';
|
587 |
+
break;
|
588 |
+
case 'none':
|
589 |
+
$retval = '
|
590 |
+
<script type="IN/Share" data-url="'.$url.'"></script>';
|
591 |
+
break;
|
592 |
+
default:
|
593 |
+
$url = 'http://www.linkedin.com/shareArticle?mini=true&url='.urlencode($url).'&title='.urlencode($title);
|
594 |
+
$title = 'Share on LinkedIn';
|
595 |
+
$text = 'Share on LinkedIn';
|
596 |
+
$icon = 'linkedin';
|
597 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
598 |
+
break;
|
599 |
}
|
600 |
+
return $retval;
|
601 |
+
}
|
602 |
+
|
603 |
+
function get_tu_tumblr($url, $title, $type, $id) {
|
604 |
+
$url = 'http://www.tumblr.com/share/link?url='.urlencode($url).'&name='.urlencode($title);
|
605 |
+
$title = 'Share on Tumblr';
|
606 |
+
$text = 'Share on Tumblr';
|
607 |
+
$icon = 'tumblr';
|
608 |
+
return $this->get_icon($type, $url, $title, $text, $icon, true);
|
609 |
+
}
|
610 |
+
|
611 |
+
function get_su_stumble($url, $title, $type, $id) {
|
612 |
+
switch ($type) {
|
613 |
+
case 'horizontal':
|
614 |
+
$retval = '
|
615 |
+
<script src="http://www.stumbleupon.com/hostedbadge.php?s=1&r='.urlencode($url).'"></script>';
|
616 |
+
break;
|
617 |
+
case 'vertical':
|
618 |
+
$retval = '
|
619 |
+
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5&r='.urlencode($url).'"></script>';
|
620 |
+
break;
|
621 |
+
default:
|
622 |
+
$url = 'http://www.stumbleupon.com/submit?url='.urlencode($url).'&title='.urlencode($title);
|
623 |
+
$title = 'Submit to StumbleUpon';
|
624 |
+
$text = 'Submit to StumbleUpon';
|
625 |
+
$icon = 'stumbleupon';
|
626 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
627 |
+
break;
|
628 |
}
|
629 |
+
return $retval;
|
630 |
+
}
|
631 |
+
|
632 |
+
function get_dl_delicious($url, $title, $type, $id) {
|
633 |
+
switch ($type) {
|
634 |
+
case 'horizontal':
|
635 |
+
$hash = md5($url);
|
636 |
+
$retval = '
|
637 |
+
<div class="delicious_horizontal">
|
638 |
+
<span class="delicious_hash">'.$hash.'</span><a class="mr_social_sharing_popup_link" href="http://del.icio.us/post?v=4&noui&jump=close&url='.urlencode($url).'&title='.urlencode($title).'" target="_blank"></a>
|
639 |
+
</div>';
|
640 |
+
break;
|
641 |
+
case 'vertical':
|
642 |
+
$hash = md5($url);
|
643 |
+
$retval = '
|
644 |
+
<div class="delicious_vertical">
|
645 |
+
<span class="delicious_hash">'.$hash.'</span><a class="mr_social_sharing_popup_link" href="http://del.icio.us/post?v=4&noui&jump=close&url='.urlencode($url).'&title='.urlencode($title).'" target="_blank"></a>
|
646 |
+
</div>';
|
647 |
+
break;
|
648 |
+
default:
|
649 |
+
$url = 'http://del.icio.us/post?url='.urlencode($url).'&title='.urlencode($title);
|
650 |
+
$title = 'Save on Delicious';
|
651 |
+
$text = 'Save on Delicious';
|
652 |
+
$icon = 'delicious';
|
653 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
654 |
+
break;
|
655 |
}
|
656 |
+
return $retval;
|
657 |
+
}
|
658 |
+
|
659 |
+
function get_dg_digg($url, $title, $type, $id) {
|
660 |
+
switch ($type) {
|
661 |
+
case 'horizontal':
|
662 |
+
$retval = '
|
663 |
+
<a class="DiggThisButton DiggCompact" href="http://digg.com/submit?url='.urlencode($url).'&title='.urlencode($title).'"></a>';
|
664 |
+
break;
|
665 |
+
case 'vertical':
|
666 |
+
$retval = '
|
667 |
+
<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url='.urlencode($url).'&title='.urlencode($title).'"></a>';
|
668 |
+
break;
|
669 |
+
default:
|
670 |
+
$url = 'http://digg.com/submit?url='.urlencode($url).'&title='.urlencode($title);
|
671 |
+
$title = 'Digg This';
|
672 |
+
$text = 'Digg This';
|
673 |
+
$icon = 'digg';
|
674 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
675 |
+
break;
|
676 |
+
}
|
677 |
+
return $retval;
|
678 |
+
}
|
679 |
+
|
680 |
+
function get_rd_reddit($url, $title, $type, $id) {
|
681 |
+
switch ($type) {
|
682 |
+
case 'horizontal':
|
683 |
+
$retval = '
|
684 |
<script type="text/javascript">
|
685 |
reddit_url = "'.$url.'";
|
686 |
reddit_title = "'.$title.'";
|
687 |
</script>
|
688 |
<script type="text/javascript" src="http://www.reddit.com/static/button/button1.js"></script>';
|
689 |
+
break;
|
690 |
+
case 'vertical':
|
691 |
+
$retval = '
|
692 |
<script type="text/javascript">
|
693 |
reddit_url = "'.$url.'";
|
694 |
reddit_title = "'.$title.'";
|
695 |
</script>
|
696 |
<script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>';
|
697 |
+
break;
|
698 |
+
default:
|
699 |
+
$url = 'http://www.reddit.com/submit?url='.urlencode($url);
|
700 |
+
$title = 'Submit to reddit';
|
701 |
+
$text = 'Submit to reddit';
|
702 |
+
$icon = 'reddit';
|
703 |
+
$retval = $this->get_icon($type, $url, $title, $text, $icon, true);
|
704 |
+
break;
|
705 |
}
|
706 |
+
return $retval;
|
707 |
+
}
|
708 |
+
|
709 |
+
function get_ms_myspace($url, $title, $type, $id) {
|
710 |
+
$url = 'http://www.myspace.com/Modules/PostTo/Pages/?t='.urlencode($title).'&u='.urlencode($url);
|
711 |
+
$title = 'Share on Myspace';
|
712 |
+
$text = 'Share on Myspace';
|
713 |
+
$icon = 'myspace';
|
714 |
+
return $this->get_icon($type, $url, $title, $text, $icon, true);
|
715 |
+
}
|
716 |
+
|
717 |
+
function get_hv_respect($url, $title, $type, $id) {
|
718 |
+
$retval = '
|
719 |
+
<iframe src="http://www.hyves.nl/respect/button?url='.urlencode($url).'&title='.urlencode($title).'" style="border: medium none; overflow:hidden; width:150px; height:21px;" scrolling="no" frameborder="0" allowTransparency="true" ></iframe>';
|
720 |
+
return $retval;
|
721 |
+
}
|
722 |
+
|
723 |
+
function get_ml_send($url, $title, $type, $id) {
|
724 |
+
$url = 'mailto:?subject='.$title.'&body='.$url;
|
725 |
+
$title = 'Share via email';
|
726 |
+
$text = 'Share via email';
|
727 |
+
$icon = 'email';
|
728 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
729 |
+
}
|
730 |
+
|
731 |
+
function get_follow_facebook($type, $id) {
|
732 |
+
$url = 'http://www.facebook.com/'.$id;
|
733 |
+
$title = 'Friend me on Facebook';
|
734 |
+
$text = 'Facebook';
|
735 |
+
$icon = 'facebook';
|
736 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
737 |
+
}
|
738 |
+
|
739 |
+
function get_follow_twitter($type, $id) {
|
740 |
+
$url = 'http://twitter.com/'.$id;
|
741 |
+
$title = 'Follow me on Twitter';
|
742 |
+
$text = 'Twitter';
|
743 |
+
$icon = 'twitter';
|
744 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
745 |
+
}
|
746 |
+
|
747 |
+
function get_follow_plus($type, $id) {
|
748 |
+
$url = 'http://plus.google.com/'.$id;
|
749 |
+
$title = 'Add me to your circles';
|
750 |
+
$text = 'Google+';
|
751 |
+
$icon = 'googleplus';
|
752 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
753 |
+
}
|
754 |
+
|
755 |
+
function get_follow_linked($type, $id) {
|
756 |
+
$url = 'http://www.linkedin.com/in/'.$id;
|
757 |
+
$title = 'Connect to me on LinkedIn';
|
758 |
+
$text = 'LinkedIn';
|
759 |
+
$icon = 'linkedin';
|
760 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
761 |
+
}
|
762 |
+
|
763 |
+
function get_follow_tumblr($type, $id) {
|
764 |
+
$url = 'http://'.$id.'.tumblr.com';
|
765 |
+
$title = 'Follow me on Tumblr';
|
766 |
+
$text = 'Tumblr';
|
767 |
+
$icon = 'tumblr';
|
768 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
769 |
+
}
|
770 |
+
|
771 |
+
function get_follow_myspace($type, $id) {
|
772 |
+
$url = 'http://www.myspace.com/'.$id;
|
773 |
+
$title = 'Friend me on Myspace';
|
774 |
+
$text = 'Myspace';
|
775 |
+
$icon = 'myspace';
|
776 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
777 |
+
}
|
778 |
+
|
779 |
+
function get_follow_hyves($type, $id) {
|
780 |
+
$url = 'http://'.$id.'.hyves.nl';
|
781 |
+
$title = 'Friend me on Hyves';
|
782 |
+
$text = 'Hyves';
|
783 |
+
$icon = 'hyves';
|
784 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
785 |
+
}
|
786 |
+
|
787 |
+
function get_follow_youtube($type, $id) {
|
788 |
+
$url = 'http://www.youtube.com/user/'.$id;
|
789 |
+
$title = 'Watch me on YouTube';
|
790 |
+
$text = 'YouTube';
|
791 |
+
$icon = 'youtube';
|
792 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
793 |
+
}
|
794 |
+
|
795 |
+
function get_follow_flickr($type, $id) {
|
796 |
+
$url = 'http://www.flickr.com/photos/'.$id;
|
797 |
+
$title = 'My photostream on Flickr';
|
798 |
+
$text = 'Flickr';
|
799 |
+
$icon = 'flickr';
|
800 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
801 |
+
}
|
802 |
+
|
803 |
+
function get_follow_picasa($type, $id) {
|
804 |
+
$url = 'http://picasaweb.google.com/'.$id;
|
805 |
+
$title = 'My Picasa Web Albums';
|
806 |
+
$text = 'Picasa';
|
807 |
+
$icon = 'picasa';
|
808 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
809 |
+
}
|
810 |
+
|
811 |
+
function get_follow_deviant($type, $id) {
|
812 |
+
$url = 'http://'.$id.'.deviantart.com/';
|
813 |
+
$title = 'My deviantArt';
|
814 |
+
$text = 'deviantArt';
|
815 |
+
$icon = 'deviantart';
|
816 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
817 |
+
}
|
818 |
+
|
819 |
+
function get_follow_rss($type, $id) {
|
820 |
+
$url = $id;
|
821 |
+
$title = 'RSS Feed';
|
822 |
+
$text = 'RSS Feed';
|
823 |
+
$icon = 'rss';
|
824 |
+
return $this->get_icon($type, $url, $title, $text, $icon);
|
825 |
+
}
|
826 |
+
|
827 |
+
function get_icon($type, $url, $title, $text, $icon, $popup = false) {
|
828 |
+
if ($icon != 'email') {
|
829 |
+
$url .= '" target="_blank';
|
830 |
}
|
831 |
+
if ($popup) {
|
832 |
+
$url .= '" class="mr_social_sharing_popup_link';
|
|
|
|
|
|
|
833 |
}
|
834 |
+
switch ($type) {
|
835 |
+
case 'none':
|
836 |
+
$retval = '
|
837 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/buttons/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/></a>';
|
838 |
+
break;
|
839 |
+
case 'icon_small':
|
840 |
+
$retval = '
|
841 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_small/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/></a>';
|
842 |
+
break;
|
843 |
+
case 'icon_small_text':
|
844 |
+
$retval = '
|
845 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_small/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/><span class="mr_small_icon">'.$text.'</span></a>';
|
846 |
+
break;
|
847 |
+
case 'icon_medium':
|
848 |
+
$retval = '
|
849 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_medium/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/></a>';
|
850 |
+
break;
|
851 |
+
case 'icon_medium_text':
|
852 |
+
$retval = '
|
853 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_medium/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/><span class="mr_medium_icon">'.$text.'</span></a>';
|
854 |
+
break;
|
855 |
+
case 'icon_large':
|
856 |
+
$retval = '
|
857 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_large/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/></a>';
|
858 |
+
break;
|
859 |
+
default:
|
860 |
+
$retval = '
|
861 |
+
<a href="'.$url.'"><img src="'.plugins_url('/images/icons_small/'.$icon.'.png', __FILE__).'" alt="'.$title.'" title="'.$title.'"/></a>';
|
862 |
+
break;
|
863 |
+
}
|
864 |
+
return $retval;
|
865 |
}
|
866 |
|
867 |
function share($content) {
|
868 |
$type = get_post_type().'s';
|
869 |
+
if (($this->options['mr_social_sharing_types'] == $type || $this->options['mr_social_sharing_types'] == 'both') && (($type != 'pages' && (is_single() || $this->options['mr_social_sharing_include_excerpts'] == 1)) || $type == 'pages' && !is_single())) {
|
870 |
+
if ($this->options['mr_social_sharing_position'] == 'top') {
|
871 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
872 |
$content = $bookmarks.$content;
|
873 |
}
|
874 |
+
if ($this->options['mr_social_sharing_position'] == 'bottom') {
|
875 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
876 |
$content .= $bookmarks;
|
877 |
}
|
881 |
|
882 |
function share_shortcode() {
|
883 |
$bookmarks = '';
|
884 |
+
if ($this->options['mr_social_sharing_position'] == 'shortcode' && (is_single() || $this->options['mr_social_sharing_include_excerpts'] == 1)) {
|
885 |
$bookmarks = $this->create_bookmarks(get_permalink(), the_title('','',false));
|
886 |
}
|
887 |
return $bookmarks;
|
888 |
}
|
889 |
|
890 |
function should_linkify_content() {
|
891 |
+
if ($this->options['mr_social_sharing_linkify_content'] == 1) {
|
892 |
return true;
|
893 |
}
|
894 |
return false;
|
895 |
}
|
896 |
|
897 |
function should_linkify_comments() {
|
898 |
+
if ($this->options['mr_social_sharing_linkify_comments'] == 1) {
|
899 |
return true;
|
900 |
}
|
901 |
return false;
|
902 |
}
|
903 |
|
904 |
function linkify($content) {
|
905 |
+
if ($this->options['mr_social_sharing_twitter_handles'] == 1) {
|
906 |
$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);
|
907 |
}
|
908 |
+
if ($this->options['mr_social_sharing_twitter_hashtags'] == 1) {
|
909 |
$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);
|
910 |
}
|
911 |
return $content;
|
915 |
function MR_Social_Sharing_Toolkit_Widget() {
|
916 |
$widget_ops = array( 'classname' => 'MR_Social_Sharing_Toolkit_Widget', 'description' => '' );
|
917 |
$control_ops = array( 'id_base' => 'mr-social-sharing-toolkit-widget' );
|
918 |
+
$this->WP_Widget( 'mr-social-sharing-toolkit-widget', 'Social Sharing Toolkit Share Widget', $widget_ops, $control_ops );
|
919 |
}
|
920 |
|
921 |
function widget ( $args, $instance) {
|
922 |
extract( $args );
|
923 |
$MR_Social_Sharing_Toolkit = new MR_Social_Sharing_Toolkit();
|
|
|
924 |
$widget_title = empty($instance['widget_title']) ? '' : $instance['widget_title'];
|
925 |
+
$url = empty($instance['fixed_url']) ? '' : $instance['fixed_url'];
|
926 |
+
$title = empty($instance['fixed_title']) ? wp_title('', false) : $instance['fixed_title'];
|
927 |
+
$bookmarks = $MR_Social_Sharing_Toolkit->create_bookmarks($url, $title, 'widget_');
|
928 |
echo $before_widget;
|
929 |
if ($widget_title != '') {
|
930 |
echo $before_title . $widget_title . $after_title;
|
935 |
|
936 |
function update($new_instance, $old_instance) {
|
937 |
$instance = $old_instance;
|
|
|
938 |
$instance['widget_title'] = $new_instance['widget_title'];
|
939 |
+
$instance['fixed_title'] = $new_instance['fixed_title'];
|
940 |
+
$instance['fixed_url'] = $new_instance['fixed_url'];
|
941 |
return $instance;
|
942 |
}
|
943 |
|
944 |
function form($instance) {
|
945 |
+
$instance = wp_parse_args((array) $instance, array( 'widget_title' => '', 'fixed_title' => '', 'fixed_url' => ''));
|
946 |
echo '
|
947 |
<p>
|
948 |
<label for="'.$this->get_field_id( 'widget_title' ).'">Title:</label>
|
949 |
<input class="widefat" id="'.$this->get_field_id( 'widget_title' ).'" name="'.$this->get_field_name( 'widget_title' ).'" value="'.$instance['widget_title'].'" />
|
950 |
+
</p>
|
951 |
+
<p>
|
952 |
+
<label for="'.$this->get_field_id( 'fixed_title' ).'">Title:</label>
|
953 |
+
<input class="widefat" id="'.$this->get_field_id( 'fixed_title' ).'" name="'.$this->get_field_name( 'fixed_title' ).'" value="'.$instance['fixed_title'].'" />
|
954 |
+
</p>
|
955 |
+
<p>
|
956 |
+
<label for="'.$this->get_field_id( 'fixed_url' ).'">Url:</label>
|
957 |
+
<input class="widefat" id="'.$this->get_field_id( 'fixed_url' ).'" name="'.$this->get_field_name( 'fixed_url' ).'" value="'.$instance['fixed_url'].'" />
|
958 |
</p>
|
959 |
<p>
|
960 |
+
Further configuration is done via the <a href="options-general.php?page=mr_social_sharing#mr_social_sharing_widget_networks">plugin admin screen</a>.
|
961 |
+
</p>';
|
962 |
+
}
|
963 |
+
}
|
964 |
+
class MR_Social_Sharing_Toolkit_Follow_Widget extends WP_Widget {
|
965 |
+
function MR_Social_Sharing_Toolkit_Follow_Widget() {
|
966 |
+
$widget_ops = array( 'classname' => 'MR_Social_Sharing_Toolkit_Follow_Widget', 'description' => '' );
|
967 |
+
$control_ops = array( 'id_base' => 'mr-social-sharing-toolkit-follow-widget' );
|
968 |
+
$this->WP_Widget( 'mr-social-sharing-toolkit-follow-widget', 'Social Sharing Toolkit Follow Widget', $widget_ops, $control_ops );
|
969 |
+
}
|
970 |
+
|
971 |
+
function widget ( $args, $instance) {
|
972 |
+
extract( $args );
|
973 |
+
$MR_Social_Sharing_Toolkit = new MR_Social_Sharing_Toolkit();
|
974 |
+
$widget_title = empty($instance['widget_title']) ? '' : $instance['widget_title'];
|
975 |
+
$followers = $MR_Social_Sharing_Toolkit->create_followers();
|
976 |
+
echo $before_widget;
|
977 |
+
if ($widget_title != '') {
|
978 |
+
echo $before_title . $widget_title . $after_title;
|
979 |
+
}
|
980 |
+
echo $followers;
|
981 |
+
echo $after_widget;
|
982 |
+
}
|
983 |
+
|
984 |
+
function update($new_instance, $old_instance) {
|
985 |
+
$instance = $old_instance;
|
986 |
+
$instance['widget_title'] = $new_instance['widget_title'];
|
987 |
+
return $instance;
|
988 |
+
}
|
989 |
+
|
990 |
+
function form($instance) {
|
991 |
+
$instance = wp_parse_args((array) $instance, array( 'widget_title' => ''));
|
992 |
+
echo '
|
993 |
+
<p>
|
994 |
+
<label for="'.$this->get_field_id( 'widget_title' ).'">Title:</label>
|
995 |
+
<input class="widefat" id="'.$this->get_field_id( 'widget_title' ).'" name="'.$this->get_field_name( 'widget_title' ).'" value="'.$instance['widget_title'].'" />
|
996 |
</p>
|
997 |
<p>
|
998 |
+
Further configuration is done via the <a href="options-general.php?page=mr_social_sharing#mr_social_sharing_follow_networks">plugin admin screen</a>.
|
999 |
</p>';
|
1000 |
}
|
1001 |
}
|
1010 |
add_filter( 'the_content', array($MR_Social_Sharing_Toolkit, 'share'));
|
1011 |
}
|
1012 |
add_shortcode('social_share', array($MR_Social_Sharing_Toolkit, 'share_shortcode'));
|
1013 |
+
/* Register widgets */
|
1014 |
add_action('widgets_init', create_function('', 'return register_widget("MR_Social_Sharing_Toolkit_Widget");'));
|
1015 |
+
add_action('widgets_init', create_function('', 'return register_widget("MR_Social_Sharing_Toolkit_Follow_Widget");'));
|
1016 |
/* Register plugin admin page */
|
1017 |
add_action('admin_menu', array($MR_Social_Sharing_Toolkit, 'plugin_menu'));
|
style.css
CHANGED
@@ -1,63 +1,118 @@
|
|
1 |
-
div.
|
2 |
-
height: auto;
|
3 |
width: 100%;
|
4 |
-
|
5 |
-
margin: 0 !important;
|
6 |
padding: 0 !important;
|
7 |
border: 0 !important;
|
8 |
}
|
9 |
|
10 |
-
|
11 |
-
list-style-type: none !important;
|
12 |
-
float: left;
|
13 |
-
clear: both;
|
14 |
display: block;
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
margin: 0 !important;
|
19 |
padding: 0 !important;
|
20 |
-
border: 0 !important;
|
21 |
}
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
float: left;
|
26 |
-
width: auto;
|
27 |
-
height: 24px;
|
28 |
-
margin: 0 !important;
|
29 |
-
padding: 4px !important;
|
30 |
-
border: 0 !important;
|
31 |
}
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
38 |
margin: 0 !important;
|
39 |
padding: 0 !important;
|
40 |
border: 0 !important;
|
|
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
list-style-type: none !important;
|
45 |
-
float: left;
|
46 |
-
width: 64px;
|
47 |
-
height: 70px;
|
48 |
-
text-align: center;
|
49 |
margin: 0 !important;
|
50 |
padding: 0 !important;
|
51 |
border: 0 !important;
|
|
|
52 |
}
|
53 |
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
56 |
padding: 0 !important;
|
57 |
-
border: 0 !important;
|
58 |
}
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
1 |
+
div.mr_social_sharing_wrapper {
|
2 |
+
height: auto!important;
|
3 |
width: 100%;
|
4 |
+
margin: 4px 0 !important;
|
|
|
5 |
padding: 0 !important;
|
6 |
border: 0 !important;
|
7 |
}
|
8 |
|
9 |
+
div.mr_social_sharing, span.mr_social_sharing, div.mr_social_sharing_top, span.mr_social_sharing_top {
|
|
|
|
|
|
|
10 |
display: block;
|
11 |
+
height: auto !important;
|
12 |
+
vertical-align: bottom !important;
|
13 |
+
margin: 2px !important;
|
|
|
14 |
padding: 0 !important;
|
|
|
15 |
}
|
16 |
|
17 |
+
span.mr_social_sharing, span.mr_social_sharing_top {
|
18 |
+
display: inline-block;
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
+
div.mr_social_sharing_top, span.mr_social_sharing_top {
|
22 |
+
vertical-align: top !important;
|
23 |
+
}
|
24 |
+
|
25 |
+
a.mr_social_sharing_popup_link, a.mr_social_sharing_popup_link:HOVER {
|
26 |
+
display: inline-block;
|
27 |
margin: 0 !important;
|
28 |
padding: 0 !important;
|
29 |
border: 0 !important;
|
30 |
+
vertical-align: bottom !important;
|
31 |
}
|
32 |
|
33 |
+
.mr_social_sharing img, .mr_social_sharing_top img {
|
|
|
|
|
|
|
|
|
|
|
34 |
margin: 0 !important;
|
35 |
padding: 0 !important;
|
36 |
border: 0 !important;
|
37 |
+
vertical-align: bottom !important;
|
38 |
}
|
39 |
|
40 |
+
.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 {
|
41 |
+
display: inline-block;
|
42 |
+
font-family: 'Droid Sans',arial,sans-serif !important;
|
43 |
+
vertical-align: bottom !important;
|
44 |
+
font-size:10px !important;
|
45 |
+
font-weight: 200 !important;
|
46 |
+
margin: 4px 0 -4px 4px !important;
|
47 |
padding: 0 !important;
|
|
|
48 |
}
|
49 |
|
50 |
+
.mr_social_sharing span.mr_medium_icon, .mr_social_sharing_top span.mr_medium_icon {
|
51 |
+
font-size:12px !important;
|
52 |
+
}
|
53 |
+
|
54 |
+
.mr_social_sharing_top span.mr_small_icon, .mr_social_sharing_top span.mr_medium_icon {
|
55 |
+
vertical-align: top !important;
|
56 |
+
}
|
57 |
+
|
58 |
+
/* Delicious */
|
59 |
+
|
60 |
+
.delicious_vertical {
|
61 |
+
display:inline-block;
|
62 |
+
width: 50px !important;
|
63 |
+
height:60px !important;
|
64 |
+
padding: 0px;
|
65 |
+
margin: 0px;
|
66 |
+
text-align:center;
|
67 |
+
}
|
68 |
+
|
69 |
+
.delicious_vertical a {
|
70 |
+
display: block;
|
71 |
+
font-family:'Droid Sans',arial,sans-serif !important;
|
72 |
+
font-size:15px !important;
|
73 |
+
font-weight: 200 !important;
|
74 |
+
color: #7e7e7e !important;
|
75 |
+
background:transparent url(images/delicious_counters.png) no-repeat scroll left top !important;
|
76 |
+
padding:7px 0px 40px 0px !important;
|
77 |
+
width: 50px !important;
|
78 |
+
height:13px !important;
|
79 |
+
line-height:12px;
|
80 |
+
text-decoration: none;
|
81 |
+
}
|
82 |
+
|
83 |
+
.delicious_vertical a:hover {
|
84 |
+
color: #0090ff !important;
|
85 |
+
text-decoration: none !important;
|
86 |
+
}
|
87 |
+
|
88 |
+
.delicious_horizontal {
|
89 |
+
display:inline-block;
|
90 |
+
height:20px !important;
|
91 |
+
width:120px !important;
|
92 |
+
padding: 0px;
|
93 |
+
margin: 0px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.delicious_horizontal a {
|
97 |
+
display: block;
|
98 |
+
font-family:'Droid Sans',arial,sans-serif !important;
|
99 |
+
font-size:12px !important;
|
100 |
+
font-weight: 300 !important;
|
101 |
+
background:transparent url(images/delicious_counters.png) no-repeat scroll left bottom;
|
102 |
+
height:15px !important;
|
103 |
+
width:35px !important;
|
104 |
+
padding:0px 5px 5px 80px !important;
|
105 |
+
color: #7e7e7e !important;
|
106 |
+
text-decoration: none;
|
107 |
+
text-align:center;
|
108 |
+
white-space:nowrap;
|
109 |
+
}
|
110 |
+
|
111 |
+
.delicious_horizontal a:hover {
|
112 |
+
color: #0090ff !important;
|
113 |
+
text-decoration: none;
|
114 |
+
}
|
115 |
+
|
116 |
+
.delicious_vertical span.delicious_hash, .delicious_horizontal span.delicious_hash {
|
117 |
+
display: none !important;
|
118 |
}
|