Flatcomments enabled: Leave this box unchecked to force replies to be to the main post instead of other comments.'); $node_type = $form['#node_type']->type; // Add option to remove reply link from comments. $form['comment']['flatcomments_remove_reply_link'] = array( '#type' => 'checkboxes', '#title' => t('Links'), '#default_value' => variable_get('flatcomments_remove_reply_link_' . $node_type, array()), '#options' => array( 'reply' => t('Do not show a reply link on comments'), ), ); } /** * Implementation of hook_comment_presave(). */ 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; } } /** * Implementation of hook_comment_view_alter(). */ function flatcomments_comment_view_alter(&$build) { $show_reply_link = variable_get('flatcomments_remove_reply_link_' . $build['#node']->type, array()); if (isset($build['links']['comment']['#links']['comment-reply']) && !empty($show_reply_link)) { unset($build['links']['comment']['#links']['comment-reply']); } }