From b322cb4c11d2771e430f7288825578d25f7d463f Mon Sep 17 00:00:00 2001 From: Marcos Bjorkelund Date: Thu, 13 Mar 2014 23:54:06 +0100 Subject: [PATCH 1/2] [ticket/12247] Add ['username'] to mcp_queue.php's user_notification() It includes the poster's username in the email notifications of posts that get approved by moderators. This is done by adding the username to every user_notification() function located in /phpBB/includes/mcp/mcp_queue.php. PHPBB3-12247 --- phpBB/includes/mcp/mcp_queue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 764461fa53..ad6282f637 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -663,12 +663,12 @@ function approve_post($post_id_list, $id, $mode) if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) { // Forum Notifications - user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id); + user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $post_data['username']); } else { // Topic Notifications - user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id); + user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $post_data['username']); } } From 4333401a279ec3eeee67276f3ea4562674e6a57d Mon Sep 17 00:00:00 2001 From: Marcos Bjorkelund Date: Fri, 14 Mar 2014 00:28:24 +0100 Subject: [PATCH 2/2] [ticket/12247] Makes static usernames work Relative to the last ticket, this allows static usernames to work correctly (those inserted in the post-column post_username) when sending the e-mail, instead of showing just "Anonymous". PHPBB3-12247 --- phpBB/includes/mcp/mcp_queue.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index ad6282f637..acf344fd3c 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -660,15 +660,17 @@ function approve_post($post_id_list, $id, $mode) foreach ($post_info as $post_id => $post_data) { + $username = ($post_data['post_username']) ? $post_data['post_username'] : $post_data['username']; + if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) { // Forum Notifications - user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $post_data['username']); + user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username); } else { // Topic Notifications - user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $post_data['username']); + user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id, $username); } }