From c2cdf5f3bf7c2f73a3b00467191fe80cdbcfe091 Mon Sep 17 00:00:00 2001 From: Znote Date: Sat, 29 Jan 2022 22:54:29 +0100 Subject: [PATCH] More accurate premium duration calculation. Dont skimp on the hours on the last day the premium expires. --- engine/function/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/function/users.php b/engine/function/users.php index 6484e4d..868a4d9 100644 --- a/engine/function/users.php +++ b/engine/function/users.php @@ -889,7 +889,7 @@ function user_account_add_premdays($accid, $days) { $days = (int)$days; mysql_update(" UPDATE `accounts` - SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP(CURDATE())) + ({$days} * 86400) + SET `premium_ends_at` = GREATEST(`premium_ends_at`, UNIX_TIMESTAMP()) + ({$days} * 86400) WHERE `id`='{$accid}'; "); }