Added a new function to allow modules (like the new Advanced Forum) to query for a user's cumulative point earnings. Cumulative points are nice to show a user's long-time contribution to a site in cases when users are allowed to "redeem" their points for rewards (thereby deducting points from their normal total.

This function is almost identical to the already existing get_current_points() function:

function userpoints_get_current_points($uid = 0) {
return (int)db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $uid));

function userpoints_get_max_points($uid = 0) {
return (int)db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d', $uid));

CommentFileSizeAuthor
userpoints_02.patch559 byteskmillecam

Comments

kmillecam’s picture

Status: Reviewed & tested by the community » Needs review
jredding’s picture

added to version 3

jredding’s picture

Version: 5.x-2.15 » 5.x-3.x-dev
Assigned: Unassigned » jredding
Status: Needs review » Fixed

Moving over to 3, if someone wants to backport it and submit a patch feel free. All new development is on 3

Anonymous’s picture

Status: Fixed » Closed (fixed)

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