Version Description
- New "Smart Load" feature to load buttons faster using async method.
- Can load button scripts after a specific time (Smart Load).
- Facebook button now uses HTML5 code instead of iframe.
- Facebook Send button now available.
- TinyMCE toolbar button now updated.
Download this release
Release Info
Developer | vaakash |
Plugin | WP Socializer |
Version | 2.4.5 |
Comparing to | |
See all releases |
Code changes from version 2.4.4 to 2.4.5
- admin/images/donate.png +0 -0
- admin/images/five-star.png +0 -0
- admin/js/tinymce/editor_plugin.js +1 -1
- admin/wpsr-admin-js.js +16 -1
- admin/wpsr-admin.php +29 -2
- includes/wpsr-addthis.php +12 -27
- includes/wpsr-digg.php +13 -29
- includes/wpsr-facebook.php +4 -27
- includes/wpsr-google.php +9 -20
- includes/wpsr-other.php +25 -31
- includes/wpsr-sharethis.php +7 -19
- includes/wpsr-shortcodes.php +15 -10
- public/js/wp-socializer-bookmark-js.js +1 -1
- public/js/wp-socializer-floating-bar-js.js +6 -4
- readme.txt +16 -7
- wp-socializer.php +71 -31
admin/images/donate.png
CHANGED
Binary file
|
admin/images/five-star.png
ADDED
Binary file
|
admin/js/tinymce/editor_plugin.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Added since WP Socializer v2.0
|
6 |
*/
|
7 |
function wpsr_insert_shortcode(type, edparam) {
|
8 |
-
var choice = prompt('Select the button to insert: \n\n1.Social buttons \n2.Addthis \n3.Sharethis \n4.Retweet \n5.Google
|
9 |
var btncode;
|
10 |
|
11 |
if (choice !== null) {
|
5 |
* Added since WP Socializer v2.0
|
6 |
*/
|
7 |
function wpsr_insert_shortcode(type, edparam) {
|
8 |
+
var choice = prompt('Select the button to insert: \n\n1.Social buttons \n2.Addthis \n3.Sharethis \n4.Retweet \n5.Google +1 \n6.Digg \n7.Facebook \n8.StumbleUpon \n9.Reddit \n10.LinkedIn \n11.Pinterest \n\nExample: 4 \n\n Please refer "http://bit.ly/wpsrParams" for parameters.', '');
|
9 |
var btncode;
|
10 |
|
11 |
if (choice !== null) {
|
admin/wpsr-admin-js.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/*
|
2 |
* WP Socializer - Admin page functions
|
3 |
* Author: Aakash Chakravarthy
|
4 |
-
* Version: 2.
|
5 |
*
|
6 |
*/
|
7 |
|
@@ -269,6 +269,21 @@ $j(document).ready(function(){
|
|
269 |
if($j('#wpsr_facebook_counter').val() == '1'){
|
270 |
$j('#wpsr_facebook_counterplacement').slideDown();
|
271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
// Live search
|
274 |
$j('#sbFilter').keyup(function(event){
|
1 |
/*
|
2 |
* WP Socializer - Admin page functions
|
3 |
* Author: Aakash Chakravarthy
|
4 |
+
* Version: 2.5
|
5 |
*
|
6 |
*/
|
7 |
|
269 |
if($j('#wpsr_facebook_counter').val() == '1'){
|
270 |
$j('#wpsr_facebook_counterplacement').slideDown();
|
271 |
}
|
272 |
+
|
273 |
+
// smartload settings
|
274 |
+
|
275 |
+
$j('#wpsr_lazload_timeout').hide();
|
276 |
+
$j('#wpsr_settings_smartload').change(function(){
|
277 |
+
if($j(this).val() == 'timeout'){
|
278 |
+
$j('#wpsr_lazload_timeout').slideDown();
|
279 |
+
}
|
280 |
+
if($j(this).val() != 'timeout'){
|
281 |
+
$j('#wpsr_lazload_timeout').slideUp();
|
282 |
+
}
|
283 |
+
});
|
284 |
+
if($j('#wpsr_settings_smartload').val() == 'timeout'){
|
285 |
+
$j('#wpsr_lazload_timeout').slideDown();
|
286 |
+
}
|
287 |
|
288 |
// Live search
|
289 |
$j('#sbFilter').keyup(function(event){
|
admin/wpsr-admin.php
CHANGED
@@ -18,7 +18,7 @@ add_action('admin_menu', 'wpsr_admin_menu');
|
|
18 |
|
19 |
## Load the Javascripts
|
20 |
function wpsr_admin_js() {
|
21 |
-
wp_register_script('wpsr-admin-js', WPSR_ADMIN_URL . 'wpsr-admin-js.js');
|
22 |
$pages = array('wp_socializer', 'wp_socializer_other', 'wp_socializer_floating_bar');
|
23 |
|
24 |
if (isset($_GET['page']) && (in_array($_GET['page'], $pages))){
|
@@ -83,7 +83,7 @@ echo
|
|
83 |
<span class="admSprites facebookIcon"></span>Facebook
|
84 |
<ul class="childMenu">
|
85 |
<li openTag="{facebook-like}">Like button</li>
|
86 |
-
<li
|
87 |
</ul>
|
88 |
</li>
|
89 |
|
@@ -305,6 +305,8 @@ function wpsr_reset_values(){
|
|
305 |
update_option("wpsr_template2_data", $wpsr_template2);
|
306 |
|
307 |
## Settings Defaults
|
|
|
|
|
308 |
$wpsr_settings['rssoutput'] = '';
|
309 |
$wpsr_settings['bitlyusername'] = '';
|
310 |
$wpsr_settings['bitlyapi'] = '';
|
@@ -453,6 +455,8 @@ function wpsr_admin_page(){
|
|
453 |
}
|
454 |
|
455 |
## Settings options
|
|
|
|
|
456 |
$wpsr_settings['rssurl'] = $_POST['wpsr_settings_rssurl'];
|
457 |
$wpsr_settings['bitlyusername'] = $_POST['wpsr_settings_bitlyusername'];
|
458 |
$wpsr_settings['bitlyapi'] = $_POST['wpsr_settings_bitlyapi'];
|
@@ -560,6 +564,12 @@ function wpsr_admin_page(){
|
|
560 |
|
561 |
<div class="startBt" data-tab="2"><span>Manual customization</span></div>
|
562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
</div>
|
564 |
|
565 |
<div class="rightCnt">
|
@@ -671,6 +681,23 @@ function wpsr_admin_page(){
|
|
671 |
</div><!-- Tab - 3-->
|
672 |
|
673 |
<div id="tab-4">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
<h3>RSS <?php _e('Settings', 'wpsr'); ?></h3>
|
675 |
<div class="section">
|
676 |
<table width="100%" height="39" border="0">
|
18 |
|
19 |
## Load the Javascripts
|
20 |
function wpsr_admin_js() {
|
21 |
+
wp_register_script('wpsr-admin-js', WPSR_ADMIN_URL . 'wpsr-admin-js.js?v=' . WPSR_VERSION);
|
22 |
$pages = array('wp_socializer', 'wp_socializer_other', 'wp_socializer_floating_bar');
|
23 |
|
24 |
if (isset($_GET['page']) && (in_array($_GET['page'], $pages))){
|
83 |
<span class="admSprites facebookIcon"></span>Facebook
|
84 |
<ul class="childMenu">
|
85 |
<li openTag="{facebook-like}">Like button</li>
|
86 |
+
<li openTag="{facebook-send}">Like button + Send button</li>
|
87 |
</ul>
|
88 |
</li>
|
89 |
|
305 |
update_option("wpsr_template2_data", $wpsr_template2);
|
306 |
|
307 |
## Settings Defaults
|
308 |
+
$wpsr_settings['smartload'] = 'normal';
|
309 |
+
$wpsr_settings['smartload_timeout'] = '1';
|
310 |
$wpsr_settings['rssoutput'] = '';
|
311 |
$wpsr_settings['bitlyusername'] = '';
|
312 |
$wpsr_settings['bitlyapi'] = '';
|
455 |
}
|
456 |
|
457 |
## Settings options
|
458 |
+
$wpsr_settings['smartload'] = $_POST['wpsr_settings_smartload'];
|
459 |
+
$wpsr_settings['smartload_timeout'] = $_POST['wpsr_settings_smartload_timeout'];
|
460 |
$wpsr_settings['rssurl'] = $_POST['wpsr_settings_rssurl'];
|
461 |
$wpsr_settings['bitlyusername'] = $_POST['wpsr_settings_bitlyusername'];
|
462 |
$wpsr_settings['bitlyapi'] = $_POST['wpsr_settings_bitlyapi'];
|
564 |
|
565 |
<div class="startBt" data-tab="2"><span>Manual customization</span></div>
|
566 |
|
567 |
+
<h5>Give 5 star rating</h5>
|
568 |
+
<p class="note">If you like this plugin then please give <a href="http://wordpress.org/extend/plugins/wp-socializer/" target="_blank"><img src="<?php echo WPSR_ADMIN_URL; ?>images/five-star.png" align="absmiddle"/></a> rating in the WP page to show the quality and worth of the plugin.</p>
|
569 |
+
|
570 |
+
<h5>Report bugs</h5>
|
571 |
+
<p class="note">If you notice a bug in the plugin, report it immediately in the <a href="http://www.aakashweb.com/forum/" target="_blank">Support Forum</a>.</p>
|
572 |
+
|
573 |
</div>
|
574 |
|
575 |
<div class="rightCnt">
|
681 |
</div><!-- Tab - 3-->
|
682 |
|
683 |
<div id="tab-4">
|
684 |
+
<h3>Smart load <small class="redText">New !</small></h3>
|
685 |
+
<div class="section">
|
686 |
+
<table width="100%" height="39" border="0">
|
687 |
+
<tr>
|
688 |
+
<td width="49%" height="35">Load the button scripts</td>
|
689 |
+
<td width="51%"><select id="wpsr_settings_smartload" name="wpsr_settings_smartload">
|
690 |
+
<option <?php echo $wpsr_settings['smartload'] == 'normal' ? ' selected="selected"' : ''; ?> value="normal">Normally (Async)</option>
|
691 |
+
<!--<option <?php echo $wpsr_settings['smartload'] == 'window' ? ' selected="selected"' : ''; ?> value="window">After window load</option>-->
|
692 |
+
<option <?php echo $wpsr_settings['smartload'] == 'timeout' ? ' selected="selected"' : ''; ?> value="timeout">After specific time</option>
|
693 |
+
</select>
|
694 |
+
<div id="wpsr_lazload_timeout">Load buttons script after: <input name="wpsr_settings_smartload_timeout" type="text" id="wpsr_settings_smartload_timeout" value="<?php echo $wpsr_settings['smartload_timeout']; ?>" size="2"/> seconds</div>
|
695 |
+
</td>
|
696 |
+
</tr>
|
697 |
+
</table>
|
698 |
+
<small class="grayText"><strong>Note:</strong> If the buttons fail to load, there might be a <abbr title="Javascript">JS</abbr> error in the page. This plugin is tested on various browsers and it seems to work fine. If you can't find a solution for the problem report it in the <a href="http://www.aakashweb.com/forum/" target="_blank">Support Forum</a></small>
|
699 |
+
</div>
|
700 |
+
|
701 |
<h3>RSS <?php _e('Settings', 'wpsr'); ?></h3>
|
702 |
<div class="section">
|
703 |
<table width="100%" height="39" border="0">
|
includes/wpsr-addthis.php
CHANGED
@@ -1,26 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Addthis button Processor code for WP Socializer Plugin
|
4 |
-
* Version : 2.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
8 |
-
function wpsr_addthis_is_used(){
|
9 |
-
## Get template data
|
10 |
-
$wpsr_template1 = get_option('wpsr_template1_data');
|
11 |
-
$wpsr_template2 = get_option('wpsr_template2_data');
|
12 |
-
|
13 |
-
$wpsr_template1_content = $wpsr_template1['content'] . $wpsr_template2['content'];
|
14 |
-
$is_addthis_used = strpos_arr($wpsr_template1_content, array("{addthis-bt}", "{addthis-tb-16px}", "{addthis-tb-32px}", "{addthis-sc}"));
|
15 |
-
|
16 |
-
if ($is_addthis_used === false){
|
17 |
-
return 0;
|
18 |
-
} else {
|
19 |
-
return 1;
|
20 |
-
}
|
21 |
-
|
22 |
-
}
|
23 |
-
|
24 |
function wpsr_addthis_uniqueid(){
|
25 |
$rand_no = dechex(mt_rand(0,min(0xffffffff,mt_getrandmax())));
|
26 |
$current_time = dechex(time());
|
@@ -34,7 +18,7 @@ function wpsr_addthis_uniqueid(){
|
|
34 |
return $unique_id;
|
35 |
}
|
36 |
|
37 |
-
function
|
38 |
## Get Addthis Options
|
39 |
$wpsr_addthis = get_option('wpsr_addthis_data');
|
40 |
|
@@ -47,9 +31,9 @@ function wpsr_addthis_script(){
|
|
47 |
|
48 |
# Config settings
|
49 |
if($wpsr_addthis['username'] == ''){
|
50 |
-
$wpsr_addthis_username = '
|
51 |
}else{
|
52 |
-
$wpsr_addthis_username = '
|
53 |
}
|
54 |
|
55 |
if($wpsr_addthis['language'] != 'lg-share-'){
|
@@ -80,7 +64,7 @@ function wpsr_addthis_script(){
|
|
80 |
$wpsr_addthis_clickback = 'data_track_clickback: false' . "\n";
|
81 |
}
|
82 |
|
83 |
-
$wpsr_addthis_config = $wpsr_addthis_btbrand . $wpsr_addthis_btheadclr . $wpsr_addthis_btheadbgclr . $wpsr_addthis_clickback;
|
84 |
|
85 |
$wpsr_addthis_settings =
|
86 |
"\n<script type=\"text/javascript\">\n" .
|
@@ -88,15 +72,16 @@ function wpsr_addthis_script(){
|
|
88 |
"var addthis_config = { \n" .
|
89 |
$wpsr_addthis_config .
|
90 |
"}\n//-->" .
|
91 |
-
"</script>\n"
|
92 |
-
'<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#' .
|
93 |
-
$wpsr_addthis_username .
|
94 |
-
'"></script>';
|
95 |
|
96 |
// Return the script
|
97 |
-
return "\n<!-- WP Socializer - AddThis
|
98 |
$wpsr_addthis_settings .
|
99 |
-
"
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
function wpsr_addthis($args = ''){
|
1 |
<?php
|
2 |
/*
|
3 |
* Addthis button Processor code for WP Socializer Plugin
|
4 |
+
* Version : 2.1
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
function wpsr_addthis_uniqueid(){
|
9 |
$rand_no = dechex(mt_rand(0,min(0xffffffff,mt_getrandmax())));
|
10 |
$current_time = dechex(time());
|
18 |
return $unique_id;
|
19 |
}
|
20 |
|
21 |
+
function wpsr_addthis_config(){
|
22 |
## Get Addthis Options
|
23 |
$wpsr_addthis = get_option('wpsr_addthis_data');
|
24 |
|
31 |
|
32 |
# Config settings
|
33 |
if($wpsr_addthis['username'] == ''){
|
34 |
+
$wpsr_addthis_username = 'username: "' . wpsr_addthis_uniqueid() . '"' . ",\n";
|
35 |
}else{
|
36 |
+
$wpsr_addthis_username = 'username: "' . $wpsr_addthis['username'] . '"' . ",\n";
|
37 |
}
|
38 |
|
39 |
if($wpsr_addthis['language'] != 'lg-share-'){
|
64 |
$wpsr_addthis_clickback = 'data_track_clickback: false' . "\n";
|
65 |
}
|
66 |
|
67 |
+
$wpsr_addthis_config = $wpsr_addthis_username . $wpsr_addthis_btbrand . $wpsr_addthis_btheadclr . $wpsr_addthis_btheadbgclr . $wpsr_addthis_clickback;
|
68 |
|
69 |
$wpsr_addthis_settings =
|
70 |
"\n<script type=\"text/javascript\">\n" .
|
72 |
"var addthis_config = { \n" .
|
73 |
$wpsr_addthis_config .
|
74 |
"}\n//-->" .
|
75 |
+
"</script>\n";
|
|
|
|
|
|
|
76 |
|
77 |
// Return the script
|
78 |
+
return "\n<!-- WP Socializer - AddThis Config -->" .
|
79 |
$wpsr_addthis_settings .
|
80 |
+
"<!-- WP Socializer - End AddThis Config -->\n";
|
81 |
+
}
|
82 |
+
|
83 |
+
function wpsr_addthis_script(){
|
84 |
+
return '<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js"></script>';
|
85 |
}
|
86 |
|
87 |
function wpsr_addthis($args = ''){
|
includes/wpsr-digg.php
CHANGED
@@ -1,40 +1,24 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Digg buttons Processor code for WP Socializer Plugin
|
4 |
-
* Version : 1.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
8 |
function wpsr_digg_script(){
|
9 |
// Return the script
|
10 |
-
return "
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
function wpsr_digg_bt_used(){
|
24 |
-
|
25 |
-
## Get template data
|
26 |
-
$wpsr_template1 = get_option('wpsr_template1_data');
|
27 |
-
$wpsr_template2 = get_option('wpsr_template2_data');
|
28 |
-
|
29 |
-
$wpsr_template1_content = $wpsr_template1['content'] . $wpsr_template2['content'];
|
30 |
-
$is_diggbt_used = strpos($wpsr_template1_content, '{digg-bt}');
|
31 |
-
|
32 |
-
if ($is_diggbt_used === false) {
|
33 |
-
return 0;
|
34 |
-
} else {
|
35 |
-
return 1;
|
36 |
-
}
|
37 |
-
|
38 |
}
|
39 |
|
40 |
function wpsr_digg($args = ''){
|
1 |
<?php
|
2 |
/*
|
3 |
* Digg buttons Processor code for WP Socializer Plugin
|
4 |
+
* Version : 1.1
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
8 |
function wpsr_digg_script(){
|
9 |
// Return the script
|
10 |
+
return "
|
11 |
+
<!-- WP Socializer - Digg Script -->\n" .
|
12 |
+
"<script type=\"text/javascript\">
|
13 |
+
(function() {
|
14 |
+
var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
|
15 |
+
s.type = 'text/javascript';
|
16 |
+
s.async = true;
|
17 |
+
s.src = 'http://widgets.digg.com/buttons.js';
|
18 |
+
s1.parentNode.insertBefore(s, s1);
|
19 |
+
})();
|
20 |
+
</script>" .
|
21 |
+
"\n<!-- WP Socializer - End Digg Script -->\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
function wpsr_digg($args = ''){
|
includes/wpsr-facebook.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Facebook buttons Processor code for WP Socializer Plugin
|
4 |
-
* Version : 1.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
@@ -37,32 +37,9 @@ function wpsr_facebook($args = ''){
|
|
37 |
switch($output){
|
38 |
// Output ordinary button
|
39 |
case 'button':
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
}
|
44 |
-
if ($style == 'standard' && $showfaces == 0){
|
45 |
-
$height = 35;
|
46 |
-
}
|
47 |
-
if ($style == 'button_count'){
|
48 |
-
$height = 21;
|
49 |
-
}
|
50 |
-
if ($style == 'box_count'){
|
51 |
-
$height = 62;
|
52 |
-
}
|
53 |
-
|
54 |
-
$facebook_processed .=
|
55 |
-
'<iframe src="http://www.facebook.com/plugins/like.php?' .
|
56 |
-
'&href=' . $url .
|
57 |
-
'&layout=' . $style .
|
58 |
-
'&show_faces=' . $showfaces .
|
59 |
-
'&width=' . $width .
|
60 |
-
'&action=' . $verb .
|
61 |
-
'&font=' . $font .
|
62 |
-
'&colorscheme=' . $color .
|
63 |
-
'&height=' . $height .
|
64 |
-
'&appId=' . $appid .
|
65 |
-
'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:' . $width . 'px; height:' . $height . 'px;" allowTransparency="true"></iframe>';
|
66 |
|
67 |
break;
|
68 |
|
1 |
<?php
|
2 |
/*
|
3 |
* Facebook buttons Processor code for WP Socializer Plugin
|
4 |
+
* Version : 1.8
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
37 |
switch($output){
|
38 |
// Output ordinary button
|
39 |
case 'button':
|
40 |
+
|
41 |
+
$facebook_processed .=
|
42 |
+
'<div class="fb-like" data-href="' . $url . '" data-send="' . (($type == 'send') ? 'true' : 'false') . '" data-layout="' . $style . '" data-width="' . $width . '" data-show-faces="' . $showfaces . '" data-action="' . $verb . '" data-font="' . $font . '" data-colorscheme="' . $color . '"></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
break;
|
45 |
|
includes/wpsr-google.php
CHANGED
@@ -1,32 +1,21 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Google +1 button Processor code for WP Socializer Plugin
|
4 |
-
* Version : 3.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
8 |
function wpsr_plusone_script(){
|
9 |
// Return the script
|
10 |
return "\n<!-- WP Socializer - +1 Script -->\n".
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$wpsr_template2 = get_option('wpsr_template2_data');
|
20 |
-
|
21 |
-
$wpsr_template_content = $wpsr_template1['content'] . $wpsr_template2['content'];
|
22 |
-
$is_plusonebt_used = strpos_arr($wpsr_template_content, array('{plusone-small}', '{plusone-medium}', '{plusone-standard}', '{plusone-tall}'));
|
23 |
-
|
24 |
-
if ($is_plusonebt_used === false) {
|
25 |
-
return 0;
|
26 |
-
} else {
|
27 |
-
return 1;
|
28 |
-
}
|
29 |
-
|
30 |
}
|
31 |
|
32 |
function wpsr_plusone($args = ''){
|
1 |
<?php
|
2 |
/*
|
3 |
* Google +1 button Processor code for WP Socializer Plugin
|
4 |
+
* Version : 3.1
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
8 |
function wpsr_plusone_script(){
|
9 |
// Return the script
|
10 |
return "\n<!-- WP Socializer - +1 Script -->\n".
|
11 |
+
"<script type=\"text/javascript\">
|
12 |
+
(function() {
|
13 |
+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
14 |
+
po.src = 'https://apis.google.com/js/plusone.js';
|
15 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
16 |
+
})();
|
17 |
+
</script>".
|
18 |
+
"\n<!-- WP Socializer - End +1 Script -->\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
function wpsr_plusone($args = ''){
|
includes/wpsr-other.php
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Pinterest, Reddit, StumbleUpon and LinkedIn buttons Processor code for WP Socializer Plugin
|
4 |
-
* Version : 2.
|
5 |
* Since v2.0
|
6 |
* Author : Aakash Chakravarthy
|
7 |
*/
|
8 |
|
9 |
// StumbleUpon button
|
10 |
function wpsr_stumbleupon_script(){
|
11 |
-
return "
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
function wpsr_stumbleupon($args = ''){
|
@@ -87,9 +90,10 @@ function wpsr_stumbleupon_rss_bt(){
|
|
87 |
|
88 |
// Pinterest button
|
89 |
function wpsr_pinterest_script(){
|
90 |
-
return "
|
91 |
-
|
92 |
-
|
|
|
93 |
}
|
94 |
|
95 |
function wpsr_pinterest($args = ''){
|
@@ -237,26 +241,16 @@ function wpsr_reddit_rss_bt(){
|
|
237 |
// LinkedIn button
|
238 |
function wpsr_linkedin_script(){
|
239 |
// Return the script
|
240 |
-
return "
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
$wpsr_template_content = $wpsr_template1['content'] . $wpsr_template2['content'];
|
252 |
-
$is_linkedin_used = strpos_arr($wpsr_template_content, array('{linkedin-standard}', '{linkedin-right}', '{linkedin-top}'));
|
253 |
-
|
254 |
-
if ($is_linkedin_used === false) {
|
255 |
-
return 0;
|
256 |
-
} else {
|
257 |
-
return 1;
|
258 |
-
}
|
259 |
-
|
260 |
}
|
261 |
|
262 |
function wpsr_linkedin($args = ''){
|
1 |
<?php
|
2 |
/*
|
3 |
* Pinterest, Reddit, StumbleUpon and LinkedIn buttons Processor code for WP Socializer Plugin
|
4 |
+
* Version : 2.3
|
5 |
* Since v2.0
|
6 |
* Author : Aakash Chakravarthy
|
7 |
*/
|
8 |
|
9 |
// StumbleUpon button
|
10 |
function wpsr_stumbleupon_script(){
|
11 |
+
return "
|
12 |
+
<!-- WP Socializer - StumbleUpon Script -->
|
13 |
+
<script type=\"text/javascript\">
|
14 |
+
(function() {
|
15 |
+
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
|
16 |
+
li.src = window.location.protocol + '//platform.stumbleupon.com/1/widgets.js';
|
17 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
|
18 |
+
})();
|
19 |
+
</script>
|
20 |
+
<!-- WP Socializer - StumbleUpon Script -->\n";
|
21 |
}
|
22 |
|
23 |
function wpsr_stumbleupon($args = ''){
|
90 |
|
91 |
// Pinterest button
|
92 |
function wpsr_pinterest_script(){
|
93 |
+
return "
|
94 |
+
<!-- WP Socializer - Pinterest Script -->\n" .
|
95 |
+
'<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>'.
|
96 |
+
"\n<!-- WP Socializer - Pinterest Script -->\n";
|
97 |
}
|
98 |
|
99 |
function wpsr_pinterest($args = ''){
|
241 |
// LinkedIn button
|
242 |
function wpsr_linkedin_script(){
|
243 |
// Return the script
|
244 |
+
return "
|
245 |
+
<!-- WP Socializer - LinkedIn Script -->\n".
|
246 |
+
"<script type=\"text/javascript\">
|
247 |
+
(function() {
|
248 |
+
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
249 |
+
po.src = 'http://platform.linkedin.com/in.js';
|
250 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
251 |
+
})();
|
252 |
+
</script>".
|
253 |
+
"\n<!-- WP Socializer - End LinkedIn Script -->\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
}
|
255 |
|
256 |
function wpsr_linkedin($args = ''){
|
includes/wpsr-sharethis.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Sharethis buttons Processor code for WP Socializer Plugin
|
4 |
-
* Version : 2.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
@@ -18,7 +18,7 @@ function wpsr_sharethis_pubkey(){
|
|
18 |
return $key;
|
19 |
}
|
20 |
|
21 |
-
function
|
22 |
## Sharethis options
|
23 |
$wpsr_sharethis = get_option('wpsr_sharethis_data');
|
24 |
|
@@ -26,25 +26,13 @@ function wpsr_sharethis_script(){
|
|
26 |
$wpsr_sharethis_pubkey = ($wpsr_sharethis_pubkey == '') ? wpsr_sharethis_pubkey() : $wpsr_sharethis_pubkey;
|
27 |
|
28 |
// Return the script
|
29 |
-
return "\n<!-- WP Socializer - ShareThis
|
30 |
-
'<script
|
31 |
-
"\n<!-- WP Socializer - End ShareThis
|
32 |
}
|
33 |
|
34 |
-
function
|
35 |
-
|
36 |
-
$wpsr_template1 = get_option('wpsr_template1_data');
|
37 |
-
$wpsr_template2 = get_option('wpsr_template2_data');
|
38 |
-
|
39 |
-
$wpsr_template1_content = $wpsr_template1['content'] . $wpsr_template2['content'];
|
40 |
-
$is_sharethis_used = strpos_arr($wpsr_template1_content, array("{sharethis-large}", "{sharethis-hcount}", "{sharethis-vcount}", "{sharethis-regular}", "{sharethis-regular2}", "{sharethis-bt}", "{sharethis-classic}"));
|
41 |
-
|
42 |
-
if ($is_sharethis_used === false) {
|
43 |
-
return 0;
|
44 |
-
} else {
|
45 |
-
return 1;
|
46 |
-
}
|
47 |
-
|
48 |
}
|
49 |
|
50 |
function wpsr_sharethis($args = ''){
|
1 |
<?php
|
2 |
/*
|
3 |
* Sharethis buttons Processor code for WP Socializer Plugin
|
4 |
+
* Version : 2.2
|
5 |
* Author : Aakash Chakravarthy
|
6 |
*/
|
7 |
|
18 |
return $key;
|
19 |
}
|
20 |
|
21 |
+
function wpsr_sharethis_config(){
|
22 |
## Sharethis options
|
23 |
$wpsr_sharethis = get_option('wpsr_sharethis_data');
|
24 |
|
26 |
$wpsr_sharethis_pubkey = ($wpsr_sharethis_pubkey == '') ? wpsr_sharethis_pubkey() : $wpsr_sharethis_pubkey;
|
27 |
|
28 |
// Return the script
|
29 |
+
return "\n<!-- WP Socializer - ShareThis Config -->\n" .
|
30 |
+
'<script type="text/javascript">stLight.options({publisher:\'' . $wpsr_sharethis_pubkey . '\'});var st_type=\'wordpress\';</script>' .
|
31 |
+
"\n<!-- WP Socializer - End ShareThis Config -->\n";
|
32 |
}
|
33 |
|
34 |
+
function wpsr_sharethis_script(){
|
35 |
+
return '<script charset="utf-8" type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
function wpsr_sharethis($args = ''){
|
includes/wpsr-shortcodes.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Shortcodes for WP Socializer plugin
|
4 |
-
* Version : 2.
|
5 |
* Author : Aakash Chakravarthy
|
6 |
* Since : 2.0
|
7 |
*/
|
@@ -14,22 +14,22 @@ add_shortcode('wpsr_socialbts', 'wpsr_socialbts_shortcode');
|
|
14 |
|
15 |
## Addthis button Shortcode
|
16 |
function wpsr_addthis_shortcode($atts){
|
17 |
-
return wpsr_addthis($atts) . wpsr_addthis_script();
|
18 |
}
|
19 |
add_shortcode('wpsr_addthis', 'wpsr_addthis_shortcode');
|
20 |
|
21 |
## Sharethis button Shortcode
|
22 |
function wpsr_sharethis_shortcode($atts){
|
23 |
-
return wpsr_sharethis($atts) .
|
24 |
}
|
25 |
add_shortcode('wpsr_sharethis', 'wpsr_sharethis_shortcode');
|
26 |
|
27 |
## Retweet button Shortcode
|
28 |
function wpsr_retweet_shortcode($atts){
|
29 |
if($atts['service'] == 'twitter' || $atts['service'] == ''){
|
30 |
-
$script = wpsr_retweet_twitter_script();
|
31 |
}elseif($atts['service'] == 'topsy'){
|
32 |
-
$script = wpsr_retweet_topsy_script();
|
33 |
}elseif($atts['service'] == 'tweetmeme' || $atts['service'] == 'retweet'){
|
34 |
$script = '';
|
35 |
}
|
@@ -46,13 +46,15 @@ add_shortcode('wpsr_buzz', 'wpsr_buzz_shortcode');
|
|
46 |
|
47 |
## Google Plusone button Shortcode
|
48 |
function wpsr_plusone_shortcode($atts){
|
49 |
-
|
|
|
50 |
}
|
51 |
add_shortcode('wpsr_plusone', 'wpsr_plusone_shortcode');
|
52 |
|
53 |
## Digg button Shortcode
|
54 |
function wpsr_digg_shortcode($atts){
|
55 |
-
|
|
|
56 |
}
|
57 |
add_shortcode('wpsr_digg', 'wpsr_digg_shortcode');
|
58 |
|
@@ -64,7 +66,8 @@ add_shortcode('wpsr_facebook', 'wpsr_facebook_shortcode');
|
|
64 |
|
65 |
## StumbleUpon Shortcode
|
66 |
function wpsr_stumbleupon_shortcode($atts){
|
67 |
-
|
|
|
68 |
}
|
69 |
add_shortcode('wpsr_stumbleupon', 'wpsr_stumbleupon_shortcode');
|
70 |
|
@@ -76,13 +79,15 @@ add_shortcode('wpsr_reddit', 'wpsr_reddit_shortcode');
|
|
76 |
|
77 |
## LinkedIn Shortcode - since v2.3
|
78 |
function wpsr_linkedin_shortcode($atts){
|
79 |
-
|
|
|
80 |
}
|
81 |
add_shortcode('wpsr_linkedin', 'wpsr_linkedin_shortcode');
|
82 |
|
83 |
## Pinterest Shortcode - since v2.4
|
84 |
function wpsr_pinterest_shortcode($atts){
|
85 |
-
|
|
|
86 |
}
|
87 |
add_shortcode('wpsr_pinterest', 'wpsr_pinterest_shortcode');
|
88 |
|
1 |
<?php
|
2 |
/*
|
3 |
* Shortcodes for WP Socializer plugin
|
4 |
+
* Version : 2.3
|
5 |
* Author : Aakash Chakravarthy
|
6 |
* Since : 2.0
|
7 |
*/
|
14 |
|
15 |
## Addthis button Shortcode
|
16 |
function wpsr_addthis_shortcode($atts){
|
17 |
+
return wpsr_addthis($atts) . wpsr_addthis_config() . wpsr_addthis_script();
|
18 |
}
|
19 |
add_shortcode('wpsr_addthis', 'wpsr_addthis_shortcode');
|
20 |
|
21 |
## Sharethis button Shortcode
|
22 |
function wpsr_sharethis_shortcode($atts){
|
23 |
+
return wpsr_sharethis($atts) . wpsr_sharethis_config() . wpsr_sharethis_config();
|
24 |
}
|
25 |
add_shortcode('wpsr_sharethis', 'wpsr_sharethis_shortcode');
|
26 |
|
27 |
## Retweet button Shortcode
|
28 |
function wpsr_retweet_shortcode($atts){
|
29 |
if($atts['service'] == 'twitter' || $atts['service'] == ''){
|
30 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_retweet_twitter_script();
|
31 |
}elseif($atts['service'] == 'topsy'){
|
32 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_retweet_topsy_script();
|
33 |
}elseif($atts['service'] == 'tweetmeme' || $atts['service'] == 'retweet'){
|
34 |
$script = '';
|
35 |
}
|
46 |
|
47 |
## Google Plusone button Shortcode
|
48 |
function wpsr_plusone_shortcode($atts){
|
49 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_plusone_script();
|
50 |
+
return wpsr_plusone($atts) . $script;
|
51 |
}
|
52 |
add_shortcode('wpsr_plusone', 'wpsr_plusone_shortcode');
|
53 |
|
54 |
## Digg button Shortcode
|
55 |
function wpsr_digg_shortcode($atts){
|
56 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_digg_script();
|
57 |
+
return wpsr_digg($atts) . $script;
|
58 |
}
|
59 |
add_shortcode('wpsr_digg', 'wpsr_digg_shortcode');
|
60 |
|
66 |
|
67 |
## StumbleUpon Shortcode
|
68 |
function wpsr_stumbleupon_shortcode($atts){
|
69 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_stumbleupon_script();
|
70 |
+
return wpsr_stumbleupon($atts) . $script;
|
71 |
}
|
72 |
add_shortcode('wpsr_stumbleupon', 'wpsr_stumbleupon_shortcode');
|
73 |
|
79 |
|
80 |
## LinkedIn Shortcode - since v2.3
|
81 |
function wpsr_linkedin_shortcode($atts){
|
82 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_linkedin_script();
|
83 |
+
return wpsr_linkedin($atts) . $script;
|
84 |
}
|
85 |
add_shortcode('wpsr_linkedin', 'wpsr_linkedin_shortcode');
|
86 |
|
87 |
## Pinterest Shortcode - since v2.4
|
88 |
function wpsr_pinterest_shortcode($atts){
|
89 |
+
$script = ($atts['script'] == "0") ? '' : wpsr_pinterest_script();
|
90 |
+
return wpsr_pinterest($atts) . $script;
|
91 |
}
|
92 |
add_shortcode('wpsr_pinterest', 'wpsr_pinterest_shortcode');
|
93 |
|
public/js/wp-socializer-bookmark-js.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
* Copyright
|
3 |
* Created for WP Socializer - Wordpress Plugin
|
4 |
*/
|
5 |
|
1 |
/*
|
2 |
+
* Copyright 2012 Aakash Chakravarthy - www.aakashweb.com
|
3 |
* Created for WP Socializer - Wordpress Plugin
|
4 |
*/
|
5 |
|
public/js/wp-socializer-floating-bar-js.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/*
|
2 |
* Copyright 2012 Aakash Chakravarthy - www.aakashweb.com
|
3 |
* Created for WP Socializer - Wordpress Plugin
|
4 |
-
* v1.
|
5 |
*/
|
6 |
|
7 |
if(typeof jQuery == 'undefined'){
|
@@ -49,9 +49,11 @@ jQuery(document).ready(function(){
|
|
49 |
wpsr_position_floatbar();
|
50 |
});
|
51 |
|
52 |
-
window.
|
53 |
-
wpsr_position_floatbar
|
54 |
-
|
|
|
|
|
55 |
|
56 |
wpsr_position_floatbar();
|
57 |
|
1 |
/*
|
2 |
* Copyright 2012 Aakash Chakravarthy - www.aakashweb.com
|
3 |
* Created for WP Socializer - Wordpress Plugin
|
4 |
+
* v1.3
|
5 |
*/
|
6 |
|
7 |
if(typeof jQuery == 'undefined'){
|
49 |
wpsr_position_floatbar();
|
50 |
});
|
51 |
|
52 |
+
if(window.addEventListener){
|
53 |
+
window.addEventListener("load", wpsr_position_floatbar, false);}
|
54 |
+
else if (window.attachEvent){
|
55 |
+
window.attachEvent("onload", wpsr_position_floatbar);
|
56 |
+
}
|
57 |
|
58 |
wpsr_position_floatbar();
|
59 |
|
readme.txt
CHANGED
@@ -6,8 +6,8 @@ Tags: social, social bookmarking, bookmarks, bookmarking, bookmarks menu, share,
|
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: http://bit.ly/wpsrDonate
|
8 |
Requires at least: 2.8
|
9 |
-
Tested up to: 3.4.
|
10 |
-
Stable tag: 2.4.
|
11 |
|
12 |
Super Cool Plugin for inserting all kinds of Social Bookmarking & Sharing buttons. Has customizable Floating Share Bar, Widgets, Shortcodes also.
|
13 |
|
@@ -19,15 +19,17 @@ WP Socializer is an advanced plugin for inserting all kinds of Social bookmarkin
|
|
19 |
|
20 |
* Insert all kinds of social buttons in posts & pages.
|
21 |
* **Floating share bar** (both horizontal & vertical)
|
|
|
22 |
* Has Shortcodes for all buttons.
|
23 |
* Widgets for inserting FB like box & G+ badges in sidebar.
|
24 |
* Template functions are available for advanced placements.
|
25 |
|
26 |
-
= New in v2.4.
|
27 |
-
*
|
28 |
-
*
|
29 |
-
*
|
30 |
-
*
|
|
|
31 |
|
32 |
[youtube="http://www.youtube.com/v/1uimAE8rFYE"]
|
33 |
|
@@ -105,6 +107,13 @@ For custom placement in theme files and posts, check out the following documenta
|
|
105 |
|
106 |
== Changelog ==
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
= 2.4.4 =
|
109 |
* New CSS3 on-hover effects for social bookmarking buttons (Magnify and Jump).
|
110 |
* New "Comments" button for the floating share bar.
|
6 |
License: GPLv2 or later
|
7 |
Donate Link: http://bit.ly/wpsrDonate
|
8 |
Requires at least: 2.8
|
9 |
+
Tested up to: 3.4.2
|
10 |
+
Stable tag: 2.4.5
|
11 |
|
12 |
Super Cool Plugin for inserting all kinds of Social Bookmarking & Sharing buttons. Has customizable Floating Share Bar, Widgets, Shortcodes also.
|
13 |
|
19 |
|
20 |
* Insert all kinds of social buttons in posts & pages.
|
21 |
* **Floating share bar** (both horizontal & vertical)
|
22 |
+
* Faster and Optimized loading with **Smart load** feature.
|
23 |
* Has Shortcodes for all buttons.
|
24 |
* Widgets for inserting FB like box & G+ badges in sidebar.
|
25 |
* Template functions are available for advanced placements.
|
26 |
|
27 |
+
= New in v2.4.5 =
|
28 |
+
* All the Buttons now load faster with "Smart Load" async feature.
|
29 |
+
* Load button scripts after a specific time (Smart Load).
|
30 |
+
* Facebook button now uses HTML5 code instead of iframe.
|
31 |
+
* Facebook Send button now available.
|
32 |
+
* TinyMCE toolbar button now updated.
|
33 |
|
34 |
[youtube="http://www.youtube.com/v/1uimAE8rFYE"]
|
35 |
|
107 |
|
108 |
== Changelog ==
|
109 |
|
110 |
+
= 2.4.5 =
|
111 |
+
* New "Smart Load" feature to load buttons faster using async method.
|
112 |
+
* Can load button scripts after a specific time (Smart Load).
|
113 |
+
* Facebook button now uses HTML5 code instead of iframe.
|
114 |
+
* Facebook Send button now available.
|
115 |
+
* TinyMCE toolbar button now updated.
|
116 |
+
|
117 |
= 2.4.4 =
|
118 |
* New CSS3 on-hover effects for social bookmarking buttons (Magnify and Jump).
|
119 |
* New "Comments" button for the floating share bar.
|
wp-socializer.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Socializer
|
4 |
-
Version: 2.4.
|
5 |
Plugin URI: http://www.aakashweb.com/
|
6 |
-
Description: WP Socializer is an advanced plugin for inserting all kinds of Social bookmarking & sharing buttons. It has super cool features to insert the buttons into posts, sidebar. It also has Floating sharebar. <a href="http://youtu.be/1uimAE8rFYE" target="_blank">Check out the demo video</a>.
|
7 |
Author: Aakash Chakravarthy
|
8 |
Author URI: http://www.aakashweb.com/
|
9 |
*/
|
@@ -14,7 +14,7 @@ if(!defined('WP_CONTENT_URL')) {
|
|
14 |
$wpsr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
|
15 |
}
|
16 |
|
17 |
-
define('WPSR_VERSION', '2.4.
|
18 |
define('WPSR_AUTHOR', 'Aakash Chakravarthy');
|
19 |
define('WPSR_URL', $wpsr_url);
|
20 |
define('WPSR_PUBLIC_URL', WPSR_URL . 'public/');
|
@@ -927,36 +927,36 @@ $wpsr_default_templates = array(
|
|
927 |
|
928 |
$wpsr_floating_bar_bts = array(
|
929 |
'Retweet' => array(
|
930 |
-
'float_left' => '[wpsr_retweet service="twitter" type="normal"]',
|
931 |
-
'bottom_fixed' => '[wpsr_retweet service="twitter"]',
|
932 |
),
|
933 |
'Google +1' => array(
|
934 |
-
'float_left' => '[wpsr_plusone type="tall"]',
|
935 |
-
'bottom_fixed' => '[wpsr_plusone type="medium"]',
|
936 |
),
|
937 |
'Digg' => array(
|
938 |
-
'float_left' => '[wpsr_digg type="DiggMedium"]',
|
939 |
-
'bottom_fixed' => '[wpsr_digg type="DiggCompact"]',
|
940 |
),
|
941 |
'Facebook' => array(
|
942 |
'float_left' => '[wpsr_facebook style="box_count" width="48"]', // Added "width" in v2.4.2
|
943 |
'bottom_fixed' => '[wpsr_facebook style="button_count"]',
|
944 |
),
|
945 |
'StumbleUpon' => array(
|
946 |
-
'float_left' => '[wpsr_stumbleupon type="5"]',
|
947 |
-
'bottom_fixed' => '[wpsr_stumbleupon type="1"]',
|
948 |
),
|
949 |
'Reddit' => array(
|
950 |
'float_left' => '[wpsr_reddit type="2"]',
|
951 |
'bottom_fixed' => '[wpsr_reddit type="1"]',
|
952 |
),
|
953 |
'LinkedIn' => array(
|
954 |
-
'float_left' => '[wpsr_linkedin type="top"]',
|
955 |
-
'bottom_fixed' => '[wpsr_linkedin type="right"]',
|
956 |
),
|
957 |
'Pinterest' => array(
|
958 |
-
'float_left' => '[wpsr_pinterest type="vertical"]',
|
959 |
-
'bottom_fixed' => '[wpsr_pinterest type="horizontal"]',
|
960 |
),
|
961 |
'Comments' => array(
|
962 |
'float_left' => '[wpsr_commentsbt type="vertical"]',
|
@@ -1240,7 +1240,7 @@ function wpsr_process_template($no, $rss = 0){
|
|
1240 |
wpsr_sharethis_bt('regular'), wpsr_sharethis_bt('regular2'), wpsr_sharethis_bt('buttons'),
|
1241 |
wpsr_sharethis_bt('classic'), wpsr_plusone_bt('small'), wpsr_plusone_bt('medium'),
|
1242 |
wpsr_plusone_bt('standard'), wpsr_plusone_bt('tall'), wpsr_retweet_bt(),
|
1243 |
-
wpsr_digg_bt(), wpsr_facebook_bt('like'), ''
|
1244 |
wpsr_reddit_bt('1'), wpsr_reddit_bt('2'), wpsr_reddit_bt('3'),
|
1245 |
wpsr_stumbleupon_bt('1'), wpsr_stumbleupon_bt('2'), wpsr_stumbleupon_bt('3'),
|
1246 |
wpsr_stumbleupon_bt('5'), wpsr_linkedin_bt('standard'), wpsr_linkedin_bt('right'),
|
@@ -1419,7 +1419,7 @@ function wpsr_button_used($name){
|
|
1419 |
|
1420 |
## Add the button scripts to the header
|
1421 |
function wpsr_scripts_adder(){
|
1422 |
-
|
1423 |
## Social Button options
|
1424 |
$wpsr_socialbt = get_option('wpsr_socialbt_data');
|
1425 |
$wpsr_socialbt_loadcss = $wpsr_socialbt['loadcss'];
|
@@ -1432,38 +1432,81 @@ function wpsr_scripts_adder(){
|
|
1432 |
$wpsr_retweet = get_option('wpsr_retweet_data');
|
1433 |
$wpsr_retweet_service = $wpsr_retweet['service'];
|
1434 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1435 |
if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'topsy'){
|
1436 |
-
|
1437 |
}
|
1438 |
|
1439 |
if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'twitter'){
|
1440 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1441 |
}
|
1442 |
|
1443 |
if(wpsr_button_used('digg') == 1){
|
1444 |
-
|
1445 |
}
|
1446 |
|
1447 |
if(wpsr_button_used('addthis') == 1){
|
1448 |
-
echo
|
|
|
1449 |
}
|
1450 |
|
1451 |
if(wpsr_button_used('sharethis') == 1){
|
1452 |
-
echo
|
|
|
1453 |
}
|
1454 |
|
1455 |
if(wpsr_button_used('plusone') == 1){
|
1456 |
-
|
1457 |
}
|
1458 |
|
1459 |
if(wpsr_button_used('linkedin') == 1){
|
1460 |
-
|
1461 |
}
|
1462 |
|
1463 |
if(wpsr_button_used('stumbleupon') == 1){
|
1464 |
-
|
1465 |
}
|
1466 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1467 |
}
|
1468 |
|
1469 |
## Add the misc/small scripts to the footer
|
@@ -1471,10 +1514,6 @@ function wpsr_footer(){
|
|
1471 |
if(wpsr_addtofavorites_bt_used()){
|
1472 |
wpsr_addtofavorites_script();
|
1473 |
}
|
1474 |
-
|
1475 |
-
if(wpsr_button_used('pinterest') == 1){
|
1476 |
-
echo wpsr_pinterest_script();
|
1477 |
-
}
|
1478 |
}
|
1479 |
|
1480 |
if(!$wpsr_settings['disablewpsr']){
|
@@ -1485,6 +1524,7 @@ if(!$wpsr_settings['disablewpsr']){
|
|
1485 |
}
|
1486 |
|
1487 |
add_action('wp_footer', 'wpsr_footer');
|
|
|
1488 |
}
|
1489 |
|
1490 |
## Add notification to the dashboard right now
|
@@ -1544,7 +1584,7 @@ function wpsr_register_wpsrbutton_tinymce($buttons) {
|
|
1544 |
}
|
1545 |
|
1546 |
function wpsr_add_wpsrbutton_tinymce($plugin_array) {
|
1547 |
-
$plugin_array['wpsrbutton'] = WPSR_ADMIN_URL . 'js/tinymce/editor_plugin.js';
|
1548 |
return $plugin_array;
|
1549 |
}
|
1550 |
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Socializer
|
4 |
+
Version: 2.4.5
|
5 |
Plugin URI: http://www.aakashweb.com/
|
6 |
+
Description: WP Socializer is an advanced plugin for inserting all kinds of Social bookmarking & sharing buttons. It has super cool features to insert the buttons into posts, sidebar. It also has Floating sharebar and Smart load feature. <a href="http://youtu.be/1uimAE8rFYE" target="_blank">Check out the demo video</a>.
|
7 |
Author: Aakash Chakravarthy
|
8 |
Author URI: http://www.aakashweb.com/
|
9 |
*/
|
14 |
$wpsr_url = WP_CONTENT_URL . '/plugins/' . plugin_basename(dirname(__FILE__)) . '/';
|
15 |
}
|
16 |
|
17 |
+
define('WPSR_VERSION', '2.4.5');
|
18 |
define('WPSR_AUTHOR', 'Aakash Chakravarthy');
|
19 |
define('WPSR_URL', $wpsr_url);
|
20 |
define('WPSR_PUBLIC_URL', WPSR_URL . 'public/');
|
927 |
|
928 |
$wpsr_floating_bar_bts = array(
|
929 |
'Retweet' => array(
|
930 |
+
'float_left' => '[wpsr_retweet service="twitter" type="normal" script="0"]',
|
931 |
+
'bottom_fixed' => '[wpsr_retweet service="twitter" script="0"]',
|
932 |
),
|
933 |
'Google +1' => array(
|
934 |
+
'float_left' => '[wpsr_plusone type="tall" script="0"]',
|
935 |
+
'bottom_fixed' => '[wpsr_plusone type="medium" script="0"]',
|
936 |
),
|
937 |
'Digg' => array(
|
938 |
+
'float_left' => '[wpsr_digg type="DiggMedium" script="0"]',
|
939 |
+
'bottom_fixed' => '[wpsr_digg type="DiggCompact" script="0"]',
|
940 |
),
|
941 |
'Facebook' => array(
|
942 |
'float_left' => '[wpsr_facebook style="box_count" width="48"]', // Added "width" in v2.4.2
|
943 |
'bottom_fixed' => '[wpsr_facebook style="button_count"]',
|
944 |
),
|
945 |
'StumbleUpon' => array(
|
946 |
+
'float_left' => '[wpsr_stumbleupon type="5" script="0"]',
|
947 |
+
'bottom_fixed' => '[wpsr_stumbleupon type="1" script="0"]',
|
948 |
),
|
949 |
'Reddit' => array(
|
950 |
'float_left' => '[wpsr_reddit type="2"]',
|
951 |
'bottom_fixed' => '[wpsr_reddit type="1"]',
|
952 |
),
|
953 |
'LinkedIn' => array(
|
954 |
+
'float_left' => '[wpsr_linkedin type="top" script="0"]',
|
955 |
+
'bottom_fixed' => '[wpsr_linkedin type="right" script="0"]',
|
956 |
),
|
957 |
'Pinterest' => array(
|
958 |
+
'float_left' => '[wpsr_pinterest type="vertical" script="0"]',
|
959 |
+
'bottom_fixed' => '[wpsr_pinterest type="horizontal" script="0"]',
|
960 |
),
|
961 |
'Comments' => array(
|
962 |
'float_left' => '[wpsr_commentsbt type="vertical"]',
|
1240 |
wpsr_sharethis_bt('regular'), wpsr_sharethis_bt('regular2'), wpsr_sharethis_bt('buttons'),
|
1241 |
wpsr_sharethis_bt('classic'), wpsr_plusone_bt('small'), wpsr_plusone_bt('medium'),
|
1242 |
wpsr_plusone_bt('standard'), wpsr_plusone_bt('tall'), wpsr_retweet_bt(),
|
1243 |
+
wpsr_digg_bt(), wpsr_facebook_bt('like'), wpsr_facebook_bt('send'),
|
1244 |
wpsr_reddit_bt('1'), wpsr_reddit_bt('2'), wpsr_reddit_bt('3'),
|
1245 |
wpsr_stumbleupon_bt('1'), wpsr_stumbleupon_bt('2'), wpsr_stumbleupon_bt('3'),
|
1246 |
wpsr_stumbleupon_bt('5'), wpsr_linkedin_bt('standard'), wpsr_linkedin_bt('right'),
|
1419 |
|
1420 |
## Add the button scripts to the header
|
1421 |
function wpsr_scripts_adder(){
|
1422 |
+
|
1423 |
## Social Button options
|
1424 |
$wpsr_socialbt = get_option('wpsr_socialbt_data');
|
1425 |
$wpsr_socialbt_loadcss = $wpsr_socialbt['loadcss'];
|
1432 |
$wpsr_retweet = get_option('wpsr_retweet_data');
|
1433 |
$wpsr_retweet_service = $wpsr_retweet['service'];
|
1434 |
|
1435 |
+
## Get Facebook Options
|
1436 |
+
$wpsr_facebook = get_option('wpsr_facebook_data');
|
1437 |
+
|
1438 |
+
# Get the settings
|
1439 |
+
$wpsr_settings = get_option('wpsr_settings_data');
|
1440 |
+
|
1441 |
+
$scripts = array();
|
1442 |
+
|
1443 |
if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'topsy'){
|
1444 |
+
array_push($scripts, '"http://cdn.topsy.com/topsy.js?init=topsyWidgetCreator"');
|
1445 |
}
|
1446 |
|
1447 |
if(wpsr_button_used('retweet') == 1 && $wpsr_retweet_service == 'twitter'){
|
1448 |
+
array_push($scripts, '"http://platform.twitter.com/widgets.js"');
|
1449 |
+
}
|
1450 |
+
|
1451 |
+
if(wpsr_button_used('facebook') == 1){
|
1452 |
+
$fbappid = $wpsr_facebook['appid'];
|
1453 |
+
$fbparam = ($fbappid == '') ? '' : '&appId=' . $fbappid;
|
1454 |
+
array_push($scripts, '"http://connect.facebook.net/en_US/all.js#xfbml=1' . $fbparam . '"');
|
1455 |
}
|
1456 |
|
1457 |
if(wpsr_button_used('digg') == 1){
|
1458 |
+
array_push($scripts, '"http://widgets.digg.com/buttons.js"');
|
1459 |
}
|
1460 |
|
1461 |
if(wpsr_button_used('addthis') == 1){
|
1462 |
+
echo wpsr_addthis_config();
|
1463 |
+
array_push($scripts, '"http://s7.addthis.com/js/300/addthis_widget.js"');
|
1464 |
}
|
1465 |
|
1466 |
if(wpsr_button_used('sharethis') == 1){
|
1467 |
+
echo wpsr_sharethis_config();
|
1468 |
+
array_push($scripts, '"http://w.sharethis.com/button/buttons.js"');
|
1469 |
}
|
1470 |
|
1471 |
if(wpsr_button_used('plusone') == 1){
|
1472 |
+
array_push($scripts, '"https://apis.google.com/js/plusone.js"');
|
1473 |
}
|
1474 |
|
1475 |
if(wpsr_button_used('linkedin') == 1){
|
1476 |
+
array_push($scripts, '"http://platform.linkedin.com/in.js"');
|
1477 |
}
|
1478 |
|
1479 |
if(wpsr_button_used('stumbleupon') == 1){
|
1480 |
+
array_push($scripts, '"http://platform.stumbleupon.com/1/widgets.js"');
|
1481 |
}
|
1482 |
+
|
1483 |
+
if(wpsr_button_used('pinterest') == 1){
|
1484 |
+
array_push($scripts, '"http://assets.pinterest.com/js/pinit.js"');
|
1485 |
+
}
|
1486 |
+
|
1487 |
+
$scriptsCount = count($scripts);
|
1488 |
+
$scriptsVar = implode(',', $scripts);
|
1489 |
+
|
1490 |
+
if($wpsr_settings['smartload'] == 'normal' || $wpsr_settings['smartload'] == ''){
|
1491 |
+
$scriptsFnc = 'wpsrload();';
|
1492 |
+
/*}elseif($wpsr_settings['smartload'] == 'window'){
|
1493 |
+
$scriptsFnc = 'function wpsraddload(a){if(window.addEventListener){window.addEventListener("load", a, false);}else if (window.attachEvent){window.attachEvent("onload", a);}} wpsraddload(wpsrload);';*/
|
1494 |
+
}elseif($wpsr_settings['smartload'] == 'timeout'){
|
1495 |
+
$scriptsFnc = 'setTimeout(wpsrload, ' . $wpsr_settings['smartload_timeout']*1000 . ');';
|
1496 |
+
}
|
1497 |
+
|
1498 |
+
if(!empty($scripts)){
|
1499 |
+
echo "\n<!--WP Socializer v" . WPSR_VERSION . " - Scripts Loader-->";
|
1500 |
+
echo '
|
1501 |
+
<script type="text/javascript">
|
1502 |
+
var wu=[' . $scriptsVar . '],wc=' . $scriptsCount . ';
|
1503 |
+
function wpsrload(){ for(var i=0;i<wc;i++){wpsrasync(wu[i]);} }
|
1504 |
+
function wpsrasync(u){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src=u;var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(a,s);} ' . $scriptsFnc . '
|
1505 |
+
</script>
|
1506 |
+
';
|
1507 |
+
echo "<!--End WP Socializer - Scripts Loader-->\n";
|
1508 |
+
}
|
1509 |
+
|
1510 |
}
|
1511 |
|
1512 |
## Add the misc/small scripts to the footer
|
1514 |
if(wpsr_addtofavorites_bt_used()){
|
1515 |
wpsr_addtofavorites_script();
|
1516 |
}
|
|
|
|
|
|
|
|
|
1517 |
}
|
1518 |
|
1519 |
if(!$wpsr_settings['disablewpsr']){
|
1524 |
}
|
1525 |
|
1526 |
add_action('wp_footer', 'wpsr_footer');
|
1527 |
+
|
1528 |
}
|
1529 |
|
1530 |
## Add notification to the dashboard right now
|
1584 |
}
|
1585 |
|
1586 |
function wpsr_add_wpsrbutton_tinymce($plugin_array) {
|
1587 |
+
$plugin_array['wpsrbutton'] = WPSR_ADMIN_URL . 'js/tinymce/editor_plugin.js?v=' . WPSR_VERSION;
|
1588 |
return $plugin_array;
|
1589 |
}
|
1590 |
|