本文整理匯總了PHP中Video::Delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Video::Delete方法的具體用法?PHP Video::Delete怎麽用?PHP Video::Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Video
的用法示例。
在下文中一共展示了Video::Delete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Delete
/**
* Delete a record
* @param integer $id ID of record to be deleted
* @return void Record is deleted from database
*/
static function Delete($id)
{
App::LoadClass('Privacy');
App::LoadClass('Avatar');
App::LoadClass('Video');
App::LoadClass('Subscription');
App::LoadClass('Rating');
App::LoadClass('Flag');
App::LoadClass('Favorite');
App::LoadClass('Comment');
App::LoadClass('Post');
App::LoadClass('Message');
$db = Database::GetInstance();
$user = new self($id);
Plugin::Trigger('user.delete');
// Delete Avatar
if (!empty($user->avatar)) {
Avatar::Delete($user->avatar);
}
// Delete Privacy Record
$privacy_id = Privacy::Exist(array('user_id' => $id));
Privacy::Delete($privacy_id);
// Delete Comments
$query = "SELECT comment_id FROM " . DB_PREFIX . "comments WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Comment::Delete($row->comment_id);
}
// Delete Ratings
$query = "SELECT rating_id FROM " . DB_PREFIX . "ratings WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Rating::Delete($row->rating_id);
}
// Delete Favorites
$query = "SELECT fav_id FROM " . DB_PREFIX . "favorites WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Favorite::Delete($row->fav_id);
}
// Delete Flags
$query = "SELECT flag_id FROM " . DB_PREFIX . "flags WHERE id = {$id} AND type = 'user'";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Flag::Delete($row->flag_id);
}
// Delete Subscriptions
$query = "SELECT sub_id FROM " . DB_PREFIX . "subscriptions WHERE user_id = {$id} OR member = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Subscription::Delete($row->sub_id);
}
// Delete Posts
$query = "SELECT post_id FROM " . DB_PREFIX . "posts WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Post::Delete($row->post_id);
}
// Delete Messages
$query = "SELECT message_id FROM " . DB_PREFIX . "messages WHERE user_id = {$id} OR recipient = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Message::Delete($row->message_id);
}
// Delete Videos
$query = "SELECT video_id FROM " . DB_PREFIX . "videos WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Video::Delete($row->video_id);
}
// Delete Privacy
$query = "SELECT privacy_id FROM " . DB_PREFIX . "privacy WHERE user_id = {$id}";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
Privacy::Delete($row->privacy_id);
}
// Delete User
$query = "DELETE FROM " . DB_PREFIX . self::$table . " WHERE " . self::$id_name . " = {$id}";
$db->Query($query);
}
示例2: header
$Video->setSet($Set);
} else {
header('location:index.php');
exit;
}
}
if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'VideoView') {
$Video->setFileName(Utils::NullIfEmpty($_POST['txtFilename']));
$Video->setFileExtension(Utils::NullIfEmpty($_POST['txtFileExtension']));
$Video->setFileSize(intval($_POST['txtFilesize']));
$Video->setFileCheckSum(Utils::NullIfEmpty($_POST['txtFileChecksum']));
$Video->setFileCRC32(Utils::NullIfEmpty($_POST['txtFileCRC32']));
$tags = Tag::GetTagArray($_POST['txtTags']);
if ($Video->getID()) {
if ($DeleteVideo) {
if (Video::Delete($Video, $CurrentUser)) {
header('location:' . $ReturnURL);
exit;
}
} else {
if (Video::Update($Video, $CurrentUser)) {
Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID(), NULL);
header('location:' . $ReturnURL);
exit;
}
}
} else {
if (Video::Insert($Video, $CurrentUser)) {
Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID());
header('location:' . $ReturnURL);
exit;
示例3: User
// Establish page variables, objects, arrays, etc
View::InitView('myvideos');
Plugin::Trigger('myvideos.start');
Functions::RedirectIf(View::$vars->logged_in = User::LoginCheck(), HOST . '/login/');
View::$vars->user = new User(View::$vars->logged_in);
$records_per_page = 9;
$url = HOST . '/myaccount/myvideos';
View::$vars->message = null;
/***********************
Handle Form if submitted
***********************/
if (isset($_GET['vid']) && is_numeric($_GET['vid'])) {
$data = array('user_id' => View::$vars->user->user_id, 'video_id' => $_GET['vid']);
$video_id = Video::Exist($data);
if ($video_id) {
Video::Delete($video_id);
View::$vars->message = Language::GetText('success_video_deleted');
View::$vars->message_type = 'success';
Plugin::Trigger('myvideos.delete_video');
}
}
// Retrieve total count
$query = "SELECT video_id FROM " . DB_PREFIX . "videos WHERE user_id = " . View::$vars->user->user_id . " AND status = 'approved'";
$result_count = $db->Query($query);
$total = $db->Count($result_count);
// Initialize pagination
View::$vars->pagination = new Pagination($url, $total, $records_per_page);
$start_record = View::$vars->pagination->GetStartRecord();
// Retrieve limited results
$query .= " LIMIT {$start_record}, {$records_per_page}";
View::$vars->result = $db->Query($query);
示例4: array
$url = ADMIN . '/videos.php';
$query_string = array();
$categories = array();
$message = null;
$sub_header = null;
// Retrieve Category names
$query = "SELECT cat_id, cat_name FROM " . DB_PREFIX . "categories";
$result = $db->Query($query);
while ($row = $db->FetchObj($result)) {
$categories[$row->cat_id] = $row->cat_name;
}
### Handle "Delete" video if requested
if (!empty($_GET['delete']) && is_numeric($_GET['delete'])) {
// Validate video id
if (Video::Exist(array('video_id' => $_GET['delete']))) {
Video::Delete($_GET['delete']);
$message = 'Video has been deleted';
$message_type = 'success';
}
} else {
if (!empty($_GET['feature']) && is_numeric($_GET['feature'])) {
// Validate video id
if (Video::Exist(array('video_id' => $_GET['feature'], 'featured' => 0))) {
$video = new Video($_GET['feature']);
$video->Update(array('featured' => 1));
$message = 'Video has been featured';
$message_type = 'success';
}
} else {
if (!empty($_GET['unfeature']) && is_numeric($_GET['unfeature'])) {
// Validate video id
示例5: PageContent
// page vars
$page_title = "";
$id = $_REQUEST['id'];
// id required
if ($id == "") {
header("Location:mainpage.php");
exit;
}
// if form was submitted
if ($_POST['commit'] == "Cancel") {
header("Location:video_list.php");
exit;
}
if ($_POST['commit'] == "Delete Video") {
$objVideo = new Video();
$objVideo->Delete($id);
header("Location:video_list.php");
exit;
}
$objVideo = new Video($id);
include "includes/pagetemplate.php";
function PageContent()
{
global $objVideo;
global $id;
?>
<div class="layout laymidwidth">
<?php
$aLabels = array();