From b7e33c5e6d46103978a84f9d4a47b8100efce33f Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 10 Sep 2022 21:37:42 +0200 Subject: [PATCH] Fix config.account_premium_days for TFS 1.4+ --- system/pages/createaccount.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/pages/createaccount.php b/system/pages/createaccount.php index abab3610..9f7b895a 100644 --- a/system/pages/createaccount.php +++ b/system/pages/createaccount.php @@ -183,8 +183,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()); + } } }