mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 13:28:41 +00:00
feat(web/blog/delete): send blog_delete system msg
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0568633496
commit
dd730a4d6a
@ -898,7 +898,7 @@ UNLOCK TABLES;
|
||||
CREATE TABLE `user_system_msg` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`content` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`receiver` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||
`send_time` datetime NOT NULL,
|
||||
`read_time` datetime DEFAULT NULL,
|
||||
|
@ -20,7 +20,20 @@
|
||||
|
||||
$delete_form = new UOJForm('delete');
|
||||
$delete_form->handle = function() {
|
||||
global $blog;
|
||||
global $myUser, $blog;
|
||||
|
||||
if ($myUser['username'] != $blog['poster']) {
|
||||
$poster_user_link = getUserLink($blog['poster']);
|
||||
$admin_user_link = isSuperUser($myUser) ? '管理员' : getUserLink($myUser['username']);
|
||||
$blog_content = HTML::escape($blog['content_md']);
|
||||
$content = <<<EOD
|
||||
<p>{$poster_user_link} 您好:</p>
|
||||
<p>您的博客 <b>{$blog['title']}</b>(ID:{$blog['id']})已经被 {$admin_user_link} 删除,现将博客原文备份发送给您,请查收。</p>
|
||||
<pre><code class="language-markdown">{$blog_content}</code></pre>
|
||||
EOD;
|
||||
sendSystemMsg($blog['poster'], '博客删除通知', $content);
|
||||
}
|
||||
|
||||
deleteBlog($blog['id']);
|
||||
};
|
||||
$delete_form->submit_button_config['class_str'] = 'btn btn-danger';
|
||||
|
Loading…
Reference in New Issue
Block a user