Hook_link causes array parsing error in version 3 beta 2 and 3x dev. I've ported the code to the D5 version.

/**
 * Implementation of hook_link().
 */
function auction_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();

  if ($type == 'node' && user_access('access content') && $teaser && $node->ptype == 'auction') {
    if (time() > $node->expires) {
      $links['bid'] = array(
                    'title' => t('Biding closed'),                    
                    'attributes' => array('class' => 'bid-link'));
    }
    else {
      $links['bid'] = array(
                    'title' => t('Bid now'),
                    'href' => "node/$node->nid",
                    'attributes' => array('title' => t('Place your bid for this item'), 'class' => 'bid-link'));
    }
  }
  return $links;
}

Comments

neclimdul’s picture

Status: Reviewed & tested by the community » Fixed

We prefer actual patches. http://drupal.org/diffandpatch Attaching patches using this format allow us to streamline the process of getting your fixes committed.

Even so, I've committed this with some coding standards changes. Commit #55709

Thanks

Anonymous’s picture

Status: Fixed » Closed (fixed)