mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-22 12:21:52 +00:00
feat(blog): send system message after comment was hidden
This commit is contained in:
parent
e626faf2ab
commit
986a5e20bc
@ -179,6 +179,8 @@ if (UOJUserBlog::userHasManagePermission(Auth::user())) {
|
||||
'validator_php' => 'validateString',
|
||||
]);
|
||||
$hide_form->handle = function (&$vdata) {
|
||||
$comment = $vdata['comment_hide_id'];
|
||||
|
||||
if ($_POST['comment_hide_type'] == 'unhide') {
|
||||
$reason = '';
|
||||
} else if ($_POST['comment_hide_type'] == 'other') {
|
||||
@ -187,7 +189,16 @@ if (UOJUserBlog::userHasManagePermission(Auth::user())) {
|
||||
$reason = '该评论由于' . UOJBlogComment::HIDE_REASONS[$_POST['comment_hide_type']] . ',已被管理员隐藏';
|
||||
}
|
||||
|
||||
$vdata['comment_hide_id']->hide($reason);
|
||||
$comment->hide($reason);
|
||||
|
||||
if ($_POST['comment_hide_type'] != 'unhide') {
|
||||
sendSystemMsg(
|
||||
$comment->info['poster'],
|
||||
'评论隐藏通知',
|
||||
"<p>" . UOJUser::getLink($comment->info['poster']) . " 您好:</p>" .
|
||||
"<p>您为博客 " . UOJBlog::cur()->getLink() . " 回复的评论 “" . substr($comment->info['content'], 0, 30) . "……” 已被管理员隐藏,隐藏原因为 “{$reason}”。</p>"
|
||||
);
|
||||
}
|
||||
};
|
||||
$hide_form->runAtServer();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user