I'd like to suggest a feature for "userpoints": what about substracting a certain amount of points for downloading a file?

So for example if a user has gained 100 points he can choose to download 2 mp3 files worth 50 points each from a list of such files. After these downloads his user points account should be zero.

Do you think its possible?

Comments

kbahey’s picture

Hmmm

downloads can be just plain files on the server, handled by Apache, not Drupal. So clicking on them may not be detected by drupal at all.

Two solutions come to mind:

- Use private file downloads. I have not explored this enough to see if it is feasible. This may require changes to Drupal core.

- Use a redirect for each file. The redirect would subtract the points, then redirect to the real file to be downloaded. This requires changes to the modules that handle the download.

However, there are issues with any of the above approach: say the download starts and never completes? The user just lost 100 points there. Of course users can complain and get the points back, but then there is no way to tell if users are sincere and others who are gaming the system.

DVV’s picture

Khalid,

I simply want to substract a certain amount of points from a user account in exchange of showing him a download link (permanent or just temporary) to the file of his dreams ;-)

It doesn't matter too much if the download was successful from the first try: having the download link my stubborn user can try as much/often as he wants to get the file he 'paid' for.

I think the easiest way to use this substracting-points-for-a-download-function (at least from my point of view, as a humble non-programmer, drupal user ;-) could be in the form of a function which I can insert as a php-snippet in a page where I can set an arbitrary value of points to substract in exchange of showing a small piece of text. When the user clicks on that special link the system substracts that amount of points from his account and shows him that small piece of text containing the download link.

I'm dreaming further to a kind of a 'download log' for every user so he can review any time where he spent all his precious user points ;-)

Regards, GigiContra

AlanT’s picture

It seems to me that one possible solution to this would be to use the ecommerce system to 'sell' the file downloads for a specified number of userpoints. This is something that is already in place and seems like what you're asking for.

khashaiar’s picture

Version: 4.7.x-1.x-dev » 6.x-1.x-dev
jredding’s picture

Status: Active » Closed (won't fix)

This solution is possible if you use ubercart and the ubercart + userpoints integrated module as suggested in #3 above.

It is much too difficult to implement a clean solution using just userpoints.
http://drupal.org/project/ubercart
http://drupal.org/project/userpoints_ubercart

I'm going to put this feature request to rest by rejecting it.