userdetails.php disable change vip_added + vip_until

This commit is contained in:
xiaomlove
2026-01-31 12:35:50 +07:00
parent fd0a2014ba
commit c162fc81be
5 changed files with 36 additions and 34 deletions
+24 -22
View File
@@ -30,8 +30,10 @@ if ($action == "edituser")
// $class = intval($_POST["class"] ?? 0); // $class = intval($_POST["class"] ?? 0);
$class = $userInfo->class; $class = $userInfo->class;
$locale = get_user_locale($userid); $locale = get_user_locale($userid);
$vip_added = ($_POST["vip_added"] == 'yes' ? 'yes' : 'no'); // $vip_added = ($_POST["vip_added"] == 'yes' ? 'yes' : 'no');
$vip_until = !empty($_POST["vip_until"]) ? $_POST['vip_until'] : null; $vip_added = $userInfo->vip_added;
// $vip_until = !empty($_POST["vip_until"]) ? $_POST['vip_until'] : null;
$vip_until = $userInfo->vip_until;
$warned = $_POST["warned"] ?? ''; $warned = $_POST["warned"] ?? '';
$warnlength = intval($_POST["warnlength"] ?? 0); $warnlength = intval($_POST["warnlength"] ?? 0);
@@ -251,26 +253,26 @@ if ($action == "edituser")
// $what = ($class > $curclass ? "Promoted" : "Demoted"); // $what = ($class > $curclass ? "Promoted" : "Demoted");
// $modcomment = date("Y-m-d") . " - $what to '" . get_user_class_name($class) . "' by {$CURUSER['username']}.\n". $modcomment; // $modcomment = date("Y-m-d") . " - $what to '" . get_user_class_name($class) . "' by {$CURUSER['username']}.\n". $modcomment;
// } // }
if ($class == UC_VIP) // if ($class == UC_VIP)
{ // {
$updateset[] = "vip_added = ".sqlesc($vip_added); // $updateset[] = "vip_added = ".sqlesc($vip_added);
if ($vip_added == 'yes') // if ($vip_added == 'yes')
$updateset[] = "vip_until = ".sqlesc($vip_until); // $updateset[] = "vip_until = ".sqlesc($vip_until);
$subject = nexus_trans("user.msg_your_vip_status_changed", [], $locale); // $subject = nexus_trans("user.msg_your_vip_status_changed", [], $locale);
$msg = nexus_trans("user.msg_vip_status_changed_by", [], $locale).$CURUSER['username']; // $msg = nexus_trans("user.msg_vip_status_changed_by", [], $locale).$CURUSER['username'];
$added = sqlesc(date("Y-m-d H:i:s")); // $added = sqlesc(date("Y-m-d H:i:s"));
//
\App\Models\Message::add([ // \App\Models\Message::add([
'sender' => 0, // 'sender' => 0,
'receiver' => $userid, // 'receiver' => $userid,
'subject' => $subject, // 'subject' => $subject,
'msg' => $msg, // 'msg' => $msg,
'added' => now(), // 'added' => now(),
]); // ]);
//
// $modcomment = date("Y-m-d") . " - VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "").".\n". $modcomment; //// $modcomment = date("Y-m-d") . " - VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "").".\n". $modcomment;
$userModifyLogs[] = "VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : ""); // $userModifyLogs[] = "VIP status changed by {$CURUSER['username']}. VIP added: ".$vip_added.($vip_added == 'yes' ? "; VIP until: ".$vip_until : "");
} // }
if ($warned && $curwarned != $warned) if ($warned && $curwarned != $warned)
{ {
+3 -3
View File
@@ -122,7 +122,7 @@ if ($CURUSER['id'] == $user['id'] || user_can('cruprfmanage'))
$userIdDisplay = $user['id']; $userIdDisplay = $user['id'];
$userManageSystemUrl = sprintf('%s/%s/user/users/%s',getSchemeAndHttpHost(), nexus_env('FILAMENT_PATH', 'nexusphp'), $user['id']); $userManageSystemUrl = sprintf('%s/%s/user/users/%s',getSchemeAndHttpHost(), nexus_env('FILAMENT_PATH', 'nexusphp'), $user['id']);
$userManageSystemText = sprintf('<a href="%s" target="_blank" class="altlink">%s</a>', $userManageSystemUrl, $lang_functions['text_management_system']); $userManageSystemText = sprintf('<a href="%s" target="_blank" class="altlink">%s</a>', $userManageSystemUrl, $lang_functions['text_management_system']);
$migratedHelp = sprintf($lang_userdetails['change_field_value_migrated'], $userManageSystemText); $migratedHelp = "&nbsp;&nbsp;".sprintf($lang_userdetails['change_field_value_migrated'], $userManageSystemText);
if (user_can('prfmanage') && $user["class"] < get_user_class()) { if (user_can('prfmanage') && $user["class"] < get_user_class()) {
$userIdDisplay .= "&nbsp;[$userManageSystemText]"; $userIdDisplay .= "&nbsp;[$userManageSystemText]";
} }
@@ -484,8 +484,8 @@ if (user_can('prfmanage') && $user["class"] < get_user_class())
$classselect=classlist('class', $maxclass, $user["class"], 0, false, true); $classselect=classlist('class', $maxclass, $user["class"], 0, false, true);
tr($lang_userdetails['row_class'], $classselect . $migratedHelp, 1); tr($lang_userdetails['row_class'], $classselect . $migratedHelp, 1);
} }
tr($lang_userdetails['row_vip_by_bonus'], "<input type=\"radio\" name=\"vip_added\" value=\"yes\"" .($user["vip_added"] == "yes" ? " checked=\"checked\"" : "")." />".$lang_userdetails['radio_yes']." <input type=\"radio\" name=\"vip_added\" value=\"no\"" .($user["vip_added"] == "no" ? " checked=\"checked\"" : "")." />".$lang_userdetails['radio_no']."<br />", 1); tr($lang_userdetails['row_vip_by_bonus'], "<input type=\"radio\" name=\"vip_added\" value=\"yes\"" .($user["vip_added"] == "yes" ? " checked=\"checked\"" : "")." disabled='disabled'/>".$lang_userdetails['radio_yes']." <input type=\"radio\" name=\"vip_added\" value=\"no\"" .($user["vip_added"] == "no" ? " checked=\"checked\"" : "")." disabled='disabled'/>".$lang_userdetails['radio_no'].$migratedHelp, 1);
tr($lang_userdetails['row_vip_until'], "<input type=\"text\" name=\"vip_until\" value=\"".htmlspecialchars($user["vip_until"])."\" /> ".$lang_userdetails['text_vip_until_note'], 1); tr($lang_userdetails['row_vip_until'], "<input type=\"text\" name=\"vip_until\" value=\"".htmlspecialchars($user["vip_until"])."\" disabled='disabled'/> ".$lang_userdetails['text_vip_until_note']. $migratedHelp, 1);
$supportlang = htmlspecialchars($user["supportlang"]); $supportlang = htmlspecialchars($user["supportlang"]);
$supportfor = htmlspecialchars($user["supportfor"]); $supportfor = htmlspecialchars($user["supportfor"]);
$pickfor = htmlspecialchars($user["pickfor"]); $pickfor = htmlspecialchars($user["pickfor"]);
+3 -3
View File
@@ -17,10 +17,10 @@ return [
'attendance_card' => 'Attend card', 'attendance_card' => 'Attend card',
'props' => 'Props', 'props' => 'Props',
'class' => 'Class', 'class' => 'Class',
'vip_added' => 'VIP status is obtained by bonus', 'vip_added' => 'VIP status auto expires',
'vip_added_help' => 'Is the VIP status redeemed by bonus.', 'vip_added_help' => 'Is the VIP status auto expires.',
'vip_until' => 'VIP status end time', 'vip_until' => 'VIP status end time',
'vip_until_help' => "The time format is 'Year-Year-Month-Day Hour:Minute:Second The time when the VIP status ends.' VIP status is obtained by bonus' must be set to 'Yes' for this rule to take effect.", 'vip_until_help' => "The time format is 'Year-Year-Month-Day Hour:Minute:Second The time when the VIP status ends.' VIP status auto expires' must be set to 'Yes' for this rule to take effect.",
], ],
'class_names' => [ 'class_names' => [
\App\Models\User::CLASS_VIP => 'Vip', \App\Models\User::CLASS_VIP => 'Vip',
+3 -3
View File
@@ -17,10 +17,10 @@ return [
'attendance_card' => '补签卡', 'attendance_card' => '补签卡',
'props' => '道具', 'props' => '道具',
'class' => '等级', 'class' => '等级',
'vip_added' => '贵宾资格为通过魔力值获得', 'vip_added' => '贵宾资格是否自动过期',
'vip_added_help' => '该贵宾资格是否为通过魔力值换取。', 'vip_added_help' => '该贵宾资格是否自动过期。',
'vip_until' => '贵宾资格结束时间', 'vip_until' => '贵宾资格结束时间',
'vip_until_help' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。贵宾资格结束的时间。'贵宾资格为通过魔力值获得'必须设为'是'此规则才能生效。", 'vip_until_help' => "时间格式为'年年年年-月月-日日 时时:分分:秒秒'。贵宾资格结束的时间。'贵宾资格是否自动过期'必须设为'是'此规则才能生效。",
], ],
'class_names' => [ 'class_names' => [
\App\Models\User::CLASS_VIP => '贵宾', \App\Models\User::CLASS_VIP => '贵宾',
+3 -3
View File
@@ -17,10 +17,10 @@ return [
'attendance_card' => '補簽卡', 'attendance_card' => '補簽卡',
'props' => '道具', 'props' => '道具',
'class' => '等級', 'class' => '等級',
'vip_added' => '貴賓資格為通過魔力值獲得', 'vip_added' => '貴賓資格是否自動過期',
'vip_added_help' => '該貴賓資格是否為通過魔力值換取。', 'vip_added_help' => '該貴賓資格是否自動過期。',
'vip_until' => '貴賓資格結束時間', 'vip_until' => '貴賓資格結束時間',
'vip_until_help' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。貴賓資格結束的時間。'貴賓資格為通過魔力值獲得'必須設為'是'此規則才能生效。", 'vip_until_help' => "時間格式為'年年年年-月月-日日 時時:分分:秒秒'。貴賓資格結束的時間。'貴賓資格是否自動過期'必須設為'是'此規則才能生效。",
], ],
'class_names' => [ 'class_names' => [
\App\Models\User::CLASS_VIP => '貴賓', \App\Models\User::CLASS_VIP => '貴賓',