Index: deals.isengard/httpdocs/sites/all/modules/addthis/addthis.module
===================================================================
--- deals.isengard.orig/httpdocs/sites/all/modules/addthis/addthis.module 2009-11-29 21:06:24.000000000 +0000
+++ deals.isengard/httpdocs/sites/all/modules/addthis/addthis.module 2009-11-29 21:06:32.000000000 +0000
@@ -146,6 +146,7 @@
* Theme the AddThis button.
*/
function theme_addthis_button($node, $teaser) {
+ static $has_script = FALSE;
// Fix IE's bug.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
drupal_add_link(array(
@@ -168,20 +169,24 @@
));
}
else {
+
+ if($has_script == FALSE)
+ {
+ $url = ($_SERVER['HTTPS'] == 'on' ? 'https://secure.addthis.com' : 'http://s7.addthis.com') . '/js/' . variable_get('addthis_widget_version', '152') . '/addthis_widget.js';
+ drupal_add_js('document.write(unescape("%3Cscript src=\''. $url .'\' type=\'text/javascript\'%3E%3C/script%3E"));', 'inline','header');
+ $has_script = TRUE;
+ }
return ( sprintf('
-
- ',
+ onclick="return addthis_sendto()">
',
$teaser ? url('node/'. $node->nid, array('absolute' => 1) ) : '[URL]',
$teaser ? addslashes($node->title) : '[TITLE]',
$_SERVER['HTTPS'] == 'on' ? addslashes(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif')) : addslashes(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif')),
addslashes(variable_get('addthis_image_width', '125')),
addslashes(variable_get('addthis_image_height', '16')),
- variable_get('addthis_image_attributes', 'alt=""'),
- $_SERVER['HTTPS'] == 'on' ? 'https://secure.addthis.com' : 'http://s7.addthis.com'
+ variable_get('addthis_image_attributes', 'alt=""')
));
}
}