I note that when I use the ping.fm module it pings the /node/<nid> URL to the article.

Nodes can have either manual aliases assigned in the node create/edit form or via pathauto - it would be nice if this was the URL that got pinged instead of the node id version

Comments

robloach’s picture

Status: Active » Needs work

It actually uses the url() function..........

/**
 * Implementation of hook_nodeapi().
 */
function pingfm_nodeapi(&$node, $op) {
  switch ($op) {
    case 'insert':
    case 'update':
      if (!empty($node->status) && !empty($node->pingfm) && !empty($node->pingfm['post'])) {
        $replacements = array(
          '!title' => $node->title,
          '!teaser' => strip_tags($node->teaser),
          '!url' => url('node/'. $node->nid, array('absolute' => TRUE)),
          '!user' => $node->name,
        );
        $result = pingfm_post(t($node->pingfm['format'], $replacements), $node->pingfm['method'], $node->title, user_load(array('uid' => $node->uid)));
        drupal_set_message($result ? t('Successfully posted to Ping.fm') : t('Failed posting to Ping.fm'), $result ? 'status' : 'warning');
      }
      break;
  }
}

You can see !url use the url() function, which will turn the node/nid to the full URL with the alias. If you play around with this and figure something out with it, I'd be happy to take a look :-) .

Maybe it sends out node/%nid because the alias hasn't been created from Path module yet? Hmmmmm. Maybe if we set the Ping.fm weight higher in the system table?

AlexisWilke’s picture

Rob,

That sounds right, the alias is probably not defined yet by then.

Alexis Wilke

Steven Brown’s picture

Status: Needs work » Closed (won't fix)

Module is Obsolete please read project description.