comment_node_update_index

Versions
7
comment_node_update_index($node)

Implement hook_node_update_index().

Code

modules/comment/comment.module, line 1155

<?php
function comment_node_update_index($node) {
  $text = '';
  if ($node->comment != COMMENT_NODE_HIDDEN) {
    $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(
      ':nid' => $node->nid,
      ':status' => COMMENT_PUBLISHED
    ));
    foreach ($comments as $comment) {
      $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', TRUE);
    }
  }
  return $text;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.