You are here

function userpoints_get_default_expiry_date in User Points 7

Same name and namespace in other branches
  1. 5.3 userpoints.module \userpoints_get_default_expiry_date()
  2. 6 userpoints.module \userpoints_get_default_expiry_date()
  3. 7.2 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 tests/userpoints_api.test
Changes the default expiration date in the administrative settings and then checks to ensure that it is saved/returned correctly.
userpoints_admin_txn in ./userpoints.admin.inc
Form builder for add/edit userpoints transaction form.
_userpoints_transaction in ./userpoints.module
Adds the points to the txn table.

File

./userpoints.module, line 1179

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