How to limit a user to one vote when using Fivestar? In Drupal 7 I have enabled the fivestar module to allow users to vote in their comments. The results are tallied and give an average vote. Cool stuff.

Problem is a person can just keep voting over and over in each new comment or reply.

How do I limited a person to just one vote per node, via the comments. In other words, once they have voted, either the stars disappear, or the persons other vote is the default and cannot be edited?

Thanks
You can easily do this using a custom module that contains code similar to the following one.

function YOURMODULENAME_print_rating($nid, $fivestar_widget) {
   $path = drupal_get_path('module', 'fivestar');
   drupal_add_js($path . '/js/fivestar.js');
   drupal_add_css($path . '/css/fivestar.css');
   $voting_message = '';
   $output = '';
   $is_login = user_is_logged_in();
   $rating = votingapi_select_single_result_value(array(
       'entity_id' =&gt; $nid,
       'entity_type' =&gt; 'node',
       'tag' =&gt; 'vote',
       'function' =&gt; 'average',
   ));
   if ($is_login) {
     if (isset($rating)) {
       $voting_message = "&lt;div&gt;You have already rated this.&lt;/div&gt;";
       $output = theme('fivestar_static', array('rating' =&gt; $rating, 'stars' =&gt; 5, 'tag' =&gt; 'vote')) . $voting_message;
     }
     else {
       $output = render($fivestar_widget);
     }
   }
   else {
     $fivestar_links = l('Login', 'user/login') . ' or ' . l('Register', 'user/register');
     $voting_message = "&lt;div&gt;Only registered user can rate this content type.&lt;br/&gt;$fivestar_links to rate this content type.&lt;/div&gt;";
     $output = theme('fivestar_static', array('rating' =&gt; $rating, 'stars' =&gt; 5, 'tag' =&gt; 'vote')) . $voting_message;
   }
   return $output;
 }


Use the below snippet in your node template file.

hide($content['field_fivestar_rating']);// This line will hide the stars which are coming from the fivestar module.
print YOURMODULENAME_print_rating($node-&gt;nid, $content['field_fivestar_rating']);// This will print the fivestar.