user_info["user_id"]==0) { $page = "error"; $smarty->assign('error_header', 11010601); $smarty->assign('error_message', $error_message); $smarty->assign('error_submit', 11010602); include "footer.php"; } // CREATE VIDEO OBJECT $video = new se_video($user->user_info['user_id'], $video_id); // SET RESULT AND ERROR VARS $result = FALSE; $is_error = 0; $show_uploader = 1; $file_result = array(); $max_uploads = 1; if( $task=="doupload" ) { // mail("leprakhauns@gmail.com", "RRR", $video_id); $isAjax = $_POST['isAjax']; $file_result = Array(); // WORKAROUND FOR FLASH UPLOADER if($_FILES['file1']['type'] == "application/octet-stream" && $isAjax) { $file_types = explode(",", str_replace(" ", "", strtolower($user->level_info['level_album_mimes']))); $_FILES['file1']['type'] = $file_types[0]; } for( $f=1; $f<=$max_uploads; $f++ ) { $fileid = "file".$f; if( empty($_FILES[$fileid]['name'])) continue; $file_result[$fileid] = $video->intro_upload("file1"); $file_result[$fileid]['file_name'] = $file_result[$fileid]['name'] = $_FILES[$fileid]['name']; if( !$file_result[$fileid]['is_error'] ) { $file_result[$fileid]['message'] = 1000086; $result = TRUE; } else { $file_result[$fileid]['message'] = $file_result[$fileid]['is_error']; } SE_Language::_preload($file_result[$fileid]['message']); } // OUTPUT JSON RESULT if( $isAjax ) { SE_Language::load(); if( $result ) { $result = "success"; $size = sprintf(SE_Language::_get($file_result['file1']['message']), $file_result['file1']['name']); $error = null; } else { $result = "failure"; $error = sprintf(SE_Language::_get($file_result['file1']['message']), $file_result['file1']['name']); $size = null; } if(!headers_sent()) { header('Content-type: application/json'); } echo json_encode(array('result' => $result, 'error' => $error, 'size' => $size)); //exit(); } // SHOW PAGE WITH RESULTS else { $show_uploader = FALSE; } if( !$file_result['file1']['is_error'] ) { $task = "uploaded"; //header("Location: introuploadframe.php"); //exit(); } else { $task = "uploaded"; $is_error = $file_result['file1']['is_error']; } $task = "uploaded"; } // DO UPLOAD PAGE STUFF if( $task=="upload" ) { // GET MAX FILESIZE ALLOWED // START NEW SESSION AND SET SESSION VARS FOR UPLOADER // Backwards compatibility with $video->video_info['video_id'], 'task' => 'doupload'); $smarty->assign('show_uploader', $show_uploader); $smarty->assign('session_id', session_id()); $smarty->assign('upload_token', $_SESSION['upload_token']); $smarty->assign('file_result', $file_result); $smarty->assign('inputs', $inputs); $smarty->assign('allowed_exts', str_replace(",", ", ", $user->level_info['level_video_exts'])); // SET UPLOADER PARAMS $smarty->assign('user_upload_max_files', 1); $smarty->assign('user_upload_max_size', $user->level_info['level_video_maxsize']); $smarty->assign('user_upload_allowed_extensions', $user->level_info['level_video_exts']); } // GET LIST OF FRIENDS FOR SUGGEST BOX $total_friends = $user->user_friend_total(0); $file_result = array(); $smarty->assign('user_upload_max_files', 1); $friends = $user->user_friend_list(0, $total_friends, 0); $smarty->assign('user_upload_max_size', $user->level_info['level_video_maxsize']); $smarty->assign('user_upload_allowed_extensions', $user->level_info['level_video_exts']); // ASSIGN SMARTY VARS AND INCLUDE FOOTER $smarty->assign('is_error', $is_error); $smarty->assign('submitted', $submitted); $smarty->assign('task', $task); $inputs = Array('video_id' => $video->video_info['video_id'], 'task' => 'doupload'); $smarty->assign_by_ref('friends', $friends); $smarty->assign('inputs', $inputs); $smarty->assign('to_user', $to_user); $smarty->assign('to_id', $to_id); $smarty->assign('subject', $subject); $smarty->assign('message', $message); include "footer.php"; ?>