Show pin & unpin actions in log actions (#857)

This commit is contained in:
Roman Kelesidis 2023-08-21 23:32:33 +07:00 committed by GitHub
commit da08532898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 4 deletions

View file

@ -224,6 +224,8 @@ if ($log_rowset) {
case $log_type['mod_topic_lock']:
case $log_type['mod_topic_unlock']:
case $log_type['mod_post_delete']:
case $log_type['mod_post_pin']:
case $log_type['mod_post_unpin']:
case $log_type['mod_topic_split']:
// topic_title
if (!empty($row['log_topic_title'])) {

View file

@ -2551,6 +2551,8 @@ $lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_unlock' => 'Topic:<br /> <b>opened</b>',
'mod_topic_split' => 'Topic:<br /> <b>split</b>',
'mod_post_delete' => 'Post:<br /> <b>deleted</b>',
'mod_post_pin' => 'Post:<br /> <b>pinned</b>',
'mod_post_unpin' => 'Post:<br /> <b>unpinned</b>',
'adm_user_delete' => 'User:<br /> <b>deleted</b>',
'adm_user_ban' => 'User:<br /> <b>ban</b>',
'adm_user_unban' => 'User:<br /> <b>unban</b>',

View file

@ -709,6 +709,17 @@ switch ($mode) {
WHERE topic_id IN($topic_csv)
");
// Log action
$type = ($pin) ? 'mod_post_pin' : 'mod_post_unpin';
foreach ($log_topics as $topic_id => $topic_title) {
$log_action->mod($type, array(
'forum_id' => $forum_id,
'topic_id' => $topic_id,
'topic_title' => $topic_title,
));
}
$msg = ($pin) ? $lang['POST_PINNED'] : $lang['POST_UNPINNED'];
bb_die(return_msg_mcp($msg));
} elseif ($topic_id) {
@ -739,6 +750,17 @@ switch ($mode) {
WHERE topic_id IN($topic_csv)
");
// Log action
$type = ($pin) ? 'mod_post_pin' : 'mod_post_unpin';
foreach ($log_topics as $topic_id => $topic_title) {
$log_action->mod($type, array(
'forum_id' => $forum_id,
'topic_id' => $topic_id,
'topic_title' => $topic_title,
));
}
$msg = ($pin) ? $lang['POST_PINNED'] : $lang['POST_UNPINNED'];
bb_die(return_msg_mcp($msg));
}

View file

@ -21,10 +21,12 @@ class LogAction
'mod_topic_lock' => 3,
'mod_topic_unlock' => 4,
'mod_post_delete' => 5,
'mod_topic_split' => 6,
'adm_user_delete' => 7,
'adm_user_ban' => 8,
'adm_user_unban' => 9,
'mod_post_pin' => 6,
'mod_post_unpin' => 7,
'mod_topic_split' => 8,
'adm_user_delete' => 9,
'adm_user_ban' => 10,
'adm_user_unban' => 11,
];
public $log_type_select = [];
public $log_disabled = false;