aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_main.php2
-rw-r--r--phpBB/includes/mcp/mcp_post.php11
-rw-r--r--phpBB/includes/mcp/mcp_queue.php32
3 files changed, 18 insertions, 27 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 0143957223..a7e71d6e97 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -964,7 +964,7 @@ class mcp_main_info
'version' => '1.0.0',
'modes' => array(
'forum_view' => array('title' => 'MCP_MAIN_FORUM_VIEW', 'auth' => 'acl_m_,$id'),
- 'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => ''),
+ 'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => 'acl_m_'),
'post_details' => array('title' => 'MCP_MAIN_POST_DETAILS', 'auth' => 'acl_m_,$id'),
'topic_view' => array('title' => 'MCP_MAIN_TOPIC_VIEW', 'auth' => 'acl_m_,$id'),
),
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 05758b9bf2..5dfb5947f9 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -165,10 +165,17 @@ function mcp_post_details($id, $mode, $action)
do
{
+ // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
+ if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ {
+ $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
+ $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
+ }
+
$template->assign_block_vars('reports', array(
'REPORT_ID' => $row['report_id'],
- 'REASON_TITLE' => $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_name'])],
- 'REASON_DESC' => $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_name'])],
+ 'REASON_TITLE' => $row['reason_title'],
+ 'REASON_DESC' => $row['reason_description'],
'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'],
'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}" : '',
'USER_NOTIFY' => ($row['user_notify']) ? true : false,
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 7884298380..e447184b55 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -542,23 +542,25 @@ function disapprove_post($post_id_list, $mode)
if ($reason_id)
{
- $sql = 'SELECT reason_name
+ $sql = 'SELECT reason_title, reason_description
FROM ' . REASONS_TABLE . "
WHERE reason_id = $reason_id";
$result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!($row = $db->sql_fetchrow($result)) || (!$reason && $row['reason_name'] == 'other'))
+ if (!$row || (!$reason && $row['reason_title'] == 'other'))
{
$additional_msg = 'Please give an appropiate reason for disapproval';
unset($_POST['confirm']);
}
else
{
- $disapprove_reason = ($row['reason_name'] != 'other') ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_name'])] : '';
+ // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
+ $disapprove_reason = ($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" . $_REQUEST['reason'] : '';
unset($reason);
}
- $db->sql_freeresult($result);
}
if (confirm_box(true))
@@ -683,27 +685,9 @@ function disapprove_post($post_id_list, $mode)
}
else
{
- $sql = 'SELECT *
- FROM ' . REASONS_TABLE . '
- ORDER BY reason_priority ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $row['reason_name'] = strtoupper($row['reason_name']);
+ include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- $reason_title = (!empty($user->lang['report_reasons']['TITLE'][$row['reason_name']])) ? $user->lang['report_reasons']['TITLE'][$row['reason_name']] : ucwords(str_replace('_', ' ', $row['reason_name']));
-
- $reason_desc = (!empty($user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']])) ? $user->lang['report_reasons']['DESCRIPTION'][$row['reason_name']] : $row['reason_desc'];
-
- $template->assign_block_vars('reason', array(
- 'ID' => $row['reason_id'],
- 'NAME' => htmlspecialchars($reason_title),
- 'DESCRIPTION' => htmlspecialchars($reason_desc),
- 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false)
- );
- }
- $db->sql_freeresult($result);
+ display_reasons($reason_id);
$template->assign_vars(array(
'S_NOTIFY_POSTER' => true,