Closed (won't fix)
Project:
Download Count
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2007 at 05:16 UTC
Updated:
30 May 2010 at 20:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
njkt commentedI wrote a small patch for this actually...
the patch also includes a previous patch from this issue: http://drupal.org/node/119860
Comment #2
njkt commentedThe patch was 2 parts.. here's the download_counter.module patch
Comment #3
njkt commentedThat download_counter patch was corrupt.. i'm never doing patches on windows again... here's the new version
Comment #4
Chill35 commentedThis is a very useful patch but I won't be commiting it for now. Let's leave the issue open so that anyone who uses the project module can apply the patch. I think that dww may solve the issue on his end, in the project module :
http://drupal.org/node/119860.
It this patch was applied, download_count would need to be generalized... applied for all modules that implement the file_download function. What do you think ?
In the admin settings... some code such as this one could be used...
foreach (module_implements('file_download') as $module) {and the admin could configure this to a "t".
Thanks!
Comment #5
njkt commentedfunny thing is, I was just thinking about this in class...
I'll mess around with it a bit over the weekend and see what I come up with, if it works out well then I'll post a follow up and if not, no harm no foul heh.
Comment #6
Chill35 commentedI probably read your mind. Because after that thought, I could not "see" more.
I don't have implants like the actress in Medium though!
Comment #7
njkt commentedHere's what I added to download_count_admin_settings() to add the options at least
Is this what you were thinking?
Comment #8
njkt commentedand an update...
made it so it appends _download_count to the module name when it saves the variable
Comment #9
Chill35 commentedI need more than the name of the module. I need the name of the database where the filename can be found.
So that I can do this check :
if (filename is in that module's database && we are doing bookkeeping for that module) then
-- increment a file counter in the table {file_downloads}
The name of the database won't always be the name of the module.
Maybe I just ought to increment a counter regardless... when the filename is NOT in {files}.
I won't know IF the file was successfully downloaded, that is, I won't know if the user actually has the right to download the file. See, as soon as a user types the file URL in the browser, and the file exists, and it has "system/files" in its URL, I get signaled, that's how the file_download hook function works. We don't have a file_download_completed hook, unfortunately. So if the user gets a Denied Access Page, I won't know that - in
all cases where a module uploads files and does not record them in {files}.
For the files uploaded with the upload module, and hence recorded in {files}, I check if the user has access "right" to the node to which the file is attached, to determine if the download was a success or failure.
I can give a false positive, in medical jargon ;)
I'll have to think about this.
What are your thoughts ?
Caroline
A coder's guide to file download in Drupal
Comment #10
livingegg commentedThe project release patch can not be applied to the latest version of project release module because there is already a project_release_file_download function in the .module - that would make this patch obsolete. However, I don't think this means that this patch was included into the core project release module - because the module still does not give any information to the download counter module.
Just a heads up to anyone trying to solve this problem - it still remains unsolved to the best of my knowledge.
Comment #11
WorldFallz commentedclosing due to new maintainer and an unsupported version. A new 6.x-2.x version is forthcoming, please open new issues against that version when available if necessary.