mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 11:27:24 +08:00
donate until blank valid forever
This commit is contained in:
+5
-1
@@ -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;
|
||||
|
||||
@@ -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') ? "<img class=\"".$donorpic."\" src=\"pic/trans.gif\" alt=\"Donor\" ".$style." />" : "";
|
||||
$pics = $arr["donor"] == "yes" && ($arr['donoruntil'] === null || $arr['donoruntil'] == '0000-00-00 00:00:00' || $arr['donoruntil'] >= date('Y-m-d H:i:s')) ? "<img class=\"".$donorpic."\" src=\"pic/trans.gif\" alt=\"Donor\" ".$style." />" : "";
|
||||
|
||||
if ($arr["enabled"] == "yes")
|
||||
$pics .= ($arr["leechwarn"] == "yes" ? "<img class=\"".$leechwarnpic."\" src=\"pic/trans.gif\" alt=\"Leechwarned\" ".$style." />" : "") . ($arr["warned"] == "yes" ? "<img class=\"".$warnedpic."\" src=\"pic/trans.gif\" alt=\"Warned\" ".$style." />" : "");
|
||||
|
||||
@@ -149,6 +149,6 @@ $lang_userdetails = array
|
||||
'text_user_id'=> "用户ID/UID",
|
||||
'row_medal' => '勋章',
|
||||
'row_donoruntil' => '捐赠状态截止时间',
|
||||
'text_donoruntil_note' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。损赠有效需要捐赠状态为'是'且截止时间大于当前时间同时满足。",
|
||||
'text_donoruntil_note' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。留空永久有效。",
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -149,6 +149,6 @@ $lang_userdetails = array
|
||||
'text_user_id'=> "用戶ID/UID",
|
||||
'row_medal' => '勛章',
|
||||
'row_donoruntil' => '捐贈狀態截止時間',
|
||||
'text_donoruntil_note' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。損贈有效需要捐贈狀態為'是'且截止時間大於當前時間同時滿足。",
|
||||
'text_donoruntil_note' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。留空永久有效。",
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -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.",
|
||||
);
|
||||
?>
|
||||
|
||||
+1
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user