Home arrow FAQ arrow Remository general arrow Change period for download limits
Change period for download limits
Contributed by Administrator   
Aug 16, 2007 at 02:10 PM

Since version 3.42, Remository allows you to specify the maximum number of downloads for a registered user and the maximum number for a visitor (determined by IP address). The limit is per 24 hour period.

More recently, the code that handles this has been in components/com_remository/p-classes/remositoryUser.php on the grounds that it is more logical for the user object to know how many file downloads have been made than for the file object to know it. Look for SQL within the nonLoggedCount (for visitors) and loggedCount (for logged in users) methods around lines 159 and 167. See below for comments on how to adjust the time limit.

In earlier versions, you could change this by editing the file components/com_remository/p-classes/remositoryFile.php at lines 464 for visitors and 473 for registered users. Within these two lines, you will find the expression "SUBDATE(NOW(), INTERVAL 24 HOUR)". You can change HOUR to DAY or MONTH, or even to SECOND, MINUTE or YEAR, and you can change the number. The result is pretty obvious - if you change to "SUBDATE(NOW(), INTERVAL 5 DAY)" then the number of downloads will be restricted over a period of 5 days. Don't code the quotes, they are just for clarity!

Last Updated ( Jun 05, 2009 at 10:23 AM )
<Previous   Next>

Save FM Radio

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Who is Online

Remository welcomes guests and visitors

Real Time Web Analytics