I think it would be really awesome to be able to set the 'maximum points' to the highest point value on the site (via a token?). On my site where earning userpoints = a good thing, there isn't a cap to set on how many points a user can earn.

Comments

marcoka’s picture

i have never created a token for the token module. At the moment i have no time to read/research token module.
code snippets appreciated :)

marcoka’s picture

Status: Active » Needs work
Crom’s picture

+1. I agree that this would be a useful feature. It seems strange to assign a quota to user points because isn't the point that we are trying to encourage users to generate as many as possible.

If I work anything up I'll post it but suggestions as to the best route would be welcome.

Thanks,
crom

marcoka’s picture

well i coded it to be used as a SIGN of what a user can download. i used userpoints to make a download quota module. I will soon start porting that to D7. Suggestions welcome.

marcoka’s picture

I asked in the issue queue of userpoints if there is an api way to get the max value.

marcoka’s picture

Priority: Major » Normal
marcoka’s picture

hm no reply so far @userpoints issue queue. i only will ad dthis if someone comes up with a solution/patch

marcoka’s picture

Status: Needs work » Closed (won't fix)

no solutions, suggestions, so wont fix

Azavia’s picture

Version: 6.x-1.x-dev » 7.x-2.0
Status: Closed (won't fix) » Active

Is there still interest in this? There's no API in userpoints, but this would be a relatively trivial change.

Something like the following would retrieve the maximum points:

$query = db_select('userpoints_total', 'upt');
$query->addExpression('MAX(upt.points)', 'maximum_points');
$result = $query->execute();
$max_points = $result->fetchField(0);

Granted it directly accesses the DB, but there's no API function to do this, and it seems that the points column shouldn't really change.

I'm willing to help with this if needed and if there is still interest.

Azavia’s picture

Assigned: Unassigned » Azavia
Status: Active » Needs review
StatusFileSize
new2.86 KB

I created a patch to create the token. The token is [userpoints-meter:max-points].

marcoka’s picture

now the community can test it and i also need a volunteer to add that to d6 because i dont maintain d6 anymore (no time).

socialnicheguru’s picture

Issue summary: View changes

how do I use the patch in #10? I really mean where do I place the token value so that the userpoints meter blocks don't need to have a max value?

mark.’s picture

Issue summary: View changes