From 22d6d3569cbdaacebbe2521c171047b91fb8f608 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 3 Aug 2015 22:20:49 -0400 Subject: [PATCH] #275 Update download count for each attachment --- download_attachment.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/download_attachment.php b/download_attachment.php index a6ad6a22..387eb5c8 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -95,6 +95,9 @@ if ( isset($_GET['kb_att']) ) hesk_checkPermission('can_man_kb'); } } + + // Update the download count + hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_attachments` SET `download_count` = `download_count` + 1 WHERE `att_id` = '{$att_id}'"); } // Ticket attachments @@ -132,6 +135,9 @@ else hesk_error($hesklang['perm_deny']); } } + + // Update the download count + hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."attachments` SET `download_count` = `download_count` + 1 WHERE `att_id` = '{$att_id}'"); } // Path of the file on the server