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
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

jredding - February 22, 2009 - 04:26

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

drfuzetto - February 22, 2009 - 18:09

Yes that makes sense but what about changing the expiration time frames? How do I do that?

#3

jredding - February 23, 2009 - 02:17

In the administrative section of userpoints. The expiration is userpoints wide an not specific to userpoints_rules.

#4

opensanta - March 29, 2009 - 20:12
Component:Code: userpoints_rules/userpoints_workflow_ng» Documentation
Status:active» fixed

seems like the user got the help he asked for.

#5

System Message - April 12, 2009 - 20:20
Status:fixed» closed

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

#6

opensanta - April 14, 2009 - 04:23
Category:support request» task
Status:closed» needs work

moving to a 'needs work documentation task'

#7

SocialNicheGuru - July 31, 2009 - 22:44

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

SocialNicheGuru - August 31, 2009 - 16:38
Status:needs work» active

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

 
 

Drupal is a registered trademark of Dries Buytaert.