本文整理匯總了PHP中Video::Insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Video::Insert方法的具體用法?PHP Video::Insert怎麽用?PHP Video::Insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Video
的用法示例。
在下文中一共展示了Video::Insert方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Video
$VideoInDb = Video::Filter($VideosInDb, $Model2Process->getID(), $Set2Process->getID(), (string) $Video->attributes()->name);
if ($VideoInDb) {
$VideoInDb = $VideoInDb[0];
}
/* @var $Video2Process Video */
$Video2Process = $VideoInDb ? $VideoInDb : new Video();
$Video2Process->setSet($Set2Process);
$Video2Process->setFileName((string) $Video->attributes()->name);
$Video2Process->setFileExtension((string) $Video->attributes()->extension);
$Video2Process->setFileSize((int) $Video->attributes()->filesize);
$Video2Process->setFileCheckSum((string) $Video->attributes()->checksum);
$Video2Process->setFileCRC32((string) $Video->attributes()->crc32);
if ($Video2Process->getID()) {
Video::Update($Video2Process, $CurrentUser);
} else {
Video::Insert($Video2Process, $CurrentUser);
}
$videotags = Tag::GetTagArray((string) $Video->attributes()->tags);
$Tag2AllThisVideo = Tag2All::Filter($Tag2AllThisSet, NULL, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID());
Tag2All::HandleTags($videotags, $Tag2AllThisVideo, $TagsInDB, $CurrentUser, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID(), FALSE);
}
}
}
}
if ($fileToProcess != 'setup_data.xml') {
unlink(realpath($fileToProcess));
}
$infoSuccess = new Info($lang->g('MessageXMLImported'));
Info::AddInfo($infoSuccess);
if (isset($argv) && $argc > 0) {
$bi->Finish();
示例2: Video
$VideosInDB = Video::Filter($Videos, $ModelID, $Set->getID(), $matches['Name'] . $matches['Number'] . $matches['Suffix']);
if ($VideosInDB) {
$VideoInDB = $VideosInDB[0];
$cis = CacheImage::Filter($CacheImages, NULL, NULL, NULL, NULL, NULL, $VideoInDB->getID());
CacheImage::DeleteMulti($cis, $CurrentUser);
} else {
$VideoInDB = new Video();
$VideoInDB->setSet($Set);
}
$VideoInDB->setFileName($matches['Prefix'] . $matches['Name'] . $matches['Number'] . $matches['Suffix']);
$VideoInDB->setFileExtension($matches['Extension']);
$VideoInDB->setFileSize($FileInfo->getSize());
$VideoInDB->setFileCheckSum(Utils::CalculateMD5($FileInfo->getRealPath()));
$VideoInDB->setFileCRC32(Utils::CalculateCRC32($FileInfo->getRealPath()));
if (!$VideoInDB->getID() && $CurrentUser->hasPermission(RIGHT_VIDEO_ADD)) {
Video::Insert($VideoInDB, $CurrentUser);
} else {
if ($CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) {
Video::Update($VideoInDB, $CurrentUser);
}
}
}
}
}
$infoSuccess = new Info($lang->g('MessageVideosImported'));
Info::AddInfo($infoSuccess);
if (isset($argv) && $argc > 0) {
$bi->Finish();
}
}
HTMLstuff::RefererRedirect();
示例3: header
$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;
}
}
}
echo HTMLstuff::HtmlHeader(sprintf('%1$s - %2$s %3$s - %4$s', $Model->GetShortName(TRUE), $lang->g('NavigationSet'), $Set->getName(), $lang->g('NavigationVideos')), $CurrentUser);
?>
<h2><?php
echo sprintf('<a href="index.php">%7$s</a> - <a href="model_view.php?model_id=%1$d">%4$s</a> - <a href="set.php?model_id=%1$d">%8$s</a> - <a href="set_view.php?model_id=%1$d&set_id=%2$d">%9$s %5$s</a> - <a href="video.php?model_id=%1$d&set_id=%2$d">%10$s</a> - %6$s', $ModelID, $SetID, $VideoID, htmlentities($Model->GetShortName(TRUE)), htmlentities($Set->getName()), htmlentities($Video->getFileName()), $lang->g('NavigationHome'), $lang->g('NavigationSets'), $lang->g('NavigationSet'), $lang->g('NavigationVideos'));
?>
</h2>
<form action="<?php