mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-07 16:15:22 +02:00
[feature/attach-dl] Downloading all attachments fully implemented
Added a function to list all available archiving methods and integrated it with the prosilver style. Heavy modifications to download/file.php to support archiving and downloading of multiple files at once. PHPBB3-11042
This commit is contained in:
parent
5bffd9883d
commit
ee7d9614c0
@ -132,8 +132,12 @@ if (isset($_GET['avatar']))
|
|||||||
// implicit else: we are not in avatar mode
|
// implicit else: we are not in avatar mode
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include($phpbb_root_path . 'common.' . $phpEx);
|
||||||
require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
|
require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
|
||||||
|
require($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
|
||||||
|
|
||||||
$download_id = request_var('id', 0);
|
$download_id = request_var('id', 0);
|
||||||
|
$topic_id = $request->variable('topic_id', 0);
|
||||||
|
$post_id = $request->variable('post_id', 0);
|
||||||
|
$archive = $request->variable('archive', '.tar');
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', '');
|
||||||
$thumbnail = request_var('t', false);
|
$thumbnail = request_var('t', false);
|
||||||
|
|
||||||
@ -142,7 +146,7 @@ $user->session_begin(false);
|
|||||||
$auth->acl($user->data);
|
$auth->acl($user->data);
|
||||||
$user->setup('viewtopic');
|
$user->setup('viewtopic');
|
||||||
|
|
||||||
if (!$download_id)
|
if (!$download_id && !$post_id && !$topic_id)
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
trigger_error('NO_ATTACHMENT_SELECTED');
|
trigger_error('NO_ATTACHMENT_SELECTED');
|
||||||
@ -154,20 +158,62 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
|
|||||||
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$attachment = false;
|
||||||
|
$attachments = false;
|
||||||
|
|
||||||
|
if ($download_id)
|
||||||
|
{
|
||||||
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
||||||
FROM ' . ATTACHMENTS_TABLE . "
|
FROM ' . ATTACHMENTS_TABLE . "
|
||||||
WHERE attach_id = $download_id";
|
WHERE attach_id = $download_id";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$attachment = $db->sql_fetchrow($result);
|
$attachment = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$attachment)
|
if ($topic_id)
|
||||||
|
{
|
||||||
|
$sql = "
|
||||||
|
SELECT attach_id, in_message, post_msg_id, extension, is_orphan, a.poster_id, filetime
|
||||||
|
FROM " . POSTS_TABLE . " p, " . ATTACHMENTS_TABLE . " a
|
||||||
|
WHERE p.topic_id = $topic_id
|
||||||
|
AND p.post_attachment = 1
|
||||||
|
AND a.post_msg_id = p.post_id
|
||||||
|
";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$attachments[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($post_id)
|
||||||
|
{
|
||||||
|
$sql = "
|
||||||
|
SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
||||||
|
FROM " . ATTACHMENTS_TABLE . "
|
||||||
|
WHERE post_msg_id = $post_id
|
||||||
|
";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$attachments[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$attachment && !$attachments)
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
trigger_error('ERROR_NO_ATTACHMENT');
|
trigger_error('ERROR_NO_ATTACHMENT');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))
|
if ($attachment && ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach'])))
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
||||||
@ -175,7 +221,7 @@ if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachmen
|
|||||||
|
|
||||||
$row = array();
|
$row = array();
|
||||||
|
|
||||||
if ($attachment['is_orphan'])
|
if ($attachment && $attachment['is_orphan'])
|
||||||
{
|
{
|
||||||
// We allow admins having attachment permissions to see orphan attachments...
|
// We allow admins having attachment permissions to see orphan attachments...
|
||||||
$own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
|
$own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
|
||||||
@ -191,13 +237,26 @@ if ($attachment['is_orphan'])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!$attachment['in_message'])
|
if ($attachments || ($attachment && !$attachment['in_message']))
|
||||||
|
{
|
||||||
|
if ($download_id || $post_id)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
|
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
|
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
|
||||||
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
|
WHERE p.post_id = ' . (($attachment) ? $attachment['post_msg_id'] : $post_id) . '
|
||||||
AND p.forum_id = f.forum_id';
|
AND p.forum_id = f.forum_id';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($topic_id)
|
||||||
|
{
|
||||||
|
$sql = "
|
||||||
|
SELECT t.forum_id, f.forum_password, f.parent_id
|
||||||
|
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
|
||||||
|
WHERE t.topic_id = $topic_id
|
||||||
|
AND t.forum_id = f.forum_id
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$row = $db->sql_fetchrow($result);
|
$row = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
@ -252,8 +311,24 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// disallowed?
|
// disallowed?
|
||||||
$extensions = array();
|
$extensions = $cache->obtain_attach_extensions($row['forum_id']);
|
||||||
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
|
|
||||||
|
if ($attachments)
|
||||||
|
{
|
||||||
|
// Remove attachments with disallowed extensions
|
||||||
|
$new_ary = array();
|
||||||
|
foreach ($attachments as $attach)
|
||||||
|
{
|
||||||
|
if (isset($extensions['_allowed_'][$attach['extension']]))
|
||||||
|
{
|
||||||
|
$new_ary[] = $attach;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$attachments = $new_ary;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($attachments && empty($attachments)) || ($attachment && !isset($extensions['_allowed_'][$attachment['extension']])))
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Forbidden');
|
send_status_line(404, 'Forbidden');
|
||||||
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
|
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
|
||||||
@ -266,22 +341,61 @@ if (!download_allowed())
|
|||||||
trigger_error($user->lang['LINKAGE_FORBIDDEN']);
|
trigger_error($user->lang['LINKAGE_FORBIDDEN']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($attachments && sizeof($attachments) < 2)
|
||||||
|
{
|
||||||
|
$attachments = false;
|
||||||
|
$attachment = $attachments[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($attachment)
|
||||||
|
{
|
||||||
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
|
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
|
||||||
|
}
|
||||||
|
|
||||||
// Fetching filename here to prevent sniffing of filename
|
// Fetching filename here to prevent sniffing of filename
|
||||||
|
if ($attachment)
|
||||||
|
{
|
||||||
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime
|
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime
|
||||||
FROM ' . ATTACHMENTS_TABLE . "
|
FROM ' . ATTACHMENTS_TABLE . "
|
||||||
WHERE attach_id = $download_id";
|
WHERE attach_id = $download_id";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$attachment = $db->sql_fetchrow($result);
|
$attachment = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$attachment)
|
if ($attachments)
|
||||||
|
{
|
||||||
|
$attach_ids = array();
|
||||||
|
foreach ($attachments as $attach)
|
||||||
|
{
|
||||||
|
$attach_ids[] = $attach['attach_id'];
|
||||||
|
}
|
||||||
|
$attach_ids = implode(',', $attach_ids);
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime
|
||||||
|
FROM " . ATTACHMENTS_TABLE . "
|
||||||
|
WHERE attach_id IN ($attach_ids)
|
||||||
|
";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$attachments = array();
|
||||||
|
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$attachments[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$attachment && empty($attachments))
|
||||||
{
|
{
|
||||||
send_status_line(404, 'Not Found');
|
send_status_line(404, 'Not Found');
|
||||||
trigger_error('ERROR_NO_ATTACHMENT');
|
trigger_error('ERROR_NO_ATTACHMENT');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($attachment)
|
||||||
|
{
|
||||||
$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
|
$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
|
||||||
$display_cat = $extensions[$attachment['extension']]['display_cat'];
|
$display_cat = $extensions[$attachment['extension']]['display_cat'];
|
||||||
|
|
||||||
@ -334,3 +448,40 @@ else
|
|||||||
file_gc();
|
file_gc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($attachments)
|
||||||
|
{
|
||||||
|
$sql = "
|
||||||
|
UPDATE " . ATTACHMENTS_TABLE . "
|
||||||
|
SET download_count = download_count + 1
|
||||||
|
WHERE attach_id IN ($attach_ids)
|
||||||
|
";
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
if (!in_array($archive, compress::methods()))
|
||||||
|
{
|
||||||
|
$archive = '.tar';
|
||||||
|
}
|
||||||
|
|
||||||
|
$store_name = 'att_' . time() . '_' . unique_id();
|
||||||
|
$archive_name = 'attachments';
|
||||||
|
|
||||||
|
if ($archive === '.zip')
|
||||||
|
{
|
||||||
|
$compress = new compress_zip('w', "{$phpbb_root_path}store/{$store_name}{$archive}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$compress = new compress_tar('w', "{$phpbb_root_path}store/{$store_name}{$archive}", $archive);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($attachments as $attach)
|
||||||
|
{
|
||||||
|
$compress->add_custom_file("{$phpbb_root_path}files/{$attach['physical_filename']}", $attach['real_filename']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$compress->close();
|
||||||
|
$compress->download($store_name, $archive_name);
|
||||||
|
file_gc();
|
||||||
|
}
|
||||||
|
@ -1285,3 +1285,33 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
|
|||||||
$avatar_img .= $avatar;
|
$avatar_img .= $avatar;
|
||||||
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a list of archive types available for compressing attachments
|
||||||
|
*
|
||||||
|
* @param string $param_key Either topic_id or post_id
|
||||||
|
* @param string $param_val The value of the topic or post id
|
||||||
|
* @param string $phpbb_root_path The root path of the phpBB installation
|
||||||
|
* @param string $phpEx The PHP extension
|
||||||
|
*
|
||||||
|
* @return array Array containing the link and the type of compression
|
||||||
|
*/
|
||||||
|
function gen_download_links($param_key, $param_val, $phpbb_root_path, $phpEx)
|
||||||
|
{
|
||||||
|
$methods = compress::methods();
|
||||||
|
$links = array();
|
||||||
|
|
||||||
|
foreach ($methods as $method)
|
||||||
|
{
|
||||||
|
$type = array_pop(explode('.', $method));
|
||||||
|
$params = array('archive' => $method);
|
||||||
|
$params[$param_key] = $param_val;
|
||||||
|
|
||||||
|
$links[] = array(
|
||||||
|
'LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", $params),
|
||||||
|
'TYPE' => $type,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $links;
|
||||||
|
}
|
||||||
|
@ -46,7 +46,14 @@
|
|||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF S_HAS_ATTACHMENTS -->
|
<!-- IF S_HAS_ATTACHMENTS -->
|
||||||
<span>[ <a href="{U_DL_ALL_LINK}">{L_DOWNLOAD_ALL_ATTACH}</a> ]</span>
|
<div class="dl_links">
|
||||||
|
<strong>{L_DOWNLOAD_ALL_ATTACH}:</strong>
|
||||||
|
<ul>
|
||||||
|
<!-- BEGIN dl_method -->
|
||||||
|
<li>[ <a href="{dl_method.LINK}">{dl_method.TYPE}</a> ]</li>
|
||||||
|
<!-- END dl_method -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF .pagination or TOTAL_POSTS -->
|
<!-- IF .pagination or TOTAL_POSTS -->
|
||||||
@ -161,7 +168,19 @@
|
|||||||
|
|
||||||
<!-- IF postrow.S_HAS_ATTACHMENTS -->
|
<!-- IF postrow.S_HAS_ATTACHMENTS -->
|
||||||
<dl class="attachbox">
|
<dl class="attachbox">
|
||||||
<dt>{L_ATTACHMENTS}<!-- IF postrow.S_MULTIPLE_ATTACH --> [ <a href="{postrow.U_DL_ALL_LINK}">{L_DOWNLOAD_ALL}</a> ]<!-- ENDIF --></dt>
|
<dt>
|
||||||
|
{L_ATTACHMENTS}
|
||||||
|
<!-- IF postrow.S_MULTIPLE_ATTACH -->
|
||||||
|
<div class="dl_links">
|
||||||
|
<strong>{L_DOWNLOAD_ALL}:</strong>
|
||||||
|
<ul>
|
||||||
|
<!-- BEGIN dl_method -->
|
||||||
|
<li>[ <a href="{postrow.dl_method.LINK}">{postrow.dl_method.TYPE}</a> ]</li>
|
||||||
|
<!-- END dl_method -->
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
<!-- BEGIN attachment -->
|
<!-- BEGIN attachment -->
|
||||||
<dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd>
|
<dd>{postrow.attachment.DISPLAY_ATTACHMENT}</dd>
|
||||||
<!-- END attachment -->
|
<!-- END attachment -->
|
||||||
|
@ -702,3 +702,26 @@ dl.pmlist dd {
|
|||||||
margin-left: 61% !important;
|
margin-left: 61% !important;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.topic-actions div.dl_links {
|
||||||
|
padding: 10px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.dl_links {
|
||||||
|
display: inline-block;
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl_links strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl_links ul {
|
||||||
|
list-style-type: none;
|
||||||
|
margin: 0;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dl_links li {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
@ -15,6 +15,7 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
|
|||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
include($phpbb_root_path . 'common.' . $phpEx);
|
||||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||||
|
include($phpbb_root_path . 'includes/functions_compress.' . $phpEx);
|
||||||
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
@ -1316,9 +1317,14 @@ if (sizeof($attach_list))
|
|||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_HAS_ATTACHMENTS' => !empty($attachments),
|
'S_HAS_ATTACHMENTS' => !empty($attachments),
|
||||||
'U_DL_ALL_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", "topic_id=$topic_id"),
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$methods = gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx);
|
||||||
|
foreach ($methods as $method)
|
||||||
|
{
|
||||||
|
$template->assign_block_vars('dl_method', $method);
|
||||||
|
}
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
// Instantiate BBCode if need be
|
||||||
if ($bbcode_bitfield !== '')
|
if ($bbcode_bitfield !== '')
|
||||||
{
|
{
|
||||||
@ -1573,8 +1579,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
|||||||
|
|
||||||
'S_IGNORE_POST' => ($row['hide_post']) ? true : false,
|
'S_IGNORE_POST' => ($row['hide_post']) ? true : false,
|
||||||
'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
|
'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
|
||||||
|
|
||||||
'U_DL_ALL_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'post_id=' . $row['post_id']),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($cp_row['row']) && sizeof($cp_row['row']))
|
if (isset($cp_row['row']) && sizeof($cp_row['row']))
|
||||||
@ -1602,6 +1606,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
|||||||
'DISPLAY_ATTACHMENT' => $attachment)
|
'DISPLAY_ATTACHMENT' => $attachment)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$methods = gen_download_links('post_id', $row['post_id'], $phpbb_root_path, $phpEx);
|
||||||
|
foreach ($methods as $method)
|
||||||
|
{
|
||||||
|
$template->assign_block_vars('postrow.dl_method', $method);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$prev_post_id = $row['post_id'];
|
$prev_post_id = $row['post_id'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user