You are here

function theme_vote_up_down_points_alt in Vote Up/Down 5

1 theme call to theme_vote_up_down_points_alt()
theme_vote_up_down_widget_alt in ./vote_up_down.module

File

./vote_up_down.module, line 590
vote_up_down is a module that adds a widget for +1/-1 votes on nodes. It depends upon Voting API. It's based upon "simplevote.module".

Code

function theme_vote_up_down_points_alt($cid, $type) {
  $vote_result = votingapi_get_voting_result($type, $cid, 'points', variable_get('vote_up_down_tag', 'vote'), 'sum');
  if ($vote_result) {
    $output = '<div id="vote_points_' . $cid . '" class="vote-points">' . $vote_result->value;
  }
  else {
    $output = '<div id="vote_points_' . $cid . '" class="vote-points">0';
  }
  $output .= '<div class="vote-points-label">' . format_plural($vote_result->value, 'point', 'points') . '</div></div>';
  return $output;
}