diff options
author | Fyorl <gaelreth@gmail.com> | 2012-08-04 13:18:20 +0100 |
---|---|---|
committer | Fyorl <gaelreth@gmail.com> | 2012-08-04 13:18:20 +0100 |
commit | ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8 (patch) | |
tree | 205a0fd29c1c7919de88087e9bd5527b61e736d4 /phpBB/includes/functions_display.php | |
parent | 5bffd9883de02807817838cd840a5293b6b908ac (diff) | |
download | forums-ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8.tar forums-ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8.tar.gz forums-ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8.tar.bz2 forums-ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8.tar.xz forums-ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8.zip |
[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
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r-- | phpBB/includes/functions_display.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a1ff7a1f99..a99d2353ed 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -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; +} |