You are here

function node_comment_block_preprocess_node in Node Comment Block 7

Same name and namespace in other branches
  1. 7.2 node_comment_block.module \node_comment_block_preprocess_node()

Implements hook_preprocess_HOOK() for nodes.

File

./node_comment_block.module, line 75
Moves the comments for a node into a block.

Code

function node_comment_block_preprocess_node(&$variables) {
  $node = $variables['node'];
  if ($node->comment !== 0 && $variables['view_mode'] == 'full') {
    if (isset($variables['content']['comments'])) {
      unset($variables['content']['comments']);
      drupal_add_css(drupal_get_path('module', 'node_comment_block') . '/node-comment-block.css');
    }
  }
}