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

* Show pin & unpin actions in log actions

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-08-21 23:20:24 +07:00 committed by GitHub
parent 0f092de85e
commit b5efd5401c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 5 deletions

View File

@ -6,6 +6,7 @@
**Merged pull requests:**
- Release v2.1.5-2023.08 🎉
- Show pin & unpin actions in log actions [\#225](https://github.com/torrentpier/torrentpier-lts/pull/225) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#215](https://github.com/torrentpier/torrentpier-lts/pull/215), [\#216](https://github.com/torrentpier/torrentpier-lts/pull/216), [\#217](https://github.com/torrentpier/torrentpier-lts/pull/217), [\#218](https://github.com/torrentpier/torrentpier-lts/pull/218), [\#221](https://github.com/torrentpier/torrentpier-lts/pull/221), [\#222](https://github.com/torrentpier/torrentpier-lts/pull/222), [\#224](https://github.com/torrentpier/torrentpier-lts/pull/224) ([belomaxorka](https://github.com/belomaxorka))
## [v2.1.5-2023.07](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.07) (2023-08-04)

View File

@ -265,6 +265,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']))
@ -326,7 +328,7 @@ if ($log_rowset)
'TOPIC_HREF_NEW_S' => url_arg($url, $topic_key, $row['log_topic_id_new']),
'TOPIC_TITLE_NEW' => $topic_title_new,
'DATE' => bb_date($row['log_time'], 'd-M-y'),
'DATE' => bb_date($row['log_time'], 'd-M-y', false),
'TIME' => bb_date($row['log_time'], 'H:i'),
'DATETIME_HREF_S' => $datetime_href_s,
'MSG' => $msg,

View File

@ -2122,10 +2122,12 @@ class log_action
'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,
);
var $log_type_select = array();
var $log_disabled = false;

View File

@ -2543,6 +2543,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

@ -2543,6 +2543,8 @@ $lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_unlock' => 'Топик:<br /> <b>открыт</b>',
'mod_topic_split' => 'Топик:<br /> <b>разделен</b>',
'mod_post_delete' => 'Пост:<br /> <b>удален</b>',
'mod_post_pin' => 'Пост:<br /> <b>закреплен</b>',
'mod_post_unpin' => 'Пост:<br /> <b>откреплен</b>',
'adm_user_delete' => 'Юзер:<br /> <b>удален</b>',
'adm_user_ban' => 'Юзер:<br /> <b>забанен</b>',
'adm_user_unban' => 'Юзер:<br /> <b>разбанен</b>'

View File

@ -2543,6 +2543,8 @@ $lang['LOG_ACTION']['LOG_TYPE'] = array(
'mod_topic_unlock' => 'Топік:<br /> <b>відкритий</b>',
'mod_topic_split' => 'Топік:<br /> <b>розділений</b>',
'mod_post_delete' => 'Пост:<br /> <b>видалений</b>',
'mod_post_pin' => 'Пост:<br /> <b>закріплений</b>',
'mod_post_unpin' => 'Пост:<br /> <b>відкріплений</b>',
'adm_user_delete' => 'Юзер:<br /> <b>видалений</b>',
'adm_user_ban' => 'Юзер:<br /> <b>забанен</b>',
'adm_user_unban' => 'Юзер:<br /> <b>разбанен</b>'

View File

@ -806,6 +806,18 @@ 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));
}
@ -840,6 +852,18 @@ 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));
}