| 50 |
{ |
{ |
| 51 |
instance.post('section_setting_service.php', { |
instance.post('section_setting_service.php', { |
| 52 |
sid: <? echo $result_set["data"]["sid"]; ?>, |
sid: <? echo $result_set["data"]["sid"]; ?>, |
| 53 |
|
sname: f.sname.value, |
| 54 |
|
title: f.title.value, |
| 55 |
comment: f.textarea_comment.value, |
comment: f.textarea_comment.value, |
| 56 |
announcement: f.textarea_announcement.value, |
announcement: f.textarea_announcement.value, |
| 57 |
|
exp_get: (f.exp_get.checked ? "1" : "0"), |
| 58 |
|
recommend: (f.recommend.checked ? "1" : "0"), |
| 59 |
|
read_user_level: f.read_user_level.value, |
| 60 |
|
write_user_level: f.write_user_level.value, |
| 61 |
|
sort_order: f.sort_order.value, |
| 62 |
ex_update: (f.ex_update.checked ? "1" : "0"), |
ex_update: (f.ex_update.checked ? "1" : "0"), |
| 63 |
}) |
}) |
| 64 |
.then(function (response) { |
.then(function (response) { |
| 141 |
return false; |
return false; |
| 142 |
} |
} |
| 143 |
|
|
| 144 |
|
function master_op(f, op, username) |
| 145 |
|
{ |
| 146 |
|
instance.post('section_master_service.php', { |
| 147 |
|
sid: <? echo $result_set["data"]["sid"]; ?>, |
| 148 |
|
op: op, |
| 149 |
|
username: (username != null ? username : f.master_username.value), |
| 150 |
|
type: f.master_type.value, |
| 151 |
|
}) |
| 152 |
|
.then(function (response) { |
| 153 |
|
var ret = response.data; |
| 154 |
|
var errorFieldMap = new Map(); |
| 155 |
|
switch (ret.return.code) |
| 156 |
|
{ |
| 157 |
|
case 0: // OK |
| 158 |
|
refresh_err_msg(errorFieldMap); |
| 159 |
|
document.location = "section_setting.php?sid=<? echo $result_set["data"]["sid"]; ?>&ts=" + Date.now(); |
| 160 |
|
break; |
| 161 |
|
case -1: // Input validation failed |
| 162 |
|
ret.return.errorFields.forEach(field => { |
| 163 |
|
errorFieldMap.set("err_msg_" + field.id, field.errMsg + "<br />"); |
| 164 |
|
}); |
| 165 |
|
refresh_err_msg(errorFieldMap); |
| 166 |
|
break; |
| 167 |
|
case -2: // Internal error |
| 168 |
|
console.log(ret.return.message); |
| 169 |
|
errorFieldMap.set("err_msg_master", "内部错误"); |
| 170 |
|
refresh_err_msg(errorFieldMap); |
| 171 |
|
break; |
| 172 |
|
default: |
| 173 |
|
console.log(ret.return.code); |
| 174 |
|
break; |
| 175 |
|
} |
| 176 |
|
}) |
| 177 |
|
.catch(function (error) { |
| 178 |
|
console.log(error); |
| 179 |
|
}); |
| 180 |
|
|
| 181 |
|
return false; |
| 182 |
|
} |
| 183 |
|
|
| 184 |
const instance = axios.create({ |
const instance = axios.create({ |
| 185 |
withCredentials: true, |
withCredentials: true, |
| 186 |
timeout: 3000, |
timeout: 3000, |
| 197 |
case "submit": |
case "submit": |
| 198 |
section_setting(f); |
section_setting(f); |
| 199 |
break; |
break; |
| 200 |
|
case "master_appoint": |
| 201 |
|
master_op(f, 1, null); |
| 202 |
|
break; |
| 203 |
case "dir_create": |
case "dir_create": |
| 204 |
ex_dir_op(f, 1); |
ex_dir_op(f, 1); |
| 205 |
break; |
break; |
| 222 |
document.location = "section_setting.php?sid=" + s.value + "&ts=" + Date.now(); |
document.location = "section_setting.php?sid=" + s.value + "&ts=" + Date.now(); |
| 223 |
} |
} |
| 224 |
}); |
}); |
| 225 |
|
|
| 226 |
|
<? |
| 227 |
|
$user_level_types = array("read_user_level", "write_user_level"); |
| 228 |
|
|
| 229 |
|
foreach ($user_level_types as $t) |
| 230 |
|
{ |
| 231 |
|
?> |
| 232 |
|
var l = document.getElementById("<? echo $t; ?>"); |
| 233 |
|
var found = false; |
| 234 |
|
for (i = 0; !found && i < l.options.length; i++) |
| 235 |
|
{ |
| 236 |
|
if (l.options[i].value == <? echo $result_set["data"][$t]; ?>) |
| 237 |
|
{ |
| 238 |
|
l.selectedIndex = i; |
| 239 |
|
found = true; |
| 240 |
|
} |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
for (i = 0; !found && i < l.options.length; i++) |
| 244 |
|
{ |
| 245 |
|
if (l.options[i].value >= <? echo $result_set["data"][$t]; ?>) |
| 246 |
|
{ |
| 247 |
|
l.selectedIndex = i; |
| 248 |
|
found = true; |
| 249 |
|
} |
| 250 |
|
} |
| 251 |
|
<? |
| 252 |
|
} |
| 253 |
|
?> |
| 254 |
|
|
| 255 |
|
var s_sort = document.getElementById("sort_order"); |
| 256 |
|
for (i = 0; i < s_sort.options.length; i++) |
| 257 |
|
{ |
| 258 |
|
if (s_sort.options[i].value == <? echo $result_set["data"]["sort_order"]; ?>) |
| 259 |
|
{ |
| 260 |
|
s_sort.selectedIndex = i; |
| 261 |
|
break; |
| 262 |
|
} |
| 263 |
|
} |
| 264 |
}); |
}); |
| 265 |
|
|
| 266 |
</script> |
</script> |
| 270 |
<p style="FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: red; FONT-FAMILY: 楷体">版块设定</p> |
<p style="FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: red; FONT-FAMILY: 楷体">版块设定</p> |
| 271 |
<p><span id="err_msg_prompt" name="err_msg" style="color: red"></span></p> |
<p><span id="err_msg_prompt" name="err_msg" style="color: red"></span></p> |
| 272 |
<form method="post" action="#" id="section_setting" name="section_setting" > |
<form method="post" action="#" id="section_setting" name="section_setting" > |
| 273 |
<table border="1" cellpadding="10" cellspacing="0" width="90%" bgcolor="#ffdead"> |
<table border="1" cellpadding="10" cellspacing="0" width="1050" bgcolor="#ffdead"> |
| 274 |
<tr> |
<tr> |
| 275 |
<td width="30%" align="right"> |
<td width="25%" align="right"> |
| 276 |
版块名称 |
操作版块 |
| 277 |
</td> |
</td> |
| 278 |
<td width="70%"> |
<td width="75%"> |
| 279 |
<select id="section_switch" name="section_switch" size="1"> |
<select id="section_switch" name="section_switch" size="1"> |
| 280 |
<? |
<? |
| 281 |
foreach ($result_set["data"]["section_hierachy"] as $c_index => $section_class) |
foreach ($result_set["data"]["section_hierachy"] as $c_index => $section_class) |
| 295 |
</td> |
</td> |
| 296 |
</tr> |
</tr> |
| 297 |
<tr> |
<tr> |
| 298 |
|
<td width="25%" align="right"> |
| 299 |
|
版块名称 |
| 300 |
|
</td> |
| 301 |
|
<td width="75%"> |
| 302 |
|
<span id="err_msg_sname" name="err_msg" style="color: red;"></span> |
| 303 |
|
<input id="sname" name="sname" size="20" value="<? echo htmlspecialchars($result_set["data"]["sname"], ENT_QUOTES | ENT_HTML401, 'UTF-8'); ?>" |
| 304 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?> |
| 305 |
|
<br />1-20位大小写字母、数字、下划线的组合,必须以字母开头 |
| 306 |
|
</td> |
| 307 |
|
</tr> |
| 308 |
|
<tr> |
| 309 |
|
<td width="25%" align="right"> |
| 310 |
|
版块标题 |
| 311 |
|
</td> |
| 312 |
|
<td width="75%"> |
| 313 |
|
<span id="err_msg_title" name="err_msg" style="color: red;"></span> |
| 314 |
|
<input id="title" name="title" size="20" value="<? echo htmlspecialchars($result_set["data"]["title"], ENT_QUOTES | ENT_HTML401, 'UTF-8'); ?>" |
| 315 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?> |
| 316 |
|
<br />长度不超过10个全角字符,不能包含空格和HTML特殊语义字符 |
| 317 |
|
</td> |
| 318 |
|
</tr> |
| 319 |
|
<tr> |
| 320 |
<td align="right"> |
<td align="right"> |
| 321 |
版块介绍 |
版块介绍 |
| 322 |
</td> |
</td> |
| 323 |
<td> |
<td> |
| 324 |
<span id="err_msg_comment" name="err_msg" style="color: red;"></span> |
<span id="err_msg_comment" name="err_msg" style="color: red;"></span> |
| 325 |
<textarea id="textarea_comment" name="textarea" cols="80" rows="5"><? echo htmlspecialchars($result_set["data"]["comment"], ENT_HTML401, 'UTF-8'); ?></textarea> |
<textarea id="textarea_comment" name="textarea" cols="80" rows="5"><? echo htmlspecialchars($result_set["data"]["comment"], ENT_HTML401, 'UTF-8'); ?></textarea> |
| 326 |
限3行80列以内 |
<br />限3行80列以内 |
| 327 |
</td> |
</td> |
| 328 |
</tr> |
</tr> |
| 329 |
<tr> |
<tr> |
| 333 |
<td> |
<td> |
| 334 |
<span id="err_msg_announcement" name="err_msg" style="color: red;"></span> |
<span id="err_msg_announcement" name="err_msg" style="color: red;"></span> |
| 335 |
<textarea id="textarea_announcement" name="textarea" cols="80" rows="5"><? echo htmlspecialchars($result_set["data"]["announcement"], ENT_HTML401, 'UTF-8'); ?></textarea> |
<textarea id="textarea_announcement" name="textarea" cols="80" rows="5"><? echo htmlspecialchars($result_set["data"]["announcement"], ENT_HTML401, 'UTF-8'); ?></textarea> |
| 336 |
限3行以内,每行不超过150字符 |
<br />限3行以内,每行不超过150字符 |
| 337 |
|
</td> |
| 338 |
|
</tr> |
| 339 |
|
<tr> |
| 340 |
|
<td width="25%" align="right"> |
| 341 |
|
版块属性 |
| 342 |
|
</td> |
| 343 |
|
<td width="75%"> |
| 344 |
|
<span id="err_msg_flag" name="err_msg" style="color: red;"></span> |
| 345 |
|
<input type="checkbox" id="exp_get" name="exp_get" <? echo ($result_set["data"]["exp_get"] ? "checked" : ""); ?> |
| 346 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?>>经验 |
| 347 |
|
<input type="checkbox" id="recommend" name="recommend" <? echo ($result_set["data"]["recommend"] ? "checked" : ""); ?> |
| 348 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?>>推荐 |
| 349 |
|
<select id="read_user_level" name="read_user_level" size="1" |
| 350 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?>> |
| 351 |
|
<? |
| 352 |
|
foreach (user_priv::$user_level_list as $level) |
| 353 |
|
{ |
| 354 |
|
?> |
| 355 |
|
<option value="<? echo $level; ?>"><? echo user_priv::s_levelname($level); ?></option> |
| 356 |
|
<? |
| 357 |
|
} |
| 358 |
|
?> |
| 359 |
|
</select>可读 |
| 360 |
|
<select id="write_user_level" name="write_user_level" size="1" |
| 361 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?>> |
| 362 |
|
<? |
| 363 |
|
foreach (user_priv::$user_level_list as $level) |
| 364 |
|
{ |
| 365 |
|
if ($level < P_USER) // Guests are not allowed to write |
| 366 |
|
{ |
| 367 |
|
continue; |
| 368 |
|
} |
| 369 |
|
?> |
| 370 |
|
<option value="<? echo $level; ?>"><? echo user_priv::s_levelname($level); ?></option> |
| 371 |
|
<? |
| 372 |
|
} |
| 373 |
|
?> |
| 374 |
|
</select>可写 |
| 375 |
|
位于 |
| 376 |
|
<select id="sort_order" name="sort_order" size="1" |
| 377 |
|
<? echo ($_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ? "" : "disabled"); ?>> |
| 378 |
|
<? |
| 379 |
|
$class_sections = $result_set["data"]["class_sections"]; |
| 380 |
|
for ($i = 0; $i < count($class_sections); $i++) |
| 381 |
|
{ |
| 382 |
|
?> |
| 383 |
|
<option value="<? echo ($i + 1); ?>"> |
| 384 |
|
<? echo $class_sections[$i]["title"]; ?> |
| 385 |
|
<? echo ($i + 1 < $result_set["data"]["sort_order"] ? "之前" : ($i + 1 > $result_set["data"]["sort_order"] ? "之后" : "")); ?> |
| 386 |
|
|
| 387 |
|
</option> |
| 388 |
|
<? |
| 389 |
|
} |
| 390 |
|
?> |
| 391 |
|
</select><br /> |
| 392 |
|
</td> |
| 393 |
|
</tr> |
| 394 |
|
<? |
| 395 |
|
if ($_SESSION["BBS_priv"]->checkpriv($sid, S_MAN_M)) |
| 396 |
|
{ |
| 397 |
|
?> |
| 398 |
|
<tr> |
| 399 |
|
<td align="right"> |
| 400 |
|
版主任命 |
| 401 |
|
</td> |
| 402 |
|
<td> |
| 403 |
|
<p><span id="err_msg_master" name="err_msg" style="color: red;"></span></p> |
| 404 |
|
<? |
| 405 |
|
$has_major = false; |
| 406 |
|
foreach ($result_set["data"]["masters"] as $m_index => $section_master) |
| 407 |
|
{ |
| 408 |
|
if (!$has_major && $section_master["major"]) |
| 409 |
|
{ |
| 410 |
|
$has_major = true; |
| 411 |
|
} |
| 412 |
|
?> |
| 413 |
|
<p> |
| 414 |
|
<? echo ($section_master["major"] ? "正版主" : "副版主"); ?> |
| 415 |
|
<a class="s3" href="show_profile.php?uid=<? echo $section_master['uid']; ?>" target=_blank><? echo $section_master["username"]; ?></a> |
| 416 |
|
<? echo (new DateTimeImmutable($section_master["begin_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("y年m月d日"); ?>--<? echo (new DateTimeImmutable($section_master["end_dt"]))->setTimezone($_SESSION["BBS_user_tz"])->format("y年m月d日"); ?> |
| 417 |
|
<? |
| 418 |
|
if ($_SESSION["BBS_priv"]->checkpriv($sid, S_ADMIN) || $section_master["major"] == 0) |
| 419 |
|
{ |
| 420 |
|
?> |
| 421 |
|
<a class="s2" href="#" onclick="return master_op(section_setting, 2, '<? echo $section_master["username"]; ?>');">撤销</a> |
| 422 |
|
<a class="s2" href="#" onclick="return master_op(section_setting, 3, '<? echo $section_master["username"]; ?>');">延期</a> |
| 423 |
|
<? |
| 424 |
|
} |
| 425 |
|
?> |
| 426 |
|
</p> |
| 427 |
|
<? |
| 428 |
|
} |
| 429 |
|
?> |
| 430 |
|
<p> |
| 431 |
|
用户名: |
| 432 |
|
<input type="text" id="master_username" name="master_username" size="20"> |
| 433 |
|
<input type="radio" id="master_major" name="master_type" value="1" <? echo ($has_major ? "disabled" : "checked"); ?>>正版主 |
| 434 |
|
<input type="radio" id="master_minor" name="master_type" value="0" <? echo ($has_major ? "checked" : ""); ?>>副版主 |
| 435 |
|
<input type="submit" name="master_appoint" value="任命"> |
| 436 |
|
<span id="err_msg_username" name="err_msg" style="color: red;"></span> |
| 437 |
|
</p> |
| 438 |
</td> |
</td> |
| 439 |
</tr> |
</tr> |
| 440 |
|
<? |
| 441 |
|
} |
| 442 |
|
?> |
| 443 |
<tr> |
<tr> |
| 444 |
<td align="right"> |
<td align="right"> |
| 445 |
精华更新 |
精华更新 |
| 454 |
目录管理 |
目录管理 |
| 455 |
</td> |
</td> |
| 456 |
<td> |
<td> |
| 457 |
<span id="err_msg_current_dir" name="err_msg" style="color: red;"></span> |
<p><span id="err_msg_current_dir" name="err_msg" style="color: red;"></span></p> |
| 458 |
<p>位置:<select id="current_dir" name="current_dir" size="1"> |
<p>位置:<select id="current_dir" name="current_dir" size="1"> |
| 459 |
</select></p> |
</select></p> |
| 460 |
<p><span id="err_msg_dir" name="err_msg" style="color: red;"></span> |
<p><span id="err_msg_dir" name="err_msg" style="color: red;"></span> |