List x number of top voted

Cactii1 - October 21, 2008 - 07:02
Project:Plus 1
Version:6.x-2.4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

How would one query the database to list the top 5 voted?

#1

Chill35 - October 22, 2008 - 01:31

Views 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.

#2

mark_basedow - October 23, 2008 - 13:41

Having 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.

#3

Cactii1 - October 23, 2008 - 14:24

I 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...

#4

timmillwood - November 11, 2008 - 20:38

Views 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.

#5

Cactii1 - November 25, 2008 - 03:54

Views 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.

 
 

Drupal is a registered trademark of Dries Buytaert.