The conversation started from #395500: time_stamp parameter is not considered in userpoints api as a timestamp feature is being discussed in the userpoints api.

Currently the module provides two functions to query about user points:

userpoints_get_current_points($uid = NULL, $tid = NULL);
userpoints_get_max_points($uid = NULL, $tid = NULL);

I suggest this two functions to be 'upgraded' (not replaced), supporting the $params schema as the userpointsapi does by this function:

userpoints_get_points($params = NULL)

params can be set to filter by uid, timestamp and whatever could be used to filter according to userpoints functionality.

About the two original api functions, and as we have a "timestamp" feature, the module should (imho) also provide the timestamp behaviour, allowing to query the module about the number of points a user have at some point in it's lifetime. It's as significant as to include the "AND created < %d" in the queries with a default time() timestamp, even if the module supports the future granting feature. As a module writer, I want to know how many points a user had three days ago, and as I don't manage the userpoints tables, it's the userpoints module the responsible of offering this kind of functionality to the rest of modules and it's currently missing..

Comments

kbahey’s picture

Status: Active » Postponed

Good idea.

Let us keep it for when we upgrade to 7.x so as not to have API changes for 6.x

ilo’s picture

yes, this is proposed for head and will not be included in the timestamp patch of the other issue.

cptX’s picture

Hi to all, I'm looking for the same functionality. More specifically I need to know how many userpoints a user has earned in the last month, for example. I haven't found a way to do this yet. Any suggestions? Should I write my own query, counting the points of the user in the past month?

berdir’s picture

Version: master » 7.x-1.x-dev
Status: Postponed » Active
BenK’s picture

Component: Code: userpoints API » Code: userpoints

Subscribing

manuel.adan’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Currently, there are no plans to improve the 7.x branch of this project with new features. Closing this by now as outdated. Please, feel free to reopen if you want to work on it.