Closed (fixed)
Project:
Plus 1
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2008 at 07:02 UTC
Updated:
27 Jan 2011 at 17:10 UTC
How would one query the database to list the top 5 voted?
Comments
Comment #1
Chill35 commentedViews 2 will give you that. That was the whole point of Integrating the module with the Voting API: make it easier to create such lists.
Comment #2
mark_basedow commentedHaving trouble with this too. I know I had this working properly once but now I can't get it to work with views 2. Everything is up to date.
In Views relationships I have Node Voting Results set to Valuetype = points, Vote tag = Vote and Aggregation Function = Count. The sorting criteria is using Voting Results API Function desc. I,ve tried all combinations of settings.
Is it something I am missing or there a bug?
Edit: Sorry I finally worked it out from the votingapi top_content view.
It wasn't very intuitive. Under "Voting API results: Value" it says "The value of an individual cast vote" and I didn't think that seemed to apply. I was wrong.
Comment #3
Cactii1 commentedI haven't had the need to install Views yet.
I would think using a module like views just to add a block with this result is quite heavy on the resources as compared to a direct database query wouldn't it?
With that in mind...
Comment #4
timmillwoodViews is the way to go, I have the top items that have been voted on in the last 48 hours all through views, plus an RSS feed for it.
Comment #5
Cactii1 commentedViews is a lot of overhead and I don't want to use it if I don't have to. What I want can be accomplished with a database query and I thought that someone would have written one by now so I don't have to study the database to figure out how it works.
Seems that I will probably have to though.
Comment #6
nancydruHere's the answer to your question but I suspect you really want a block or something like that.
I agree that Views is a lot of overhead for this.
Comment #7
nancydruIf I get commit access, you will have a block.
Comment #8
nancydruComment #9
nancydruCommitted to 6.x-2.x-dev.