Invites: Permanent invites feature (#1670)

* Invites: Permanent invites feature

* Update config.php

* Update config.php

* Update CHANGELOG.md

* Update config.php
This commit is contained in:
Roman Kelesidis 2024-11-05 00:06:09 +07:00 committed by GitHub
commit d9a8adbaaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View file

@ -16,6 +16,7 @@
- Added ability to set country name manually [\#1652](https://github.com/torrentpier/torrentpier/pull/1652) ([belomaxorka](https://github.com/belomaxorka)) - 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 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)) - 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)) - 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)) - 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)) - Fixed incorrect page width on mobile devices [\#1653](https://github.com/torrentpier/torrentpier/pull/1653) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -406,10 +406,12 @@ $bb_cfg['invites_system'] = [
'codes' => [ 'codes' => [
// Syntax: 'invite_code' => 'validity_period' // Syntax: 'invite_code' => 'validity_period'
// The 'validity_period' value is based on strtotime() function: https://www.php.net/manual/en/function.strtotime.php // 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 // Invite link example: site_url/profile.php?mode=register&invite=new_year
'new_year' => '2022-12-31 00:00:01', 'new_year2023' => '2022-12-31 00:00:01',
'ein_volk' => '29 July 1936', '340c4bb6ea2d284c13e085b60b990a8a' => '12 April 1961',
'catch_up_overtake' => '1917-10-09' 'tp_birthday' => '2005-04-04',
'endless' => 'permanent'
] ]
]; ];
$bb_cfg['password_symbols'] = [ $bb_cfg['password_symbols'] = [

View file

@ -207,8 +207,10 @@ foreach ($profile_fields as $field => $can_edit) {
$invite_code = $_POST['invite_code'] ?? ''; $invite_code = $_POST['invite_code'] ?? '';
if ($submit) { if ($submit) {
if (isset($bb_cfg['invites_system']['codes'][$invite_code])) { if (isset($bb_cfg['invites_system']['codes'][$invite_code])) {
if (TIMENOW > strtotime($bb_cfg['invites_system']['codes'][$invite_code])) { if ($bb_cfg['invites_system']['codes'][$invite_code] !== 'permanent') {
$errors[] = $lang['INVITE_EXPIRED']; if (TIMENOW > strtotime($bb_cfg['invites_system']['codes'][$invite_code])) {
$errors[] = $lang['INVITE_EXPIRED'];
}
} }
} else { } else {
$errors[] = $lang['INCORRECT_INVITE']; $errors[] = $lang['INCORRECT_INVITE'];