Hello,
I have created the code for you.
1. Open upload.php, located in ./*
2. Look for: if(has_access('allow_video_upload',false,$verify_logged_user))
{
3. Under that line, copy-paste this code: //Check if the upload limit has been exceeded
$currdate = date("Y-m-d"); //Get current date in format YYYY-DD-MM like in database
$q = "SELECT COUNT(*) FROM cb_video WHERE datecreated='{$currdate}'"; // Query to count videos with that date
$res = mysql_query($q);
$row = mysql_fetch_assoc($res);
//$row <- will contain the current number of videos upload with that date
//We will now check with an if statement if the limit has been exceeded.
if($row >= '4') { // if it HAS BEEN exceeded
$userquery->logincheck('allow_video_upload',true);
} else { //if NOT BEEN
It will now look like this: if(has_access('allow_video_upload',false,$verify_logged_user))
{
//Check if the upload limit has been exceeded
$currdate = date("Y-m-d"); //Get current date in format YYYY-DD-MM like in database
$q = "SELECT COUNT(*) FROM cb_video WHERE datecreated='{$currdate}'"; // Query to count videos with that date
$res = mysql_query($q);
$row = mysql_fetch_assoc($res);
//$row <- will contain the current number of videos upload with that date
//We will now check with an if statement if the limit has been exceeded.
if($row >= '4') { // if it HAS BEEN exceeded
$userquery->logincheck('allow_video_upload',true);
} else { //if NOT BEEN
$file_name = time().RandomString(5);
assign('file_name',$file_name);
4. Now, you are missing an ending curly bracket of the if(). Add this code: }//End our check BEFORE: }else
{
$userquery->logincheck('allow_video_upload',true);
}
So the complete code will not look like this: //Check if the upload limit has been exceeded
$currdate = date("Y-m-d"); //Get current date in format YYYY-DD-MM like in database
$q = "SELECT COUNT(*) FROM cb_video WHERE datecreated='{$currdate}'"; // Query to count videos with that date
$res = mysql_query($q);
$row = mysql_fetch_assoc($res);
//$row <- will contain the current number of videos upload with that date
//We will now check with an if statement if the limit has been exceeded.
if($row >= '4') { // if it HAS BEEN exceeded
$userquery->logincheck('allow_video_upload',true);
} else { //if NOT BEEN
$file_name = time().RandomString(5);
assign('file_name',$file_name);
$step = 1;
if(isset($_POST['submit_data']))
{
$Upload->validate_video_upload_form();
if(empty($eh->error_list))
{
$step=2;
}
}
if(isset($_POST['submit_upload']))
{
if(!$_POST['file_name'])
$_POST['file_name'] = time().RandomString(5);
//$Upload->validate_video_upload_form(NULL,TRUE);
if(empty($eh->error_list))
{
$vid = $Upload->submit_upload();
//echo $db->db_query;
//Call file so it can activate video
$Upload->do_after_video_upload($vid);
if(!error())
$step=3;
}
}
//Assigning Form Name [RECOMMEND for submitting purpose]
Assign('upload_form_name','UploadForm');
//Adding Uploading JS Files
$Cbucket->add_js(array('swfupload/swfupload.js'=>'uploadactive'));
$Cbucket->add_js(array('swfupload/plugins/swfupload.queue.js'=>'uploadactive'));
$Cbucket->add_js(array('swfupload/plugins/handlers.js'=>'uploadactive'));
$Cbucket->add_js(array('swfupload/plugins/fileprogress.js'=>'uploadactive'));
}//End our check
}else
{
$userquery->logincheck('allow_video_upload',true);
}
Hope it helps.
Best Regards,
Richi