coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: glazzaro on February 05, 2007, 07:24:21 AM

Title: Limiting Uploads per day
Post by: glazzaro on February 05, 2007, 07:24:21 AM
I would like to limit the number of uploads per day per user.  I read one thread here that pertained to that very question but the thread was long and a lot of changes made to the code in the thread.  Is there any that can assist me with configuring the software to limit the number of pic uploads daily?  Thank you.

Greg
Title: Re: Limiting Uploads per day
Post by: Joachim Müller on February 05, 2007, 07:34:05 AM
Such a feature doesn't exist out-of-the-box, so you'd need to perform code changes. If there is a thread that explains it, do as suggested there, or at least post a link to the thread you're refering to.
Title: Re: Limiting Uploads per day
Post by: glazzaro on February 05, 2007, 07:49:57 AM
Here is the thread that I viewed on the matter http://forum.coppermine-gallery.net/index.php?topic=15874.msg106618#msg106618 (http://forum.coppermine-gallery.net/index.php?topic=15874.msg106618#msg106618)
Title: Re: Limiting Uploads per day
Post by: Joachim Müller on February 05, 2007, 08:00:02 AM
As Nibbler suggested, the thread you're refering to deals with cpg1.3.x
Quote from: Nibbler on August 12, 2006, 12:42:47 PM
If you have 1.4 then don't apply code changes posted to the 1.3 board unless you are a coder and can understand the changes between Coppermine  versions.

Bottom line: the feature you're looking for doesn't exist. If you need it, then code it, or try to modify the hack for cpg1.3.x to make it work for cpg1.4.x. However, it goes unsupported.
Title: Re: Limiting Uploads per day
Post by: RadioErewan on January 05, 2008, 02:58:10 AM
Changed query style from CPG 1.3 solution, and it works:

$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = ".USER_ID." AND ctime > ".time()." - (72*60*60)");
if (mysql_num_rows($result) > 0) {
cpg_die(INFORMATION, "Some information for user (now the limit is set to 72 hrs and 1 upload).<br />Experimental.");
}