You are here

function vote_up_down_preprocess_node in Vote Up/Down 6

Node template preprocess. Adding vote_up_down widget to variable list.

File

./vote_up_down.module, line 233

Code

function vote_up_down_preprocess_node(&$variables) {
  if (user_access('view up/down votes')) {
    $node = $variables['node'];
    $node_type = in_array($node->type, variable_get('vote_up_down_node_types', array()), TRUE);
    if ($node->nid && $node_type) {
      $style = variable_get('vote_up_down_widget_style_node', 0) == 1 ? '_alt' : '';
      $variables['vote_up_down'] = theme("vote_up_down_widget{$style}", $node->nid, 'node');
    }
  }
}