本文整理汇总了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 {