本文整理汇总了PHP中Video::Create方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::Create方法的具体用法?PHP Video::Create怎么用?PHP Video::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Video
的用法示例。
在下文中一共展示了Video::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$aDropFieldTypes = array();
array_push($aDropFields, 'image_file_drop');
array_push($aDropFieldTypes, 'image');
// if form was submitted:
if ($_POST['commit'] == "Cancel") {
header("Location:video_list.php");
exit;
}
if ($_POST['commit'] == "Save Video") {
if ($id == 0) {
// add the listing
$objVideo = new Video();
$objVideo->Title = $_REQUEST["title"];
$objVideo->Summary = $_REQUEST["summary"];
$objVideo->VideoEmbed = $_REQUEST["video_embed"];
$objVideo->Create();
$objVideo->HandleFileUploads();
$objVideo->HandleDropFileUploads($aDropFields[0], 'ImageFile');
// redirect to listing list
header("Location:video_list.php");
exit;
} else {
$objVideo = new Video($_REQUEST["id"]);
$objVideo->Title = $_REQUEST["title"];
$objVideo->Summary = $_REQUEST["summary"];
$objVideo->VideoEmbed = $_REQUEST["video_embed"];
$objVideo->Update();
$objVideo->HandleFileUploads();
$objVideo->HandleDropFileUploads($aDropFields[0], 'ImageFile');
// redirect to listing list
header("Location:video_list.php");
示例2: htmlspecialchars
// Validate private
if (!empty($_POST['private']) && $_POST['private'] == '1') {
View::$vars->data['private'] = '1';
if (!empty($_POST['private_url']) && strlen($_POST['private_url']) == 7 && !Video::Exist(array('private_url' => $_POST['private_url']))) {
View::$vars->data['private_url'] = htmlspecialchars(trim($_POST['private_url']));
View::$vars->private_url = View::$vars->data['private_url'];
} else {
View::$vars->errors['private_url'] = Language::GetText('error_private_url');
}
} else {
View::$vars->data['private'] = '0';
}
// Validate Video Upload last (only if other fields were valid)
if (empty(View::$vars->errors)) {
View::$vars->data['user_id'] = View::$vars->user->user_id;
View::$vars->data['filename'] = Video::CreateFilename();
View::$vars->data['status'] = 'new';
Plugin::Trigger('upload.before_create_video');
$_SESSION['upload'] = Video::Create(View::$vars->data);
Plugin::Trigger('upload.create_video');
header('Location: ' . HOST . '/myaccount/upload/video/');
exit;
} else {
View::$vars->message = Language::GetText('errors_below');
View::$vars->message .= '<br /><br /> - ' . implode('<br /> - ', View::$vars->errors);
View::$vars->message_type = 'error';
}
}
// Output page
Plugin::Trigger('upload.before_render');
View::Render('myaccount/upload.tpl');
示例3: basename
$private_url = $data['private_url'];
} else {
$errors['private_url'] = 'Invalid private URL';
}
} else {
$data['private'] = '0';
}
// Update video if no errors were made
if (empty($errors)) {
// Create record
$data['user_id'] = $admin->user_id;
$data['original_extension'] = Functions::GetExtension($data['upload']['temp']);
$data['filename'] = basename($data['upload']['temp'], '.' . $data['original_extension']);
unset($data['upload']);
$data['status'] = 'pending conversion';
$id = Video::Create($data);
// Begin encoding
$cmd_output = $config->debug_conversion ? CONVERSION_LOG : '/dev/null';
$converter_cmd = 'nohup ' . $php_path . ' ' . DOC_ROOT . '/cc-core/system/encode.php --video="' . $id . '" >> ' . $cmd_output . ' &';
exec($converter_cmd);
// Output message
$message = 'Video has been created.';
$message_type = 'success';
unset($data);
} else {
$message = 'The following errors were found. Please correct them and try again.';
$message .= '<br /><br /> - ' . implode('<br /> - ', $errors);
$message_type = 'error';
}
}
// Output Header