Version Description
- Minor updates
Download this release
Release Info
Developer | srijith.v |
Plugin | WordPress Share Buttons Plugin – AddThis |
Version | 3.5.7 |
Comparing to | |
See all releases |
Code changes from version 3.5.6 to 3.5.7
- addthis_social_widget.php +133 -87
- includes/addthis_addjs.php +8 -1
- readme.txt +8 -2
addthis_social_widget.php
CHANGED
@@ -23,7 +23,7 @@
|
|
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: 3.5.
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
@@ -46,8 +46,8 @@ function addthis_early(){
|
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
-
define( 'ADDTHIS_PLUGIN_VERSION' , '3.5.
|
50 |
-
define( 'ADDTHIS_PRODUCT_VERSION' , 'wpp-3.5.
|
51 |
define( 'ADDTHIS_ATVERSION', '300');
|
52 |
define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
|
53 |
define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
|
@@ -174,6 +174,9 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
174 |
if ($show_stats = get_option('addthis_show_stats'))
|
175 |
$addthis_new_options['addthis_show_stats'] = $show_stats;
|
176 |
|
|
|
|
|
|
|
177 |
if ($append_data = get_option('addthis_append_data'))
|
178 |
$addthis_new_options['addthis_append_data'] = $append_data;
|
179 |
|
@@ -230,6 +233,7 @@ if ( apply_filters( 'at_do_options_upgrades', '__return_true') || apply_filters(
|
|
230 |
// if the option saved, delete the old options
|
231 |
|
232 |
delete_option('addthis_show_stats');
|
|
|
233 |
delete_option('addthis_password');
|
234 |
delete_option('addthis_fallback_username');
|
235 |
delete_option('addthis_options');
|
@@ -311,11 +315,11 @@ function addthis_get_wp_version() {
|
|
311 |
/**
|
312 |
* For templates, we need a wrapper for printing out the code on demand.
|
313 |
*/
|
314 |
-
function addthis_print_widget($url=null, $title=null, $style = addthis_style_default
|
315 |
global $addthis_styles, $addthis_new_styles;
|
316 |
$styles = array_merge($addthis_styles, $addthis_new_styles);
|
317 |
|
318 |
-
if (
|
319 |
$preview = true;
|
320 |
else
|
321 |
$options = get_option('addthis_settings');
|
@@ -323,20 +327,15 @@ function addthis_print_widget($url=null, $title=null, $style = addthis_style_def
|
|
323 |
$identifier = addthis_get_identifier($url, $title);
|
324 |
|
325 |
echo "\n<!-- AddThis Custom -->\n";
|
326 |
-
if (
|
327 |
echo sprintf($addthis_new_styles[$style]['src'], $identifier);
|
328 |
-
}
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
elseif ($style
|
335 |
-
{
|
336 |
-
if ( isset ($styles[$options['below']]['src'] ))
|
337 |
-
echo sprintf($styles[$options['below']]['src'], $identifier);
|
338 |
-
}
|
339 |
-
elseif (is_array($style))
|
340 |
echo addthis_custom_toolbox($style, $url, $title);
|
341 |
echo "\n<!-- End AddThis Custom -->\n";
|
342 |
}
|
@@ -990,7 +989,7 @@ if (isset($data['addthis_copytrackingremove']) && $data['addthis_copytrackingrem
|
|
990 |
unset($data['addthis_copytracking1']);
|
991 |
|
992 |
// All the checkbox fields
|
993 |
-
foreach (array('addthis_show_stats', 'addthis_append_data', 'addthis_showonhome', 'addthis_showonpages', 'addthis_showonarchives', 'addthis_showoncats', 'addthis_showonexcerpts', 'addthis_aftertitle' , 'addthis_beforecomments', 'addthis_addressbar','addthis_508','addthis_copytracking2' ) as $field)
|
994 |
{
|
995 |
if ( isset($data[$field]) && $data[$field] == true)
|
996 |
$options[$field] = true;
|
@@ -1362,6 +1361,73 @@ function addthis_display_social_widget_excerpt($content)
|
|
1362 |
return $content;
|
1363 |
}
|
1364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
|
1366 |
function addthis_display_social_widget($content, $filtered = true, $below_excerpt = false)
|
1367 |
{
|
@@ -1437,41 +1503,8 @@ function addthis_display_social_widget($content, $filtered = true, $below_excerp
|
|
1437 |
// Still here? Well let's add some social goodness
|
1438 |
if ( isset( $options['above'] ) && $options['above'] != 'none' && $options['above'] != 'disable' && $display )
|
1439 |
{
|
1440 |
-
|
1441 |
-
{
|
1442 |
-
if (isset ($options['above_chosen_list']) && strlen($options['above_chosen_list']) != 0) {
|
1443 |
-
if (isset ($options['above']) && $options['above'] == 'large_toolbox') {
|
1444 |
-
$aboveOptions['size'] = '32';
|
1445 |
}
|
1446 |
-
elseif (isset ($options['above']) && $options['above'] == 'small_toolbox') {
|
1447 |
-
$aboveOptions['size'] = '16';
|
1448 |
-
}
|
1449 |
-
$aboveOptions['type'] = $options['above'];
|
1450 |
-
$aboveOptions['services'] = $options['above_chosen_list'];
|
1451 |
-
$aboveOptions['addthis_options'] = $options['addthis_options'];
|
1452 |
-
$above = apply_filters('addthis_above_content', addthis_custom_toolbox($aboveOptions, $url, $title) );
|
1453 |
-
}
|
1454 |
-
else {
|
1455 |
-
$above = apply_filters('addthis_above_content', $styles[$options['above']]['src']);
|
1456 |
-
}
|
1457 |
-
}
|
1458 |
-
elseif ($options['above'] == 'custom')
|
1459 |
-
{
|
1460 |
-
$aboveOptions['size'] = $options['above_custom_size'];
|
1461 |
-
if ($options['above_do_custom_services'])
|
1462 |
-
$aboveOptions['services'] = $options['above_custom_services'];
|
1463 |
-
if ($options['above_do_custom_preferred'])
|
1464 |
-
$aboveOptions['preferred'] = $options['above_custom_preferred'];
|
1465 |
-
$aboveOptions['more'] = $options['above_custom_more'];
|
1466 |
-
$aboveOptions['addthis_options'] = $options['addthis_options'];
|
1467 |
-
$above = apply_filters('addthis_above_content', addthis_custom_toolbox($aboveOptions, $url, $title) );
|
1468 |
-
}
|
1469 |
-
elseif( $options['above'] == 'custom_string')
|
1470 |
-
{
|
1471 |
-
$custom = preg_replace( '/<\s*div\s*/', '<div %1$s ', $options['above_custom_string'] );
|
1472 |
-
$above = apply_filters('addthis_above_content', $custom);
|
1473 |
-
}
|
1474 |
-
}
|
1475 |
elseif ($display)
|
1476 |
$above = apply_filters('addthis_above_content','' );
|
1477 |
else
|
@@ -1479,39 +1512,8 @@ function addthis_display_social_widget($content, $filtered = true, $below_excerp
|
|
1479 |
|
1480 |
if ( isset( $options['below'] ) && $options['below'] != 'none' && $options['below'] != 'disable' && $display && ! $below_excerpt )
|
1481 |
{
|
1482 |
-
|
1483 |
-
{
|
1484 |
-
if (isset ($options['below_chosen_list']) && strlen($options['below_chosen_list']) != 0) {
|
1485 |
-
if (isset ($options['below']) && $options['below'] == 'large_toolbox') {
|
1486 |
-
$belowOptions['size'] = '32';
|
1487 |
}
|
1488 |
-
elseif (isset ($options['below']) && $options['below'] == 'small_toolbox') {
|
1489 |
-
$belowOptions['size'] = '16';
|
1490 |
-
}
|
1491 |
-
$belowOptions['type'] = $options['below'];
|
1492 |
-
$belowOptions['services'] = $options['below_chosen_list'];
|
1493 |
-
$belowOptions['addthis_options'] = $options['addthis_options'];
|
1494 |
-
$below = apply_filters('addthis_above_content', addthis_custom_toolbox($belowOptions, $url, $title) );
|
1495 |
-
}
|
1496 |
-
else {
|
1497 |
-
$below = apply_filters('addthis_below_content', $styles[$options['below']]['src']);
|
1498 |
-
}
|
1499 |
-
}
|
1500 |
-
elseif ($options['below'] == 'custom')
|
1501 |
-
{
|
1502 |
-
$belowOptions['size'] = $options['below_custom_size'];
|
1503 |
-
$belowOptions['services'] = $options['below_custom_services'];
|
1504 |
-
$belowOptions['preferred'] = $options['below_custom_preferred'];
|
1505 |
-
$belowOptions['more'] = $options['below_custom_more'];
|
1506 |
-
$belowOptions['addthis_options'] = $options['addthis_options'];
|
1507 |
-
$below = apply_filters('addthis_below_content', addthis_custom_toolbox($belowOptions, $url, $title) );
|
1508 |
-
}
|
1509 |
-
elseif( $options['below'] == 'custom_string')
|
1510 |
-
{
|
1511 |
-
$custom = preg_replace( '/<\s*div\s*/', '<div %1$s ', $options['below_custom_string'] );
|
1512 |
-
$below = apply_filters('addthis_below_content', $custom);
|
1513 |
-
}
|
1514 |
-
}
|
1515 |
elseif ($below_excerpt && $display && $options['below'] != 'none' )
|
1516 |
{
|
1517 |
$below = apply_filters('addthis_below_content','' );
|
@@ -1948,6 +1950,7 @@ function addthis_admin_menu()
|
|
1948 |
'below' => 'fb_tw_p1_sc',
|
1949 |
'above' => 'large_toolbox',
|
1950 |
'addthis_show_stats' => true,
|
|
|
1951 |
'addthis_append_data'=> true,
|
1952 |
'addthis_showonhome' => true,
|
1953 |
'addthis_showonpages' => true,
|
@@ -2023,7 +2026,7 @@ function addthis_plugin_options_php4() {
|
|
2023 |
if ($addthis_options == false)
|
2024 |
add_option('addthis_settings', array() );
|
2025 |
|
2026 |
-
foreach ( array( 'addthis_show_stats', 'addthis_append_data', 'addthis_showonhome', 'addthis_showonpages', 'addthis_showonarchives', 'addthis_showoncats' ) as $option)
|
2027 |
{
|
2028 |
if ( $addthis_options && ! isset($addthis_options[$option]) )
|
2029 |
$addthis_options[$option] = false;
|
@@ -2032,7 +2035,18 @@ function addthis_plugin_options_php4() {
|
|
2032 |
extract($options);
|
2033 |
?>
|
2034 |
|
2035 |
-
<p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2036 |
<img alt='addthis' src="//cache.addthis.com/icons/v1/thumbs/32x32/more.png" class="header-img"/>
|
2037 |
<span class="addthis-title">AddThis</span> <span class="addthis-plugin-name">Share</span>
|
2038 |
<div class="page-header" id="tabs">
|
@@ -2241,6 +2255,10 @@ function addthis_plugin_options_php4() {
|
|
2241 |
<th scope="row"><?php _e("Show analytics in admin dashboard:", 'addthis_trans_domain' ); ?></th>
|
2242 |
<td><input type="checkbox" name="addthis_settings[addthis_show_stats]" value="true" <?php echo ($addthis_show_stats == true ? 'checked="checked"' : ''); ?>/></td>
|
2243 |
</tr>
|
|
|
|
|
|
|
|
|
2244 |
<tr>
|
2245 |
<tr>
|
2246 |
<th scope="row"><?php _e("Enable enhanced accessibility:", 'addthis_trans_domain' ); ?></th>
|
@@ -2403,5 +2421,33 @@ if (! function_exists('get_first_twitter_username'))
|
|
2403 |
}
|
2404 |
|
2405 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2406 |
require_once('addthis_post_metabox.php');
|
2407 |
|
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: 3.5.7
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
+
define( 'ADDTHIS_PLUGIN_VERSION' , '3.5.7');
|
50 |
+
define( 'ADDTHIS_PRODUCT_VERSION' , 'wpp-3.5.7');
|
51 |
define( 'ADDTHIS_ATVERSION', '300');
|
52 |
define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
|
53 |
define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
|
174 |
if ($show_stats = get_option('addthis_show_stats'))
|
175 |
$addthis_new_options['addthis_show_stats'] = $show_stats;
|
176 |
|
177 |
+
if ($asynchronous_loading = get_option('addthis_asynchronous_loading'))
|
178 |
+
$addthis_new_options['addthis_asynchronous_loading'] = $asynchronous_loading;
|
179 |
+
|
180 |
if ($append_data = get_option('addthis_append_data'))
|
181 |
$addthis_new_options['addthis_append_data'] = $append_data;
|
182 |
|
233 |
// if the option saved, delete the old options
|
234 |
|
235 |
delete_option('addthis_show_stats');
|
236 |
+
delete_option('addthis_asynchronous_loading');
|
237 |
delete_option('addthis_password');
|
238 |
delete_option('addthis_fallback_username');
|
239 |
delete_option('addthis_options');
|
315 |
/**
|
316 |
* For templates, we need a wrapper for printing out the code on demand.
|
317 |
*/
|
318 |
+
function addthis_print_widget($url = null, $title = null, $style = addthis_style_default) {
|
319 |
global $addthis_styles, $addthis_new_styles;
|
320 |
$styles = array_merge($addthis_styles, $addthis_new_styles);
|
321 |
|
322 |
+
if (isset($_GET['preview']) && $_GET['preview'] == 1 && $options = get_transient('addthis_settings'))
|
323 |
$preview = true;
|
324 |
else
|
325 |
$options = get_option('addthis_settings');
|
327 |
$identifier = addthis_get_identifier($url, $title);
|
328 |
|
329 |
echo "\n<!-- AddThis Custom -->\n";
|
330 |
+
if (!is_array($style) && isset($addthis_new_styles[$style])) {
|
331 |
echo sprintf($addthis_new_styles[$style]['src'], $identifier);
|
332 |
+
} elseif ($style == 'above') {
|
333 |
+
$above = addthis_display_widget_above($styles, $url, $title, $options);
|
334 |
+
echo sprintf($above, $identifier);
|
335 |
+
} elseif ($style == 'below') {
|
336 |
+
$below = addthis_display_widget_below($styles, $url, $title, $options);
|
337 |
+
echo sprintf($below, $identifier);
|
338 |
+
} elseif (is_array($style))
|
|
|
|
|
|
|
|
|
|
|
339 |
echo addthis_custom_toolbox($style, $url, $title);
|
340 |
echo "\n<!-- End AddThis Custom -->\n";
|
341 |
}
|
989 |
unset($data['addthis_copytracking1']);
|
990 |
|
991 |
// All the checkbox fields
|
992 |
+
foreach (array('addthis_show_stats', 'addthis_asynchronous_loading','addthis_append_data', 'addthis_showonhome', 'addthis_showonpages', 'addthis_showonarchives', 'addthis_showoncats', 'addthis_showonexcerpts', 'addthis_aftertitle' , 'addthis_beforecomments', 'addthis_addressbar','addthis_508','addthis_copytracking2' ) as $field)
|
993 |
{
|
994 |
if ( isset($data[$field]) && $data[$field] == true)
|
995 |
$options[$field] = true;
|
1361 |
return $content;
|
1362 |
}
|
1363 |
|
1364 |
+
function addthis_display_widget_above($styles, $url, $title, $options) {
|
1365 |
+
$above = '';
|
1366 |
+
if (isset($styles[$options['above']])) {
|
1367 |
+
if (isset($options['above_chosen_list']) && strlen($options['above_chosen_list']) != 0) {
|
1368 |
+
if (isset($options['above']) && $options['above'] == 'large_toolbox') {
|
1369 |
+
$aboveOptions['size'] = '32';
|
1370 |
+
} elseif (isset($options['above']) && $options['above'] == 'small_toolbox') {
|
1371 |
+
$aboveOptions['size'] = '16';
|
1372 |
+
}
|
1373 |
+
$aboveOptions['type'] = $options['above'];
|
1374 |
+
$aboveOptions['services'] = $options['above_chosen_list'];
|
1375 |
+
if(isset($options['addthis_options']))
|
1376 |
+
$aboveOptions['addthis_options'] = $options['addthis_options'];
|
1377 |
+
else
|
1378 |
+
$aboveOptions['addthis_options'] = '';
|
1379 |
+
$above = apply_filters('addthis_above_content', addthis_custom_toolbox($aboveOptions, $url, $title));
|
1380 |
+
} else {
|
1381 |
+
$above = apply_filters('addthis_above_content', $styles[$options['above']]['src']);
|
1382 |
+
}
|
1383 |
+
} elseif ($options['above'] == 'custom') {
|
1384 |
+
$aboveOptions['size'] = $options['above_custom_size'];
|
1385 |
+
if ($options['above_do_custom_services'])
|
1386 |
+
$aboveOptions['services'] = $options['above_custom_services'];
|
1387 |
+
if ($options['above_do_custom_preferred'])
|
1388 |
+
$aboveOptions['preferred'] = $options['above_custom_preferred'];
|
1389 |
+
$aboveOptions['more'] = $options['above_custom_more'];
|
1390 |
+
$aboveOptions['addthis_options'] = $options['addthis_options'];
|
1391 |
+
$above = apply_filters('addthis_above_content', addthis_custom_toolbox($aboveOptions, $url, $title));
|
1392 |
+
} elseif ($options['above'] == 'custom_string') {
|
1393 |
+
$custom = preg_replace('/<\s*div\s*/', '<div %1$s ', $options['above_custom_string']);
|
1394 |
+
$above = apply_filters('addthis_above_content', $custom);
|
1395 |
+
}
|
1396 |
+
return $above;
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
function addthis_display_widget_below($styles, $url, $title, $options) {
|
1400 |
+
$below = '';
|
1401 |
+
if (isset($styles[$options['below']])) {
|
1402 |
+
if (isset($options['below_chosen_list']) && strlen($options['below_chosen_list']) != 0) {
|
1403 |
+
if (isset($options['below']) && $options['below'] == 'large_toolbox') {
|
1404 |
+
$belowOptions['size'] = '32';
|
1405 |
+
} elseif (isset($options['below']) && $options['below'] == 'small_toolbox') {
|
1406 |
+
$belowOptions['size'] = '16';
|
1407 |
+
}
|
1408 |
+
$belowOptions['type'] = $options['below'];
|
1409 |
+
$belowOptions['services'] = $options['below_chosen_list'];
|
1410 |
+
if(isset($options['addthis_options']))
|
1411 |
+
$belowOptions['addthis_options'] = $options['addthis_options'];
|
1412 |
+
else
|
1413 |
+
$belowOptions['addthis_options'] = '';
|
1414 |
+
$below = apply_filters('addthis_above_content', addthis_custom_toolbox($belowOptions, $url, $title));
|
1415 |
+
} else {
|
1416 |
+
$below = apply_filters('addthis_below_content', $styles[$options['below']]['src']);
|
1417 |
+
}
|
1418 |
+
} elseif ($options['below'] == 'custom') {
|
1419 |
+
$belowOptions['size'] = $options['below_custom_size'];
|
1420 |
+
$belowOptions['services'] = $options['below_custom_services'];
|
1421 |
+
$belowOptions['preferred'] = $options['below_custom_preferred'];
|
1422 |
+
$belowOptions['more'] = $options['below_custom_more'];
|
1423 |
+
$belowOptions['addthis_options'] = $options['addthis_options'];
|
1424 |
+
$below = apply_filters('addthis_below_content', addthis_custom_toolbox($belowOptions, $url, $title));
|
1425 |
+
} elseif ($options['below'] == 'custom_string') {
|
1426 |
+
$custom = preg_replace('/<\s*div\s*/', '<div %1$s ', $options['below_custom_string']);
|
1427 |
+
$below = apply_filters('addthis_below_content', $custom);
|
1428 |
+
}
|
1429 |
+
return $below;
|
1430 |
+
}
|
1431 |
|
1432 |
function addthis_display_social_widget($content, $filtered = true, $below_excerpt = false)
|
1433 |
{
|
1503 |
// Still here? Well let's add some social goodness
|
1504 |
if ( isset( $options['above'] ) && $options['above'] != 'none' && $options['above'] != 'disable' && $display )
|
1505 |
{
|
1506 |
+
$above = addthis_display_widget_above($styles, $url, $title, $options);
|
|
|
|
|
|
|
|
|
1507 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1508 |
elseif ($display)
|
1509 |
$above = apply_filters('addthis_above_content','' );
|
1510 |
else
|
1512 |
|
1513 |
if ( isset( $options['below'] ) && $options['below'] != 'none' && $options['below'] != 'disable' && $display && ! $below_excerpt )
|
1514 |
{
|
1515 |
+
$below = addthis_display_widget_below($styles, $url, $title, $options);
|
|
|
|
|
|
|
|
|
1516 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1517 |
elseif ($below_excerpt && $display && $options['below'] != 'none' )
|
1518 |
{
|
1519 |
$below = apply_filters('addthis_below_content','' );
|
1950 |
'below' => 'fb_tw_p1_sc',
|
1951 |
'above' => 'large_toolbox',
|
1952 |
'addthis_show_stats' => true,
|
1953 |
+
'addthis_asynchronous_loading' => true,
|
1954 |
'addthis_append_data'=> true,
|
1955 |
'addthis_showonhome' => true,
|
1956 |
'addthis_showonpages' => true,
|
2026 |
if ($addthis_options == false)
|
2027 |
add_option('addthis_settings', array() );
|
2028 |
|
2029 |
+
foreach ( array( 'addthis_show_stats', 'addthis_asynchronous_loading','addthis_append_data', 'addthis_showonhome', 'addthis_showonpages', 'addthis_showonarchives', 'addthis_showoncats' ) as $option)
|
2030 |
{
|
2031 |
if ( $addthis_options && ! isset($addthis_options[$option]) )
|
2032 |
$addthis_options[$option] = false;
|
2035 |
extract($options);
|
2036 |
?>
|
2037 |
|
2038 |
+
<p>
|
2039 |
+
<?php if(!is_pro_user()) { ?>
|
2040 |
+
<div class="updated addthis_setup_nag">
|
2041 |
+
<p>AddThis Pro now available - start your trial at
|
2042 |
+
<a href="http://www.addthis.com" target="_blank">www.addthis.com</a>
|
2043 |
+
and get premium widgets, personalized content recommendations,
|
2044 |
+
advanced customization options and priority support.
|
2045 |
+
</p>
|
2046 |
+
</div>
|
2047 |
+
<?php } ?>
|
2048 |
+
<?php echo $addthis_addjs->getAtPluginPromoText(); ?>
|
2049 |
+
</p>
|
2050 |
<img alt='addthis' src="//cache.addthis.com/icons/v1/thumbs/32x32/more.png" class="header-img"/>
|
2051 |
<span class="addthis-title">AddThis</span> <span class="addthis-plugin-name">Share</span>
|
2052 |
<div class="page-header" id="tabs">
|
2255 |
<th scope="row"><?php _e("Show analytics in admin dashboard:", 'addthis_trans_domain' ); ?></th>
|
2256 |
<td><input type="checkbox" name="addthis_settings[addthis_show_stats]" value="true" <?php echo ($addthis_show_stats == true ? 'checked="checked"' : ''); ?>/></td>
|
2257 |
</tr>
|
2258 |
+
<tr>
|
2259 |
+
<th scope="row"><?php _e("Asynchronous Loading:", 'addthis_trans_domain' ); ?></th>
|
2260 |
+
<td><input type="checkbox" name="addthis_settings[addthis_asynchronous_loading]" value="true" <?php echo ($addthis_asynchronous_loading == true ? 'checked="checked"' : ''); ?>/></td>
|
2261 |
+
</tr>
|
2262 |
<tr>
|
2263 |
<tr>
|
2264 |
<th scope="row"><?php _e("Enable enhanced accessibility:", 'addthis_trans_domain' ); ?></th>
|
2421 |
}
|
2422 |
|
2423 |
|
2424 |
+
// check for pro user
|
2425 |
+
function is_pro_user() {
|
2426 |
+
$isPro = false;
|
2427 |
+
$options = get_option('addthis_settings');
|
2428 |
+
$profile = $options['profile'];
|
2429 |
+
if ($profile) {
|
2430 |
+
$profile_code = str_replace('-', '', $profile);
|
2431 |
+
$ch = curl_init();
|
2432 |
+
curl_setopt($ch, CURLOPT_URL, "http://q.addthis.com/feeds/1.0/config.json?pubid=" . $profile);
|
2433 |
+
|
2434 |
+
// receive server response ...
|
2435 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
2436 |
+
|
2437 |
+
// further processing ....
|
2438 |
+
$server_output = curl_exec($ch);
|
2439 |
+
curl_close($ch);
|
2440 |
+
|
2441 |
+
$array = json_decode($server_output);
|
2442 |
+
// check for pro user
|
2443 |
+
if (array_key_exists('_default',$array)) {
|
2444 |
+
$isPro = true;
|
2445 |
+
} else {
|
2446 |
+
$isPro = false;
|
2447 |
+
}
|
2448 |
+
}
|
2449 |
+
return $isPro;
|
2450 |
+
}
|
2451 |
+
|
2452 |
require_once('addthis_post_metabox.php');
|
2453 |
|
includes/addthis_addjs.php
CHANGED
@@ -164,7 +164,14 @@ Class AddThis_addjs{
|
|
164 |
}
|
165 |
|
166 |
function addWidgetToJs(){
|
167 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
}
|
169 |
|
170 |
function addAfterToJs(){
|
164 |
}
|
165 |
|
166 |
function addWidgetToJs(){
|
167 |
+
$addthis_settings_options = get_option('addthis_settings');
|
168 |
+
$addthis_asynchronous_loading = $addthis_settings_options['addthis_asynchronous_loading'];
|
169 |
+
if(isset($addthis_asynchronous_loading) && $addthis_asynchronous_loading) {
|
170 |
+
$this->jsToAdd .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$this->atversion.'/addthis_widget.js#pubid='. urlencode( $this->pubid ).'&async=1"></script>';
|
171 |
+
$this->jsToAdd .= '<script type="text/javascript">jQuery(document).ready(function($) { addthis.init(); }); </script>';
|
172 |
+
} else {
|
173 |
+
$this->jsToAdd .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$this->atversion.'/addthis_widget.js#pubid='. urlencode( $this->pubid ).'"></script>';
|
174 |
+
}
|
175 |
}
|
176 |
|
177 |
function addAfterToJs(){
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: srijith.v, solchea, _mjk_, addthis_paul
|
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: 3.0
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 3.5.
|
7 |
|
8 |
AddThis Share Buttons help drive traffic to your site by helping visitors share, bookmark and email your content to over 330 services.
|
9 |
|
@@ -76,6 +76,9 @@ PHP 5+ is preferred; PHP 4 is supported.
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
79 |
= 3.5.6 =
|
80 |
* Fix for better analytics
|
81 |
|
@@ -252,6 +255,9 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
|
|
252 |
|
253 |
== Upgrade Notice ==
|
254 |
|
|
|
|
|
|
|
255 |
= 3.5.5 =
|
256 |
Bug fixes
|
257 |
|
2 |
Contributors: srijith.v, solchea, _mjk_, addthis_paul
|
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: 3.0
|
5 |
+
Tested up to: 3.8.1
|
6 |
+
Stable tag: 3.5.7
|
7 |
|
8 |
AddThis Share Buttons help drive traffic to your site by helping visitors share, bookmark and email your content to over 330 services.
|
9 |
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 3.5.7 =
|
80 |
+
* Minor updates
|
81 |
+
|
82 |
= 3.5.6 =
|
83 |
* Fix for better analytics
|
84 |
|
255 |
|
256 |
== Upgrade Notice ==
|
257 |
|
258 |
+
= 3.5.6 =
|
259 |
+
Minor updates
|
260 |
+
|
261 |
= 3.5.5 =
|
262 |
Bug fixes
|
263 |
|