2013-10-07 12:17:06 +00:00
< ? php
/*
*******************************************************************
| Copyright ( c ) 2007 - 2008 Clip - Bucket . com . All rights reserved .
| @ Author : ArslanHassan
| @ Software : ClipBucket , <EFBFBD> PHPBucket . com
| @ Modified : June 14 , 2009 by Arslan Hassan
*******************************************************************
*/
define ( " THIS_PAGE " , " upload " );
define ( " PARENT_PAGE " , " upload " );
2014-03-18 06:13:35 +00:00
/* if ( isset ( $_POST [ 'embed_code' ])){
$_POST [ 'embed_code' ] = base64_encode ( $_POST [ 'embed_code' ]);
} */
//var_dump($_POST);die();
2013-10-07 12:17:06 +00:00
require 'includes/config.inc.php' ;
2014-03-18 06:13:35 +00:00
//var_dump($_POST);die();
2014-09-23 12:07:50 +00:00
//$userquery->logincheck();
2013-10-07 12:17:06 +00:00
$pages -> page_redir ();
subtitle ( 'upload' );
//Checking if user is guest
if ( userid ())
$verify_logged_user = true ;
else
$verify_logged_user = false ;
if ( has_access ( 'allow_video_upload' , false , $verify_logged_user ))
{
2014-09-23 12:07:50 +00:00
2013-10-07 12:17:06 +00:00
$file_name = time () . RandomString ( 5 );
assign ( 'file_name' , $file_name );
$step = 1 ;
2014-03-18 06:13:35 +00:00
/* if ( ! empty ( $_POST )){
foreach ( $_POST as $key => $value ) {
echo " { $key } : " ;
dump (( $value ));
}
} */
2013-10-07 12:17:06 +00:00
if ( isset ( $_POST [ 'submit_data' ]))
{
$Upload -> validate_video_upload_form ();
if ( empty ( $eh -> error_list ))
{
$step = 2 ;
}
}
if ( isset ( $_POST [ 'submit_upload' ]))
{
2014-03-18 06:13:35 +00:00
2013-10-07 12:17:06 +00:00
if ( ! $_POST [ 'file_name' ])
$_POST [ 'file_name' ] = time () . RandomString ( 5 );
{
2015-01-22 13:53:20 +00:00
$file_directory = create_dated_folder ( NULL , $_REQUEST [ 'time_stamp' ]);
2013-10-07 12:17:06 +00:00
$vid = $Upload -> submit_upload ();
$Upload -> do_after_video_upload ( $vid );
2015-07-30 14:23:37 +00:00
/**
* Function used to get direct URL of YT video on Embed Upload
*/
2015-10-28 12:07:58 +00:00
if ( defined ( 'YT_CLIP_INSTALLED' ) )
2015-07-30 14:23:37 +00:00
{
get_direct_url_embed_upload ( $vid );
}
2015-01-22 12:00:05 +00:00
echo ' < div class = " alert alert-success embed_video " >
Video has been Embeded succesfully ..
</ div > ' ;
2013-10-07 12:17:06 +00:00
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' ));
2015-10-07 10:12:10 +00:00
}
else
2013-10-07 12:17:06 +00:00
{
$userquery -> logincheck ( 'allow_video_upload' , true );
}
Assign ( 'step' , $step );
2014-03-26 08:19:12 +00:00
Assign ( 'extensions' , $Cbucket -> get_extensions ());
2013-10-07 12:17:06 +00:00
subtitle ( lang ( 'upload' ));
//Displaying The Template
2015-10-07 10:12:10 +00:00
if ( ! userid () )
{
echo '<div id="notlogged_err" class="container alert alert-danger">You must login to be able to upload content. Login if you have account or register</div>' ;
}
else
{
template_files ( 'upload.html' );
}
2013-10-07 12:17:06 +00:00
display_it ();
?>