예제 #1
0
function wpsr_sharethis_config()
{
    ## Sharethis options
    $wpsr_sharethis = get_option('wpsr_sharethis_data');
    $wpsr_sharethis_pubkey = $wpsr_sharethis['pubkey'];
    $wpsr_sharethis_pubkey = $wpsr_sharethis_pubkey == '' ? wpsr_sharethis_pubkey() : $wpsr_sharethis_pubkey;
    // Return the script
    return "\n<!-- WP Socializer - ShareThis Config -->\n" . '<script type="text/javascript">
var sharethisLoad = function(){ stLight.options({publisher:\'' . $wpsr_sharethis_pubkey . '\'}); }, st_type=\'wordpress\';
if(window.addEventListener) window.addEventListener("load", sharethisLoad, false); 
else if (window.attachEvent) window.attachEvent("onload", sharethisLoad);
</script>' . "\n<!-- WP Socializer - End ShareThis Config -->\n";
}
예제 #2
0
function wpsr_sharethis_config()
{
    ## Sharethis options
    $wpsr_sharethis = get_option('wpsr_sharethis_data');
    $wpsr_sharethis_pubkey = $wpsr_sharethis['pubkey'];
    $wpsr_sharethis_pubkey = $wpsr_sharethis_pubkey == '' ? wpsr_sharethis_pubkey() : $wpsr_sharethis_pubkey;
    $wpsr_sharethis_copynshare = $wpsr_sharethis['copynshare'] ? 'true' : 'false';
    // Return the script
    return '<!-- WP Socializer - ShareThis Config -->
<script type="text/javascript">
var switchTo5x=false;
var sharethisLoad = function(){
	' . "stLight.options({publisher: '{$wpsr_sharethis_pubkey}', doNotHash: {$wpsr_sharethis_copynshare}, doNotCopy: {$wpsr_sharethis_copynshare}, hashAddressBar: false});" . '
};
if(window.addEventListener) window.addEventListener("load", sharethisLoad, false); 
else if (window.attachEvent) window.attachEvent("onload", sharethisLoad);
</script>
<!-- WP Socializer - End ShareThis Config -->';
}