Closed (works as designed)
Project:
Public Download Count
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Jul 2009 at 18:57 UTC
Updated:
27 Feb 2012 at 13:19 UTC
If I have two files named home.jpg in two different folders, their counter is treated as the same.
Comments
Comment #1
pixture commentedActually, this is not a bug but a current design. When I developed the module, I thought it would not be a popular case, so I decided not to add URL path when the download count data is stored into the Drupal database. This also helps to reduce the amount of data to be stored since the URL path can be extremely long.
If many people think this is important, then I will think about it but for the time being, this won't be changed. I will leave this issue open so that we can hear the opinion of other people on this issue.
Comment #2
outlawstar223 commentedHow about if its turned into an option. This way people can make the choice according to their needs.
Comment #3
outlawstar223 commentedWhile people are still voicing their opinion, is there anyway I can get a patch for just my site? If not could you point me to the necessary changes in order for this to work?
Comment #4
pixture commentedIt would not be a simple code change of a few lines. You need to do either one of these:
(1) Add a new URL field to pubdlcnt database and store the URL together with other information and use URL for searching/updaing existing record instead of using file name.
(2) Change the length of existing filename field (currently the length is 255 bytes, which needs to be expanded so that it can contain full URL) and store the URL instead of file name.
Then you need to modify pubdlcnt.module and pubdlcnt.php to comply with this basic change. Sorry but I do not have time to work on this issue right now. So please give it a try by yourself.
Good luck :-)
Comment #5
outlawstar223 commentedHey man thank you very much, I understand everyones time is precious. I will go ahead and try to make these changes, and thanks for the pointers.
Comment #6
outlawstar223 commentedThis is what I did
On Line 83 I made this change: $filename = $url;
It seems to be working now, do you think this is sufficient?
Comment #7
pixture commentedYes, what you did seems to be OK (if the total length of URL is less than 255 characters).
Good finding!
Comment #8
pixture commentedI am closing this issue by changing the category to "feature request" since this is not a bug but a design, since there's no activities for a while.
Comment #9
michiellucas commentedCan you explain your solution? We have simular problem, same filename and wrong download results.