If I have two files named home.jpg in two different folders, their counter is treated as the same.

Comments

pixture’s picture

Assigned: Unassigned » pixture
Status: Active » Postponed

Actually, 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.

outlawstar223’s picture

How about if its turned into an option. This way people can make the choice according to their needs.

outlawstar223’s picture

While 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?

pixture’s picture

It 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 :-)

outlawstar223’s picture

Hey 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.

outlawstar223’s picture

This 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?

pixture’s picture

Yes, what you did seems to be OK (if the total length of URL is less than 255 characters).
Good finding!

pixture’s picture

Category: bug » feature
Status: Postponed » Closed (works as designed)

I 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.

michiellucas’s picture

Can you explain your solution? We have simular problem, same filename and wrong download results.