diff --git a/addthis.admin.inc b/addthis.admin.inc index 005dc659b5db2341ede3de6c2aa50db225df4bc6..f60ab4822e6060c82df7e4f53ff5ddee5afa30a7 100644 --- a/addthis.admin.inc +++ b/addthis.admin.inc @@ -117,7 +117,7 @@ function addthis_admin_settings() { '#default_value' => variable_get('addthis_options', 'favorites, email, digg, delicious, myspace, facebook, google, live, more'), '#description' => t('A comma-separated ordered list of options to include in the drop-down. Example: favorites, email, digg, delicious, more
Currently supported options:
aim, aolfav, ask, backflip, ballhype, blinklist, blogmarks, bluedot, buzz, delicious, digg, diigo, email, facebook, favorites, fark, feedmelinks, friendfeed, furl, google, kaboodle, kirtsy, linkedin, live, magnolia, misterwong, mixx, multiply, myweb, myspace, netvous, newsvine, pownce, propeller, reddit, segnalo, sharedstuff, slashdot, spurl, stumbleupon, stylehive, tailrank, technorati, thisnext, twitter, yardbarker, yahoobkm, more
- The most up-to-date list can be found here.', array('!url' => url('http://addthis.com/customization.php'))), + The most up-to-date list can be found here.', array('!url' => url('http://addthis.com/services/list'))), ); $form['addthis_widget_settings']['addthis_offset_top'] = array( '#type' => 'textfield', diff --git a/addthis.module b/addthis.module index c715a8d9875dfa8af0040f99f49c4f30af3945ea..7b1f7f7aa0348a09bc9596e5d7eb986dbd502f87 100644 --- a/addthis.module +++ b/addthis.module @@ -60,7 +60,7 @@ function addthis_block($op = 'list', $delta = 0) { $blocks[0]['info'] = t('AddThis button'); return $blocks; } - else if ($op == 'view' && user_access('view addthis')) { + elseif ($op == 'view' && user_access('view addthis')) { $block['subject'] = t('AddThis'); $block['content'] = _addthis_create_button(); return $block; @@ -129,12 +129,12 @@ function _addthis_create_button($node=NULL, $teaser = FALSE) { addthis_options = \'%s\'; addthis_disable_flash = \'%s\'; ', - addslashes(variable_get('addthis_username', 'my-username')), - addslashes(variable_get('addthis_logo', 'http://www.addthis.com/images/yourlogo.png')), - addslashes(variable_get('addthis_logo_background', 'EFEFFF')), - addslashes(variable_get('addthis_logo_color', '666699')), - addslashes($brand), - addslashes(variable_get('addthis_options', 'favorites, email, digg, delicious, myspace, facebook, google, live, more')), + addslashes(check_plain(variable_get('addthis_username', 'my-username'))), + addslashes(check_plain(variable_get('addthis_logo', 'http://www.addthis.com/images/yourlogo.png'))), + addslashes(check_plain(variable_get('addthis_logo_background', 'EFEFFF'))), + addslashes(check_plain(variable_get('addthis_logo_color', '666699'))), + addslashes(check_plain($brand)), + addslashes(check_plain(variable_get('addthis_options', 'favorites, email, digg, delicious, myspace, facebook, google, live, more'))), variable_get('addthis_options', FALSE) ? 'true' : 'false' ), 'inline'); } @@ -146,6 +146,8 @@ function _addthis_create_button($node=NULL, $teaser = FALSE) { * Theme the AddThis button. */ function theme_addthis_button($node, $teaser) { + global $_addthis_counter; + // Fix IE's bug. if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { drupal_add_link(array( @@ -156,32 +158,36 @@ function theme_addthis_button($node, $teaser) { } if (variable_get('addthis_dropdown_disabled', '0')) { - return ( sprintf(' + $button = sprintf(' - - ', - $_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')), - addslashes(variable_get('addthis_image_attributes', 'alt=""')) - )); + ', + $_SERVER['HTTPS'] == 'on' ? addslashes(check_plain(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'))) : addslashes(check_plain(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'))), + variable_get('addthis_image_width', '125'), + variable_get('addthis_image_height', '16'), + addslashes(filter_xss(variable_get('addthis_image_attributes', 'alt=""'))) + ); } else { - return ( sprintf(' + $button = 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' - )); + $_SERVER['HTTPS'] == 'on' ? addslashes(check_plain(variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'))) : addslashes(check_plain(variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'))), + variable_get('addthis_image_width', '125'), + variable_get('addthis_image_height', '16'), + check_plain(variable_get('addthis_image_attributes', 'alt=""')) + ); + if ($_addthis_counter == 1) { + $button .= sprintf(''; } + return $button; } diff --git a/addthis_handler_field_service_links.inc b/addthis_handler_field_service_links.inc index 02ac4265b5a3763753fc4a9d0a362cc44db626fc..2c2a57b0e94d7b29e48632606fdf69eabedeed81 100644 --- a/addthis_handler_field_service_links.inc +++ b/addthis_handler_field_service_links.inc @@ -2,6 +2,7 @@ // $Id$ /** + * @file * A handler to provide an AddThis field for a particular node. * * @ingroup views_field_handlers