From 1be1bc9178fa662ad79aa72829e13ee0f0aa69da Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 7 Nov 2022 09:11:57 +0100 Subject: [PATCH] fix premium_ends_at for tfs 1.3+ --- system/pages/account/create.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/pages/account/create.php b/system/pages/account/create.php index 20cd0170..f094d5b1 100644 --- a/system/pages/account/create.php +++ b/system/pages/account/create.php @@ -200,8 +200,13 @@ if($save) $new_account->setCustomField('premend', time() + $config['account_premium_days'] * 86400); } else { // rest - $new_account->setCustomField('premdays', $config['account_premium_days']); - $new_account->setCustomField('lastday', time()); + if ($db->hasColumn('accounts', 'premium_ends_at')) { // TFS 1.4+ + $new_account->setCustomField('premium_ends_at', time() + $config['account_premium_days'] * (60 * 60 * 24)); + } + else { + $new_account->setCustomField('premdays', $config['account_premium_days']); + $new_account->setCustomField('lastday', time()); + } } }