📄 action_add_message.php
字号:
<?php
include("include/god_def.inc");
include("system/articleTools.php");
$file_name = FILE_MESSAGE;
$doc = new GodDocument;
$content = html2text($_POST['content']);
if (strlen($content) > 7000)
{
echo "字数不能大于7000个,<a href='#' onclick='javascript:history.back();'>返回上一页</a>";
exit();
}
if (!(file_exists($file_name)))
{
$doc->createNewDataFile($file_name);
}
$name = html2text($_POST['name']);
$title = html2text($_POST['title']);
if (rtrim($name) == "")
{
$name = "无名仕";
}
if (rtrim($title) == "")
{
$title = "[无主题]";
}
if (rtrim($content) == "")
{
$content = "[无内容]";
}
$time = date("Y-m-d H:i:s",time());
$id = getMaxID($file_name) + 1;
$doc->load($file_name);
$doc->addArticle($id, $name, $time, $title, $content);
if ($doc->save($file_name))
{
echo ("<script>location.href='index.php?gid=".GOD_MESSAGE."'</script>");
}
echo "...message added error...<br>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -