customize expiration of points
drfuzetto - February 21, 2009 - 21:46
| Project: | User Points |
| Version: | 6.x-1.0 |
| Component: | Documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
How can add to the options of when user points expire. I want the points to expire 4 months from the day that they are added. It won't delete all points right? Just the ones that are expired.
Thanks

#1
The standard release of userpoints includes a point expiration option. If you set this option individual point entries will be reversed (deleted) when they date is reached. For example if set point expiration to 2 days the following would happens
Monday user gains 5 points ; total 5 points
Tuesday user gains 10 point; total 15 points
Wednesday user has 5 points automatically expire; total 10 points
Thursday user has 10 points automatically expire; total 0 points
Hope that makes sense
#2
Yes that makes sense but what about changing the expiration time frames? How do I do that?
#3
In the administrative section of userpoints. The expiration is userpoints wide an not specific to userpoints_rules.
#4
seems like the user got the help he asked for.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
moving to a 'needs work documentation task'
#7
right now is there anyway to add different time frames for expiration of points. There is 1,2,3,4 weeks and 365 days. I would like to add other options.
#8
Anyway to add 5, 10, or 20 weeks if I want to?
in the userpoints.module I added:
3024000 => 'Five Weeks', // added line which is 5 weeks in seconds I believe.
I haven't tested it yet. I would love some help testing it.
/*
* returns an array of possible expiry times
* to the administrative settings page
*/
function expiry_dates() {
return array(
NULL => 'Never',
3600 => 'One hour',
86400 => 'One Day',
604800 => 'One Week',
1209600 => 'Two Weeks',
2419200 => 'Four Weeks',
3024000 => 'Five Weeks', // added line which is 5 weeks in seconds I believe.
31536000 => '365 Days',
);
} //expiry_dates