1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +02:00

[ticket/9657] Populate data about post's delete status in mcp_post

PHPBB3-9657
This commit is contained in:
Joas Schilling 2013-03-12 11:36:40 +01:00
parent a67daa8c8a
commit b712cff496

View File

@ -174,6 +174,33 @@ function mcp_post_details($id, $mode, $action)
}
}
// Deleting information
if ($post_info['post_visibility'] == ITEM_DELETED && $post_info['post_delete_user'])
{
// User having deleted the post also being the post author?
if (!$post_info['post_delete_user'] || $post_info['post_delete_user'] == $post_info['poster_id'])
{
$display_username = get_username_string('full', $post_info['poster_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']);
}
else
{
$sql = 'SELECT user_id, username, user_colour
FROM ' . USERS_TABLE . '
WHERE user_id = ' . (int) $post_info['post_delete_user'];
$result = $db->sql_query($sql);
$user_delete_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$display_username = get_username_string('full', $post_info['post_delete_user'], $user_delete_row['username'], $user_delete_row['user_colour']);
}
$user->add_lang('viewtopic');
$l_deleted_by = $user->lang('DELETED_INFORMATION', $display_username, $user->format_date($post_info['post_delete_time'], false, true));
}
else
{
$l_deleted_by = '';
}
$template->assign_vars(array(
'U_MCP_ACTION' => "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
@ -186,9 +213,12 @@ function mcp_post_details($id, $mode, $action)
'S_POST_REPORTED' => ($post_info['post_reported']) ? true : false,
'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED) ? true : false,
'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED) ? true : false,
'S_POST_LOCKED' => ($post_info['post_edit_locked']) ? true : false,
'S_USER_NOTES' => true,
'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false,
'DELETED_MESSAGE' => $l_deleted_by,
'DELETE_REASON' => $post_info['post_delete_reason'],
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '',
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true'),
@ -205,6 +235,7 @@ function mcp_post_details($id, $mode, $action)
'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&amp;start={$start}") . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'DELETED_IMG' => $user->img('icon_topic_deleted', $user->lang['POST_DELETED']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),