Closed (fixed)
Project:
User Points
Version:
6.x-1.x-dev
Component:
Code: userpoints API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jan 2011 at 20:17 UTC
Updated:
9 Feb 2011 at 09:00 UTC
I want to know if there is a way for me to get a user's points at a particular time. There is a function userpoints_get_current_points that will get me my points as of today.
I would love to be able to send in a date and find the max points that I had at that time.
Comments
Comment #1
berdirThere is no API function, but you might be able to calculate it with an SQL query based on the transactions table.
Basically, you need to load all transactions older than X, optionally of a specific category of a given user and then SUM() the points.
Something like this
Comment #2
socialnicheguru commentedhow can I add in the category?
Comment #3
berdirAdd ' AND tid = %d' to the query and your category term id as an argument after $time.
Comment #4
berdirOh, and please document this somewhere below http://drupal.org/documentation/modules/userpoints as a How-To page, thanks!