You are here

function flatcomments_comment_presave in Flatcomments 7.2

Implementation of hook_comment_presave().

File

./flatcomments.module, line 31
Make comments replies to the node, regardless of the reply link used.

Code

function flatcomments_comment_presave($comment) {

  // Only affect new comments and comments set to be displayed flat.
  $display_mode = (int) variable_get('comment_default_mode_' . str_replace('comment_node_', '', $comment->node_type), 0);
  if (!$comment->cid && $display_mode === 0) {

    // Set parent id to NULL to prevent threads.
    $comment->pid = NULL;
  }
}