Closed (won't fix)
Project:
Download Count
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2008 at 16:05 UTC
Updated:
30 May 2010 at 20:00 UTC
I work with Drupal 5 and Download Counter 5.x-1.0 module.
I have a content-type called Document which allows to attach a file. In my example (issue.PNG) I have the file BI.doc
I changed a part of download_count.module (code given here : http://drupal.org/node/110125#comment-199181)
<?php
function download_count_file_download($filename) {
$file = file_create_path($filename);
$result = db_query("SELECT f.* FROM {files} f WHERE filepath = '%s'", $file);
if ($file = db_fetch_object($result)) {
if (user_access('view uploaded files') && node_access('view', node_load($file->nid))) {
$message = t('%file was downloaded', array('%file' => theme('placeholder', $filename)));
watchdog('download', $message, WATCHDOG_NOTICE);
// If the file is already added, just increment the count,
// otherwise add the file with count 1
if(db_result(db_query("SELECT filename FROM {file_downloads} WHERE filename = '$filename'"))) {
db_query("UPDATE {file_downloads} SET count = count+1 WHERE filename = '$filename'");
}
else {
db_query("INSERT INTO {file_downloads} (filename, count) VALUES ('$filename', 1)");
}
}
else {
$message = t('Failed to download %file', array('%file' => theme('placeholder', $filename)));
watchdog('download', $message, WATCHDOG_WARNING);
}
}
}
?>
Now when I download one file counter's incrementation is one.
But the counter takes two wrong files images/PhotoBB 116.thumbnail.jpg and images/PC282766.thumbnail.JPG instead of BI.doc. Moreover the value for last update is 38 years 32 weeks ago.
Anybody to help me to solve this problem please ?
Regards,
Nicolas
| Comment | File | Size | Author |
|---|---|---|---|
| issue.PNG | 34.27 KB | Nicolas_85 |
Comments
Comment #1
iva2k commentedI noticed this issue is in the wrong queue. Also, do not assign it to yourself unless you plan to fix it. Probably too old for anyone to care though.
Comment #2
WorldFallz commentedclosing due to new maintainer and an unsupported version. A new 6.x-2.x version is forthcoming, please open new against that version when available.