@@ -110,6 +110,11 @@
  */
 define('COMMENT_NODE_READ_WRITE', 2);
 
+/**]
+* Comments are write-once, read-only on this node.
+*/
+define('COMMENT_NODE_WRITE_ONCE', 3);
+
 /**
  * Comment preview is optional.
  */
@@ -319,7 +324,7 @@
           }
         }
         else {
-          if ($node->comment == COMMENT_NODE_READ_WRITE) {
+          if ($node->comment == (COMMENT_NODE_READ_WRITE || COMMENT_NODE_WRITE_ONCE)) {
             if (user_access('post comments')) {
               $links['comment_add'] = array(
                 'title' => t('Add new comment'),
@@ -339,7 +344,7 @@
       // 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 ($node->comment == (COMMENT_NODE_READ_WRITE || COMMENT_NODE_WRITE_ONCE)) {
         if (user_access('post comments')) {
           if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) {
             $links['comment_add'] = array(
@@ -373,7 +378,7 @@
       '#type' => 'radios',
       '#title' => t('Default comment setting'),
       '#default_value' => variable_get('comment_'. $form['#node_type']->type, COMMENT_NODE_READ_WRITE),
-      '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')),
+      '#options' => array(t('Disabled'), t('Read only'), t('Read/Write'), t('Write-once, Read-only')),
       '#description' => t('Users with the <em>administer comments</em> permission will be able to override this setting.'),
     );
   }
@@ -392,7 +397,7 @@
         '#type' => 'radios',
         '#parents' => array('comment'),
         '#default_value' => $node->comment,
-        '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')),
+        '#options' => array(t('Disabled'), t('Read only'), t('Read/Write'), t('Write-once, Read-only')),
       );
     }
   }
@@ -667,7 +672,7 @@
       }
 
       // Should we show the reply box?
-      if (node_comment_mode($nid) != COMMENT_NODE_READ_WRITE) {
+      if (node_comment_mode($nid) != (COMMENT_NODE_READ_WRITE || COMMENT_NODE_WRITE_ONCE)) {
         drupal_set_message(t("This discussion is closed: you can't post new comments."), 'error');
         drupal_goto("node/$nid");
       }
@@ -700,7 +705,7 @@
  */
 function comment_save($edit) {
   global $user;
-  if (user_access('post comments') && (user_access('administer comments') || node_comment_mode($edit['nid']) == COMMENT_NODE_READ_WRITE)) {
+  if (user_access('post comments') && (user_access('administer comments') || node_comment_mode($edit['nid']) == (COMMENT_NODE_READ_WRITE || COMMENT_NODE_WRITE_ONCE))) {
     if (!form_get_errors()) {
       if ($edit['cid']) {
         // Update the comment in the database.
@@ -847,7 +852,7 @@
       );
     }
     else if (user_access('post comments')) {
-      if (comment_access('edit', $comment)) {
+      if (comment_access('edit', $comment) && !(COMMENT_NODE_WRITE_ONCE)) {
         $links['comment_edit'] = array(
           'title' => t('edit'),
           'href' => "comment/edit/$comment->cid"
@@ -1057,7 +1062,7 @@
 
     // 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', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
+    if (user_access('post comments') && node_comment_mode($nid) == (COMMENT_NODE_READ_WRITE || COMMENT_NODE_WRITE_ONCE) && (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) {
       $output .= comment_form_box(array('nid' => $nid), t('Post new comment'));
     }