aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download/file.php
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-04 14:48:07 +0100
committerFyorl <gaelreth@gmail.com>2012-08-04 14:48:07 +0100
commited1435d04093132b751e940937e7f4f4b0687031 (patch)
treeffeff9b63a18eaa9b8262b16794ba0390a2ceeb8 /phpBB/download/file.php
parent20a2ceccbdbb47229750735bfcdf2a5d05353d95 (diff)
downloadforums-ed1435d04093132b751e940937e7f4f4b0687031.tar
forums-ed1435d04093132b751e940937e7f4f4b0687031.tar.gz
forums-ed1435d04093132b751e940937e7f4f4b0687031.tar.bz2
forums-ed1435d04093132b751e940937e7f4f4b0687031.tar.xz
forums-ed1435d04093132b751e940937e7f4f4b0687031.zip
[feature/attach-dl] Added function for incrementing download counter
PHPBB3-11042
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r--phpBB/download/file.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index f360132b0f..cec4aa55b3 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -407,10 +407,7 @@ if ($attachment)
else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize']))
{
// Update download count
- $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
- SET download_count = download_count + 1
- WHERE attach_id = ' . $attachment['attach_id'];
- $db->sql_query($sql);
+ phpbb_increment_downloads($db, $attachment['attach_id']);
}
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false)))
@@ -443,10 +440,7 @@ if ($attachment)
if ($attachments)
{
- $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
- SET download_count = download_count + 1
- WHERE ' . $db->sql_in_set('attach_id', $attach_ids);
- $db->sql_query($sql);
+ phpbb_increment_downloads($db, $attach_ids);
if (!in_array($archive, compress::methods()))
{