Index: modules/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/Attic/comment.module,v retrieving revision 1.455.2.8 diff -u -r1.455.2.8 comment.module --- modules/comment.module 10 Aug 2006 08:49:05 -0000 1.455.2.8 +++ modules/comment.module 28 Dec 2006 00:17:05 -0000 @@ -171,7 +171,7 @@ } function theme_comment_block() { - $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', 'c'), COMMENT_PUBLISHED, 0, 10); + $result = db_query_range(db_rewrite_sql('SELECT c.nid, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE n.status = 1 AND c.status = %d ORDER BY c.timestamp DESC', 'c'), COMMENT_PUBLISHED, 0, 5); $items = array(); while ($comment = db_fetch_object($result)) { $items[] = l($comment->subject, 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid) .'
'. t('%time ago', array('%time' => format_interval(time() - $comment->timestamp))); @@ -561,7 +561,6 @@ // Allow modules to respond to the updating of a comment. comment_invoke_comment($edit, 'update'); - // Add an entry to the watchdog log. watchdog('content', t('Comment: updated %subject.', array('%subject' => theme('placeholder', $edit['subject']))), WATCHDOG_NOTICE, l(t('view'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid'])); } @@ -628,10 +627,10 @@ $edit['name'] = $user->name; } - db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], $_SERVER['REMOTE_ADDR'], $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']); + db_query("INSERT INTO {comments} (cid, nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage,notify) VALUES (%d, %d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s')", $edit['cid'], $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], $_SERVER['REMOTE_ADDR'], $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage'],$edit['notify']); _comment_update_node_statistics($edit['nid']); - + // Tell the other modules a new comment has been submitted. comment_invoke_comment($edit, 'insert'); @@ -646,7 +645,10 @@ // redirect the user to the node he's commenting on. if ($status == COMMENT_NOT_PUBLISHED) { drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.')); + } + else + comment_invoke_comment($edit, 'publish'); return $edit['cid']; } else { @@ -1001,6 +1003,7 @@ $operations = comment_operations(); if ($operations[$edit['operation']][1]) { // extract the appropriate database query operation + $query = $operations[$edit['operation']][1]; foreach ($edit['comments'] as $cid => $value) { if ($value) {