diff --git a/app/Models/User.php b/app/Models/User.php index bf4b354f..06665581 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -434,7 +434,11 @@ class User extends Authenticatable public function isDonating() { - if ($this->donor == 'yes' && $this->donoruntil && $this->donoruntil->gte(Carbon::now())) { + $rawDonorUntil = $this->getRawOriginal('donoruntil'); + if ( + $this->donor == 'yes' + && ($rawDonorUntil === null || $rawDonorUntil == '0000-00-00 00:00:00' || $this->donoruntil->gte(Carbon::now())) + ) { return true; } return false; diff --git a/include/functions.php b/include/functions.php index 66ed5aff..d9dc5312 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3588,7 +3588,7 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f $disabledpic = "disabled"; $style = "style='margin-left: 2pt'"; } - $pics = $arr["donor"] == "yes" && $arr['donoruntil'] !== null && $arr['donoruntil'] >= date('Y-m-d H:i:s') ? "\"Donor\"" : ""; + $pics = $arr["donor"] == "yes" && ($arr['donoruntil'] === null || $arr['donoruntil'] == '0000-00-00 00:00:00' || $arr['donoruntil'] >= date('Y-m-d H:i:s')) ? "\"Donor\"" : ""; if ($arr["enabled"] == "yes") $pics .= ($arr["leechwarn"] == "yes" ? "\"Leechwarned\"" : "") . ($arr["warned"] == "yes" ? "\"Warned\"" : ""); diff --git a/lang/chs/lang_userdetails.php b/lang/chs/lang_userdetails.php index e9fd49a0..9159c40b 100644 --- a/lang/chs/lang_userdetails.php +++ b/lang/chs/lang_userdetails.php @@ -149,6 +149,6 @@ $lang_userdetails = array 'text_user_id'=> "用户ID/UID", 'row_medal' => '勋章', 'row_donoruntil' => '捐赠状态截止时间', - 'text_donoruntil_note' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。损赠有效需要捐赠状态为'是'且截止时间大于当前时间同时满足。", + 'text_donoruntil_note' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。留空永久有效。", ); ?> diff --git a/lang/cht/lang_userdetails.php b/lang/cht/lang_userdetails.php index e0233b8d..d58bf1d5 100644 --- a/lang/cht/lang_userdetails.php +++ b/lang/cht/lang_userdetails.php @@ -149,6 +149,6 @@ $lang_userdetails = array 'text_user_id'=> "用戶ID/UID", 'row_medal' => '勛章', 'row_donoruntil' => '捐贈狀態截止時間', - 'text_donoruntil_note' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。損贈有效需要捐贈狀態為'是'且截止時間大於當前時間同時滿足。", + 'text_donoruntil_note' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。留空永久有效。", ); ?> diff --git a/lang/en/lang_userdetails.php b/lang/en/lang_userdetails.php index 34e90c4e..1c3d6a34 100644 --- a/lang/en/lang_userdetails.php +++ b/lang/en/lang_userdetails.php @@ -149,6 +149,6 @@ $lang_userdetails = array 'text_user_id'=> "User ID", 'row_medal' => 'Medal', 'row_donoruntil' => 'Donated until', - 'text_donoruntil_note' => "Time format is YYYY-MM-DD hh:mm:ss. To be valid, the donation status must be 'Yes' and the deadline is greater than the current time.", + 'text_donoruntil_note' => "Time format is YYYY-MM-DD hh:mm:ss. Leave blank permanently.", ); ?> diff --git a/public/announce.php b/public/announce.php index a500206d..8d4b6b18 100644 --- a/public/announce.php +++ b/public/announce.php @@ -452,7 +452,7 @@ elseif(isset($self)) if ( $event == 'completed' && $az['class'] < \App\Models\HitAndRun::MINIMUM_IGNORE_USER_CLASS - && ($az['donor'] == 'no' || empty($az['donoruntil']) || $az['donoruntil'] === null || $az['donoruntil'] < date("Y-m-d H:i:s")) + && ($az['donor'] == 'no' || (!empty($az['donoruntil']) && $az['donoruntil'] != '0000-00-00 00:00:00' && $az['donoruntil'] < date("Y-m-d H:i:s"))) ) { //think about H&R $hrMode = get_setting('hr.mode');