mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/14285] Move code to increment download count
PHPBB3-14285
This commit is contained in:
parent
af222e73f3
commit
469f139a2f
1 changed files with 5 additions and 7 deletions
|
@ -151,19 +151,17 @@ class attachment extends controller
|
||||||
|
|
||||||
$display_cat = $extensions[$attachment['extension']]['display_cat'];
|
$display_cat = $extensions[$attachment['extension']]['display_cat'];
|
||||||
|
|
||||||
if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$this->user->optionget('viewimg'))
|
|
||||||
{
|
|
||||||
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($thumbnail)
|
if ($thumbnail)
|
||||||
{
|
{
|
||||||
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
|
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
|
||||||
}
|
}
|
||||||
else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'])
|
else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'])
|
||||||
{
|
{
|
||||||
// Update download count
|
if (!(($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$this->user->optionget('viewimg')))
|
||||||
$this->phpbb_increment_downloads($attachment['attach_id']);
|
{
|
||||||
|
// Update download count
|
||||||
|
$this->phpbb_increment_downloads($attachment['attach_id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect = '';
|
$redirect = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue