mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 11:44:08 +02:00
Users can report PMs to moderators which are then visible in a new MCP module
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9814 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -115,78 +115,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
// Build Recipient List if in outbox/sentbox - max two additional queries
|
||||
if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
|
||||
{
|
||||
$recipient_list = $address = array();
|
||||
|
||||
foreach ($folder_info['rowset'] as $message_id => $row)
|
||||
{
|
||||
$address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
|
||||
$_save = array('u', 'g');
|
||||
foreach ($_save as $save)
|
||||
{
|
||||
if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save]))
|
||||
{
|
||||
foreach (array_keys($address[$message_id][$save]) as $ug_id)
|
||||
{
|
||||
$recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_types = array('u', 'g');
|
||||
foreach ($_types as $ug_type)
|
||||
{
|
||||
if (!empty($recipient_list[$ug_type]))
|
||||
{
|
||||
if ($ug_type == 'u')
|
||||
{
|
||||
$sql = 'SELECT user_id as id, username as name, user_colour as colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE ';
|
||||
}
|
||||
$sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($ug_type == 'g')
|
||||
{
|
||||
$row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
|
||||
}
|
||||
|
||||
$recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($address as $message_id => $adr_ary)
|
||||
{
|
||||
foreach ($adr_ary as $type => $id_ary)
|
||||
{
|
||||
foreach ($id_ary as $ug_id => $_id)
|
||||
{
|
||||
if ($type == 'u')
|
||||
{
|
||||
$address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
|
||||
$link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>';
|
||||
$address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($recipient_list, $address);
|
||||
$address_list = get_recipient_strings($folder_info['rowset']);
|
||||
}
|
||||
|
||||
$data = array();
|
||||
|
@@ -190,6 +190,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['SEND_EMAIL']),
|
||||
'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']),
|
||||
'REPLY_IMG' => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']),
|
||||
'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_POST'),
|
||||
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']),
|
||||
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']),
|
||||
|
||||
@@ -210,6 +211,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
|
||||
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
'U_EMAIL' => $user_info['email'],
|
||||
'U_REPORT' => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '',
|
||||
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
'U_EDIT' => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
|
Reference in New Issue
Block a user