本文整理匯總了PHP中Video::Approve方法的典型用法代碼示例。如果您正苦於以下問題:PHP Video::Approve方法的具體用法?PHP Video::Approve怎麽用?PHP Video::Approve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Video
的用法示例。
在下文中一共展示了Video::Approve方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlspecialchars
$data['private_url'] = '';
$private_url = Video::GeneratePrivate();
}
// Validate status
if (!empty($_POST['status']) && !ctype_space($_POST['status'])) {
$data['status'] = htmlspecialchars(trim($_POST['status']));
} else {
$errors['status'] = 'Invalid status';
}
// Update video if no errors were made
if (empty($errors)) {
// Perform addional actions based on status change
if ($data['status'] != $video->status) {
// Handle "Approve" action
if ($data['status'] == 'approved') {
$video->Approve('approve');
} else {
if ($data['status'] == 'banned') {
Flag::FlagDecision($video->video_id, 'video', true);
}
}
}
$video->Update($data);
$message = 'Video has been updated.';
$message_type = 'success';
} else {
$message = 'The following errors were found. Please correct them and try again.';
$message .= '<br /><br /> - ' . implode('<br /> - ', $errors);
$message_type = 'error';
}
}
示例2: Exception
if (!file_exists($thumb) || filesize($thumb) == 0) {
throw new Exception("The video thumbnail is invalid. The id of the video is: {$video->video_id}");
}
/////////////////////////////////////////////////////////////
// STEP 7 //
// Update Video Information //
/////////////////////////////////////////////////////////////
// Debug Log
$config->debug_conversion ? App::Log(CONVERSION_LOG, "\nUpdating video information...") : null;
// Update database with new video status information
$data['duration'] = $duration[0];
Plugin::Trigger('encode.before_update');
$video->Update($data);
Plugin::Trigger('encode.update');
// Activate video
$video->Approve('activate');
/////////////////////////////////////////////////////////////
// STEP 8 //
// Clean up //
/////////////////////////////////////////////////////////////
try {
// Debug Log
$config->debug_conversion ? App::Log(CONVERSION_LOG, 'Deleting raw video...') : null;
### Delete raw videos & pre-faststart files
Filesystem::Open();
Filesystem::Delete($raw_video);
Filesystem::Delete($mobile_temp);
### Delete encoding log files
if ($config->debug_conversion) {
App::Log(CONVERSION_LOG, "Video ID: {$video->video_id}, has completed processing!\n");
} else {