summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Przybilla2008-04-17 04:16:19 (GMT)
committer Patrick Przybilla2008-04-17 04:16:19 (GMT)
commit754744f17140d33663a66c615888d9f175a69b43 (patch)
tree8e25bc0ebd532ccd4e607bbd475d57f46634a945
this rocks6.x-1.05.x-1.0
-rw-r--r--addthis.css6
-rw-r--r--addthis.info4
-rw-r--r--addthis.module37
3 files changed, 47 insertions, 0 deletions
diff --git a/addthis.css b/addthis.css
new file mode 100644
index 0000000..80dd670
--- /dev/null
+++ b/addthis.css
@@ -0,0 +1,6 @@
+.addthis{
+ display:inline;
+ position:relative;
+ top:2px;
+
+} \ No newline at end of file
diff --git a/addthis.info b/addthis.info
new file mode 100644
index 0000000..1d404a5
--- /dev/null
+++ b/addthis.info
@@ -0,0 +1,4 @@
+; $ID$
+name = AddThis
+description = "Lets site users invite persons directly from their gmail, yahoo, hotmail or AOL address book."
+
diff --git a/addthis.module b/addthis.module
new file mode 100644
index 0000000..741760b
--- /dev/null
+++ b/addthis.module
@@ -0,0 +1,37 @@
+<?php
+
+function addtoany_perm() {
+ //$perms = array('administer content types', 'administer nodes', 'access content', 'view revisions', 'revert revisions');
+
+ foreach (node_get_types() as $type) {
+ $name = check_plain($type->type);
+ $perms[] = 'share '. $name .' content';
+
+ }
+
+ return $perms;
+}
+
+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;
+
+}
+