Hello friends,
I am using drupal 7 and installed fivestar module. Everything is going on good. Now i stuck in a problem. I make a content type with name "review" and add fivestar rating..I created three nodes with fivestar rating (one with 3 starts, second 5 star and third 4). Now i want overall value of these three rating(means it may be percentage, total numbers of rating example: its three nodes then rating is 3 etc..) with stars image...

I dont have any idea how i can that.. So, please give me suitable thing with that i can do this..

Regards
Puneet Sharma

Comments

TSC_2010’s picture

I'm also interested in this topic. I figure there is a way to use the computed field module in order to get an overall average of different rating widgets on one node, comment, etc.

Refineo’s picture

sub

ericduran’s picture

Category: support » feature
Status: Active » Postponed (maintainer needs more info)

I'm curious as to what the use case is?

If you where to be doing this with multiple comments being targeted at a single node then yes, this is possible.

But getting the overal rating for a tag accross multiple nodes is not possible.

You could do this with writing your own query against votingapi or using the votingapi functions. But fivestar would probably never do this.

I'm willing to hear the use case for it, to see if I can provide some guidance. Hope this helps.

Refineo’s picture

Status: Postponed (maintainer needs more info) » Active

Hello,

First of all, thank you for this module.

Here is the use case.

For my restaurant review website case I would like users to rate 3 different qualities of restaurants: staff, food, interior.
These detailed ratings can be visible on node pages. However I would like to show the list of all restaurants sorted using a calculated overall rating criteria:

(example)
overall rating=(w1*staff + w2*food + w3*interior)/ (w1+w2+w3)
where w1, w2, w3 are weights

It would be great to display this as fivestar rating as well.

ericduran’s picture

I see, So right now you can have the tree different rating assuming you used a different 'axis' name.

The thing that I just don't see us doing if getting the sum of different axis (aka staff, food, interior). This seems like a pretty specific usecase, and the odds are that other people would want to weight there values differently.

That being said this is perfectly doable if you query the votingapi data directly. Then you can just display those values in the fivestar display. It would required some custom code.

Sadly I don't see a way of doing this generic enough for everyone :-(

ayesh’s picture

I randomly came here while searching for a different problem but here are my thoughts.

As the OP wants to have different nodes, it looks like he is trying to get the functionality of a "review" node that they rate the restaurant.
This is just a perfect use case for rating target setup, so if you want to allow users to vote to another entity remotely, make use of it.
Currently FiveStar supports Node References (References module), User references and Node->Comment relationships.

As for voting on a different axis, there is no built-in way (hopefully, yet) to populate a field using the module, but you can easily put some tiny php code to display an average in a same-looking fivestar bar.

Related: #335493: Vote-averaging for multi-axis
Document page: http://drupal.org/node/1308114
Sorry if this is not what you were looking for.

IWasBornToWin’s picture

@ericduran - i've seen other pages asking for the same solution - overall results, none have ever been answered. He is asking the same here. This is not an isolated request. I will give you the common requests I've seen which is the same as mine.

here are a few links - http://drupal.org/node/1041110

http://drupal.org/node/1299784

1 content type, different nodes, different node authors.

And using the original posters example - what if the same author listed 5 restaurants and wanted each one reviewed at its own node and then the we wanted to show the restaurant owner's overall rating?

another example - product content type and nodes. one author has 3 different product nodes. Fivestar tag is product.

three different rated products but we want to show the author's over all rating by adding all the votes from all of that authors products. I've seen this request all over the site. and as i said, some are almost two years old and have never been answered. Any suggestions op ow to do this? I will use compute field or whatever i need to use. I just want to show it in a view. Even if i can query voting api i need to use fivestar to show end uer the nice display rather than something like 3.8 avg (26 votes)

Thank you

IWasBornToWin’s picture

And here's another unanswered request, there are many more but i hope you get the point, there are plenty of us needing, desperately to get overall totals...any way possible.

http://drupal.org/node/1231220

I'd be willing to chip in if this is something which can be written

moshang’s picture

i guess this will help

http://drupal.org/node/1308114

btw, im not sure if there is a problem in the module since when i tried this.
it only record the latest vote (only one vote will be recorded)
then i changed the line 133 of the module to let it pass in the uid (it is set to null originally).

i still have problems of deleting comments and vote multi times. if ppl delete a comment, the average vote will mess up.
looking for solution for this problem.

whiteph’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)