Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show pin & unpin actions in log actions #225

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion admin/admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@
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']))
Expand Down Expand Up @@ -326,7 +328,7 @@
'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,
Expand Down
10 changes: 6 additions & 4 deletions library/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions library/language/en/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,8 @@
'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>',
Expand Down
2 changes: 2 additions & 0 deletions library/language/ru/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,8 @@
'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>'
Expand Down
2 changes: 2 additions & 0 deletions library/language/uk/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,8 @@
'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>'
Expand Down
24 changes: 24 additions & 0 deletions modcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,18 @@ function validate_mode_condition($request_index, $mod_action='') {
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));
}
Expand Down Expand Up @@ -840,6 +852,18 @@ function validate_mode_condition($request_index, $mod_action='') {
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));
}
Expand Down