Project:Public Download Count
Version:6.x-1.0-beta3
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:pixture
Status:active

Issue Summary

It's possible to add the user, if it isn't anonymous, to the "Public download count" report?

Comments

#1

Assigned to:Anonymous» pixture

It's possible but requires some code changes. The issue here is that the download records that will be stored in the database can become huge if we keep track of download of each file by each user on daily basis, and that's the main reason I did not implement this feature. I need to think about this and also would like to get more opinion from others on this feature.

#2

I like the idea of tracking by users. It would be nice to have the option.

#3

I would be interested in hearing how you might impliment this as its a feature that I have to put into a site I'm working on. Our tracking is somewhat unique in that we're only tracking an image that is only seen by users who we provide the link too. So what we're using it for is a general idea on how many times a unique link has been clicked. So for us, tracking by user is quite necessary.

I would be willing to build this out and submit a patch, but I would be interested in hearing how you had thought about putting this in.

#4

Since pubdlcnt.php is a separate external CGI program directly invoked by the mouse click of the anchor link, it would be difficult (maybe not impossible) to get the user information. So I would add the user ID to the anchor link.
Currently the pubdlcnt.module adds file name and node ID to the anchor link as query strings. So I would modify pubdlcnt.module to add user ID too. This is an easy change.
Then, pubdlcnt.php update the database record which has added user ID column(field). This is also not a difficult too.

I think that the difficult part is how to present the download statitstics by user. Right now, I do not have any good idea on this. How would you do this?

#5

Our situation is were porting over a asp + php website into drupal. The currently download counter system we have access to is actually written in php, so we may end up using some code from that setup.

In that php code/setup, we actually do the presentation of images by:
Date of Last Download
Then each item is in a row and there is a link under the custom column for view all images (downloaded by user).

Back to the pubdlcnt module. I actually was thinking the same thing for the user tracking. Append ?uid=32. A snippet from our node-photo.tpl.php file:

<?php
global $base_url;
$purchaser_role = array('purchaser');
if (
is_array($user->roles)) {
  if (
count(array_intersect($user->roles, $purchaser_role)) > 0) {
?>

<a class="ptext" rel="nofollow" href="/sites/all/modules/contrib/pubdlcnt/pubdlcnt.php?file=<?php echo $base_url . '/'. $field_photo[0]['filepath']; ?>&amp;nid=<?php echo $node->nid; ?>&amp;uid=<?php echo $user->uid;">HI-RES DOWNLOAD</a>
<?php
  }
}
?>

For the time being this type of url will work. I had originally wanted to do some type of jquery/json request and have a clean url.
I'll let people updated on the code we do, and submit it as a patch.