\n" .
"" .
"\n" .
'';
// Return the script
return "\n" .
$wpsr_addthis_settings .
"\n\n";
}
function wpsr_addthis($args = ''){
global $post;
$details = wpsr_get_post_details();
$def_url = $details['permalink'];
$def_title = $details['title'];
## Get Addthis Options
$wpsr_addthis = get_option('wpsr_addthis_data');
$defaults = array (
'output' => 'button',
'url' => $def_url,
'title' => $def_title,
'type' => 'button',
'btstyle' => 'lg-share-',
'tbstyle' => '16px',
'tbservices' => 'facebook,twitter,digg,delicious,email,compact',
'scstyle' => 'normal',
'username' => $wpsr_addthis['username'],
'lang' => 'en',
'text' => __('Share with Addthis' ,'wpsr'),
'params' => '',
);
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
## Adjustments
$url = ' addthis:url="' . $url .'"' ;
$title = ' addthis:title="' . $title .'"' ;
$btwidth = (strpos($btstyle, 'lg') === false) ? '83' : '125';
$addthis_processed = "\n\n";
switch($output){
// Output the ordinary button
case 'button':
switch($type){
// Display the toolbar
case 'toolbar':
$style = ($tbstyle == '16px') ? 'addthis_default_style' : 'addthis_default_style addthis_32x32_style';
$outer_start = '
' . "\n";
$outer_end = '
';
$default_code = '';
switch($tbstyle){
case '16px':
if($tbservices == ''){
$inner = $default_code;
}else{
$tb_16px = explode(',', $tbservices);
foreach($tb_16px as $tb_16px_srvc){
$tb_16px_srvc = trim($tb_16px_srvc);
$inner .= "\n";
}
}
break;
case '32px':
if($tbservices == ''){
$inner = $default_code;
}else{
$tb_32px = explode(',', $tbservices);
foreach($tb_32px as $tb_32px_srvc){
$tb_32px_srvc = trim($tb_32px_srvc);
$inner .= "\n";
}
}
break;
}
$addthis_processed .= $outer_start . $inner . $outer_end;
break;
// Display the sharecount
case 'sharecount':
$outer_start = "\n" . '' . "\n";
$outer_end = '
' . "\n";
switch($scstyle){
case 'normal':
$inner = '';
break;
case 'pill':
$inner = '';
break;
case 'grouped':
$inner = '';
break;
}
$addthis_processed .= $outer_start . $inner . $outer_end;
break;
// Display the ordinary button
case 'button':
$addthis_processed .=
'
';
break;
}
break;
case 'text':
$addthis_processed .=
'' . $text . '';
break;
}
$addthis_processed .= "\n\n";
return $addthis_processed;
}
## Addthis function
function wpsr_addthis_bt($type, $tbstyle = '16px'){
## Addthis Options
$wpsr_addthis = get_option('wpsr_addthis_data');
## Start Output
$wpsr_addthis_bt_processed = wpsr_addthis(array(
'output' => 'button',
'type' => $type,
'tbstyle' => $tbstyle,
'scstyle' => $wpsr_addthis['sharecount'],
'btstyle' => $wpsr_addthis['button'],
'tbservices' => ($tbstyle == '16px') ? $wpsr_addthis['tb_16pxservices'] : $wpsr_addthis['tb_32pxservices'],
'lang' => $wpsr_addthis['language'],
));
## End Output
return $wpsr_addthis_bt_processed;
}
function wpsr_addthis_rss_bt(){
## Get the Options
$wpsr_addthis = get_option('wpsr_addthis_data');
## Start Output
$wpsr_addthis_processed = wpsr_addthis(array(
'output' => 'text',
'type' => 'button',
'btstyle' => $wpsr_addthis['button'],
'lang' => $wpsr_addthis['language'],
'params' => 'target="_blank"',
));
## End Output
return $wpsr_addthis_processed;
}
?>