function userpoints_get_default_expiry_date in User Points 7.2
Same name and namespace in other branches
- 5.3 userpoints.module \userpoints_get_default_expiry_date()
- 6 userpoints.module \userpoints_get_default_expiry_date()
- 7 userpoints.module \userpoints_get_default_expiry_date()
Determines the correct default expiration date.
Return value
The default expiration date.
3 calls to userpoints_get_default_expiry_date()
- UserpointsAPITestCase::testDefaultExpireDate in ./
userpoints.test - Changes the default expiration date in the administrative settings and then checks to ensure that it is saved/returned correctly.
- UserpointsTransaction::__construct in ./
userpoints.transaction.inc - Start a new transaction or update an existing one.
- userpoints_admin_txn in ./
userpoints.admin.inc - Form builder for add/edit userpoints transaction form.
File
- ./
userpoints.module, line 764
Code
function userpoints_get_default_expiry_date() {
$expirydate = userpoints_date_to_timestamp(variable_get(USERPOINTS_EXPIREON_DATE, 0));
if ($expirydate < REQUEST_TIME) {
$expirydate = variable_get(USERPOINTS_EXPIREAFTER_DATE, 0);
if ($expirydate) {
$expirydate = REQUEST_TIME + $expirydate;
}
}
return (int) $expirydate;
}