I wrote this simple click-thru release download counter patch for a repository site I am building, and I am submitting it for comments, additions, questions, and blasphemous remarks :) Please feel free to tear it apart if it can be done in a better way.

A summary of what I did:

  1. Changed the code that generates the link to the extension download file to point to an intermediary page called "dlcounter/node_number" instead of "files/filename"
  2. Registered the page "dlcounter/node_number" to a callback handler function
  3. Created the callback handler function. this function increments the download count in the database and redirects the page to the actual file
  4. Modified the install and update database schema profiles to add the extra download count field to the project_release_nodes table
  5. Added a download count message to project release pages

If you go to a release node, you will see a download count. I will be adding a default view for most downloads per project, and any settings that seem critical.

Thank you!
buchanae

CommentFileSizeAuthor
release_dlcounter.patch4.58 KBbuchanae

Comments

dww’s picture

Status: Active » Closed (duplicate)

thanks, but please search for duplicates, first. ;)

http://drupal.org/node/102422

please follow-up there with your patch. however, i have *no* time to look closely now, and am about to leave for a month, so don't be disappointed if there's little/no reply for a while.

cheers,
-derek