From 1c336c355965fbe47717744e0d5fb04125d12247 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Sat, 26 Apr 2014 12:47:24 +0200 Subject: [PATCH] [ticket/11942] Adding the reason to hard deleted topic/post PHPBB3-11942 --- phpBB/includes/mcp/mcp_main.php | 4 ++-- phpBB/language/en/acp/common.php | 8 ++++---- phpBB/posting.php | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 0343c2f631..075e49453f 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -789,7 +789,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '' } else { - add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); + add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason); } } } @@ -987,7 +987,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', foreach ($post_data as $id => $row) { $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; - add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username); + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason); } // Now delete the posts, topics and forums are automatically resync'ed diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 66dc09b071..3dec17b05d 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -539,9 +539,9 @@ $lang = array_merge($lang, array( 'LOG_APPROVE_TOPIC' => 'Approved topic
» %s', 'LOG_BUMP_TOPIC' => 'User bumped topic
» %s', - 'LOG_DELETE_POST' => 'Deleted post “%1$s” written by
» %2$s', + 'LOG_DELETE_POST' => 'Deleted post “%1$s” written by “%2$s” with the following reason
» %3$s', 'LOG_DELETE_SHADOW_TOPIC' => 'Deleted shadow topic
» %s', - 'LOG_DELETE_TOPIC' => 'Deleted topic “%1$s” written by
» %2$s', + 'LOG_DELETE_TOPIC' => 'Deleted topic “%1$s” written by “%2$s” with the following reason
» %3$s', 'LOG_FORK' => 'Copied topic
» from %s', 'LOG_LOCK' => 'Locked topic
» %s', 'LOG_LOCK_POST' => 'Locked post
» %s', @@ -556,8 +556,8 @@ $lang = array_merge($lang, array( 'LOG_REPORT_CLOSED' => 'Closed report
» %s', 'LOG_REPORT_DELETED' => 'Deleted report
» %s', 'LOG_RESTORE_TOPIC' => 'Restored topic “%1$s” written by
» %2$s', - 'LOG_SOFTDELETE_POST' => 'Soft deleted post “%1$s” written by “%2$s”
» %3$s', - 'LOG_SOFTDELETE_TOPIC' => 'Soft deleted topic “%1$s” written by “%2$s”
» %3$s', + 'LOG_SOFTDELETE_POST' => 'Soft deleted post “%1$s” written by “%2$s” with the following reason
» %3$s', + 'LOG_SOFTDELETE_TOPIC' => 'Soft deleted topic “%1$s” written by “%2$s” with the following reason
» %3$s', 'LOG_SPLIT_DESTINATION' => 'Moved split posts
» to %s', 'LOG_SPLIT_SOURCE' => 'Split posts
» from %s', diff --git a/phpBB/posting.php b/phpBB/posting.php index cfd6524e62..46ccf40e5c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1709,14 +1709,14 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof if ($next_post_id === false) { - add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username); + add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $soft_delete_reason); $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"); $message = $user->lang['POST_DELETED']; } else { - add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username); + add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $soft_delete_reason); $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; $message = $user->lang['POST_DELETED'];