This widget does not support anonymous voting but it would be nice.

Comments

Chill35’s picture

Category: feature » support

It does. Give anonymous users the permission to "vote on content". They will be able to vote only once for a given content with an IP address for a certain duration of time. That 'certain duration of time' is set through the configuration page of the Voting API module.

moshe weitzman’s picture

Thanks Chill35. I was just reading the theme function. It certainly looks to me like logged in is needed ...


if (!$logged_in || user_access('rate content')) {
    $output .= '<div class="plus1-msg">';
    if (!$logged_in) {
      $output .= '<small>'. l(t('Log in<br />to vote'), 'user', array('html' => TRUE)) .'</small>';
    }

Chill35’s picture

Version: 6.x-2.3 » 6.x-1.3

You are looking at the wrong branch.

What you're looking at is deprecated.

Here is the theming function:

  if (!$logged_in || user_access('vote on content')) {
    $output .= '<div class="'. $message_class . '">';
    if (!$logged_in && !user_access('vote on content')) {
      $output .= '<small>'. l(t('Log in<br />to vote'), 'user', array('html' => TRUE)) .'</small>';
    }
    else if ($voted) { // User already voted.
      $output .= check_plain(variable_get('plus1_you_voted', t('You voted')));
    }
    else if (user_access('vote on content')) {
      // User is eligible to vote.
      // The class name provided by Drupal.settings.plus1.link_class what we will search for in our jQuery later.
      $output .= '<div class="plus1-vote">'. l(t('Vote'), 'plus1/vote/'. $node->nid, array('attributes' => array('class' => $link_class))) .'</div>';
    }
    $output .= '</div>';
  }

Anonymous voting is indeed not supported in the first branch.

moshe weitzman’s picture

Status: Active » Fixed

Oh, thats much better. Thanks for setting me straight.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.