Index: pingfm/pingfm.admin.inc
===================================================================
--- pingfm/pingfm.admin.inc	(revision 3162)
+++ pingfm/pingfm.admin.inc	(working copy)
@@ -36,6 +36,13 @@
     '#description' => t('The default format when posting to Ping.fm.'),
     '#default_value' => variable_get('pingfm_default_format', '!title: !url'),
   );
+  $form['node_settings']['pingfm_pingthis_nodetypes'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Ping This'),
+    '#default_value' => isset($edit['pingfm_pingthis_nodetypes']) ? $edit['pingfm_pingthis_nodetypes'] : array(),
+    '#description' => t('The node types that users will be able to see the <a href="http://ping.fm/ref/help/">Ping this! button</a>.'),
+    '#options' => node_get_types('names'),
+  );
   $form['advanced'] = array(
     '#type' => 'fieldset',
     '#collapsible' => TRUE,
Index: pingfm/pingfm.module
===================================================================
--- pingfm/pingfm.module	(revision 3162)
+++ pingfm/pingfm.module	(working copy)
@@ -225,3 +225,44 @@
     return t('Ping.fm <a href="!customurl">custom URLs</a> requires POST requests.', array('!customurl' => 'http://ping.fm/custom/'));
   }
 }
+
+/**
+ * Implementation of hook_link
+ */
+function pingfm_link($type, $object, $teaser) {
+  $links = array();
+  if ($type == 'node') {
+    $pingthis_nodetypes = variable_get('pingfm_pingthis_nodetypes', array());
+    if (in_array($object->type, $pingthis_nodetypes, FALSE)) {
+      $title = t(
+        '!image Ping this!',
+        array(
+          '!image' => theme(
+	    'image',
+	    'http://ping.fm/_images/icons/ping.png',
+	    t('Ping this!'),
+	    t('Ping this!'),
+	    array('width' => 16, 'height' => 16), FALSE
+	  )
+	)
+      );
+      // we cannot use the query feature of the $link array because it calls
+      // drupal_urlencode() with the side effect of transforming // into /%2F
+      // so we use the following code to generate the href including the query string
+      // (note: the drupal_urlencode() is important for internal links, not external ones)
+      $href = 'http://ping.fm/ref/';
+      $href .= '?link=' . url('node/'. $object->nid, array('absolute' => TRUE, 'external' => FALSE));
+      $href .= '&title=' . str_replace('%2F', '/', rawurlencode($object->title));
+      $href .= '&body=' . str_replace('%2F', '/', rawurlencode(check_markup($object->teaser, $object->format, FALSE)));
+      $links['pingfm_pingthis'] = array(
+        'title' => $title,
+        'href' => $href,
+        'attributes' => array(
+	  'title' => t('Ping this!'),
+	),
+        'html' => TRUE
+      );
+    }
+  }
+  return $links;
+}
