Page 1 of 1

Download Limits per file and per user.

PostPosted: August 22nd, 2011, 6:12 pm
by JulioMedina
I want to limit the users of a specific membership to x amount of downloads per day but then also put a limit on how many times each individual file can be downloaded. How can this be implemented.

Example: A basic membership subscriber access the files area and is allowed to download 3 files per day. A Pro member is allowed to download 6 files per day but then I also want to set a limit so that each file can only be downloaded x amount of times overall.

Re: Download Limits per file and per user.

PostPosted: August 23rd, 2011, 7:57 pm
by Jason Caldwell
Thanks for your inquiry.

Well, by default, s2Member does NOT count the exact same file downloaded by the exact same Member twice. That is, s2Member will allow a Member to download the same file and over and over again without that counting against them. The closest I can get you do the behavior you desire, would be to turn that part of s2Member's functionality off. If you'd like s2Member to count each and every file download, you might want to seek assistance from a freelancer. You'll need some minor edits inside this file:
/s2member/includes/classes/files-in.inc.php

Sorry, it's not a quick change, otherwise I'd custom code it for you.

Re: Download Limits per file and per user.

PostPosted: August 23rd, 2011, 8:27 pm
by JulioMedina
Jason,

Thanks for the quick reply. I found this code: http://www.webvamp.co.uk/blog/coding/cr ... oad-links/

Would that work to implement the change I am looking for? I want to continue to use the Limits per membership like it has but then I also want to be able to limit the downloads of the files.

Re: Download Limits per file and per user.

PostPosted: August 27th, 2011, 3:26 pm
by Jason Caldwell
Certainly, something like that would certainly work for you. Of course, that code is not intended to run with s2Member, but if you wanted to install something like this on your server, specifically for this type of usage, I don't see a problem. Again, you might need some assistance from a freelancer to bring this all the way home though; unless you yourself know a little PHP.

Re: Download Limits per file and per user.

PostPosted: October 21st, 2011, 4:18 pm
by kennymcnett
@Julio, Did you find a solution for counting the number of times a user has downloaded a file? I'm gnawing at the same issue right now. :(