From 5bffd9883de02807817838cd840a5293b6b908ac Mon Sep 17 00:00:00 2001 From: Fyorl Date: Thu, 2 Aug 2012 20:47:09 +0100 Subject: [feature/attach-dl] Added links to the templates PHPBB3-11042 --- phpBB/viewtopic.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b6df14d42d..fce1be7784 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1314,6 +1314,11 @@ if (sizeof($attach_list)) } } +$template->assign_vars(array( + 'S_HAS_ATTACHMENTS' => !empty($attachments), + 'U_DL_ALL_LINK' => append_sid("{$phpbb_root_path}download/file.$phpEx", "topic_id=$topic_id"), +)); + // Instantiate BBCode if need be if ($bbcode_bitfield !== '') { @@ -1556,6 +1561,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_ID' => $poster_id, 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_MULTIPLE_ATTACH' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], @@ -1567,6 +1573,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) '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']), '', '') : '', + + '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'])) -- cgit v1.2.1 From ee7d9614c07c3961d62edbd0e8bf5ef1e2d75ff8 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sat, 4 Aug 2012 13:18:20 +0100 Subject: [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 --- phpBB/viewtopic.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index fce1be7784..1199fc4d14 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -15,6 +15,7 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); +include($phpbb_root_path . 'includes/functions_compress.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // Start session management @@ -1316,9 +1317,14 @@ if (sizeof($attach_list)) $template->assign_vars(array( '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 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, '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']), '', '') : '', - - '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'])) @@ -1602,6 +1606,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) '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']; -- cgit v1.2.1 From 18d7210a11b4d98c50ad55bb427c8cd2cc14a2f1 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Sat, 4 Aug 2012 13:58:50 +0100 Subject: [feature/attach-dl] Prefixed gen_download_links with phpbb_ PHPBB3-11042 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1199fc4d14..a4d7c8baa1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1319,7 +1319,7 @@ $template->assign_vars(array( 'S_HAS_ATTACHMENTS' => !empty($attachments), )); -$methods = gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); +$methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); foreach ($methods as $method) { $template->assign_block_vars('dl_method', $method); @@ -1607,7 +1607,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ); } - $methods = gen_download_links('post_id', $row['post_id'], $phpbb_root_path, $phpEx); + $methods = phpbb_gen_download_links('post_id', $row['post_id'], $phpbb_root_path, $phpEx); foreach ($methods as $method) { $template->assign_block_vars('postrow.dl_method', $method); -- cgit v1.2.1 From 058bf77a397aa49d1dfc76d95b2c2fde124cf984 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Tue, 7 Aug 2012 12:00:10 +0100 Subject: [feature/attach-dl] Moved functions_compress include PHPBB3-11042 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a4d7c8baa1..a65944742e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -15,7 +15,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); -include($phpbb_root_path . 'includes/functions_compress.' . $phpEx); include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // Start session management @@ -1319,6 +1318,7 @@ $template->assign_vars(array( 'S_HAS_ATTACHMENTS' => !empty($attachments), )); +require_once $phpbb_root_path . 'includes/functions_compress.' . $phpEx; $methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); foreach ($methods as $method) { -- cgit v1.2.1 From 773c513ac0a0d3b580462a5eec2f65782f26b3c3 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Tue, 7 Aug 2012 16:59:57 +0100 Subject: [feature/attach-dl] Moved include of compress class inside function PHPBB3-11042 --- phpBB/viewtopic.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index a65944742e..9f044e0a89 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1318,7 +1318,6 @@ $template->assign_vars(array( 'S_HAS_ATTACHMENTS' => !empty($attachments), )); -require_once $phpbb_root_path . 'includes/functions_compress.' . $phpEx; $methods = phpbb_gen_download_links('topic_id', $topic_id, $phpbb_root_path, $phpEx); foreach ($methods as $method) { -- cgit v1.2.1 From 53aadd60a66c813db90aa1d54e649384679f2614 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Fri, 17 Aug 2012 16:16:02 +0100 Subject: [feature/attach-dl] Renamed $post_id to $post_msg_id PHPBB3-11042 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9f044e0a89..41566219b9 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1606,7 +1606,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) ); } - $methods = phpbb_gen_download_links('post_id', $row['post_id'], $phpbb_root_path, $phpEx); + $methods = phpbb_gen_download_links('post_msg_id', $row['post_id'], $phpbb_root_path, $phpEx); foreach ($methods as $method) { $template->assign_block_vars('postrow.dl_method', $method); -- cgit v1.2.1 From e1a4aa3ea255874660d31e13c0b4cadc8993ef4f Mon Sep 17 00:00:00 2001 From: Fyorl Date: Mon, 20 Aug 2012 21:52:42 +0100 Subject: [feature/attach-dl] Removed the use of some abbreviations PHPBB3-11042 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 41566219b9..036f70e729 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1566,7 +1566,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_ID' => $poster_id, 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, - 'S_MULTIPLE_ATTACH' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, + 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, 'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $row['post_attachment'], -- cgit v1.2.1