You are here

function addthis_link in AddThis 6

Same name and namespace in other branches
  1. 5.2 addthis.module \addthis_link()
  2. 6.3 addthis.module \addthis_link()
  3. 6.2 addthis.module \addthis_link()

File

./addthis.module, line 15

Code

function addthis_link($type, $node = NULL, $teaser = FALSE) {
  global $base_url;
  $string = 'share ' . $node->type . ' content';
  drupal_add_css(drupal_get_path('module', 'addthis') . '/addthis.css', $type = 'module', $media = 'all', $preprocess = TRUE);
  $links = array();
  $output .= '<script type="text/javascript">addthis_pub  = "' . variable_get('addthis_user', 'tipzdigger') . '";</script>
					<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, \'\', \'[URL]\', \'[TITLE]\')" onmouseout="addthis_close()"
					onclick="return addthis_sendto()"><img
					src="http://s9.addthis.com/button1-share.gif" width="125" height="16"
					border="0" alt="" /></a><script type="text/javascript"
					src="http://s7.addthis.com/js/152/addthis_widget.js"></script>';
  if (!$teaser && user_access($string)) {
    $links['addthis'] = array(
      'title' => '<div class="addthis" style="display:inline">' . $output . '</div>',
      'href' => '#',
      'html' => TRUE,
    );
  }
  return $links;
}