Index: pingfm.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pingfm/Attic/pingfm.module,v retrieving revision 1.1.2.5 diff -u -r1.1.2.5 pingfm.module --- pingfm.module 8 Jul 2008 00:20:25 -0000 1.1.2.5 +++ pingfm.module 24 Jul 2008 23:38:05 -0000 @@ -75,6 +75,13 @@ '#default_value' => isset($edit['pingfm_default_format']) ? $edit['pingfm_default_format'] : t('New post: !title (!url)'), '#description' => t('The default format used when making posts to Ping.fm. You can use !url, !title, !teaser and !user as replacement text.'), ); + $form['pingfm']['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 Ping this! button.'), + '#options' => node_get_types('names'), + ); $form['pingfm']['pingfm_customurl_nodetype'] = array( '#type' => 'radios', '#title' => t('Custom URL Node Creation'), @@ -181,6 +188,30 @@ } /** + * 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)) { + $links['pingfm_pingthis'] = array( + '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))), + 'href' => 'http://ping.fm/ref/', + 'query' => array( + 'link' => 'node/'. $object->nid, + 'title' => $object->title, + 'body' => check_plain($object->teaser), + ), + 'attributes' => array('title' => t('Ping this!')), + 'html' => TRUE + ); + } + } + return $links; +} + +/** * Menu callback; A request from the Ping.fm Custom URL service. */ function pingfm_custom_url($user, $key) {