mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- allow reporting posts that have a closed report
- show multiple reports for one post correctly - Bug #1389 git-svn-id: file:///svn/phpbb/trunk@5771 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
fc167b2e42
commit
c5b203b485
4 changed files with 11 additions and 20 deletions
|
@ -222,11 +222,11 @@ class mcp_reports
|
||||||
|
|
||||||
if ($mode == 'reports')
|
if ($mode == 'reports')
|
||||||
{
|
{
|
||||||
$report_state = 'AND p.post_reported = 1';
|
$report_state = 'AND p.post_reported = 1 AND r.report_closed = 0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$report_state = 'AND p.post_reported = 0 AND r.report_closed = 1';
|
$report_state = 'AND r.report_closed = 1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT p.post_id
|
$sql = 'SELECT p.post_id
|
||||||
|
|
|
@ -249,7 +249,6 @@ $lang = array_merge($lang, array(
|
||||||
'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.',
|
'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.',
|
||||||
'REPORTS_TOTAL' => 'In total there are <b>%d</b> reports to review',
|
'REPORTS_TOTAL' => 'In total there are <b>%d</b> reports to review',
|
||||||
'REPORTS_ZERO_TOTAL' => 'There are no reports to review',
|
'REPORTS_ZERO_TOTAL' => 'There are no reports to review',
|
||||||
'REPORT_ALREADY_DEALT_WITH' => 'This post has already been reported previously and successfully dealt with',
|
|
||||||
'REPORT_CLOSED' => 'This report has previously been closed.',
|
'REPORT_CLOSED' => 'This report has previously been closed.',
|
||||||
'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.',
|
'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.',
|
||||||
'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.',
|
'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.',
|
||||||
|
|
|
@ -401,11 +401,11 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
|
||||||
|
|
||||||
if ($mode == 'reports')
|
if ($mode == 'reports')
|
||||||
{
|
{
|
||||||
$where_sql .= 'AND r.report_closed = 0';
|
$where_sql .= ' AND r.report_closed = 0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$where_sql .= 'AND r.report_closed = 1';
|
$where_sql .= ' AND r.report_closed = 1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(r.report_id) AS total
|
$sql = 'SELECT COUNT(r.report_id) AS total
|
||||||
|
|
|
@ -69,17 +69,9 @@ foreach ($acl_check_ary as $acl => $error)
|
||||||
}
|
}
|
||||||
unset($acl_check_ary);
|
unset($acl_check_ary);
|
||||||
|
|
||||||
// Check if the post has already been reported...
|
if ($report_data['post_reported'])
|
||||||
$sql = 'SELECT report_id, report_closed
|
|
||||||
FROM ' . REPORTS_TABLE . "
|
|
||||||
WHERE post_id = $post_id";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($row)
|
|
||||||
{
|
{
|
||||||
$message = ($row['report_closed']) ? $user->lang['REPORT_ALREADY_DEALT_WITH'] : $user->lang['ALREADY_REPORTED'];
|
$message = $user->lang['ALREADY_REPORTED'];
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . $redirect_url . '">', '</a>');
|
$message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . $redirect_url . '">', '</a>');
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +80,7 @@ if ($row)
|
||||||
if (isset($_POST['submit']) && $reason_id)
|
if (isset($_POST['submit']) && $reason_id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . REASONS_TABLE . "
|
FROM ' . REASONS_TABLE . "
|
||||||
WHERE reason_id = $reason_id";
|
WHERE reason_id = $reason_id";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
|
@ -115,16 +107,16 @@ if (isset($_POST['submit']) && $reason_id)
|
||||||
|
|
||||||
if (!$report_data['post_reported'])
|
if (!$report_data['post_reported'])
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||||
SET post_reported = 1
|
SET post_reported = 1
|
||||||
WHERE post_id = ' . $post_id;
|
WHERE post_id = ' . $post_id;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$report_data['topic_reported'])
|
if (!$report_data['topic_reported'])
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||||
SET topic_reported = 1
|
SET topic_reported = 1
|
||||||
WHERE topic_id = ' . $report_data['topic_id'];
|
WHERE topic_id = ' . $report_data['topic_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue