Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

trackback_link

Definition

trackback_link($type, $node = NULL, $teaser = FALSE)
contributions/trackback/trackback.module, line 240

Code

<?php
function trackback_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  switch ($type) {
    case 'node':
      if ($teaser && isset($node->can_receive)) {
        $count = db_result(db_query("SELECT count(*) FROM {trackback_received} WHERE nid=%d AND status=1", $node->nid));
        if ($count) {
          $links[] = array(
            'title' => format_plural($count, '1 trackback', '@count trackbacks'),
            'href' => _trackback_path($node),
            'fragment' => 'trackbacks'
          );
        }
      }
      break;

    case 'trackback':
      if (!$teaser) {
        $links['trackback_edit'] = array(
          'title' => t('edit'),
          'href' => 'trackback/edit/'. $node->trid
        );
      }
      $links['trackback_delete'] = array(
        'title' => t('delete'),
        'href' => 'trackback/delete/'. $node->trid
      );
      if (TRACKBACK_WITH_SPAM) {
        $links += _trackback_spam_link($node);
      }
      break;
  }
  return $links;
}
?>