I am using the userpoints as a tipping function for live video performances here. I used an ajax dialog window to contain the tip function so as not to interrupt a playing video stream. The userpoints are 'spent' using Rules. I used the block refresh module with Heartbeat to keep a running tally of people who leave tips.

What I would like to create is a method of displaying the top 5 spenders during a performance. Any ideas?

Comments

berdir’s picture

Category: feature » support
Status: Active » Fixed

It is not clear to me what your actual problem is.

You just need to make sure that you can trace a transaction back to the live performance (e.g. by using entity_type and entity_id if the video performance is an entity or with the internal reference field).

Then, all you need to do is create a query on the userpoints_transaction table, apply your limits and order by points DESC.

There is no API for that, but you don't really need one.

berdir’s picture

Note that it should actually be rather easy to build a views for this and then you'd pass in e.g. the node id when you're on a node display as views argument and then display the list sorted by points (you might need to sort ascending as you probably have negative points transactions).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.