mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
[ticket/9135] Fix report-icon for moderators in PM folders.
There was a S_TOPIC_REPORTED switch in the template of prosilver, which should indicate whether the PM is reported. But the variable was neither filled, nor named correctly. Now it is filled with a boolean and a link to the report is displayed for permitted users. PHPBB3-9135
This commit is contained in:
parent
6d7e30ae99
commit
9e24993855
4 changed files with 30 additions and 2 deletions
|
@ -170,10 +170,12 @@ function view_folder($id, $mode, $folder_id, $folder)
|
|||
'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
|
||||
'S_PM_DELETED' => ($row['pm_deleted']) ? true : false,
|
||||
'S_PM_REPORTED' => (isset($row['report_id'])) ? true : false,
|
||||
'S_AUTHOR_DELETED' => ($row['author_id'] == ANONYMOUS) ? true : false,
|
||||
|
||||
'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url,
|
||||
'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '',
|
||||
'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $row['report_id']) : '',
|
||||
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '')
|
||||
);
|
||||
}
|
||||
|
@ -183,6 +185,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
|||
'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false,
|
||||
'S_SHOW_COLOUR_LEGEND' => true,
|
||||
|
||||
'REPORTED_IMG' => $user->img('icon_topic_reported', 'PM_REPORTED'),
|
||||
'S_PM_ICONS' => ($config['enable_pm_icons']) ? true : false)
|
||||
);
|
||||
}
|
||||
|
@ -502,7 +505,7 @@ function get_pm_from($folder_id, $folder, $user_id)
|
|||
$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
|
||||
}
|
||||
|
||||
$sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour
|
||||
$sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported
|
||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||
WHERE t.user_id = $user_id
|
||||
AND p.author_id = u.user_id
|
||||
|
@ -512,13 +515,34 @@ function get_pm_from($folder_id, $folder, $user_id)
|
|||
ORDER BY $sql_sort_order";
|
||||
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||
|
||||
$pm_reported = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$rowset[$row['msg_id']] = $row;
|
||||
$pm_list[] = $row['msg_id'];
|
||||
if ($row['message_reported'])
|
||||
{
|
||||
$pm_reported[] = $row['msg_id'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Fetch the report_ids, if there are any reported pms.
|
||||
if (!empty($pm_reported) && $auth->acl_getf_global('m_report'))
|
||||
{
|
||||
$sql = 'SELECT pm_id, report_id
|
||||
FROM ' . REPORTS_TABLE . '
|
||||
WHERE report_closed = 0
|
||||
AND ' . $db->sql_in_set('pm_id', $pm_reported);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$rowset[$row['pm_id']]['report_id'] = $row['report_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$pm_list = ($store_reverse) ? array_reverse($pm_list) : $pm_list;
|
||||
|
||||
return array(
|
||||
|
|
|
@ -420,6 +420,7 @@ $lang = array_merge($lang, array(
|
|||
'PIXEL' => 'px',
|
||||
'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
|
||||
'PM' => 'PM',
|
||||
'PM_REPORTED' => 'Click to view report',
|
||||
'POSTING_MESSAGE' => 'Posting message in %s',
|
||||
'POSTING_PRIVATE_MESSAGE' => 'Composing private message',
|
||||
'POST' => 'Post',
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<br /><em class="small">{L_PM_FROM_REMOVED_AUTHOR}</em>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF messagerow.S_TOPIC_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br />
|
||||
<!-- IF messagerow.S_PM_REPORTED --><a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --> {messagerow.ATTACH_ICON_IMG}<br />
|
||||
<!-- IF S_SHOW_RECIPIENTS -->{L_MESSAGE_TO} {messagerow.RECIPIENTS}<!-- ELSE -->{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME}<!-- ENDIF -->
|
||||
</dt>
|
||||
<!-- IF S_SHOW_RECIPIENTS --><dd class="info"><span>{L_SENT_AT}: {messagerow.SENT_TIME}</span></dd><!-- ENDIF -->
|
||||
|
|
|
@ -81,6 +81,9 @@
|
|||
<!-- ELSE -->
|
||||
<a href="{messagerow.U_VIEW_PM}">{messagerow.SUBJECT}</a>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF messagerow.S_PM_REPORTED -->
|
||||
<a href="{messagerow.U_MCP_REPORT}">{REPORTED_IMG}</a>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF messagerow.S_AUTHOR_DELETED -->
|
||||
<br /><em class="gensmall">{L_PM_FROM_REMOVED_AUTHOR}</em>
|
||||
<!-- ENDIF -->
|
||||
|
|
Loading…
Add table
Reference in a new issue