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 renamed topic actions in log actions #227

Merged
merged 1 commit 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 admin/admin_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
case $log_type['mod_topic_unlock']:
case $log_type['mod_topic_set_downloaded']:
case $log_type['mod_topic_unset_downloaded']:
case $log_type['mod_topic_renamed']:
case $log_type['mod_post_delete']:
case $log_type['mod_post_pin']:
case $log_type['mod_post_unpin']:
Expand Down
11 changes: 10 additions & 1 deletion library/ajax/mod_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if (!defined('IN_AJAX')) die(basename(__FILE__));

global $userdata, $bb_cfg, $lang, $datastore;
global $userdata, $bb_cfg, $lang, $datastore, $log_action;

$mode = (string) $this->request['mode'];

Expand Down Expand Up @@ -32,6 +32,7 @@
$topic_id = (int) $this->request['topic_id'];
$topic_title = (string) $this->request['topic_title'];
$new_title = clean_title($topic_title);
$old_title = get_topic_title($topic_id);

if (!$topic_id) $this->ajax_die($lang['INVALID_TOPIC_ID']);
if ($new_title == '') $this->ajax_die($lang['DONT_MESSAGE_TITLE']);
Expand Down Expand Up @@ -61,6 +62,14 @@
$datastore->update('network_news');
}

// Log action
$log_action->mod('mod_topic_renamed', array(
'forum_id' => $t_data['forum_id'],
'topic_id' => $topic_id,
'topic_title' => $old_title,
'topic_title_new' => $new_title,
));

$this->response['topic_id'] = $topic_id;
$this->response['topic_title'] = $new_title;
break;
Expand Down
1 change: 1 addition & 0 deletions library/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,7 @@ class log_action
'mod_post_unpin' => 11,
'mod_topic_set_downloaded' => 12,
'mod_topic_unset_downloaded' => 13,
'mod_topic_renamed' => 14,
);
var $log_type_select = array();
var $log_disabled = false;
Expand Down
1 change: 1 addition & 0 deletions library/language/en/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,7 @@
'mod_topic_split' => 'Topic:<br /> <b>split</b>',
'mod_topic_set_downloaded' => 'Topic:<br /> <b>set downloaded</b>',
'mod_topic_unset_downloaded' => 'Topic:<br /> <b>unset downloaded</b>',
'mod_topic_renamed' => 'Topic:<br /> <b>renamed</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>',
Expand Down
1 change: 1 addition & 0 deletions library/language/ru/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,7 @@
'mod_topic_split' => 'Топик:<br /> <b>разделен</b>',
'mod_topic_set_downloaded' => 'Топик:<br /> <b>скачивание разрешено</b>',
'mod_topic_unset_downloaded' => 'Топик:<br /> <b>скачивание запрещено</b>',
'mod_topic_renamed' => 'Топик:<br /> <b>переименован</b>',
'mod_post_delete' => 'Пост:<br /> <b>удален</b>',
'mod_post_pin' => 'Пост:<br /> <b>закреплен</b>',
'mod_post_unpin' => 'Пост:<br /> <b>откреплен</b>',
Expand Down
1 change: 1 addition & 0 deletions library/language/uk/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,7 @@
'mod_topic_split' => 'Топік:<br /> <b>розділений</b>',
'mod_topic_set_downloaded' => 'Топік:<br /> <b>скачування дозволено</b>',
'mod_topic_unset_downloaded' => 'Топік:<br /> <b>скачування заборонено</b>',
'mod_topic_renamed' => 'Топік:<br /> <b>перейменовано</b>',
'mod_post_delete' => 'Пост:<br /> <b>видалений</b>',
'mod_post_pin' => 'Пост:<br /> <b>закріплений</b>',
'mod_post_unpin' => 'Пост:<br /> <b>відкріплений</b>',
Expand Down