diff options
author | Chris Smith <toonarmy@phpbb.com> | 2008-09-08 13:39:34 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2008-09-08 13:39:34 +0000 |
commit | 0e0100c5255dd288cc479274a112e4eb42a4bacf (patch) | |
tree | 1013fd8ea222d4e4fbab3d360fc25be2d59218b0 /phpBB/includes/mcp/mcp_queue.php | |
parent | a32f3a67095327dc3e75c01ba21bbb90ad479c83 (diff) | |
download | forums-0e0100c5255dd288cc479274a112e4eb42a4bacf.tar forums-0e0100c5255dd288cc479274a112e4eb42a4bacf.tar.gz forums-0e0100c5255dd288cc479274a112e4eb42a4bacf.tar.bz2 forums-0e0100c5255dd288cc479274a112e4eb42a4bacf.tar.xz forums-0e0100c5255dd288cc479274a112e4eb42a4bacf.zip |
merge r8829, r8830, r8831, r8832, r8833, r8834, r8835, r8836, r8837, r8838
git-svn-id: file:///svn/phpbb/trunk@8839 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 4be1a9e554..d9c5dbb759 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -814,6 +814,13 @@ function disapprove_post($post_id_list, $id, $mode) // If the reason is defined within the language file, we will use the localized version, else just use the database entry... $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; $disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; + + if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) + { + $disapprove_reason_lang = strtoupper($row['reason_title']); + } + + $email_disapprove_reason = $disapprove_reason; } } @@ -933,6 +940,8 @@ function disapprove_post($post_id_list, $id, $mode) // Notify Poster? if ($notify_poster) { + $lang_reasons = array(); + foreach ($post_info as $post_id => $post_data) { if ($post_data['poster_id'] == ANONYMOUS) @@ -940,6 +949,35 @@ function disapprove_post($post_id_list, $id, $mode) continue; } + if (isset($disapprove_reason_lang)) + { + // Okay we need to get the reason from the posters language + if (!isset($lang_reasons[$post_data['user_lang']])) + { + // Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity. + $lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + + // Only load up the language pack if the language is different to the current one + if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx)) + { + // Load up the language pack + $lang = array(); + @include($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx); + + // If we find the reason in this language pack use it + if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang])) + { + $lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]; + } + + unset($lang); // Free memory + } + } + + $email_disapprove_reason = $lang_reasons[$post_data['user_lang']]; + $email_disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; + } + $email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_disapproved' : 'post_disapproved'; $messenger->template($email_template, $post_data['user_lang']); @@ -949,15 +987,17 @@ function disapprove_post($post_id_list, $id, $mode) $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($post_data['username']), - 'REASON' => htmlspecialchars_decode($disapprove_reason), + 'REASON' => htmlspecialchars_decode($email_disapprove_reason), 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title']))) ); $messenger->send($post_data['user_notify_type']); } + + unset($lang_reasons); } - unset($post_info, $disapprove_reason); + unset($post_info, $disapprove_reason, $email_disapprove_reason, $disapprove_reason_lang); $messenger->save_queue(); |