I would like to calculate the number of people who voted 1, 2, 3, 4, and 5 on a particular node. Is there a way to do this using the existing api or would I need to query the database directly?
Thanks!
I would like to calculate the number of people who voted 1, 2, 3, 4, and 5 on a particular node. Is there a way to do this using the existing api or would I need to query the database directly?
Thanks!
Comments
Comment #1
knowledges33ker commentedI need this as well. I'm trying to use fivestar with flag and workflow. I can't figure out how to trigger an action on the event of "x" users voting on a node. The events I want to trigger (if possible) are adding a flag and changing the current workflow state to a new state. Does anyone know if this is possible?
Comment #2
venkatd commentedOkay, so I hunted around the votingapi module and could not find anything. I decided to write a query somewhat like this:
Maybe I should create an issue in votingapi for an aggregate function so that I can call a function like this:
Where the last parameter 'value' is an optional parameter to group the results. Thoughts?
Edit: I posted a function here that does the trick: http://drupal.org/node/698602.
Comment #3
dbt102 commentedDrupal 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)". 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 8 issues.