getSetting('dateEndMembership', 0); if (!$dateEnd) $dateEnd = 0; // if the membership is expired, extend it to today + 1 year $time = time(); if ($dateEnd < $time ) $dateEnd = $time; $dateEnd = mktime(23, 59, 59, date("m", $dateEnd), date("d", $dateEnd), date("Y", $dateEnd)+1); $user->updateSetting('dateEndMembership', $dateEnd, 'date', 0); } } ?>