Permalink
Browse files

Added some topic moderation tools.

  • Loading branch information...
flashwave committed Jan 11, 2019
1 parent 44e8daf commit 125c2a708a866d8e1a0a4f02f7f9ef0db7c88e78
@@ -47,4 +47,20 @@
font-size: .9em;
}
}

&__actions {
display: flex;
}

&__action {
margin-right: 10px;
color: inherit;
text-decoration: none;
transition: color .2s;

&:hover,
&:focus {
color: var(--accent-colour);
}
}
}
@@ -50,7 +50,7 @@
$forumUserId,
$topicsOffset,
$forumPagination['range'],
perms_check($perms, MSZ_FORUM_PERM_DELETE_TOPIC | MSZ_FORUM_PERM_DELETE_ANY_POST)
perms_check($perms, MSZ_FORUM_PERM_DELETE_ANY_POST)
)
: [];
@@ -23,7 +23,7 @@
$categories[$key]['forum_subforums'] = forum_get_children(
$category['forum_id'],
user_session_current('user_id', 0),
perms_check($category['forum_permissions'], MSZ_FORUM_PERM_DELETE_TOPIC | MSZ_FORUM_PERM_DELETE_ANY_POST)
perms_check($category['forum_permissions'], MSZ_FORUM_PERM_DELETE_ANY_POST)
);
foreach ($categories[$key]['forum_subforums'] as $skey => $sub) {
@@ -35,7 +35,7 @@
= forum_get_children(
$sub['forum_id'],
user_session_current('user_id', 0),
perms_check($sub['forum_permissions'], MSZ_FORUM_PERM_DELETE_TOPIC | MSZ_FORUM_PERM_DELETE_ANY_POST),
perms_check($sub['forum_permissions'], MSZ_FORUM_PERM_DELETE_ANY_POST),
true
);
}
@@ -81,7 +81,7 @@
break;
case MSZ_E_FORUM_POST_DELETE_OLD:
$responseCode = 401;
$canDeleteMsg = 'This post has existed for too long, ask a moderator to remove if it absolutely necessary.';
$canDeleteMsg = 'This post has existed for too long. Ask a moderator to remove if it absolutely necessary.';
break;
case MSZ_E_FORUM_POST_DELETE_PERM:
$responseCode = 401;
@@ -122,9 +122,11 @@
echo tpl_render('forum.confirm', [
'title' => 'Confirm post deletion',
'class' => 'far fa-trash-alt',
'mode' => 'delete',
'message' => sprintf('You are about to delete post #%d. Are you sure about that?', $postInfo['post_id']),
'post' => $postInfo,
'params' => [
'p' => $postInfo['post_id'],
'm' => 'delete',
],
]);
break;
}
@@ -163,9 +165,11 @@
echo tpl_render('forum.confirm', [
'title' => 'Confirm post nuke',
'class' => 'fas fa-radiation',
'mode' => 'nuke',
'message' => sprintf('You are about to PERMANENTLY DELETE post #%d. Are you sure about that?', $postInfo['post_id']),
'post' => $postInfo,
'params' => [
'p' => $postInfo['post_id'],
'm' => 'nuke',
],
]);
break;
}
@@ -199,9 +203,11 @@
echo tpl_render('forum.confirm', [
'title' => 'Confirm post restore',
'class' => 'fas fa-magic',
'mode' => 'restore',
'message' => sprintf('You are about to restore post #%d. Are you sure about that?', $postInfo['post_id']),
'post' => $postInfo,
'params' => [
'p' => $postInfo['post_id'],
'm' => 'restore',
],
]);
break;
}
@@ -46,7 +46,7 @@
}
if (!empty($topicId)) {
$topic = forum_topic_fetch($topicId);
$topic = forum_topic_get($topicId);
if (isset($topic['forum_id'])) {
$forumId = (int)$topic['forum_id'];
Oops, something went wrong.

0 comments on commit 125c2a7

Please sign in to comment.