--- ./modules/comment.module 2004/03/14 17:07:31 1.1.1.1 +++ ./modules/comment.module 2004/03/15 01:13:37 @@ -205,13 +205,23 @@ if ($pid) { $comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $pid)); $comment = drupal_unpack($comment); + $subject = $comment->subject; $output .= theme("comment_view", $comment); } else if (user_access("access content")) { - $output .= node_view(node_load(array("nid" => $nid))); + $node = node_load(array("nid" => $nid)); + $subject = $node->title; + $output .= node_view($node); $pid = 0; } + if ($subject) { + $subject = trim($subject); + if (strtolower(substr($subject, 0, 3)) != "re:") { + $subject = "Re: " . $subject; + } + } + /* ** If possible, show reply form */ @@ -220,7 +230,7 @@ $output .= theme("box", t("Reply"), t("This discussion is closed: you can't post new comments.")); } else if (user_access("post comments")) { - $output .= theme("comment_form", array("pid" => $pid, "nid" => $nid), t("Reply")); + $output .= theme("comment_form", array("pid" => $pid, "nid" => $nid, "subject" => $subject), t("Reply")); } else { $output .= theme("box", t("Reply"), t("You are not authorized to post comments.")); @@ -726,8 +743,13 @@ ** If enabled, show new comment form */ + $subject = trim($node->title); + if ($subject != "" && strtolower(substr($subject, 0, 3)) != "re:") { + $subject = "Re: " . $subject; + } + if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) { - $output .= theme("comment_form", array("nid" => $nid), t("Post new comment")); + $output .= theme("comment_form", array("nid" => $nid, "subject" => $subject), t("Post new comment")); } } return $output;