views:

24

answers:

1

hi,

I'm using FiveStars module and I'm modifying the code. I need to get the last vote of a user for a specific node.

I'm sure that the module stores it, because it displays the stars the user previously selected, when he logs in and re-visits the node.

But I'm not able to find this in the code. (I only found the average vote for a node, and the count of nodes).

thanks

+1  A: 

Take a look at fivestar_get_votes() in fivestar.module. To get the votes for, say, user 1 on node 34, you'd do fivestar_get_votes('node', 34, 'vote', 1). Alternatively, take a look at the Voting API, which fivestar_get_votes() uses.

Mark Trapp
The votes are stored from Voting API. I would use the Fivestar functions if there isn't any other module that allows users to vote.
kiamlaluno
Great thanks, it worked. Fivestars works great, and it is easy to fix to assign custom points for each star...
Patrick

related questions