Submission limit for WCDDL

Status
Not open for further replies.
10 comments
would someone please try using this in their doSubmit() function:
PHP:
                /* submissions limit */
                        //using this would be asuming you empty your queue at least once every 24 hrs.
                    $dailyL = '40'; //set your limit
                    $Qtitles = mysql_query("SELECT title FROM wcddl_queue WHERE sid = '".mysql_real_escape_string($sid)."'");
                    if(count($Qtitles) + count($titles) => $dailyL) {
                        $listfail = true;
                        $this->error .= '<br>You have reached the maximum number of submissions for today ('.$dailyL.').';
                    }
                /*end*/

It doesnt work for me, but im sure a nice person could get it working <3
 
You'd have to num rows $Qtitles or fetch the array THEN count() it.

Don't know if that'd do what you want it to do but it'd be working code lol.
 
pretty much the only thing that would be wrong after that is, when processing the titles,urls,types etc it would drop the entire last submission(s) lot if it were to exceed $dailyL, instead of accepting the remaining allowed then dropping the rest..

For instance katz system drops all submissions AFTER the limit has been accepted. Which is probably what mecho wants to achieve.
 
Try this
PHP:
/* submissions limit */
//using this would be asuming you empty your queue at least once every 24 hrs.
    $dailyL = '40'; //set your limit
    $Qrow = mysql_query("SELECT COUNT(id) as c FROM wcddl_queue WHERE sid = '".mysql_real_escape_string($sid)."' AND dat < ".(time() - 86400)."");
   $res = mysql_query($Qrow);
   $c = mysql_result("c",$res);
   if($res + count($titles) >= $dailyL) {
                        $listfail = true;
                        $this->error .= '<br>You have reached the maximum number of submissions for today ('.$dailyL.').';
                    }
                /*end*/

erm try summat like that.. not tested
 
Status
Not open for further replies.
Back
Top