Closed (won't fix)
Project:
Voting API
Version:
5.x-1.6
Component:
Code
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2008 at 23:26 UTC
Updated:
11 Jan 2011 at 16:14 UTC
I hope this request isn't too basic - I'm somewhat new to Drupal so I'm not sure what's very easy to implement and what's more complex.
My question: is there a way to display the average votes received by the ALL the content created by a given user?
My scenario: I'm setting up a services marketplace (www.youplatform.com) and right now customers can view ratings given to any product created by a user. However, I think it would be much more useful for customers to see the average rating given to all the products a given user provides.
Any help in terms of finding a good contributed module to use or code snippet to add would be very helpful.
Thank you.
Comments
Comment #1
walker2238 commentedI'm also interested in doing this.
Comment #2
Poetro commentedSince Voting API doesn't know what is a content, and modules using Voting API can implement (and do implement) various usage of the votingapi, the answer is not Voting API specific, but the module implementing the Voting API. For example Advanced Poll module uses the 'advpoll' as content_type while others may use 'node', 'user', 'comment' or ANY name for the content type. This way content association with users is module specific, not Voting API related.
Also consider that averaging different kind of votes may not make any sense. Some modules may use 1-100 scale while others -100 - 100 as the scale, while others use 1-10 as the scale. Averaging this will NOT make any sense.
Comment #3
walker2238 commentedI'm using fivestar and from what I see the only table that was created was for comment voting. It appears the rest of the data is stored into the voting api tables. I'm not sure I understand why this wouldn't make any sense for my needs as I only has one content type for voting. I just figured some how I could join the node table with something like the votingapi_cache table to get results my matching the content_id. My SQL skills are poor so maybe I'm wrong.
Comment #4
Poetro commentedYou can do it in YOUR module, or ask the fivestar module's developer to add this feature to it, but dont expect the API to do it, as the API is created to be general, and can be used for various implementations of voting / rating.
Comment #5
walker2238 commentedOk well with a little guidance I did manage to do it. by taking the votes from voting_cache database and joining it with the node database. I guess I wasn't being to detailed about my request... or maybe I still don't understand what you meant. here is what I am using.
and then the rest is done i relation to the module you use. Is that what you were getting at?
Comment #6
eaton commentedSupport for the 5.x branch of VotingAPI has ended with the release of Drupal 7 and the upcoming release of VotingAPI 7.x-2.4.