当前位置: 首页>>代码示例>>PHP>>正文


PHP Video::Insert方法代码示例

本文整理汇总了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();
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:setup_data.php

示例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();
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:import_video.php

示例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&amp;set_id=%2$d">%9$s %5$s</a> - <a href="video.php?model_id=%1$d&amp;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 
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:video_view.php


注:本文中的Video::Insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。