1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

oh my god - what did he do? Adding attachment display to post/topic review, queue, reports, post details, mcp topic view... fixing other tiny things along the line.

git-svn-id: file:///svn/phpbb/trunk@7642 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-05-19 12:04:22 +00:00
parent e242a73a6f
commit 456586475b
34 changed files with 441 additions and 128 deletions

View File

@@ -14,7 +14,7 @@
function mcp_post_details($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth;
global $template, $db, $user, $auth, $cache;
$user->add_lang('posting');
@@ -92,6 +92,7 @@ function mcp_post_details($id, $mode, $action)
// Set some vars
$users_ary = $usernames_ary = array();
$attachments = $extensions = array();
$post_id = $post_info['post_id'];
$topic_tracking_info = array();
@@ -120,6 +121,43 @@ function mcp_post_details($id, $mode, $action)
}
$message = smiley_text($message);
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
{
$extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . '
AND in_message = 0
ORDER BY filetime DESC, post_msg_id ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$attachments[] = $row;
}
$db->sql_freeresult($result);
if (sizeof($attachments))
{
$update_count = array();
parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
}
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments))
{
$template->assign_var('S_HAS_ATTACHMENTS', true);
foreach ($attachments as $attachment)
{
$template->assign_block_vars('attachment', array(
'DISPLAY_ATTACHMENT' => $attachment)
);
}
}
}
$template->assign_vars(array(
'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
@@ -163,9 +201,10 @@ function mcp_post_details($id, $mode, $action)
'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']),
'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '',
'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '',
));