Closed (fixed)
Project:
Download Count
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 May 2008 at 05:42 UTC
Updated:
17 Jun 2008 at 18:21 UTC
I fixed problem with the query to display all downloads... there was a problem with the "join upload.description with files_download.filename"
Here are the right queries :
if(user_access('view all downloads count')) {
$result = db_query("SELECT fd.filename, fd.count, fd.timestamp, u.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filename = fd.filename JOIN {upload} u ON f.fid = u.fid JOIN {node} n ON n.nid = u.nid" . tablesort_sql($header), $fileDirectoryPath);
}
else {
$result = db_query("SELECT fd.filename, fd.count, fd.timestamp, u.nid, n.type FROM {file_downloads} fd JOIN {files} f ON f.filename = fd.filename JOIN {upload} u ON f.fid = u.fid JOIN {node} n ON n.nid = u.nid WHERE n.uid = %d" . tablesort_sql($header), $fileDirectoryPath, $user->uid);
}
Comments
Comment #1
Chill35 commentedYeah I added a JOIN between the {upload} and {files} tables on the 'fid'. I no longer confuse 'description' and 'filename'.
There were major changes -- and a new table added for files -- between Drupal 5 and 6. I must have been doped when I upgraded my module to Drupal 6. I saw the change but made bad choices...
My apologies.
Look for the next release 6.x-1.2
Let me know if that fixes all problems, if you can.
:)
Comment #2
Chill35 commentedComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.