1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +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:
Fyorl
2012-08-04 13:18:20 +01:00
parent 5bffd9883d
commit ee7d9614c0
5 changed files with 307 additions and 74 deletions

View File

@@ -1285,3 +1285,33 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
$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) . '" />';
}
/**
* 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;
}