? files
? misc/mc_blocks.js
? sites/localhost
? sites/localhost.drupal.dotest
? sites/localhost.drupal.project
? sites/all/modules
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.520.2.6
diff -u -F^f -r1.520.2.6 comment.module
--- modules/comment/comment.module	26 Jul 2007 19:16:45 -0000	1.520.2.6
+++ modules/comment/comment.module	3 Oct 2007 14:05:38 -0000
@@ -329,7 +329,7 @@ function comment_link($type, $node = NUL
               );
             }
             else {
-              $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node->nid);
+              $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node);
             }
           }
         }
@@ -341,7 +341,7 @@ function comment_link($type, $node = NUL
 
       if ($node->comment == COMMENT_NODE_READ_WRITE) {
         if (user_access('post comments')) {
-          if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
+          if ($node->comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
             $links['comment_add'] = array(
               'title' => t('Add new comment'),
               'href' => "comment/reply/$node->nid",
@@ -351,7 +351,7 @@ function comment_link($type, $node = NUL
           }
         }
         else {
-          $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node->nid);
+          $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node);
         }
       }
     }
@@ -405,6 +405,10 @@ function comment_form_alter($form_id, &$
 function comment_nodeapi(&$node, $op, $arg = 0) {
   switch ($op) {
     case 'load':
+      if (!isset($node->comment_form_location)) {
+        $node->comment_form_location = variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE);
+      }
+
       return db_fetch_array(db_query("SELECT last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid = %d", $node->nid));
       break;
 
@@ -859,7 +863,8 @@ function comment_links($comment, $return
       );
     }
     else {
-      $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $comment->nid);
+      $node = node_load($comment->nid);
+      $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node);
     }
   }
 
@@ -1056,7 +1061,7 @@ function comment_render($node, $cid = 0)
     }
 
     // If enabled, show new comment form.
-    if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW)) {
+    if (user_access('post comments') && node_comment_mode($nid) == COMMENT_NODE_READ_WRITE && ($node->comment_form_location == COMMENT_FORM_BELOW)) {
       $output .= comment_form_box(array('nid' => $nid), t('Post new comment'));
     }
 
@@ -1809,14 +1814,14 @@ function theme_comment_thread_expanded($
   return $output;
 }
 
-function theme_comment_post_forbidden($nid) {
+function theme_comment_post_forbidden($node) {
   global $user;
   if ($user->uid) {
     return t("you can't post comments");
   }
   else {
     // we cannot use drupal_get_destination() because these links sometimes appear on /node and taxo listing pages
-    if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
+    if ($node->comment_form_location == COMMENT_FORM_SEPARATE_PAGE) {
       $destination = "destination=". drupal_urlencode("comment/reply/$nid#comment-form");
     }
     else {
