diff --git a/CHANGELOG.md b/CHANGELOG.md index 860d20af5..a39e86e8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Added ability to set country name manually [\#1652](https://github.com/torrentpier/torrentpier/pull/1652) ([belomaxorka](https://github.com/belomaxorka)) - Improved BitTorrent clients ban functionality [\#1657](https://github.com/torrentpier/torrentpier/pull/1657) ([belomaxorka](https://github.com/belomaxorka)) - Improved `filelist.php` [\#1586](https://github.com/torrentpier/torrentpier/pull/1586) ([belomaxorka](https://github.com/belomaxorka)) +- Invites: Permanent invites feature [\#1670](https://github.com/torrentpier/torrentpier/pull/1670) ([belomaxorka](https://github.com/belomaxorka)) - Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka)) - BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka)) - Fixed incorrect page width on mobile devices [\#1653](https://github.com/torrentpier/torrentpier/pull/1653) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/config.php b/library/config.php index 629f86e02..6c2e55f0b 100644 --- a/library/config.php +++ b/library/config.php @@ -406,10 +406,12 @@ $bb_cfg['invites_system'] = [ 'codes' => [ // Syntax: 'invite_code' => 'validity_period' // The 'validity_period' value is based on strtotime() function: https://www.php.net/manual/en/function.strtotime.php + // You can also create a permanent invite, set 'permanent' value for 'validity_period' // Invite link example: site_url/profile.php?mode=register&invite=new_year - 'new_year' => '2022-12-31 00:00:01', - 'ein_volk' => '29 July 1936', - 'catch_up_overtake' => '1917-10-09' + 'new_year2023' => '2022-12-31 00:00:01', + '340c4bb6ea2d284c13e085b60b990a8a' => '12 April 1961', + 'tp_birthday' => '2005-04-04', + 'endless' => 'permanent' ] ]; $bb_cfg['password_symbols'] = [ diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index 74d8a58c0..372df7dff 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -207,8 +207,10 @@ foreach ($profile_fields as $field => $can_edit) { $invite_code = $_POST['invite_code'] ?? ''; if ($submit) { if (isset($bb_cfg['invites_system']['codes'][$invite_code])) { - if (TIMENOW > strtotime($bb_cfg['invites_system']['codes'][$invite_code])) { - $errors[] = $lang['INVITE_EXPIRED']; + if ($bb_cfg['invites_system']['codes'][$invite_code] !== 'permanent') { + if (TIMENOW > strtotime($bb_cfg['invites_system']['codes'][$invite_code])) { + $errors[] = $lang['INVITE_EXPIRED']; + } } } else { $errors[] = $lang['INCORRECT_INVITE'];