diff options
Diffstat (limited to 'modules/comment.module')
-rw-r--r-- | modules/comment.module | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/comment.module b/modules/comment.module index f0f164a3f..6a3b8cee5 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -261,6 +261,16 @@ function comment_nodeapi(&$node, $op, $arg = 0) { db_query('DELETE FROM {comments} WHERE nid = %d', $node->nid); db_query('DELETE FROM {node_comment_statistics} WHERE nid = %d', $node->nid); break; + case 'update index': + $text = ''; + $comments = db_query('SELECT subject, comment, format FROM {comments} WHERE nid = %d AND status = 0', $node->nid); + while ($comment = db_fetch_object($comments)) { + $text .= '<h2>'. $comment->subject .'</h2>'. check_output($comment->comment, $comment->format); + } + return $text; + case 'search result': + $comments = db_result(db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = %d', $node->nid)); + return format_plural($comments, '1 comment', '%count comments'); } } |