Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.400
diff -u -r1.400 common.inc
--- includes/common.inc	18 Nov 2004 19:57:39 -0000	1.400
+++ includes/common.inc	20 Nov 2004 14:19:36 -0000
@@ -1596,15 +1596,6 @@
 }
 
 /**
- * Fetch a set of links to display after a given node.
- *
- * The links are gathered by calls to hook_link('node') in each module.
- */
-function link_node($node, $main = 0) {
-  return module_invoke_all('link', 'node', $node, $main);
-}
-
-/**
  * Perform end-of-request tasks.
  *
  * This function sets the page cache if appropriate, and allows modules to
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.217
diff -u -r1.217 theme.inc
--- includes/theme.inc	14 Oct 2004 02:38:32 -0000	1.217
+++ includes/theme.inc	20 Nov 2004 14:19:20 -0000
@@ -519,8 +519,8 @@
     $output .= $node->body;
   }
 
-  if ($links = link_node($node, $teaser)) {
-    $output .= '<div class="links">'. theme('links', $links) .'</div>';
+  if ($node->links) {
+    $output .= '<div class="links">'. theme('links', $node->links) .'</div>';
   }
 
   return $output;
Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.422
diff -u -r1.422 node.module
--- modules/node.module	18 Nov 2004 21:28:34 -0000	1.422
+++ modules/node.module	20 Nov 2004 14:22:36 -0000
@@ -507,11 +507,13 @@
  *   Whether to display only the teaser for the node.
  * @param $page
  *   Whether the node is being displayed by itself as a page.
+ * @param $links
+ *   Whether or not to display node links. Links are omitted for node previews.
  *
  * @return
  *   An HTML representation of the themed node.
  */
-function node_view($node, $teaser = FALSE, $page = FALSE) {
+function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
   $node = array2object($node);
 
   // Remove the delimiter (if any) that separates the teaser from the body.
@@ -528,6 +530,9 @@
   }
   // Allow modules to change $node->body before viewing.
   node_invoke_nodeapi($node, 'view', $teaser, $page);
+  if ($links) {
+    $node->links = module_invoke_all('link', 'node', $node, !$page);
+  }
 
   return theme('node', $node, $teaser, $page);
 }
@@ -1354,13 +1359,13 @@
     // Display a preview of the node:
     if ($node->teaser && $node->teaser != $node->body) {
       $output = '<h3>'. t('Preview trimmed version') .'</h3>';
-      $output .= node_view($node, 1);
+      $output .= node_view($node, 1, FALSE, 0);
       $output .= '<p><em>'. t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.') .'</em></p>';
       $output .= '<h3>'. t('Preview full version') .'</h3>';
-      $output .= node_view($node, 0);
+      $output .= node_view($node, 0, FALSE, 0);
     }
     else {
-      $output .= node_view($node, 0);
+      $output .= node_view($node, 0, FALSE, 0);
     }
 
     $output .= node_form($node);
Index: modules/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll.module,v
retrieving revision 1.149
diff -u -r1.149 poll.module
--- modules/poll.module	31 Oct 2004 07:34:47 -0000	1.149
+++ modules/poll.module	22 Nov 2004 01:11:26 -0000
@@ -435,7 +435,7 @@
     // No 'read more' link
     $node->body = $node->teaser = '';
 
-    $links = link_node($node, $main);
+    $links = module_invoke_all('link', 'node', $node, 0);
     $links[] = l(t('older polls'), 'poll', array('title' => t('View the list of polls on this site.')));
     if ($node->allowvotes && $block) {
       $links[] = l(t('results'), 'node/'. $node->nid .'/results', array('title' => t('View the current poll results.')));
Index: modules/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics.module,v
retrieving revision 1.171
diff -u -r1.171 statistics.module
--- modules/statistics.module	15 Nov 2004 11:16:39 -0000	1.171
+++ modules/statistics.module	20 Nov 2004 14:19:20 -0000
@@ -629,7 +629,6 @@
   $result = db_query_range('SELECT n.nid, n.title FROM {node_counter} s INNER JOIN {node} n ON s.nid = n.nid ORDER BY %s DESC', $dbfield, 0, $dbrows);
   while ($nid = db_fetch_array($result)) {
     $content = node_load(array('nid' => $nid['nid']));
-    $links = link_node($content, 1);
 
     // Filter and prepare node teaser
     if (node_hook($content, 'view')) {
@@ -641,7 +640,7 @@
 
     $output .= '<tr><td><strong>'. l($nid['title'], 'node/'. $nid['nid'], array('title' => t('View this posting.'))) .'</strong></td><td style="text-align: right;"><small>'. t('Submitted by %a on %b', array('%a' => format_name($content), '%b' => format_date($content->created, 'large'))) .'</small></td></tr>';
     $output .= '<tr><td colspan="2"><div style="margin-left: 20px;">'. $content->teaser .'</div></td></tr>';
-    $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $links) .' ]<br /><br /></td></tr>';
+    $output .= '<tr><td style="text-align: right;" colspan="2">[ '. theme('links', $content->links) .' ]<br /><br /></td></tr>';
   }
 
   return $output;
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.22
diff -u -r1.22 chameleon.theme
--- themes/chameleon/chameleon.theme	20 Sep 2004 14:36:53 -0000	1.22
+++ themes/chameleon/chameleon.theme	20 Nov 2004 14:19:18 -0000
@@ -136,8 +136,8 @@
     $terms = taxonomy_link("taxonomy terms", $node);
   }
 
-  if ($links = link_node($node, $main)) {
-    $output .= " <div class=\"links\">". theme('links', array_merge($submitted, $terms, $links)) ."</div>\n";
+  if ($node->links) {
+    $output .= " <div class=\"links\">". theme('links', array_merge($submitted, $terms, $node->links)) ."</div>\n";
   }
 
   $output .= "</div>\n";
Index: themes/engines/xtemplate/xtemplate.engine
===================================================================
RCS file: /cvs/drupal/drupal/themes/engines/xtemplate/xtemplate.engine,v
retrieving revision 1.7
diff -u -r1.7 xtemplate.engine
--- themes/engines/xtemplate/xtemplate.engine	19 Oct 2004 18:02:31 -0000	1.7
+++ themes/engines/xtemplate/xtemplate.engine	22 Nov 2004 02:05:32 -0000
@@ -63,8 +63,8 @@
     $xtemplate->template->parse("node.taxonomy");
   }
 
-  if ($links = link_node($node, $main)) {
-    $xtemplate->template->assign("links", theme_links($links));
+  if ($node->links) {
+    $xtemplate->template->assign("links", theme_links($node->links));
     $xtemplate->template->parse("node.links");
   }
 
