Version Description
- New streamlined and simplified share menu
- Added Instant Share for Facebook and Twitter
- Updated Pinterest support
- Bug fixes
Download this release
Release Info
Developer | solchea |
Plugin | WordPress Share Buttons Plugin – AddThis |
Version | 2.5.0 |
Comparing to | |
See all releases |
Code changes from version 2.4.3 to 2.5.0
- addthis_settings_functions.php +39 -0
- addthis_social_widget.php +188 -105
- css/options-page.css +27 -0
- img/update.png +0 -0
- includes/addthis_addjs.php +8 -13
- js/options-page.32.js +33 -1
- js/options-page.js +35 -1
- readme.txt +13 -4
addthis_settings_functions.php
CHANGED
@@ -62,6 +62,45 @@ function addthis_kses($string)
|
|
62 |
|
63 |
return $new_string;
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
/**
|
67 |
* The icon choser row. Should be made to look a bit prettier
|
62 |
|
63 |
return $new_string;
|
64 |
}
|
65 |
+
/**
|
66 |
+
* Add this version notification message
|
67 |
+
* @param int $atversion_update_status
|
68 |
+
* @param int $atversion
|
69 |
+
*/
|
70 |
+
function _addthis_version_notification($atversion_update_status, $atversion)
|
71 |
+
{
|
72 |
+
//Fresh install Scenario. ie., atversion = 300 without reverting back.
|
73 |
+
if($atversion_update_status == ADDTHIS_ATVERSION_AUTO_UPDATE && $atversion >= ADDTHIS_ATVERSION) {
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
$imgLocationBase = apply_filters( 'addthis_files_uri', plugins_url( '' , basename(dirname(__FILE__)))) . '/addthis/img/' ;
|
77 |
+
ob_start();
|
78 |
+
// In the automatic update by the system the $atversion_update_status is 0
|
79 |
+
// On subsequent update using notification link the $atversion_update_status = -1
|
80 |
+
// In both cases display the revert link
|
81 |
+
if ($atversion_update_status == ADDTHIS_ATVERSION_AUTO_UPDATE || $atversion_update_status == ADDTHIS_ATVERSION_MANUAL_UPDATE) {
|
82 |
+
?>
|
83 |
+
<div class="addthis-notification addthis-success-message">
|
84 |
+
<div style="float:left">Your AddThis sharing plugin has been updated.</div>
|
85 |
+
<div style="float:right">
|
86 |
+
<a href="#" class="addthis-revert-atversion">Revert back to previous version</a>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
<?php
|
90 |
+
} else {
|
91 |
+
?>
|
92 |
+
<div class="addthis-notification addthis-warning-message">
|
93 |
+
<div style="float:left">Update AddThis to activate new features that will make sharing even easier.</div>
|
94 |
+
<div style="float:right">
|
95 |
+
<a href="#" class="addthis-update-atversion"><img src="<?php echo $imgLocationBase . 'update.png';?>" /></a>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
<?php
|
99 |
+
}
|
100 |
+
$notification_content = ob_get_contents();
|
101 |
+
ob_end_clean();
|
102 |
+
return $notification_content;
|
103 |
+
}
|
104 |
|
105 |
/**
|
106 |
* The icon choser row. Should be made to look a bit prettier
|
addthis_social_widget.php
CHANGED
@@ -23,17 +23,17 @@
|
|
23 |
* Plugin Name: AddThis Social Bookmarking Widget
|
24 |
* Plugin URI: http://www.addthis.com
|
25 |
* Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
|
26 |
-
* Version: 2.
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
30 |
*/
|
31 |
-
|
32 |
if (!defined('ADDTHIS_INIT')) define('ADDTHIS_INIT', 1);
|
33 |
else return;
|
34 |
|
35 |
|
36 |
// Setup our shared resources early
|
|
|
37 |
add_action('init', 'addthis_early', 1);
|
38 |
function addthis_early(){
|
39 |
global $addthis_addjs;
|
@@ -46,7 +46,11 @@ function addthis_early(){
|
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
-
define( 'ADDTHIS_PLUGIN_VERSION', '2.
|
|
|
|
|
|
|
|
|
50 |
|
51 |
$addthis_settings = array();
|
52 |
$addthis_settings['isdropdown'] = 'true';
|
@@ -56,6 +60,7 @@ $addthis_settings['language'] = 'en';
|
|
56 |
$addthis_settings['username'] = '';
|
57 |
$addthis_settings['fallback_username'] = '';
|
58 |
$addthis_settings['style'] = 'share';
|
|
|
59 |
|
60 |
$addthis_languages = array(''=>'Automatic','af'=>'Afrikaaner', 'ar'=>'Arabic', 'zh'=>'Chinese', 'cs'=>'Czech', 'da'=>'Danish', 'nl'=>'Dutch', 'en'=>'English', 'fa'=>'Farsi', 'fi'=>'Finnish', 'fr'=>'French', 'ga'=>'Gaelic', 'de'=>'German', 'el'=>'Greek', 'he'=>'Hebrew', 'hi'=>'Hindi', 'it'=>'Italian', 'ja'=>'Japanese', 'ko'=>'Korean', 'lv'=>'Latvian', 'lt'=>'Lithuanian', 'no'=>'Norwegian', 'pl'=>'Polish', 'pt'=>'Portugese', 'ro'=>'Romanian', 'ru'=>'Russian', 'sk'=>'Slovakian', 'sl'=>'Slovenian', 'es'=>'Spanish', 'sv'=>'Swedish', 'th'=>'Thai', 'ur'=>'Urdu', 'cy'=>'Welsh', 'vi'=>'Vietnamese');
|
61 |
|
@@ -79,13 +84,13 @@ $addthis_new_styles = array(
|
|
79 |
), // 32x32
|
80 |
'plus_one_share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style" %s ><a class="addthis_button_google_plusone" g:plusone:size="medium" ></a><a class="addthis_counter addthis_pill_style"></a></div>', 'img' => 'plusone-share.gif', 'name' => 'Plus One and Share Counter', 'above'=> 'hidden', 'below'=>'hidden' , 'defaultHide' => true
|
81 |
), // +1
|
82 |
-
'small_toolbox_with_share' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a href="//addthis.com/bookmark.php?v=
|
83 |
), // Plus sign share | four buttons
|
84 |
'fb_tw_sc' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>' , 'img' => 'fb-tw-sc.jpg' , 'name' => 'Like, Tweet, Counter', 'above' => 'hidden', 'below' => 'hidden', 'defaultHide' => true
|
85 |
), // facebook tweet share counter
|
86 |
-
'simple_button' => array('src' => '<div class="addthis_toolbox addthis_default_style " %s><a href="//addthis.com/bookmark.php?v=
|
87 |
), // Plus sign share
|
88 |
-
'button' => array( 'src' => '<div><a class="addthis_button" href="//addthis.com/bookmark.php?v=
|
89 |
), // classic
|
90 |
'share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_counter"></a></div>', 'img' => 'share_counter.png', 'name' => 'Share Counter', 'above' => 'hidden ', 'below' => 'hidden' , 'defaultHide' => true
|
91 |
),
|
@@ -93,6 +98,10 @@ $addthis_new_styles = array(
|
|
93 |
|
94 |
|
95 |
//add_filter('the_title', 'at_title_check');
|
|
|
|
|
|
|
|
|
96 |
function at_title_check($title)
|
97 |
{
|
98 |
|
@@ -111,14 +120,10 @@ function at_title_check($title)
|
|
111 |
}
|
112 |
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
function addthis_script_to_content($content)
|
123 |
{
|
124 |
global $addthis_did_script_output;
|
@@ -131,12 +136,20 @@ function addthis_script_to_content($content)
|
|
131 |
return $content ;
|
132 |
}
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
/**
|
135 |
* Converts our old many options in to one beautiful array
|
136 |
*
|
137 |
*/
|
138 |
|
139 |
-
// Caution: Using this filter to disable upgrades may have unexpected
|
140 |
if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters( 'addthis_do_options_upgrades', '__return_true') )
|
141 |
{
|
142 |
function addthis_options_200()
|
@@ -188,8 +201,12 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
188 |
$addthis_new_options['addthis_brand'] = $brand;
|
189 |
if ($language = get_option('addthis_language'))
|
190 |
$addthis_new_options['addthis_language'] = $language;
|
191 |
-
|
192 |
-
|
|
|
|
|
|
|
|
|
193 |
// Above is new, set it to none
|
194 |
$addthis_new_options['above'] = 'none';
|
195 |
|
@@ -216,16 +233,14 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
216 |
delete_option('addthis_header_color');
|
217 |
delete_option('addthis_sidebar_only');
|
218 |
delete_option('addthis_brand');
|
219 |
-
delete_option('addthis_language')
|
|
|
220 |
|
221 |
|
222 |
global $current_user;
|
223 |
$user_id = $current_user->ID;
|
224 |
|
225 |
add_user_meta($user_id, 'addthis_nag_updated_options', 'true', true);
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
}
|
230 |
|
231 |
function addthis_options_210()
|
@@ -235,7 +250,6 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
235 |
$options['profile'] = $options['username'];
|
236 |
|
237 |
update_option( 'addthis_settings', $options);
|
238 |
-
|
239 |
}
|
240 |
|
241 |
function addthis_options_240()
|
@@ -243,11 +257,10 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
243 |
$options = get_option('addthis_settings');
|
244 |
|
245 |
// Add An option for the AT Version
|
246 |
-
$options['atversion'] =
|
247 |
-
|
248 |
//$options['wpfooter'] = false;
|
249 |
update_option( 'addthis_settings', $options);
|
250 |
-
|
251 |
}
|
252 |
}
|
253 |
|
@@ -283,7 +296,6 @@ function addthis_get_wp_version() {
|
|
283 |
* For templates, we need a wrapper for printing out the code on demand.
|
284 |
*/
|
285 |
function addthis_print_widget($url=null, $title=null, $style = addthis_style_default ) {
|
286 |
-
|
287 |
global $addthis_styles, $addthis_new_styles;
|
288 |
$styles = array_merge($addthis_styles, $addthis_new_styles);
|
289 |
|
@@ -295,8 +307,6 @@ function addthis_print_widget($url=null, $title=null, $style = addthis_style_def
|
|
295 |
$identifier = addthis_get_identifier($url, $title);
|
296 |
|
297 |
echo "\n<!-- AddThis Custom -->\n";
|
298 |
-
|
299 |
-
|
300 |
if ( ! is_array($style) && isset($addthis_new_styles[$style]) ){
|
301 |
echo sprintf($addthis_new_styles[$style]['src'], $identifier);
|
302 |
}
|
@@ -532,7 +542,7 @@ function addthis_render_dashboard_widget() {
|
|
532 |
$password = urlencode($options['password']);
|
533 |
else
|
534 |
{
|
535 |
-
echo 'No
|
536 |
return false;
|
537 |
}
|
538 |
$domain = get_home_url();
|
@@ -576,7 +586,7 @@ function addthis_render_dashboard_widget() {
|
|
576 |
|
577 |
if ( is_wp_error( $stats[$metric.$dimension.$period] ) )
|
578 |
{
|
579 |
-
echo "There was an error retrieving your stats from the AddThis servers. Please wait and try again in a few moments
|
580 |
if (defined(WP_DEBUG) && WP_DEBUG == TRUE)
|
581 |
echo "Error Code:" . $stats[$metric.$dimension.$period]->get_error_code();
|
582 |
|
@@ -585,19 +595,19 @@ function addthis_render_dashboard_widget() {
|
|
585 |
|
586 |
else if ($stats[$metric.$dimension.$period]['response']['code'] == 401 )
|
587 |
{
|
588 |
-
echo "The
|
589 |
-
echo "Please confirm that you have correctly entered your AddThis username, password and profile
|
590 |
exit;
|
591 |
}
|
592 |
else if ( $stats[$metric.$dimension.$period]['response']['code'] == 500)
|
593 |
{
|
594 |
-
echo "Something has gone terribly wrong! This should never happen, but somehow did. We are working to correct it right now. We will get everything up again soon";
|
595 |
exit;
|
596 |
}
|
597 |
|
598 |
else if ($stats[$metric.$dimension.$period]['response']['code'] == 501 )
|
599 |
{
|
600 |
-
echo "There was an error retrieving your analytics. If you wait a momeent and try again, you should be all set
|
601 |
exit;
|
602 |
}
|
603 |
else if ($stats[$metric.$dimension.$period]['response']['code'] != 201 )
|
@@ -650,29 +660,37 @@ function addthis_render_dashboard_widget() {
|
|
650 |
}
|
651 |
$lastmonth['viral'] = ($lastmonth['shares'] > 0 && $lastmonth['clickbacks'] ) ? $lastmonth['clickbacks'] / $lastmonth['shares'] * 100 . '%' : 'n/a';
|
652 |
|
653 |
-
|
654 |
$services['shares'] = json_decode($stats['shares/servicemonth']['body']);
|
|
|
655 |
$services['clickbacks'] = json_decode($stats['clickbacks/servicemonth']['body']);
|
656 |
-
|
|
|
|
|
657 |
{
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
}
|
670 |
-
|
671 |
-
|
672 |
-
$servicesCharts[$type] = '//chart.apis.google.com/chart?&chdlp=b&chs=118x145&cht=p3&chco=BA3A1C|F75C39|424242&chf=bg,s,00000000&'.
|
673 |
-
'chdl='.$firstLabel.'|'.$secondLabel.'|'.$thirdLabel.'&'.
|
674 |
-
'chd=t:'.$firstAmount.','.$secondAmount.','.$thirdAmount;
|
675 |
-
}
|
676 |
|
677 |
|
678 |
echo "<div id='at_tabs'>";
|
@@ -922,8 +940,10 @@ if ( isset ($data['data_ga_property']) && strlen($data['data_ga_property']) != 0
|
|
922 |
$options['data_ga_property'] = sanitize_text_field($data['data_ga_property']);
|
923 |
|
924 |
//[addthis_twitter_template]
|
925 |
-
if ( isset ($data['addthis_twitter_template']) && strlen($data['addthis_twitter_template']) != 0 )
|
926 |
-
|
|
|
|
|
927 |
|
928 |
if (isset ($data['addthis_bitly_login']) && strlen($data['addthis_bitly_login']) != 0 )
|
929 |
$options['addthis_bitly_login'] = sanitize_text_field($data['addthis_bitly_login']);
|
@@ -946,6 +966,14 @@ if ( isset ($data['addthis_language']))
|
|
946 |
$options['addthis_language'] = sanitize_text_field($data['addthis_language']);
|
947 |
|
948 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
949 |
if ( isset ($data['addthis_header_background']) && strlen($data['addthis_header_background']) != 0 )
|
950 |
{
|
951 |
if (! strpos($data['addthis_header_background'], '#') === 0)
|
@@ -1060,6 +1088,10 @@ function addthis_init()
|
|
1060 |
|
1061 |
}
|
1062 |
|
|
|
|
|
|
|
|
|
1063 |
function addthis_set_addthis_settings()
|
1064 |
{
|
1065 |
global $addthis_settings;
|
@@ -1079,6 +1111,9 @@ function addthis_set_addthis_settings()
|
|
1079 |
|
1080 |
$language = get_option('addthis_language');
|
1081 |
$addthis_settings['language'] = $language;
|
|
|
|
|
|
|
1082 |
|
1083 |
$advopts = array('brand', 'append_data', 'language', 'header_background', 'header_color');
|
1084 |
$addthis_settings['customization'] = '';
|
@@ -1089,7 +1124,6 @@ function addthis_set_addthis_settings()
|
|
1089 |
if (isset($val) && strlen($val)) $addthis_settings['customization'] .= "var addthis_$opt = '$val';";
|
1090 |
}
|
1091 |
$addthis_settings['options'] = get_option('addthis_options');
|
1092 |
-
|
1093 |
}
|
1094 |
|
1095 |
add_action('wp_dashboard_setup', 'addthis_dashboard_init' );
|
@@ -1170,6 +1204,10 @@ function addthis_remove_tag($content, $text = '')
|
|
1170 |
}
|
1171 |
}
|
1172 |
|
|
|
|
|
|
|
|
|
1173 |
function addthis_late_widget($link_text)
|
1174 |
{
|
1175 |
remove_filter('get_the_excerpt', 'addthis_late_widget');
|
@@ -1230,10 +1268,13 @@ function addthis_display_social_widget_excerpt($content)
|
|
1230 |
else
|
1231 |
$options = get_option('addthis_settings');
|
1232 |
|
1233 |
-
|
1234 |
-
|
|
|
|
|
|
|
1235 |
return addthis_display_social_widget($content, true, true);
|
1236 |
-
else
|
1237 |
return $content;
|
1238 |
}
|
1239 |
|
@@ -1266,6 +1307,7 @@ function addthis_display_social_widget($content, $filtered = true, $below_excerp
|
|
1266 |
$display = true;
|
1267 |
else
|
1268 |
$display = false;
|
|
|
1269 |
$custom_fields = get_post_custom($post->ID);
|
1270 |
if (isset ($custom_fields['addthis_exclude']) && $custom_fields['addthis_exclude'][0] == 'true')
|
1271 |
$display = false;
|
@@ -1386,6 +1428,7 @@ function addthis_register_script_in_addjs(){
|
|
1386 |
*/
|
1387 |
function addthis_output_script($return = false, $justConfig = false )
|
1388 |
{
|
|
|
1389 |
global $addthis_settings;
|
1390 |
|
1391 |
if ( isset($_GET['preview']) && $_GET['preview'] == 1 && $options = get_transient('addthis_settings') )
|
@@ -1395,7 +1438,7 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1395 |
|
1396 |
$script = "\n<!-- AddThis Button Begin -->\n"
|
1397 |
.'<script type="text/javascript">'
|
1398 |
-
."var addthis_product = 'wpp-
|
1399 |
|
1400 |
|
1401 |
$pub = (isset($options['profile'])) ? $options['profile'] : false ;
|
@@ -1407,26 +1450,17 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1407 |
$addthis_config = array();
|
1408 |
$addthis_share = array();
|
1409 |
|
1410 |
-
|
1411 |
-
$addthis_config["data_track_clickback"] = true;
|
1412 |
-
else
|
1413 |
-
$addthis_config["data_track_clickback"] = false;
|
1414 |
|
1415 |
if ( isset($options['data_ga_property']) ){
|
1416 |
$addthis_config['data_ga_property'] = $options['data_ga_property'];
|
1417 |
$addthis_config['data_ga_social'] = true;
|
1418 |
}
|
1419 |
|
1420 |
-
|
1421 |
-
$addthis_config["data_track_addressbar"] = true;
|
1422 |
-
else
|
1423 |
-
$addthis_config["data_track_addressbar"] = false;
|
1424 |
|
1425 |
// Opt in
|
1426 |
-
|
1427 |
-
$addthis_config['data_track_textcopy'] = true;
|
1428 |
-
else
|
1429 |
-
$addthis_config['data_track_textcopy'] = false;
|
1430 |
|
1431 |
// Old opt out
|
1432 |
if ( isset($options['addthis_copytracking1']) && $options['addthis_copytracking1'] == true)
|
@@ -1440,6 +1474,9 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1440 |
|
1441 |
if ( isset($options['addthis_language']) && strlen($options['addthis_language']) == 2)
|
1442 |
$addthis_config['ui_language'] = $options['addthis_language'];
|
|
|
|
|
|
|
1443 |
|
1444 |
if ( isset($options['addthis_header_background']) )
|
1445 |
$addthis_config['ui_header_background'] = $options['addthis_header_background'];
|
@@ -1454,17 +1491,17 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1454 |
$addthis_config['ui_508_compliant'] = true;
|
1455 |
|
1456 |
$addthis_config = apply_filters('addthis_config_js_var', $addthis_config);
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
$script .= 'var addthis_config = '. json_encode($addthis_config) .';';
|
1462 |
-
|
1463 |
if (isset($options['addthis_options']) && strlen($options['addthis_options']) != 0)
|
1464 |
-
|
1465 |
|
1466 |
if (isset($options['addthis_twitter_template'])){
|
1467 |
-
|
|
|
|
|
1468 |
|
1469 |
}
|
1470 |
if (isset($options['addthis_bitly_login']) && isset($options['addthis_bitly_key']) ){
|
@@ -1491,14 +1528,11 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1491 |
$return .= 'var addthis_options = "'.$options['addthis_options'].'";';
|
1492 |
|
1493 |
$return .= "\n";
|
1494 |
-
|
1495 |
-
|
1496 |
-
elseif (! empty ($addthis_config) )
|
1497 |
-
$return .= 'var addthis_config = '. json_encode($addthis_config) .';';
|
1498 |
|
1499 |
$return .= "\n";
|
1500 |
|
1501 |
-
|
1502 |
return $return;
|
1503 |
|
1504 |
}
|
@@ -1511,16 +1545,35 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1511 |
$script .= '</script>';
|
1512 |
|
1513 |
|
1514 |
-
$script .= '<script type="text/javascript" src="//s7.addthis.com/js/
|
1515 |
|
1516 |
|
1517 |
if ( ! is_admin() && ! is_feed() )
|
1518 |
echo $script;
|
1519 |
-
elseif ($return == true &&
|
1520 |
return $script;
|
1521 |
}
|
1522 |
|
1523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1524 |
|
1525 |
/**
|
1526 |
* Appends AddThis button to post content.
|
@@ -1555,7 +1608,7 @@ function addthis_social_widget($content, $onSidebar = false, $url = null, $title
|
|
1555 |
$content .= "\n<!-- AddThis Button BEGIN -->\n"
|
1556 |
.'<script type="text/javascript">'
|
1557 |
."\n//<!--\n"
|
1558 |
-
."var addthis_product = 'wpp-
|
1559 |
|
1560 |
|
1561 |
if (strlen($addthis_settings['customization']))
|
@@ -1569,15 +1622,15 @@ function addthis_social_widget($content, $onSidebar = false, $url = null, $title
|
|
1569 |
$content .= <<<EOF
|
1570 |
//-->
|
1571 |
</script>
|
1572 |
-
<div class="addthis_container"><a href="//www.addthis.com/bookmark.php?v=
|
1573 |
EOF;
|
1574 |
-
$content .= ($addthis_settings['language'] == '' ? '' /* no hardcoded image -- we'll choose the language automatically */ : addthis_get_button_img()) . '</a><script type="text/javascript" src="//s7.addthis.com/js/
|
1575 |
}
|
1576 |
else if ($addthis_settings['menu_type'] === 'toolbox')
|
1577 |
{
|
1578 |
$content .= "\n//-->\n</script>\n";
|
1579 |
$content .= <<<EOF
|
1580 |
-
<div class="addthis_container addthis_toolbox addthis_default_style" addthis:url="$link" addthis:title="$title"><a href="//www.addthis.com/bookmark.php?v=
|
1581 |
EOF;
|
1582 |
if (!strlen($addthis_options)) $addthis_options = 'email,favorites,print,facebook,twitter';
|
1583 |
$addthis_options = split(',', $addthis_options);
|
@@ -1587,7 +1640,7 @@ EOF;
|
|
1587 |
$content .= '<a class="addthis_button_'.$option.'"></a>';
|
1588 |
}
|
1589 |
}
|
1590 |
-
$content .= '<script type="text/javascript" src="//s7.addthis.com/js/
|
1591 |
}
|
1592 |
else
|
1593 |
{
|
@@ -1596,7 +1649,7 @@ EOF;
|
|
1596 |
$content .= <<<EOF
|
1597 |
//-->
|
1598 |
</script>
|
1599 |
-
<div class="addthis_container"><a href="//www.addthis.com/bookmark.php?v=
|
1600 |
EOF;
|
1601 |
$content .= addthis_get_button_img() . '</a></div>';
|
1602 |
}
|
@@ -1714,6 +1767,8 @@ function addthis_admin_menu()
|
|
1714 |
'addthis_bitly_key' => '',
|
1715 |
'addthis_config_json' => '',
|
1716 |
'addthis_share_json' => '',
|
|
|
|
|
1717 |
);
|
1718 |
|
1719 |
function addthis_plugin_options_php4() {
|
@@ -1734,9 +1789,11 @@ function addthis_plugin_options_php4() {
|
|
1734 |
|
1735 |
if (get_user_meta($user_id, 'addthis_nag_updated_options') )
|
1736 |
delete_user_meta($user_id, 'addthis_nag_updated_options', 'true');
|
|
|
1737 |
?>
|
1738 |
<div class="wrap">
|
1739 |
<h2 class='placeholder'> </h2>
|
|
|
1740 |
<form id="addthis_settings" method="post" action="options.php">
|
1741 |
<?php
|
1742 |
// use the old-school settings style in older versions of wordpress
|
@@ -1755,10 +1812,8 @@ function addthis_plugin_options_php4() {
|
|
1755 |
if ( $addthis_options && ! isset($addthis_options[$option]) )
|
1756 |
$addthis_options[$option] = false;
|
1757 |
}
|
1758 |
-
|
1759 |
-
|
1760 |
-
$options = wp_parse_args($addthis_options, $addthis_default_options);
|
1761 |
-
extract($options);
|
1762 |
?>
|
1763 |
|
1764 |
<p><?php echo $addthis_addjs->getAtPluginPromoText(); ?></p>
|
@@ -1770,7 +1825,11 @@ function addthis_plugin_options_php4() {
|
|
1770 |
<li><h2 class="nav-tab-wrapper"><a href="#tabs-2">Advanced</a></h2></li>
|
1771 |
</ul>
|
1772 |
<div class='clear'> </div>
|
|
|
1773 |
<div id="tabs-1">
|
|
|
|
|
|
|
1774 |
<table class="form-table">
|
1775 |
<tbody>
|
1776 |
<?php _addthis_choose_icons('above', $options ); ?>
|
@@ -1802,8 +1861,9 @@ function addthis_plugin_options_php4() {
|
|
1802 |
<div class='clear'> </div>
|
1803 |
<br/>
|
1804 |
</div>
|
1805 |
-
|
1806 |
<div id="tabs-2">
|
|
|
1807 |
<table class="form-table">
|
1808 |
<tr>
|
1809 |
<th><h2>Show AddThis on …</h2></th>
|
@@ -1863,13 +1923,13 @@ function addthis_plugin_options_php4() {
|
|
1863 |
<span class='description'><?php _e('Enter a comma-separated list of <a href="//addthis.com/services/list">service codes</a>', 'addthis_trans_domain' ); ?></span>
|
1864 |
</td>
|
1865 |
</tr>
|
1866 |
-
<tr valign="top">
|
1867 |
<th scope="row"><?php _e("Brand:", 'addthis_trans_domain' ); ?></th>
|
1868 |
<td><input type="text" name="addthis_settings[addthis_brand]" value="<?php echo $addthis_brand; ?>" /></td>
|
1869 |
</tr>
|
1870 |
<tr valign="top">
|
1871 |
-
<th scope="row"><?php _e("
|
1872 |
-
|
1873 |
</tr>
|
1874 |
|
1875 |
<tr valign="top">
|
@@ -1886,11 +1946,11 @@ function addthis_plugin_options_php4() {
|
|
1886 |
</select>
|
1887 |
</td>
|
1888 |
</tr>
|
1889 |
-
<tr valign="top">
|
1890 |
<th scope="row"><?php _e("Header background:", 'addthis_trans_domain' ); ?></th>
|
1891 |
<td><input type="text" name="addthis_settings[addthis_header_background]" value="<?php echo $addthis_header_background; ?>" /></td>
|
1892 |
</tr>
|
1893 |
-
<tr valign="top">
|
1894 |
<th scope="row"><?php _e("Header color:", 'addthis_trans_domain' ); ?></th>
|
1895 |
<td><input type="text" name="addthis_settings[addthis_header_color]" value="<?php echo $addthis_header_color; ?>" /></td>
|
1896 |
</tr>
|
@@ -1930,7 +1990,7 @@ function addthis_plugin_options_php4() {
|
|
1930 |
<tr valign="top">
|
1931 |
<th scope="row"><?php _e("addthis_share values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
|
1932 |
<td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_share_json]" /><?php echo $addthis_share_json; ?></textarea></td>
|
1933 |
-
|
1934 |
</table>
|
1935 |
<div class='clear'> </div>
|
1936 |
</div>
|
@@ -2037,6 +2097,29 @@ function addthis_activation_hook(){
|
|
2037 |
|
2038 |
register_activation_hook( __FILE__, 'addthis_activation_hook' );
|
2039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2040 |
|
2041 |
require_once('addthis_post_metabox.php');
|
2042 |
|
23 |
* Plugin Name: AddThis Social Bookmarking Widget
|
24 |
* Plugin URI: http://www.addthis.com
|
25 |
* Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
|
26 |
+
* Version: 2.5.0
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
30 |
*/
|
|
|
31 |
if (!defined('ADDTHIS_INIT')) define('ADDTHIS_INIT', 1);
|
32 |
else return;
|
33 |
|
34 |
|
35 |
// Setup our shared resources early
|
36 |
+
// addthis_addjs.php is a standard class shared by the various AddThis plugins to make it easy for us to include our bootstrapping JavaScript only once.
|
37 |
add_action('init', 'addthis_early', 1);
|
38 |
function addthis_early(){
|
39 |
global $addthis_addjs;
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
+
define( 'ADDTHIS_PLUGIN_VERSION', '2.5.0');
|
50 |
+
define( 'ADDTHIS_ATVERSION', '300');
|
51 |
+
define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
|
52 |
+
define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
|
53 |
+
define( 'ADDTHIS_ATVERSION_REVERTED', 1);
|
54 |
|
55 |
$addthis_settings = array();
|
56 |
$addthis_settings['isdropdown'] = 'true';
|
60 |
$addthis_settings['username'] = '';
|
61 |
$addthis_settings['fallback_username'] = '';
|
62 |
$addthis_settings['style'] = 'share';
|
63 |
+
$addthis_settings['atversion'] = ADDTHIS_ATVERSION;
|
64 |
|
65 |
$addthis_languages = array(''=>'Automatic','af'=>'Afrikaaner', 'ar'=>'Arabic', 'zh'=>'Chinese', 'cs'=>'Czech', 'da'=>'Danish', 'nl'=>'Dutch', 'en'=>'English', 'fa'=>'Farsi', 'fi'=>'Finnish', 'fr'=>'French', 'ga'=>'Gaelic', 'de'=>'German', 'el'=>'Greek', 'he'=>'Hebrew', 'hi'=>'Hindi', 'it'=>'Italian', 'ja'=>'Japanese', 'ko'=>'Korean', 'lv'=>'Latvian', 'lt'=>'Lithuanian', 'no'=>'Norwegian', 'pl'=>'Polish', 'pt'=>'Portugese', 'ro'=>'Romanian', 'ru'=>'Russian', 'sk'=>'Slovakian', 'sl'=>'Slovenian', 'es'=>'Spanish', 'sv'=>'Swedish', 'th'=>'Thai', 'ur'=>'Urdu', 'cy'=>'Welsh', 'vi'=>'Vietnamese');
|
66 |
|
84 |
), // 32x32
|
85 |
'plus_one_share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style" %s ><a class="addthis_button_google_plusone" g:plusone:size="medium" ></a><a class="addthis_counter addthis_pill_style"></a></div>', 'img' => 'plusone-share.gif', 'name' => 'Plus One and Share Counter', 'above'=> 'hidden', 'below'=>'hidden' , 'defaultHide' => true
|
86 |
), // +1
|
87 |
+
'small_toolbox_with_share' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a href="//addthis.com/bookmark.php?v='.$atversion.'&username=xa-4d2b47597ad291fb" class="addthis_button_compact">Share</a><span class="addthis_separator">|</span><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a></div>', 'img' => 'small-toolbox.jpg', 'name' => 'Small Toolbox with Share first', 'above' => '', 'below' => 'hidden' , 'defaultHide' => true
|
88 |
), // Plus sign share | four buttons
|
89 |
'fb_tw_sc' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>' , 'img' => 'fb-tw-sc.jpg' , 'name' => 'Like, Tweet, Counter', 'above' => 'hidden', 'below' => 'hidden', 'defaultHide' => true
|
90 |
), // facebook tweet share counter
|
91 |
+
'simple_button' => array('src' => '<div class="addthis_toolbox addthis_default_style " %s><a href="//addthis.com/bookmark.php?v='.$atversion.'&username=xa-4d2b47f81ddfbdce" class="addthis_button_compact">Share</a></div>', 'img' => 'share.jpg', 'name' => 'Share Button', 'above' => 'hidden ', 'below' => 'hidden', 'defaultHide' => true
|
92 |
), // Plus sign share
|
93 |
+
'button' => array( 'src' => '<div><a class="addthis_button" href="//addthis.com/bookmark.php?v='.$atversion.'" %s><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>', 'img' => 'button.jpg', 'name' => 'Classic Share Button', 'above' => 'hidden ', 'below' => 'hidden'
|
94 |
), // classic
|
95 |
'share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_counter"></a></div>', 'img' => 'share_counter.png', 'name' => 'Share Counter', 'above' => 'hidden ', 'below' => 'hidden' , 'defaultHide' => true
|
96 |
),
|
98 |
|
99 |
|
100 |
//add_filter('the_title', 'at_title_check');
|
101 |
+
/**
|
102 |
+
* @deprecated
|
103 |
+
* @todo Add _deprecated_function notice.
|
104 |
+
*/
|
105 |
function at_title_check($title)
|
106 |
{
|
107 |
|
120 |
}
|
121 |
|
122 |
|
123 |
+
/**
|
124 |
+
* @deprecated
|
125 |
+
* @todo Add _deprecated_function notice.
|
126 |
+
*/
|
|
|
|
|
|
|
|
|
127 |
function addthis_script_to_content($content)
|
128 |
{
|
129 |
global $addthis_did_script_output;
|
136 |
return $content ;
|
137 |
}
|
138 |
|
139 |
+
|
140 |
+
add_filter('language_attributes', 'addthis_language_attributes');
|
141 |
+
function addthis_language_attributes($input)
|
142 |
+
{
|
143 |
+
return $input . ' xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:addthis="http://www.addthis.com/help/api-spec" ';
|
144 |
+
}
|
145 |
+
|
146 |
+
|
147 |
/**
|
148 |
* Converts our old many options in to one beautiful array
|
149 |
*
|
150 |
*/
|
151 |
|
152 |
+
// Caution: Using this filter to disable upgrades may have unexpected consequences.
|
153 |
if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters( 'addthis_do_options_upgrades', '__return_true') )
|
154 |
{
|
155 |
function addthis_options_200()
|
201 |
$addthis_new_options['addthis_brand'] = $brand;
|
202 |
if ($language = get_option('addthis_language'))
|
203 |
$addthis_new_options['addthis_language'] = $language;
|
204 |
+
|
205 |
+
//version check
|
206 |
+
if ($atversion = get_option('atversion'))
|
207 |
+
$addthis_new_options['atversion'] = $atversion;
|
208 |
+
|
209 |
+
|
210 |
// Above is new, set it to none
|
211 |
$addthis_new_options['above'] = 'none';
|
212 |
|
233 |
delete_option('addthis_header_color');
|
234 |
delete_option('addthis_sidebar_only');
|
235 |
delete_option('addthis_brand');
|
236 |
+
delete_option('addthis_language');
|
237 |
+
delete_option('atversion');
|
238 |
|
239 |
|
240 |
global $current_user;
|
241 |
$user_id = $current_user->ID;
|
242 |
|
243 |
add_user_meta($user_id, 'addthis_nag_updated_options', 'true', true);
|
|
|
|
|
|
|
244 |
}
|
245 |
|
246 |
function addthis_options_210()
|
250 |
$options['profile'] = $options['username'];
|
251 |
|
252 |
update_option( 'addthis_settings', $options);
|
|
|
253 |
}
|
254 |
|
255 |
function addthis_options_240()
|
257 |
$options = get_option('addthis_settings');
|
258 |
|
259 |
// Add An option for the AT Version
|
260 |
+
$options['atversion'] = ADDTHIS_ATVERSION;
|
261 |
+
|
262 |
//$options['wpfooter'] = false;
|
263 |
update_option( 'addthis_settings', $options);
|
|
|
264 |
}
|
265 |
}
|
266 |
|
296 |
* For templates, we need a wrapper for printing out the code on demand.
|
297 |
*/
|
298 |
function addthis_print_widget($url=null, $title=null, $style = addthis_style_default ) {
|
|
|
299 |
global $addthis_styles, $addthis_new_styles;
|
300 |
$styles = array_merge($addthis_styles, $addthis_new_styles);
|
301 |
|
307 |
$identifier = addthis_get_identifier($url, $title);
|
308 |
|
309 |
echo "\n<!-- AddThis Custom -->\n";
|
|
|
|
|
310 |
if ( ! is_array($style) && isset($addthis_new_styles[$style]) ){
|
311 |
echo sprintf($addthis_new_styles[$style]['src'], $identifier);
|
312 |
}
|
542 |
$password = urlencode($options['password']);
|
543 |
else
|
544 |
{
|
545 |
+
echo 'No Password entered';
|
546 |
return false;
|
547 |
}
|
548 |
$domain = get_home_url();
|
586 |
|
587 |
if ( is_wp_error( $stats[$metric.$dimension.$period] ) )
|
588 |
{
|
589 |
+
echo "There was an error retrieving your stats from the AddThis servers. Please wait and try again in a few moments.\n";
|
590 |
if (defined(WP_DEBUG) && WP_DEBUG == TRUE)
|
591 |
echo "Error Code:" . $stats[$metric.$dimension.$period]->get_error_code();
|
592 |
|
595 |
|
596 |
else if ($stats[$metric.$dimension.$period]['response']['code'] == 401 )
|
597 |
{
|
598 |
+
echo "The username, password, and profile combination you entered is invalid.<br />";
|
599 |
+
echo "Please confirm that you have correctly entered your AddThis username, password and profile ID.";
|
600 |
exit;
|
601 |
}
|
602 |
else if ( $stats[$metric.$dimension.$period]['response']['code'] == 500)
|
603 |
{
|
604 |
+
echo "Something has gone terribly wrong! This should never happen, but somehow did. We are working to correct it right now. We will get everything up again soon.";
|
605 |
exit;
|
606 |
}
|
607 |
|
608 |
else if ($stats[$metric.$dimension.$period]['response']['code'] == 501 )
|
609 |
{
|
610 |
+
echo "There was an error retrieving your analytics. If you wait a momeent and try again, you should be all set.";
|
611 |
exit;
|
612 |
}
|
613 |
else if ($stats[$metric.$dimension.$period]['response']['code'] != 201 )
|
660 |
}
|
661 |
$lastmonth['viral'] = ($lastmonth['shares'] > 0 && $lastmonth['clickbacks'] ) ? $lastmonth['clickbacks'] / $lastmonth['shares'] * 100 . '%' : 'n/a';
|
662 |
|
|
|
663 |
$services['shares'] = json_decode($stats['shares/servicemonth']['body']);
|
664 |
+
if (is_null($services['shares'])) $services['shares'] = array();
|
665 |
$services['clickbacks'] = json_decode($stats['clickbacks/servicemonth']['body']);
|
666 |
+
if (is_null($services['clickbacks'])) $services['shares'] = array();
|
667 |
+
|
668 |
+
foreach (array('shares', 'clickbacks') as $type)
|
669 |
{
|
670 |
+
if (is_array($services[$type])) {
|
671 |
+
$topServiceShare = array_shift($services[$type]);
|
672 |
+
$firstLabel = ( isset($_services[$topServiceShare->service])) ? $_services[$topServiceShare->service] : $topServiceShare->service;
|
673 |
+
$firstAmount = $topServiceShare->{$type};
|
674 |
+
$topServiceShare = array_shift($services[$type]);
|
675 |
+
$secondLabel = ( isset($_services[$topServiceShare->service])) ? $_services[$topServiceShare->service] : $topServiceShare->service;
|
676 |
+
$secondAmount = $topServiceShare->{$type};
|
677 |
+
$thirdLabel = 'Others';
|
678 |
+
$thirdAmount = 0;
|
679 |
+
if (is_array($services[$type])) {
|
680 |
+
foreach($services[$type] as $service )
|
681 |
+
{
|
682 |
+
$thirdAmount += $service->{$type};
|
683 |
+
}
|
684 |
+
}
|
685 |
+
|
686 |
+
|
687 |
+
$servicesCharts[$type] = '//chart.apis.google.com/chart?&chdlp=b&chs=118x145&cht=p3&chco=BA3A1C|F75C39|424242&chf=bg,s,00000000&'.
|
688 |
+
'chdl='.$firstLabel.'|'.$secondLabel.'|'.$thirdLabel.'&'.
|
689 |
+
'chd=t:'.$firstAmount.','.$secondAmount.','.$thirdAmount;
|
690 |
+
} else {
|
691 |
+
$servicesCharts[$type] = '//chart.apis.google.com/chart?&chdlp=b&chs=118x145&cht=p3&chco=BA3A1C|F75C39|424242&chf=bg,s,00000000&';
|
692 |
}
|
693 |
+
}
|
|
|
|
|
|
|
|
|
|
|
694 |
|
695 |
|
696 |
echo "<div id='at_tabs'>";
|
940 |
$options['data_ga_property'] = sanitize_text_field($data['data_ga_property']);
|
941 |
|
942 |
//[addthis_twitter_template]
|
943 |
+
if ( isset ($data['addthis_twitter_template']) && strlen($data['addthis_twitter_template']) != 0 ) {
|
944 |
+
//Parse the first twitter username to be used with via
|
945 |
+
$options['addthis_twitter_template'] = get_first_twitter_username(sanitize_text_field($data['addthis_twitter_template']));
|
946 |
+
}
|
947 |
|
948 |
if (isset ($data['addthis_bitly_login']) && strlen($data['addthis_bitly_login']) != 0 )
|
949 |
$options['addthis_bitly_login'] = sanitize_text_field($data['addthis_bitly_login']);
|
966 |
$options['addthis_language'] = sanitize_text_field($data['addthis_language']);
|
967 |
|
968 |
|
969 |
+
//[atversion]=>
|
970 |
+
if ( isset ($data['atversion']))
|
971 |
+
$options['atversion'] = sanitize_text_field($data['atversion']);
|
972 |
+
|
973 |
+
//[atversion_update_status]=>
|
974 |
+
if ( isset ($data['atversion_update_status']))
|
975 |
+
$options['atversion_update_status'] = sanitize_text_field($data['atversion_update_status']);
|
976 |
+
|
977 |
if ( isset ($data['addthis_header_background']) && strlen($data['addthis_header_background']) != 0 )
|
978 |
{
|
979 |
if (! strpos($data['addthis_header_background'], '#') === 0)
|
1088 |
|
1089 |
}
|
1090 |
|
1091 |
+
/**
|
1092 |
+
* Places our options into a global associative array.
|
1093 |
+
* @refactor
|
1094 |
+
*/
|
1095 |
function addthis_set_addthis_settings()
|
1096 |
{
|
1097 |
global $addthis_settings;
|
1111 |
|
1112 |
$language = get_option('addthis_language');
|
1113 |
$addthis_settings['language'] = $language;
|
1114 |
+
|
1115 |
+
$atversion = get_option('atversion');
|
1116 |
+
$addthis_settings['atversion'] = $atversion;
|
1117 |
|
1118 |
$advopts = array('brand', 'append_data', 'language', 'header_background', 'header_color');
|
1119 |
$addthis_settings['customization'] = '';
|
1124 |
if (isset($val) && strlen($val)) $addthis_settings['customization'] .= "var addthis_$opt = '$val';";
|
1125 |
}
|
1126 |
$addthis_settings['options'] = get_option('addthis_options');
|
|
|
1127 |
}
|
1128 |
|
1129 |
add_action('wp_dashboard_setup', 'addthis_dashboard_init' );
|
1204 |
}
|
1205 |
}
|
1206 |
|
1207 |
+
|
1208 |
+
/**
|
1209 |
+
* so named because it is added "later then the standard filter and all the WP internal filters"
|
1210 |
+
*/
|
1211 |
function addthis_late_widget($link_text)
|
1212 |
{
|
1213 |
remove_filter('get_the_excerpt', 'addthis_late_widget');
|
1268 |
else
|
1269 |
$options = get_option('addthis_settings');
|
1270 |
|
1271 |
+
// I don't think has_excerpt() is always necessarily true when calling "get_the_excerpt()",
|
1272 |
+
// but since this function is only as a get_the_excerpt() filter, we should probably
|
1273 |
+
// not care whether or not an excerpt is there since the caller obviously wants one.
|
1274 |
+
// needs testing/understanding.
|
1275 |
+
if ( has_excerpt() && $options['addthis_showonexcerpts'] == true ) {
|
1276 |
return addthis_display_social_widget($content, true, true);
|
1277 |
+
} else
|
1278 |
return $content;
|
1279 |
}
|
1280 |
|
1307 |
$display = true;
|
1308 |
else
|
1309 |
$display = false;
|
1310 |
+
|
1311 |
$custom_fields = get_post_custom($post->ID);
|
1312 |
if (isset ($custom_fields['addthis_exclude']) && $custom_fields['addthis_exclude'][0] == 'true')
|
1313 |
$display = false;
|
1428 |
*/
|
1429 |
function addthis_output_script($return = false, $justConfig = false )
|
1430 |
{
|
1431 |
+
|
1432 |
global $addthis_settings;
|
1433 |
|
1434 |
if ( isset($_GET['preview']) && $_GET['preview'] == 1 && $options = get_transient('addthis_settings') )
|
1438 |
|
1439 |
$script = "\n<!-- AddThis Button Begin -->\n"
|
1440 |
.'<script type="text/javascript">'
|
1441 |
+
."var addthis_product = 'wpp-2.5.0';\n";
|
1442 |
|
1443 |
|
1444 |
$pub = (isset($options['profile'])) ? $options['profile'] : false ;
|
1450 |
$addthis_config = array();
|
1451 |
$addthis_share = array();
|
1452 |
|
1453 |
+
$addthis_config["data_track_clickback"] = (isset($options['addthis_append_data']) && $options['addthis_append_data'] == true);
|
|
|
|
|
|
|
1454 |
|
1455 |
if ( isset($options['data_ga_property']) ){
|
1456 |
$addthis_config['data_ga_property'] = $options['data_ga_property'];
|
1457 |
$addthis_config['data_ga_social'] = true;
|
1458 |
}
|
1459 |
|
1460 |
+
$addthis_config["data_track_addressbar"] = (isset($options['addthis_addressbar']) && $options['addthis_addressbar'] == true);
|
|
|
|
|
|
|
1461 |
|
1462 |
// Opt in
|
1463 |
+
$addthis_config['data_track_textcopy'] = (isset($options['addthis_copytracking2']) && $options['addthis_copytracking2'] == true);
|
|
|
|
|
|
|
1464 |
|
1465 |
// Old opt out
|
1466 |
if ( isset($options['addthis_copytracking1']) && $options['addthis_copytracking1'] == true)
|
1474 |
|
1475 |
if ( isset($options['addthis_language']) && strlen($options['addthis_language']) == 2)
|
1476 |
$addthis_config['ui_language'] = $options['addthis_language'];
|
1477 |
+
|
1478 |
+
if ( isset($options['atversion']))
|
1479 |
+
$addthis_config['ui_atversion'] = isset($options['atversion_update_status']) && $options['atversion_update_status'] == ADDTHIS_ATVERSION_REVERTED ? $options['atversion'] : ADDTHIS_ATVERSION;
|
1480 |
|
1481 |
if ( isset($options['addthis_header_background']) )
|
1482 |
$addthis_config['ui_header_background'] = $options['addthis_header_background'];
|
1491 |
$addthis_config['ui_508_compliant'] = true;
|
1492 |
|
1493 |
$addthis_config = apply_filters('addthis_config_js_var', $addthis_config);
|
1494 |
+
|
1495 |
+
$script = merge_config_with_json_config($script, $addthis_config, $options['addthis_config_json']);
|
1496 |
+
|
1497 |
+
|
|
|
|
|
1498 |
if (isset($options['addthis_options']) && strlen($options['addthis_options']) != 0)
|
1499 |
+
$script .= 'var addthis_options = "'.$options['addthis_options'].'";';
|
1500 |
|
1501 |
if (isset($options['addthis_twitter_template'])){
|
1502 |
+
//The following twitter template translation is deprecated and replaced with via
|
1503 |
+
//$addthis_share['templates']['twitter'] = esc_js($options['addthis_twitter_template']);
|
1504 |
+
$addthis_share['passthrough']['twitter']['via'] = esc_js(get_first_twitter_username($options['addthis_twitter_template']));
|
1505 |
|
1506 |
}
|
1507 |
if (isset($options['addthis_bitly_login']) && isset($options['addthis_bitly_key']) ){
|
1528 |
$return .= 'var addthis_options = "'.$options['addthis_options'].'";';
|
1529 |
|
1530 |
$return .= "\n";
|
1531 |
+
|
1532 |
+
$return = merge_config_with_json_config($return, $addthis_config, $options['addthis_config_json']);
|
|
|
|
|
1533 |
|
1534 |
$return .= "\n";
|
1535 |
|
|
|
1536 |
return $return;
|
1537 |
|
1538 |
}
|
1545 |
$script .= '</script>';
|
1546 |
|
1547 |
|
1548 |
+
$script .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$atversion.'/addthis_widget.js#pubid='.$pub.'"></script>';
|
1549 |
|
1550 |
|
1551 |
if ( ! is_admin() && ! is_feed() )
|
1552 |
echo $script;
|
1553 |
+
elseif ($return == true && ! is_admin() && ! is_feed() )
|
1554 |
return $script;
|
1555 |
}
|
1556 |
|
1557 |
+
/*
|
1558 |
+
* Merge the Add this settings with that given using JSON format
|
1559 |
+
* @param String $appendString - The string to build and return the script
|
1560 |
+
* @param array $addthis_config - The setting array for add this config
|
1561 |
+
* @param String $addthis_json_config - The JSON String
|
1562 |
+
* @return String $appendString - The string to build and return the script
|
1563 |
+
*/
|
1564 |
+
function merge_config_with_json_config($append_string, $addthis_config, $addthis_json_config) {
|
1565 |
+
if ( isset( $addthis_json_config ) && trim($addthis_json_config) != '') {
|
1566 |
+
$addthis_config_json_list = json_decode($addthis_json_config, true);
|
1567 |
+
if (! empty ($addthis_config_json_list) && ! empty ($addthis_config)) {
|
1568 |
+
foreach($addthis_config_json_list as $key_json => $json_config_value) {
|
1569 |
+
$addthis_config[$key_json] = $json_config_value;
|
1570 |
+
}
|
1571 |
+
}
|
1572 |
+
}
|
1573 |
+
if (! empty ($addthis_config) )
|
1574 |
+
$append_string .= 'var addthis_config = '. json_encode($addthis_config) .';';
|
1575 |
+
return $append_string;
|
1576 |
+
}
|
1577 |
|
1578 |
/**
|
1579 |
* Appends AddThis button to post content.
|
1608 |
$content .= "\n<!-- AddThis Button BEGIN -->\n"
|
1609 |
.'<script type="text/javascript">'
|
1610 |
."\n//<!--\n"
|
1611 |
+
."var addthis_product = 'wpp-2.5.0';\n";
|
1612 |
|
1613 |
|
1614 |
if (strlen($addthis_settings['customization']))
|
1622 |
$content .= <<<EOF
|
1623 |
//-->
|
1624 |
</script>
|
1625 |
+
<div class="addthis_container"><a href="//www.addthis.com/bookmark.php?v='.$atversion.'&username=$pub" class="addthis_button" addthis:url="$link" addthis:title="$title">
|
1626 |
EOF;
|
1627 |
+
$content .= ($addthis_settings['language'] == '' ? '' /* no hardcoded image -- we'll choose the language automatically */ : addthis_get_button_img()) . '</a><script type="text/javascript" src="//s7.addthis.com/js/'.$atversion.'/addthis_widget.js#username='.$pub.'"></script></div>';
|
1628 |
}
|
1629 |
else if ($addthis_settings['menu_type'] === 'toolbox')
|
1630 |
{
|
1631 |
$content .= "\n//-->\n</script>\n";
|
1632 |
$content .= <<<EOF
|
1633 |
+
<div class="addthis_container addthis_toolbox addthis_default_style" addthis:url="$link" addthis:title="$title"><a href="//www.addthis.com/bookmark.php?v='.$atversion.'&username=$pub" class="addthis_button_compact">Share</a><span class="addthis_separator">|</span>
|
1634 |
EOF;
|
1635 |
if (!strlen($addthis_options)) $addthis_options = 'email,favorites,print,facebook,twitter';
|
1636 |
$addthis_options = split(',', $addthis_options);
|
1640 |
$content .= '<a class="addthis_button_'.$option.'"></a>';
|
1641 |
}
|
1642 |
}
|
1643 |
+
$content .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$atversion.'/addthis_widget.js#username='.$pub.'"></script></div>';
|
1644 |
}
|
1645 |
else
|
1646 |
{
|
1649 |
$content .= <<<EOF
|
1650 |
//-->
|
1651 |
</script>
|
1652 |
+
<div class="addthis_container"><a href="//www.addthis.com/bookmark.php?v='.$atversion.'&username=$pub" onclick="window.open('//www.addthis.com/bookmark.php?v='.$atversion.'&username=$pub&url=$link&title=$title', 'ext_addthis', 'scrollbars=yes,menubar=no,width=620,height=520,resizable=yes,toolbar=no,location=no,status=no'); return false;" title="Bookmark using any bookmark manager!" target="_blank">
|
1653 |
EOF;
|
1654 |
$content .= addthis_get_button_img() . '</a></div>';
|
1655 |
}
|
1767 |
'addthis_bitly_key' => '',
|
1768 |
'addthis_config_json' => '',
|
1769 |
'addthis_share_json' => '',
|
1770 |
+
'atversion' => ADDTHIS_ATVERSION,
|
1771 |
+
'atversion_update_status' => 0
|
1772 |
);
|
1773 |
|
1774 |
function addthis_plugin_options_php4() {
|
1789 |
|
1790 |
if (get_user_meta($user_id, 'addthis_nag_updated_options') )
|
1791 |
delete_user_meta($user_id, 'addthis_nag_updated_options', 'true');
|
1792 |
+
|
1793 |
?>
|
1794 |
<div class="wrap">
|
1795 |
<h2 class='placeholder'> </h2>
|
1796 |
+
|
1797 |
<form id="addthis_settings" method="post" action="options.php">
|
1798 |
<?php
|
1799 |
// use the old-school settings style in older versions of wordpress
|
1812 |
if ( $addthis_options && ! isset($addthis_options[$option]) )
|
1813 |
$addthis_options[$option] = false;
|
1814 |
}
|
1815 |
+
$options = wp_parse_args($addthis_options, $addthis_default_options);
|
1816 |
+
extract($options);
|
|
|
|
|
1817 |
?>
|
1818 |
|
1819 |
<p><?php echo $addthis_addjs->getAtPluginPromoText(); ?></p>
|
1825 |
<li><h2 class="nav-tab-wrapper"><a href="#tabs-2">Advanced</a></h2></li>
|
1826 |
</ul>
|
1827 |
<div class='clear'> </div>
|
1828 |
+
|
1829 |
<div id="tabs-1">
|
1830 |
+
<?php echo $version_notification_content = _addthis_version_notification($atversion_update_status, $atversion);?>
|
1831 |
+
<input type="hidden" value="<?php echo $atversion?>" name="addthis_settings[atversion]" id="addthis_atversion_hidden" />
|
1832 |
+
<input type="hidden" value="<?php echo $atversion_update_status?>" name="addthis_settings[atversion_update_status]" id="addthis_atversion_update_status" />
|
1833 |
<table class="form-table">
|
1834 |
<tbody>
|
1835 |
<?php _addthis_choose_icons('above', $options ); ?>
|
1861 |
<div class='clear'> </div>
|
1862 |
<br/>
|
1863 |
</div>
|
1864 |
+
|
1865 |
<div id="tabs-2">
|
1866 |
+
<?php echo $version_notification_content?>
|
1867 |
<table class="form-table">
|
1868 |
<tr>
|
1869 |
<th><h2>Show AddThis on …</h2></th>
|
1923 |
<span class='description'><?php _e('Enter a comma-separated list of <a href="//addthis.com/services/list">service codes</a>', 'addthis_trans_domain' ); ?></span>
|
1924 |
</td>
|
1925 |
</tr>
|
1926 |
+
<tr valign="top" class="classicFeature">
|
1927 |
<th scope="row"><?php _e("Brand:", 'addthis_trans_domain' ); ?></th>
|
1928 |
<td><input type="text" name="addthis_settings[addthis_brand]" value="<?php echo $addthis_brand; ?>" /></td>
|
1929 |
</tr>
|
1930 |
<tr valign="top">
|
1931 |
+
<th scope="row"><?php _e("Twitter via:", 'addthis_trans_domain' ); ?></th>
|
1932 |
+
<td><input type="text" name="addthis_settings[addthis_twitter_template]" value="<?php echo get_first_twitter_username($addthis_twitter_template) ; ?>" /></td>
|
1933 |
</tr>
|
1934 |
|
1935 |
<tr valign="top">
|
1946 |
</select>
|
1947 |
</td>
|
1948 |
</tr>
|
1949 |
+
<tr valign="top" class="classicFeature">
|
1950 |
<th scope="row"><?php _e("Header background:", 'addthis_trans_domain' ); ?></th>
|
1951 |
<td><input type="text" name="addthis_settings[addthis_header_background]" value="<?php echo $addthis_header_background; ?>" /></td>
|
1952 |
</tr>
|
1953 |
+
<tr valign="top" class="classicFeature">
|
1954 |
<th scope="row"><?php _e("Header color:", 'addthis_trans_domain' ); ?></th>
|
1955 |
<td><input type="text" name="addthis_settings[addthis_header_color]" value="<?php echo $addthis_header_color; ?>" /></td>
|
1956 |
</tr>
|
1990 |
<tr valign="top">
|
1991 |
<th scope="row"><?php _e("addthis_share values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
|
1992 |
<td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_share_json]" /><?php echo $addthis_share_json; ?></textarea></td>
|
1993 |
+
</tr>
|
1994 |
</table>
|
1995 |
<div class='clear'> </div>
|
1996 |
</div>
|
2097 |
|
2098 |
register_activation_hook( __FILE__, 'addthis_activation_hook' );
|
2099 |
|
2100 |
+
/**
|
2101 |
+
* Parse for the first twitter username in the given string
|
2102 |
+
* @param String $raw_twitter_username Raw string containing twitter usernames
|
2103 |
+
* @return String twitter username
|
2104 |
+
*/
|
2105 |
+
if (! function_exists('get_first_twitter_username'))
|
2106 |
+
{
|
2107 |
+
function get_first_twitter_username($raw_twitter_username)
|
2108 |
+
{
|
2109 |
+
$twitter_username = '';
|
2110 |
+
preg_match_all('/@(\w+)\b/i', $raw_twitter_username, $twitter_via_matches);
|
2111 |
+
if (count($twitter_via_matches[1]) == 0) {
|
2112 |
+
//To handle strings without @
|
2113 |
+
preg_match_all('/(\w+)\b/i', $raw_twitter_username, $twitter_via_refined_matches);
|
2114 |
+
if (count($twitter_via_refined_matches[1]) > 0) {
|
2115 |
+
$twitter_username = $twitter_via_refined_matches[1][0];
|
2116 |
+
}
|
2117 |
+
} else {
|
2118 |
+
$twitter_username = $twitter_via_matches[1][0];
|
2119 |
+
}
|
2120 |
+
return $twitter_username;
|
2121 |
+
}
|
2122 |
+
}
|
2123 |
|
2124 |
require_once('addthis_post_metabox.php');
|
2125 |
|
css/options-page.css
CHANGED
@@ -144,3 +144,30 @@ height: 36px;
|
|
144 |
padding: 14px 6px 15px 0;
|
145 |
width: 36px;
|
146 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
padding: 14px 6px 15px 0;
|
145 |
width: 36px;
|
146 |
}
|
147 |
+
/*AddThis Version Notification*/
|
148 |
+
.addthis-notification {
|
149 |
+
border-radius: 3px 3px 3px 3px;
|
150 |
+
border-style: solid;
|
151 |
+
border-width: 1px;
|
152 |
+
margin: 5px 0 15px;
|
153 |
+
padding: 1em 0.6em 1em 0.6em;
|
154 |
+
font-size: 16px;
|
155 |
+
float:left;
|
156 |
+
width:97%;
|
157 |
+
height: 30px;
|
158 |
+
line-height: 30px;
|
159 |
+
}
|
160 |
+
.addthis-notification a {
|
161 |
+
color: #45B3EF;
|
162 |
+
font-size: 12px;
|
163 |
+
}
|
164 |
+
.addthis-warning-message {
|
165 |
+
background-color: #FDF7E2;
|
166 |
+
border-color: #EFE9D5;
|
167 |
+
color: #C49855;
|
168 |
+
}
|
169 |
+
.addthis-success-message {
|
170 |
+
background-color: #DDEFD7;
|
171 |
+
border-color: #D0E2C9;
|
172 |
+
color: #6A9B58;
|
173 |
+
}
|
img/update.png
ADDED
Binary file
|
includes/addthis_addjs.php
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
3 |
Class AddThis_addjs{
|
4 |
/**
|
5 |
* var bool check to see if we have added our JS already. Ensures that we don't add it twice
|
@@ -38,16 +41,16 @@ Class AddThis_addjs{
|
|
38 |
_doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first',1 );
|
39 |
}
|
40 |
|
41 |
-
$this->productCode = 'wpp-
|
42 |
-
|
43 |
-
// Version of AddThis code to use
|
44 |
-
$this->atversion = '250';
|
45 |
|
46 |
// We haven't added our JS yet. Or at least better not have.
|
47 |
$this->_js_added = false;
|
48 |
|
49 |
$this->_options = $options;
|
50 |
-
|
|
|
|
|
|
|
51 |
// set the cuid
|
52 |
$base = home_url();
|
53 |
$cuid = hash_hmac('md5', $base, 'addthis');
|
@@ -237,14 +240,6 @@ Class AddThis_addjs{
|
|
237 |
}
|
238 |
|
239 |
return '<p class="addthis_more_promo">' .$string . '</p>';
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
}
|
247 |
}
|
248 |
-
|
249 |
}
|
250 |
-
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* Class for managing AddThis script includes across all its plugins.
|
5 |
+
*/
|
6 |
Class AddThis_addjs{
|
7 |
/**
|
8 |
* var bool check to see if we have added our JS already. Ensures that we don't add it twice
|
41 |
_doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first',1 );
|
42 |
}
|
43 |
|
44 |
+
$this->productCode = 'wpp-2.5.0';
|
|
|
|
|
|
|
45 |
|
46 |
// We haven't added our JS yet. Or at least better not have.
|
47 |
$this->_js_added = false;
|
48 |
|
49 |
$this->_options = $options;
|
50 |
+
|
51 |
+
// Version of AddThis code to use
|
52 |
+
$this->atversion = array_key_exists('atversion_update_status', $options) && $options['atversion_update_status'] == ADDTHIS_ATVERSION_REVERTED ? $options['atversion'] : ADDTHIS_ATVERSION;
|
53 |
+
|
54 |
// set the cuid
|
55 |
$base = home_url();
|
56 |
$cuid = hash_hmac('md5', $base, 'addthis');
|
240 |
}
|
241 |
|
242 |
return '<p class="addthis_more_promo">' .$string . '</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
}
|
244 |
}
|
|
|
245 |
}
|
|
js/options-page.32.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
jQuery(document).ready(function($) {
|
2 |
$( "#tabs" ).tabs();
|
3 |
-
|
4 |
var thickDims, tbWidth, tbHeight;
|
5 |
thickDims = function() {
|
6 |
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
@@ -161,5 +160,38 @@ jQuery(document).ready(function($) {
|
|
161 |
$('input[name="addthis_settings[above]"]').change( function(){aboveCustomShow(); aboveCustomStringShow();} );
|
162 |
$('input[name="addthis_settings[below]"]').change( function(){belowCustomShow(); belowCustomStringShow();} );
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
});
|
1 |
jQuery(document).ready(function($) {
|
2 |
$( "#tabs" ).tabs();
|
|
|
3 |
var thickDims, tbWidth, tbHeight;
|
4 |
thickDims = function() {
|
5 |
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
160 |
$('input[name="addthis_settings[above]"]').change( function(){aboveCustomShow(); aboveCustomStringShow();} );
|
161 |
$('input[name="addthis_settings[below]"]').change( function(){belowCustomShow(); belowCustomStringShow();} );
|
162 |
|
163 |
+
/**
|
164 |
+
* Hide Theming and branding options when user selects version 3.0 or above
|
165 |
+
*/
|
166 |
+
var ATVERSION_250 = 250;
|
167 |
+
var AT_VERSION_300 = 300;
|
168 |
+
var MANUAL_UPDATE = -1;
|
169 |
+
var AUTO_UPDATE = 0;
|
170 |
+
var REVERTED = 1;
|
171 |
+
var atVersionUpdateStatus = $("#addthis_atversion_update_status").val();
|
172 |
+
if (atVersionUpdateStatus == REVERTED) {
|
173 |
+
$(".classicFeature").show();
|
174 |
+
} else {
|
175 |
+
$(".classicFeature").hide();
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Revert to older version after the user upgrades
|
180 |
+
*/
|
181 |
+
$(".addthis-revert-atversion").click(function(){
|
182 |
+
$("#addthis_atversion_update_status").val(REVERTED);
|
183 |
+
$("#addthis_atversion_hidden").val(ATVERSION_250);
|
184 |
+
$(this).closest("form").submit();
|
185 |
+
return false;
|
186 |
+
});
|
187 |
+
/**
|
188 |
+
* Update to a newer version
|
189 |
+
*/
|
190 |
+
$(".addthis-update-atversion").click(function(){
|
191 |
+
$("#addthis_atversion_update_status").val(MANUAL_UPDATE);
|
192 |
+
$("#addthis_atversion_hidden").val(AT_VERSION_300);
|
193 |
+
$(this).closest("form").submit();
|
194 |
+
return false;
|
195 |
+
});
|
196 |
|
197 |
});
|
js/options-page.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
jQuery(document).ready(function($) {
|
2 |
$( "#tabs" ).tabs();
|
3 |
-
|
4 |
var thickDims, tbWidth, tbHeight;
|
5 |
thickDims = function() {
|
6 |
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
@@ -161,4 +160,39 @@ jQuery(document).ready(function($) {
|
|
161 |
|
162 |
$('input[name="addthis_settings[above]"]').change( function(){aboveCustomShow(); aboveCustomStringShow();} );
|
163 |
$('input[name="addthis_settings[below]"]').change( function(){belowCustomShow(); belowCustomStringShow();} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
});
|
1 |
jQuery(document).ready(function($) {
|
2 |
$( "#tabs" ).tabs();
|
|
|
3 |
var thickDims, tbWidth, tbHeight;
|
4 |
thickDims = function() {
|
5 |
var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
|
160 |
|
161 |
$('input[name="addthis_settings[above]"]').change( function(){aboveCustomShow(); aboveCustomStringShow();} );
|
162 |
$('input[name="addthis_settings[below]"]').change( function(){belowCustomShow(); belowCustomStringShow();} );
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Hide Theming and branding options when user selects version 3.0 or above
|
166 |
+
*/
|
167 |
+
var ATVERSION_250 = 250;
|
168 |
+
var AT_VERSION_300 = 300;
|
169 |
+
var MANUAL_UPDATE = -1;
|
170 |
+
var AUTO_UPDATE = 0;
|
171 |
+
var REVERTED = 1;
|
172 |
+
var atVersionUpdateStatus = $("#addthis_atversion_update_status").val();
|
173 |
+
if (atVersionUpdateStatus == REVERTED) {
|
174 |
+
$(".classicFeature").show();
|
175 |
+
} else {
|
176 |
+
$(".classicFeature").hide();
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Revert to older version after the user upgrades
|
181 |
+
*/
|
182 |
+
$(".addthis-revert-atversion").click(function(){
|
183 |
+
$("#addthis_atversion_update_status").val(REVERTED);
|
184 |
+
$("#addthis_atversion_hidden").val(ATVERSION_250);
|
185 |
+
$(this).closest("form").submit();
|
186 |
+
return false;
|
187 |
+
});
|
188 |
+
/**
|
189 |
+
* Update to a newer version
|
190 |
+
*/
|
191 |
+
$(".addthis-update-atversion").click(function(){
|
192 |
+
$("#addthis_atversion_update_status").val(MANUAL_UPDATE);
|
193 |
+
$("#addthis_atversion_hidden").val(AT_VERSION_300);
|
194 |
+
$(this).closest("form").submit();
|
195 |
+
return false;
|
196 |
+
});
|
197 |
+
|
198 |
});
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== AddThis ===
|
2 |
-
Contributors: _mjk_, jorbin, addthis_paul, joesullivan
|
3 |
Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
|
4 |
Requires at least: 2.9
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
The AddThis Social Bookmarking Widget allows any visitor to bookmark and share your site easily with over 330 popular services.
|
9 |
|
@@ -59,7 +59,7 @@ All of the options required through this plugin require javascript. JavaScript
|
|
59 |
1. It's free!
|
60 |
|
61 |
= Who else uses AddThis? =
|
62 |
-
Over
|
63 |
|
64 |
= What services does AddThis support? =
|
65 |
We currently support over 330 services, from email and blogging platforms to social networks and news aggregators, and we add new services every month. Want to know if your favorite service is supported? This list is accurate up to the minute: <a href="http://www.addthis.com/services">http://www.addthis.com/services</a>.
|
@@ -78,6 +78,12 @@ In the screen options you can enable the AddThis meta box. Check the box and sa
|
|
78 |
PHP 5+ is preferred; PHP 4 is supported.
|
79 |
|
80 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
= 2.4.1 =
|
82 |
* Bug fixes
|
83 |
|
@@ -191,6 +197,9 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
|
|
191 |
|
192 |
|
193 |
== Upgrade Notice ==
|
|
|
|
|
|
|
194 |
= 2.4.3 =
|
195 |
Fixed admin console bug for non-administrators.
|
196 |
|
1 |
=== AddThis ===
|
2 |
+
Contributors: _mjk_, jorbin, addthis_paul, joesullivan, solchea, srijith.v
|
3 |
Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
|
4 |
Requires at least: 2.9
|
5 |
+
Tested up to: 3.4.2
|
6 |
+
Stable tag: 2.5.0
|
7 |
|
8 |
The AddThis Social Bookmarking Widget allows any visitor to bookmark and share your site easily with over 330 popular services.
|
9 |
|
59 |
1. It's free!
|
60 |
|
61 |
= Who else uses AddThis? =
|
62 |
+
Over 14,000,000 sites have installed AddThis. With over a billion unique users, AddThis is helping share content all over the world, in more than sixty languages. You might be surprised who's sharing their website using AddThis--<a href="http://www.addthis.com/features#partners">here are just a few</a>.
|
63 |
|
64 |
= What services does AddThis support? =
|
65 |
We currently support over 330 services, from email and blogging platforms to social networks and news aggregators, and we add new services every month. Want to know if your favorite service is supported? This list is accurate up to the minute: <a href="http://www.addthis.com/services">http://www.addthis.com/services</a>.
|
78 |
PHP 5+ is preferred; PHP 4 is supported.
|
79 |
|
80 |
== Changelog ==
|
81 |
+
= 2.5.0 =
|
82 |
+
* <a href="http://www.addthis.com/blog/2012/09/13/introducing-our-new-sharing-experience">New streamlined and simplified share menu</a>
|
83 |
+
* Added Instant Share for Facebook and Twitter
|
84 |
+
* Updated Pinterest support
|
85 |
+
* Bug fixes
|
86 |
+
|
87 |
= 2.4.1 =
|
88 |
* Bug fixes
|
89 |
|
197 |
|
198 |
|
199 |
== Upgrade Notice ==
|
200 |
+
= 2.5.0 =
|
201 |
+
Updated share menu, Instant Share, Pinterest updates and bug fixes.
|
202 |
+
|
203 |
= 2.4.3 =
|
204 |
Fixed admin console bug for non-administrators.
|
205 |
|