1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

submit some attachment changes/fixes as well as fixing the language pack download for zip files.

git-svn-id: file:///svn/phpbb/trunk@6260 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-08-11 13:21:51 +00:00
parent b70a0369af
commit 7508b00978
5 changed files with 36 additions and 15 deletions

View File

@@ -17,12 +17,13 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$download_id = request_var('id', 0);
// Thumbnails are not handled by this file by default - but for modders this should be interesting. ;)
$thumbnail = request_var('t', false);
// Start session management
$user->session_begin();
// Disable browser check for downloads
$config['browser_check'] = false;
// Start session management, do not update session page.
$user->session_begin(false);
$auth->acl($user->data);
$user->setup('viewtopic');
@@ -65,6 +66,19 @@ if (!$attachment['in_message'])
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Global announcement?
if (!$row)
{
$forum_id = request_var('f', 0);
$sql = 'SELECT forum_id, forum_password, parent_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
{
if ($row['forum_password'])
@@ -116,12 +130,13 @@ if (!$attachment)
$attachment['physical_filename'] = basename($attachment['physical_filename']);
$display_cat = $extensions[$attachment['extension']]['display_cat'];
if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else
else if ($display_cat == ATTACHMENT_CATEGORY_NONE)
{
// Update download count
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '