? .completion.db
? MyProject.kpf
? drnr.kpf
? drnr.tmproj
? files
? mw.patch
? tmp.patch
? sites/all/modules
? sites/default/files
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.456
diff -u -F^f -p -r1.456 theme.inc
--- includes/theme.inc	16 Dec 2008 22:05:50 -0000	1.456
+++ includes/theme.inc	29 Dec 2008 17:57:04 -0000
@@ -1983,6 +1983,7 @@ function template_preprocess_node(&$vari
   $variables['name']      = theme('username', $node);
   $variables['node_url']  = url('node/' . $node->nid);
   $variables['title']     = check_plain($node->title);
+  $variables['page']     = (bool)menu_get_object();
   
   if ($node->build_mode == NODE_BUILD_PREVIEW) {
     unset($node->content['links']);
@@ -1993,6 +1994,9 @@ function template_preprocess_node(&$vari
   
   // Render all remaining node links.
   $variables['links']     = !empty($node->content['links']) ? drupal_render($node->content['links']) : '';
+  
+  // Render any comments.
+  $variables['comments']     = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : '';
 
   // Render the rest of the node into $content.
   if (!empty($node->content['teaser'])) {
Index: modules/comment/comment.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.css,v
retrieving revision 1.4
diff -u -F^f -p -r1.4 comment.css
--- modules/comment/comment.css	24 Jul 2007 21:33:53 -0000	1.4
+++ modules/comment/comment.css	29 Dec 2008 17:57:04 -0000
@@ -1,5 +1,8 @@
 /* $Id: comment.css,v 1.4 2007/07/24 21:33:53 goba Exp $ */
 
+#comments {
+  margin-top: 15px;
+}
 .indented {
   margin-left: 25px; /* LTR */
 }
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.673
diff -u -F^f -p -r1.673 comment.module
--- modules/comment/comment.module	20 Dec 2008 18:24:35 -0000	1.673
+++ modules/comment/comment.module	29 Dec 2008 17:57:05 -0000
@@ -422,10 +422,10 @@ function theme_comment_block() {
 /**
  * An implementation of hook_nodeapi_view().
  */
-function comment_nodeapi_view($node, $teaser, $page) {
+function comment_nodeapi_view($node, $teaser) {
   $links = array();
 
-  if ($node->comment) {
+  if (comment_node_mode($node)) {
     if ($teaser) {
       // Main page: display the number of comments that have been posted.
       if (user_access('access comments')) {
@@ -449,7 +449,7 @@ function comment_nodeapi_view($node, $te
           }
         }
         else {
-          if ($node->comment == COMMENT_NODE_READ_WRITE) {
+          if (comment_node_mode($node) == COMMENT_NODE_READ_WRITE) {
             if (user_access('post comments')) {
               $links['comment_add'] = array(
                 'title' => t('Add new comment'),
@@ -468,7 +468,7 @@ function comment_nodeapi_view($node, $te
     else {
       // Node page: add a "post comment" link if the user is allowed to post comments,
       // if this node is not read-only, and if the comment form isn't already shown.
-      if ($node->comment == COMMENT_NODE_READ_WRITE) {
+      if (comment_node_mode($node) == COMMENT_NODE_READ_WRITE) {
         if (user_access('post comments')) {
           if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
             $links['comment_add'] = array(
@@ -493,6 +493,13 @@ function comment_nodeapi_view($node, $te
       '#type' => 'node_links',
       '#value' => $links,
     );
+    
+    // Append the list of comments to $node->content for node detail pages.
+    if (comment_node_mode($node) && (bool)menu_get_object()) {
+      $node->content['comments'] = array(
+        '#markup' => comment_render($node),
+      );
+    }
   }
 }
 
@@ -662,6 +669,14 @@ function comment_nodeapi_update_index($n
 }
 
 /**
+ * Implementation of hook_update_index().
+ */
+function comment_update_index() {
+  // Store the maximum possible comments per thread (used for ranking by reply count)
+  variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'))));
+}
+
+/**
  * Implementation of hook_nodeapi_search_result().
  */
 function comment_nodeapi_search_result($node) {
@@ -740,7 +755,8 @@ function comment_node_url() {
  */
 function comment_save($edit) {
   global $user;
-  if (user_access('post comments') && (user_access('administer comments') || node_comment_mode($edit['nid']) == COMMENT_NODE_READ_WRITE)) {
+  $node = node_load($edit['nid']);
+  if (user_access('post comments') && (user_access('administer comments') || comment_node_mode($node) == COMMENT_NODE_READ_WRITE)) {
     if (!form_get_errors()) {
       $edit += array(
         'mail' => '',
@@ -902,7 +918,8 @@ function comment_links($comment, $return
     );
   }
 
-  if (node_comment_mode($comment->nid) == COMMENT_NODE_READ_WRITE) {
+  $node = node_load($comment->nid);
+  if (comment_node_mode($node) == COMMENT_NODE_READ_WRITE) {
     if (user_access('administer comments') && user_access('post comments')) {
       $links['comment_delete'] = array(
         'title' => t('delete'),
@@ -1117,7 +1134,7 @@ function comment_render($node, $cid = 0)
 
     // If enabled, show new comment form if it's not already being displayed.
     $reply = arg(0) == 'comment' && arg(1) == 'reply';
-    if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
+    if (user_access('post comments') && comment_node_mode($node) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
       $output .= comment_form_box(array('nid' => $nid), t('Post new comment'));
     }
     $output = theme('comment_wrapper', $output, $node);
@@ -2158,3 +2175,10 @@ function comment_ranking() {
     ),
   );
 }
+
+/**
+ * Retrieve the comment mode for the given node (none, read, or read/write).
+ */
+function comment_node_mode($node) {
+  return $node->comment;
+}
Index: modules/comment/comment.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.pages.inc,v
retrieving revision 1.10
diff -u -F^f -p -r1.10 comment.pages.inc
--- modules/comment/comment.pages.inc	3 Dec 2008 16:32:21 -0000	1.10
+++ modules/comment/comment.pages.inc	29 Dec 2008 17:57:05 -0000
@@ -96,7 +96,7 @@ function comment_reply($node, $pid = NUL
       }
 
       // Should we show the reply box?
-      if (node_comment_mode($node->nid) != COMMENT_NODE_READ_WRITE) {
+      if (comment_node_mode($node) != COMMENT_NODE_READ_WRITE) {
         drupal_set_message(t("This discussion is closed: you can't post new comments."), 'error');
         drupal_goto("node/$node->nid");
       }
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.479
diff -u -F^f -p -r1.479 forum.module
--- modules/forum/forum.module	20 Dec 2008 18:24:36 -0000	1.479
+++ modules/forum/forum.module	29 Dec 2008 17:57:05 -0000
@@ -183,11 +183,11 @@ function _forum_nodeapi_check_node_type(
 /**
  * Implementation of hook_nodeapi_view().
  */
-function forum_nodeapi_view($node, $teaser, $page) {
+function forum_nodeapi_view($node, $teaser) {
   $vid = variable_get('forum_nav_vocabulary', '');
   $vocabulary = taxonomy_vocabulary_load($vid);
   if (_forum_nodeapi_check_node_type($node, $vocabulary)) {
-    if ($page && taxonomy_node_get_terms_by_vocabulary($node, $vid) && $tree = taxonomy_get_tree($vid)) {
+    if ((bool)menu_get_object() && taxonomy_node_get_terms_by_vocabulary($node, $vid) && $tree = taxonomy_get_tree($vid)) {
       // Get the forum terms from the (cached) tree
       foreach ($tree as $term) {
         $forum_terms[] = $term->tid;
Index: modules/node/node.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.api.php,v
retrieving revision 1.4
diff -u -F^f -p -r1.4 node.api.php
--- modules/node/node.api.php	20 Dec 2008 18:24:38 -0000	1.4
+++ modules/node/node.api.php	29 Dec 2008 17:57:05 -0000
@@ -166,8 +166,6 @@ function hook_node_operations() {
  *   The node the action is being performed on.
  * @param $teaser
  *   The $teaser parameter from node_view().
- * @param $page
- *   The $page parameter from node_view().
  * @return
  *   None.
  */
@@ -766,11 +764,6 @@ function hook_validate($node, &$form) {
  * @param $teaser
  *   Whether we are to generate a "teaser" or summary of the node, rather than
  *   display the whole thing.
- * @param $page
- *   Whether the node is being displayed as a standalone page. If this is
- *   TRUE, the node title should not be displayed, as it will be printed
- *   automatically by the theme system. Also, the module may choose to alter
- *   the default breadcrumb trail in this case.
  * @return
  *   $node. The passed $node parameter should be modified as necessary and
  *   returned so it can be properly presented. Nodes are prepared for display
@@ -785,8 +778,8 @@ function hook_validate($node, &$form) {
  *
  * For a detailed usage example, see node_example.module.
  */
-function hook_view($node, $teaser = FALSE, $page = FALSE) {
-  if ($page) {
+function hook_view($node, $teaser = FALSE) {
+  if ((bool)menu_get_object()) {
     $breadcrumb = array();
     $breadcrumb[] = array('path' => 'example', 'title' => t('example'));
     $breadcrumb[] = array('path' => 'example/' . $node->field1,
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1004
diff -u -F^f -p -r1.1004 node.module
--- modules/node/node.module	20 Dec 2008 18:24:38 -0000	1.1004
+++ modules/node/node.module	29 Dec 2008 17:57:09 -0000
@@ -1129,20 +1129,18 @@ function node_delete($nid) {
  *   A node array or node object.
  * @param $teaser
  *   Whether to display the teaser only or the full form.
- * @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) {
   $node = (object)$node;
 
-  $node = node_build_content($node, $teaser, $page);
+  $node = node_build_content($node, $teaser);
 
-  return theme('node', $node, $teaser, $page);
+  return theme('node', $node, $teaser);
 }
 
 /**
@@ -1176,14 +1174,12 @@ function node_prepare($node, $teaser = F
  *   A node object.
  * @param $teaser
  *   Whether to display the teaser only, as on the main page.
- * @param $page
- *   Whether the node is being displayed by itself as a page.
  *
  * @return
  *   An structured array containing the individual elements
  *   of the node's body.
  */
-function node_build_content($node, $teaser = FALSE, $page = FALSE) {
+function node_build_content($node, $teaser = FALSE) {
 
   // The build mode identifies the target for which the node is built.
   if (!isset($node->build_mode)) {
@@ -1196,35 +1192,31 @@ function node_build_content($node, $teas
   // The 'view' hook can be implemented to overwrite the default function
   // to display nodes.
   if (node_hook($node, 'view')) {
-    $node = node_invoke($node, 'view', $teaser, $page);
+    $node = node_invoke($node, 'view', $teaser);
   }
   else {
     $node = node_prepare($node, $teaser);
   }
 
   // Allow modules to make their own additions to the node.
-  node_invoke_nodeapi($node, 'view', $teaser, $page);
+  node_invoke_nodeapi($node, 'view', $teaser);
   
   // Allow modules to modify the structured node.
-  drupal_alter('node_view', $node, $teaser, $page);
+  drupal_alter('node_view', $node, $teaser);
 
   return $node;
 }
 
 /**
- * Generate a page displaying a single node, along with its comments.
+ * Generate a page displaying a single node.
  */
-function node_show($node, $cid, $message = FALSE) {
+function node_show($node, $message = FALSE) {
   if ($message) {
     drupal_set_title(t('Revision of %title from %date', array('%title' => $node->title, '%date' => format_date($node->revision_timestamp))), PASS_THROUGH);
   }
 
   $output = node_view($node, FALSE, TRUE);
 
-  if (function_exists('comment_render') && $node->comment) {
-    $output .= comment_render($node, $cid);
-  }
-
   // Update the history table, stating that this user viewed this node.
   node_tag_new($node->nid);
 
@@ -1514,14 +1506,6 @@ function theme_node_search_admin($form) 
 }
 
 /**
- * Retrieve the comment mode for the given node ID (none, read, or read/write).
- */
-function node_comment_mode($nid) {
-  $node = node_load($nid);
-  return $node->comment;
-}
-
-/**
  * Implementation of hook_link().
  */
 function node_link($type, $node = NULL, $teaser = FALSE) {
@@ -1720,7 +1704,7 @@ function node_menu() {
     'title' => 'Revisions',
     'load arguments' => array(3),
     'page callback' => 'node_show',
-    'page arguments' => array(1, NULL, TRUE),
+    'page arguments' => array(1, TRUE),
     'access callback' => '_node_revision_access',
     'access arguments' => array(1),
     'type' => MENU_CALLBACK,
@@ -1924,9 +1908,9 @@ function node_page_default() {
 /**
  * Menu callback; view a single node.
  */
-function node_page_view($node, $cid = NULL) {
+function node_page_view($node) {
   drupal_set_title($node->title);
-  return node_show($node, $cid);
+  return node_show($node);
 }
 
 /**
@@ -1935,8 +1919,6 @@ function node_page_view($node, $cid = NU
 function node_update_index() {
   $limit = (int)variable_get('search_cron_limit', 100);
 
-  // Store the maximum possible comments per thread (used for ranking by reply count)
-  variable_set('node_cron_comments_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}'))));
   variable_set('node_cron_views_scale', 1.0 / max(1, db_result(db_query('SELECT MAX(totalcount) FROM {node_counter}'))));
 
   $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit);
Index: modules/node/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.tpl.php,v
retrieving revision 1.5
diff -u -F^f -p -r1.5 node.tpl.php
--- modules/node/node.tpl.php	13 Oct 2008 12:31:42 -0000	1.5
+++ modules/node/node.tpl.php	29 Dec 2008 17:57:09 -0000
@@ -8,6 +8,7 @@
  * Available variables:
  * - $title: the (sanitized) title of the node.
  * - $content: Node body or teaser depending on $teaser flag.
+ * - $comments: the themed list of comments (if any).
  * - $picture: The authors picture of the node output from
  *   theme_user_picture().
  * - $date: Formatted creation date (use $created to reformat with
@@ -70,4 +71,7 @@
   </div>
 
   <?php print $links; ?>
+  
+  <?php print $comments; ?>
+  
 </div>
\ No newline at end of file
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.282
diff -u -F^f -p -r1.282 poll.module
--- modules/poll/poll.module	18 Dec 2008 14:38:37 -0000	1.282
+++ modules/poll/poll.module	29 Dec 2008 17:57:09 -0000
@@ -524,7 +524,7 @@ function poll_delete($node) {
  *   An extra parameter that adapts the hook to display a block-ready
  *   rendering of the poll.
  */
-function poll_view($node, $teaser = FALSE, $page = FALSE, $block = FALSE) {
+function poll_view($node, $teaser = FALSE, $block = FALSE) {
   global $user;
   $output = '';
 
Index: modules/poll/poll.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v
retrieving revision 1.10
diff -u -F^f -p -r1.10 poll.pages.inc
--- modules/poll/poll.pages.inc	5 Dec 2008 12:50:28 -0000	1.10
+++ modules/poll/poll.pages.inc	29 Dec 2008 17:57:09 -0000
@@ -53,5 +53,5 @@ function poll_votes($node) {
 function poll_results($node) {
   drupal_set_title($node->title);
   $node->show_results = TRUE;
-  return node_show($node, 0);
+  return node_show($node);
 }
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.280
diff -u -F^f -p -r1.280 search.module
--- modules/search/search.module	20 Dec 2008 18:24:38 -0000	1.280
+++ modules/search/search.module	29 Dec 2008 17:57:10 -0000
@@ -281,10 +281,7 @@ function search_cron() {
   register_shutdown_function('search_update_totals');
 
   // Update word index
-  foreach (module_implements('update_index') as $module) {
-    $function = $module . '_update_index';
-    $function();
-  }
+  module_invoke_all('update_index');
 }
 
 /**
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.13
diff -u -F^f -p -r1.13 search.test
--- modules/search/search.test	16 Dec 2008 23:57:33 -0000	1.13
+++ modules/search/search.test	29 Dec 2008 17:57:10 -0000
@@ -300,7 +300,7 @@ class SearchRankingTestCase extends Drup
     }
 
     // Update the search index.
-    node_update_index();
+    module_invoke_all('update_index');
     search_update_totals();
 
     // Refresh variables after the treatment.
Index: themes/bluemarine/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/bluemarine/node.tpl.php,v
retrieving revision 1.7
diff -u -F^f -p -r1.7 node.tpl.php
--- themes/bluemarine/node.tpl.php	7 Aug 2007 08:39:36 -0000	1.7
+++ themes/bluemarine/node.tpl.php	29 Dec 2008 17:57:10 -0000
@@ -10,4 +10,5 @@
     <div class="taxonomy"><?php print $terms?></div>
     <div class="content"><?php print $content?></div>
     <?php if ($links) { ?><div class="links">&raquo; <?php print $links?></div><?php }; ?>
+    <?php print $comments; ?>
   </div>
Index: themes/chameleon/chameleon.theme
===================================================================
RCS file: /cvs/drupal/drupal/themes/chameleon/chameleon.theme,v
retrieving revision 1.85
diff -u -F^f -p -r1.85 chameleon.theme
--- themes/chameleon/chameleon.theme	28 Dec 2008 08:26:51 -0000	1.85
+++ themes/chameleon/chameleon.theme	29 Dec 2008 17:57:10 -0000
@@ -114,7 +114,7 @@ function chameleon_page($content, $show_
   return $output;
 }
 
-function chameleon_node($node, $teaser = 0, $page = 0) {
+function chameleon_node($node, $teaser = 0) {
 
   $output  = "<div class=\"node" . ((!$node->status) ? ' node-unpublished' : '') . (($node->sticky) ? ' sticky' : '') . "\">\n";
 
@@ -153,6 +153,10 @@ function chameleon_node($node, $teaser =
   }
 
   $output .= "</div>\n";
+  
+  if ($node->content['comments']) {
+    $output .= drupal_render($node->content['comments']);
+  }
 
   return $output;
 }
Index: themes/garland/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/garland/node.tpl.php,v
retrieving revision 1.6
diff -u -F^f -p -r1.6 node.tpl.php
--- themes/garland/node.tpl.php	26 Dec 2008 10:46:54 -0000	1.6
+++ themes/garland/node.tpl.php	29 Dec 2008 17:57:10 -0000
@@ -27,6 +27,9 @@
     <?php if ($links): ?>
       <div class="links"><?php print $links; ?></div>
     <?php endif; ?>
+    
+    <?php print $comments; ?>
+    
   </div>
 
 </div>
Index: themes/pushbutton/node.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/pushbutton/node.tpl.php,v
retrieving revision 1.4
diff -u -F^f -p -r1.4 node.tpl.php
--- themes/pushbutton/node.tpl.php	7 Aug 2007 08:39:36 -0000	1.4
+++ themes/pushbutton/node.tpl.php	29 Dec 2008 17:57:10 -0000
@@ -3,7 +3,7 @@
 ?>
 <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
   <?php print $picture ?>
-  <?php if ($page == 0): ?>
+  <?php if (!$page): ?>
     <h1 class="title"><a href="<?php print $node_url ?>"><?php print $title ?></a></h1>
   <?php endif; ?>
     <span class="submitted"><?php print $submitted ?></span>
@@ -11,5 +11,8 @@
     <div class="content"><?php print $content ?></div>
     <?php if ($links): ?>
     <div class="links">&raquo; <?php print $links ?></div>
+    
+    <?php print $comments; ?>
+      
     <?php endif; ?>
 </div>
