代码拉取完成,页面将自动刷新
<?php
require "include/bittorrent.php";
dbconn();
loggedinorreturn();
checkserver();
if (get_user_class() < $staffmem_class) {
stderr("错误", "权限不足");
}
$username = $CURUSER['username'];
$noticeoff = $_POST['noticeoff'] == '' || $_POST['noticeoff'] == 'yes' ? "yes" : "no";
$notice = $_POST['notice'];
if ($notice == '') {
stderr("错误", "内容不可为空!");
}
$data = date("Y-m-d H:i:s", TIMENOW);
$count = mysql_num_rows(sql_query("SELECT id FROM notice ORDER BY id DESC LIMIT 1"));
if ($count == 0) {
sql_query("INSERT notice (noticeoff, notice, bydata, byuser) VALUES ('$noticeoff', '$notice', '$data', '$username')");
} else {
sql_query("UPDATE notice SET noticeoff = '$noticeoff', notice = '$notice', bydata = '$data', byuser = '$username' ORDER BY id DESC LIMIT 1");
}
write_log("管理员 $username 修改了小公告");
header("Location: " . get_protocol_prefix() . "$BASEURL/notice.php");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。