of your page, so feel free to add it anywhere...
Current Arguments:
* username -- created on addthis.com site -
if you sign up for a username on addthis.com, you can access addthis.com's sharing statistics.
even anonymous users seem to have usernames assigned in the form of a long string of
random-ish characters (i.e. "49fd93d418b90e5e")... it may or may not work without it (i haven't
checked), so to get the anonymous username just hit the "get your button code" button on the
addthis.com site, and look for the part of the script that says something like:
var addthis_pub="49fd93d418b90e5e";
use the number generated for you in quotes for your username if you don't have a username...
* btn - button styles -
-- the standard ones currently enabled are "plus", "sm-share", "lg-share", "sm-bookmark", "lg-bookmark",
and "lg-addthis"; the default is "sm-share"
-- you can also create your own custom image and use it instead - just
1. add your custom image to your pub directory
2. declare it in config.php: $AddThis_customBtn = $PubDirUrl."/AddThisWidget/AddThis_myCustomBtn.png";
3. call it in the Markup: (:addThis username="myusername" btn="custom":)
- there are currently two versions: "custom" & "custom_NoText" - custom adds $AddThis_defaultText after it as a text link
-- and finally, you can just use text, which is set by $AddThis_defaultText
More info on the 'Add This' widget: http://addthis.com
This file is a modification to version 2011-08-11. It should work under PHP 5.5 and higher
*/
# Version date
$RecipeInfo['AddThisWidget']['Version'] = '2015-08-011b';
# Defaults
SDV($AddThis_customBtn, ''); // no custom button defined
SDV($AddThis_defaultText, 'Share');
# 'AddThis' Markup -- accepts both lower-case and uppercase: addThis & AddThis
Markup_e('addThisWidget', 'directives',
'/\\(:addThis (.*?):\\)/i',
"addThisWidgetFunc(\$m[1],\$m[2])");
# OR
Markup_e('AddThisWidget', 'directives',
'/\\(:addThis (.*?):\\)/i',
"addThisWidgetFunc(\$m[1],\$m[2])");
# 'AddThis' Widget Function
function addThisWidgetFunc($args) {
global $pagename, $AddThis_customBtn, $AddThis_defaultText;
// ARGS //
$args = ParseArgs($args); // get parameters...
$addThisUsername = $args['username']; // username
$addThisButtonInput = $args['btn'];
//$addThisButtonSize = $args['size'];
// BUTTON TYPES //
if ($addThisButtonInput=='custom') {
// USE CUSTOM BTN w/ TEXT LINK -- add your own custom button info here, and use btn="custom" to call it
$addThisBtnOut = '
'.$AddThis_defaultText;
} elseif ($addThisButtonInput=='custom_NoText') {
// USE CUSTOM BTN -- add your own custom button info here, and use btn="custom_NoText" to call it
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='text') {
// USE TEXT LINK, NO BUTTON -- add your own custom button info here, and use btn="custom_NoText" to call it
$addThisBtnOut = $AddThis_defaultText;
} elseif ($addThisButtonInput=='sm-share' || $addThisButtonInput=='' || $addThisButtonInput=='default') {
// SMALL SHARE BTN
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='lg-share') {
// LARGE SHARE BTN
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='plus') {
// PLUS (+) button
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='lg-bookmark') {
// LARGE BOOKMARK BTN
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='sm-bookmark') {
// SMALL BOOKMARK BTN
$addThisBtnOut = '
';
} elseif ($addThisButtonInput=='lg-addthis') {
// LARGE ADD THIS BTN
$addThisBtnOut = '
';
}
// OUTPUT //
if ($addThisButtonInput=='custom') {
$customStyle = ' style="text-decoration:none;"'; // this is added to the
tag
}
// OUTPUT - STANDARD //
$addThis_out = '
'.$addThisBtnOut.'';
$addThis_out = Keep("$addThis_out");
return "$addThis_out";
}