2013-10-07 12:17:06 +00:00
< ? php
/*
*******************************************************************
2016-06-08 22:42:17 -07:00
| Copyright ( c ) 2007 - 2016 Clip - Bucket . com . All rights reserved .
2013-10-07 12:17:06 +00:00
| @ Author : ArslanHassan
2016-06-08 22:42:17 -07:00
| @ Software : ClipBucket
| @ Modified : June 9 , 2016 by Saqib Razzaq
2013-10-07 12:17:06 +00:00
*******************************************************************
*/
2016-06-08 23:22:55 -07:00
define ( " THIS_PAGE " , " upload " );
define ( " PARENT_PAGE " , " upload " );
require 'includes/config.inc.php' ;
$pages -> page_redir ();
subtitle ( 'upload' );
2013-10-07 12:17:06 +00:00
2016-06-08 23:22:55 -07:00
//Checking if user is guest
if ( userid ()) {
$verify_logged_user = true ;
} else {
$verify_logged_user = false ;
2013-10-07 12:17:06 +00:00
}
2014-03-18 06:13:35 +00:00
2016-06-08 23:22:55 -07:00
if ( has_access ( 'allow_video_upload' , false , $verify_logged_user )) {
#pre_upload();
$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 );
{
$file_directory = create_dated_folder ( NULL , $_REQUEST [ 'time_stamp' ]);
$vid = $Upload -> submit_upload ();
$Upload -> do_after_video_upload ( $vid );
2015-07-30 14:23:37 +00:00
2017-12-20 13:00:44 +05:00
2016-06-08 23:22:55 -07:00
2017-12-20 13:00:44 +05:00
if ( ! error ()){
e ( 'Video has been Embeded succesfully ..' , 'm' );
$step = 3 ;
}
2016-06-08 23:22:55 -07:00
}
2013-10-07 12:17:06 +00:00
}
2016-06-08 23:22:55 -07:00
//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' ));
} else {
$userquery -> logincheck ( 'allow_video_upload' , true );
2013-10-07 12:17:06 +00:00
}
2016-06-08 23:22:55 -07:00
assign ( 'step' , $step );
assign ( 'extensions' , $Cbucket -> get_extensions ());
subtitle ( lang ( 'upload' ));
//Displaying The Template
if ( ! userid () ) {
2016-06-15 03:54:30 -07:00
echo '<div id="notlogged_err" class="container alert alert-danger" style="margin-top:70px">You must login to be able to upload content. Login if you have account or register</div>' ;
2016-06-08 23:22:55 -07:00
} else {
template_files ( 'upload.html' );
}
2015-10-07 10:12:10 +00:00
2016-06-08 23:22:55 -07:00
display_it ();
2013-10-07 12:17:06 +00:00
?>