1
0
mirror of https://github.com/torrentpier/torrentpier.git synced 2025-03-12 04:35:42 -07:00

Invites: Permanent invites feature ()

* 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
parent 7a209bc615
commit d9a8adbaaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

@ -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))

@ -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'] = [

@ -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'];