Here is what I would like to do: I would like to make my Fivestar Ratings display much like Amazon does:
-I would like to have the static Average Rating widget display at the top of the node body (which I can do with the node config options).
-But then I would like users to be able to comment on the node and rate it; in the display of a particular user's Comment, his individual rating should be alongside of it.
So if one user rates the node low, you can see why he was disappointed, while if another rates it highly, you can see why he was satisfied.

I tried many configurations, but I cannot get the individual rating alongside the comment.
I searched, not sure if this post is asking for the same thing (and in any case it was not answered there): http://drupal.org/node/282907.

Any help would be greatly appreciated!

Comments

911’s picture

Subscribing.

I also want to display avarage voting in node and each user voting in the comment visible for everybody.

chadchandler’s picture

You might have to do something like this in comment.tpl.php , or node-type.tpl.php if users are nodes. Not all that sure what your setup is, but here is something to maybe try.

<?php
       $current_rating = votingapi_get_voting_result('node', $nid, 'percent', 'vote', 'average');
       $numstars = 5; // Change this to how many stars you want
       print theme('fivestar_static', $current_rating->value, $numstars);
     
?>
AgentD’s picture

re: "I tried many configurations, but I cannot get the individual rating alongside the comment."

This must be a bug, a lot of people have reported it but I haven't found a solution. I have 2 sites up using the latest Drupal, votingapi and fivestar (one site with default theme) and neither show the users' votes in the comments.

911’s picture

Hmm, is played a bit around the last days. I just noticed my votes now show up in the comments for annonymus visitors.

I just havent had a closer look what I did that the votes show up. But I installed the actually development version of fivestar (but the Drupal 6 Version). Perhaps this is already fixed in this version. I also played around with the permissions for fivestar. Perhaps it is only related to some permission settings.

Try out the dev release and give some feedback.
[EDIT] Just noticed there is no actually dev version for Drupal 5.

j0k3z’s picture

Prodigy, that code didnt seem to work for me.

This is something that I really need on my site.

AgentD’s picture

I'm using it on v6 sites and they just don't show up in the comments...

najibx’s picture

I am using multi-axis and get the average below :

print "Value for money";
print fivestar_widget_form($node, 'value');
print "Level of difficulty";
print fivestar_widget_form($node, 'level');
print "Overall";
$current_rating = votingapi_get_voting_result('node', $node->nid, 'percent', 'vote', 'average');
print theme('fivestar_static', $current_rating->value);

It does doing some averaging, but not sure how the calculation being done. I want to give percentage to different criteria, so need to tweak this votingapi_get_voting_result(). How?

Check this out http://drupal.org/node/185074.

stenson’s picture

Has anyone made any progress on this?

Prodigy, looking at your code, does it return User XYZ's rating with his comment, or the average rating of all users?

I have PHP experience, but the module is very big -- it would be helpful if someone who wrote the module or knows it VERY well could suggest modifications to achieve what I, and apparantly many others, are looking for.

Thanks!!!

AgentD’s picture

Download the latest release, there's a patch in it that fixed it for me.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity. Try out the 1.13 release.

Fidelix’s picture

Just FYI, votingapi_get_voting_result() does not exist anymore.

Fidelix’s picture