Congratulations on a great module!

Id like to know if it is possible to use Five Star to calculate a rating based on the rating score of several other nodes.

e.g. can i have a calculated rating for a group, based on the ratings of the posts within the group?

Cheers.

Comments

quicksketch’s picture

Fivestar has no built-in support for what you're describing. Anything like this you'll need to manually query the results from VotingAPI and calculate results yourself.

googletorp’s picture

Once multi axis rating gets implemented, I'm sure a lot of people would like an easy way of setting up a view with the votes from all the criteria and a calculated average. I haven't done views integration, so I don't know how hard such a feature would be to implement.

thatistosay’s picture

I also think vote-averaging is a very obvious feature to want for multi-axis. I'm doing it like this right now:

/**
 * Implementation of hook_votingapi_results_alter()
 *
 * Finds content with vote tags other than 'vote'
 * and replaces the vote average with an average
 * of the other tags. For multi-axis voting.
 */
function MYMODULE_votingapi_results_alter(&$cache, $content_type, $content_id) {
  $vote_avg_sum = 0;
  $vote_avg_count = 0;
  $vote_tags = 0;
  
  foreach($cache as $tag => $data) {
    if($tag != 'vote') {
      $vote_avg_sum += $data['percent']['average'];
      $vote_avg_count += $data['percent']['count'];
      $vote_tags++;
    }
  }
  if($vote_tags > 0) {
    $cache['vote']['percent']['average'] = $vote_avg_sum/$vote_tags;
    $cache['vote']['percent']['count'] = $vote_avg_count/$vote_tags;
  }
}
dbt102’s picture

Assigned: Unassigned » dbt102
Issue summary: View changes
Status: Active » Closed (outdated)

Fivestar for Drupal 6

Drupal 6 is now end of life, and is no longer supported. So Drupal 6 issues for Fivestar are being closed as "Closed (won't fix)" or "Closed (outdated)". However, we don't want users who are porting from Drupal 6 to 7 to feel unwanted, so if you have any migration issues, please open them as Drupal 7 issues.