You are here

function userpoints_get_default_expiry_date in User Points 6

Same name and namespace in other branches
  1. 5.3 userpoints.module \userpoints_get_default_expiry_date()
  2. 7.2 userpoints.module \userpoints_get_default_expiry_date()
  3. 7 userpoints.module \userpoints_get_default_expiry_date()
3 calls to userpoints_get_default_expiry_date()
UserpointsTestCase::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.module
_userpoints_transaction in ./userpoints.module

File

./userpoints.module, line 858

Code

function userpoints_get_default_expiry_date() {
  $expirydate = userpoints_date_to_timestamp(variable_get(USERPOINTS_EXPIREON_DATE, NULL));
  if ($expirydate < time()) {
    $expirydate = variable_get(USERPOINTS_EXPIREAFTER_DATE, NULL);
    if ($expirydate) {
      $expirydate = time() + $expirydate;
    }
  }
  return $expirydate;
}