aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_post.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp/mcp_post.php')
-rw-r--r--phpBB/includes/mcp/mcp_post.php43
1 files changed, 41 insertions, 2 deletions
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index ea2e2fafd7..8dbbdba92e 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -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']}") : '',
));