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


PHP Video::Filter方法代码示例

本文整理汇总了PHP中Video::Filter方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::Filter方法的具体用法?PHP Video::Filter怎么用?PHP Video::Filter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Video的用法示例。


在下文中一共展示了Video::Filter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: VideoSearchParameters

$Video = NULL;
$Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, FALSE, FALSE, $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, $ModelID));
$Dates = Date::GetDates(new DateSearchParameters(FALSE, FALSE, FALSE, FALSE, $ModelID));
if ($Sets) {
    if ($Sets[0]->getModel()->getFirstName() == 'VIP') {
        usort($Sets, array('Set', 'CompareAsc'));
    }
    /* @var $Set Set */
    foreach ($Sets as $Set) {
        $SetCount++;
        if (!$Model) {
            $Model = $Set->getModel();
        }
        $DatesThisSet = Date::FilterDates($Dates, NULL, $ModelID, $Set->getID());
        $Video = Video::Filter($Videos, $ModelID, $Set->getID());
        if ($Video) {
            $Video = $Video[0];
        }
        $DatesOutput = '';
        if ($DatesThisSet) {
            $DatesOutput = '<ul>';
            /* @var $date Date */
            foreach ($DatesThisSet as $date) {
                $DatesOutput .= sprintf("<li>%1\$s (%2\$s)</li>", date($CurrentUser->getDateFormat(), $date->getTimeStamp()), $date->getDateKind() == DATE_KIND_VIDEO ? 'V' : ($date->getDateKind() == DATE_KIND_IMAGE ? 'P' : '?'));
            }
            $DatesOutput .= '</ul>';
        }
        $SetRows .= sprintf("<div class=\"SetThumbGalItem\">\n\t\t\t<h3 class=\"Hidden\">%1\$s %13\$s %2\$s</h3>\n\t\t\t\n\t\t\t<div class=\"SetThumbImageWrapper\">\n\t\t\t%27\$s\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"SetThumbDataWrapper\">\n\t\t\t<ul>\n\t\t\t<li>%14\$s: %3\$s</li>\n\t\t\t<li>%15\$s: %2\$s</li>\n\t\t\t<li>%16\$s %9\$s</li>\n\t\t\t<li%11\$s>%17\$s: %4\$d</li>\n\t\t\t<li%12\$s>%18\$s: %5\$d</li>\n\t\t\t</ul>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"SetThumbButtonWrapper\">\n\t\t\t%28\$s\n\t\t\t%29\$s\n\t\t\t%30\$s\n\t\t\t%31\$s\n\t\t\t%32\$s\n\t\t\t%33\$s\n\t\t\t<a href=\"image.php?model_id=%8\$d&amp;set_id=%6\$d\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" title=\"%25\$s\" alt=\"%25\$s\"/></a>\n\t\t\t<a href=\"video.php?model_id=%8\$d&amp;set_id=%6\$d\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" title=\"%26\$s\" alt=\"%26\$s\"/></a>\n\t\t\t</div>\n\t\t\t\n\t\t\t</div>\n\t\t\t\n\t\t\t%10\$s", htmlentities($Model->GetFullName()), htmlentities($Set->getName()), htmlentities($Set->getPrefix()), $Set->getAmountPicsInDB(), $Set->getAmountVidsInDB(), $Set->getID(), COMMAND_DELETE, $Model->getID(), $DatesOutput, $SetCount % 3 == 0 ? "<div class=\"Clear\"></div>" : NULL, $Set->getSetIsDirtyPic() ? " class=\"Dirty\"" : NULL, $Set->getSetIsDirtyVid() ? " class=\"Dirty\"" : NULL, strtolower($lang->g('NavigationSet')), $lang->g('LabelPrefix'), $lang->g('LabelName'), $lang->g('LabelDates'), $lang->g('NavigationImages'), $lang->g('NavigationVideos'), $lang->g('LabelEditSet'), $lang->g('LabelDeleteSet'), $lang->g('ButtonImportImages'), $lang->g('ButtonImportVideos'), $lang->g('LabelDownloadImages'), $lang->g('LabelDownloadVideos'), $lang->g('LabelViewImages'), $lang->g('LabelViewVideos'), $Video && $Set->getContainsWhat() == SET_CONTENT_VIDEO ? sprintf("<a href=\"video.php?model_id=%1\$d&amp;set_id=%2\$d\">" . "<img src=\"download_image.php?video_id=%6\$d&amp;landscape_only=true&amp;width=225&amp;height=150\" height=\"150\" alt=\"%3\$s %4\$s %5\$s\" title=\"%3\$s %4\$s %5\$s\" />" . "</a>", $Model->getID(), $Set->getID(), htmlentities($Model->GetFullName()), strtolower($lang->g('NavigationSet')), htmlentities($Set->getName()), $Video->getID()) : sprintf("<a href=\"image.php?model_id=%1\$d&amp;set_id=%2\$d\">" . "<img src=\"download_image.php?set_id=%2\$d&amp;landscape_only=true&amp;width=225&amp;height=150\" height=\"150\" alt=\"%3\$s %4\$s %5\$s\" title=\"%3\$s %4\$s %5\$s\" />" . "</a>", $Model->getID(), $Set->getID(), htmlentities($Model->GetFullName()), strtolower($lang->g('NavigationSet')), htmlentities($Set->getName())), $CurrentUser->hasPermission(RIGHT_SET_EDIT) ? sprintf("<a href=\"set_view.php?model_id=%1\$d&amp;set_id=%2\$d\"><img src=\"images/button_edit.png\" width=\"16\" height=\"16\" title=\"%3\$s\" alt=\"%3\$s\"/></a>", $ModelID, $Set->getID(), $lang->g('LabelEditSet')) : sprintf("<a href=\"#\"><img src=\"images/button_edit_invalid.png\" width=\"16\" height=\"16\" title=\"%1\$s\" alt=\"%1\$s\"/></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_SET_DELETE) ? sprintf("<a href=\"set_view.php?model_id=%1\$d&amp;set_id=%2\$d&amp;cmd=%4\$s\"><img src=\"images/button_delete.png\" width=\"16\" height=\"16\" title=\"%3\$s\" alt=\"%3\$s\"/></a>", $ModelID, $Set->getID(), $lang->g('LabelDeleteSet'), COMMAND_DELETE) : sprintf("<a href=\"#\"><img src=\"images/button_delete_invalid.png\" width=\"16\" height=\"16\" title=\"%1\$s\" alt=\"%1\$s\"/></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_IMAGE_ADD) ? sprintf("<a href=\"import_image.php?model_id=%1\$d&amp;set_id=%2\$d\"><img src=\"images/button_upload.png\" width=\"16\" height=\"16\" alt=\"%3\$s\" title=\"%3\$s\" /></a>", $ModelID, $Set->getID(), $lang->g('ButtonImportImages')) : sprintf("<a href=\"#\"><img src=\"images/button_upload_invalid.png\" width=\"16\" height=\"16\" alt=\"%1\$s\" title=\"%1\$s\" /></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_VIDEO_ADD) ? sprintf("<a href=\"import_video.php?model_id=%1\$d&amp;set_id=%2\$d\"><img src=\"images/button_upload.png\" width=\"16\" height=\"16\" alt=\"%3\$s\" title=\"%3\$s\" /></a>", $ModelID, $Set->getID(), $lang->g('ButtonImportVideos')) : sprintf("<a href=\"#\"><img src=\"images/button_upload_invalid.png\" width=\"16\" height=\"16\" alt=\"%1\$s\" title=\"%1\$s\" /></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_EXPORT_ZIP) ? sprintf("<a href=\"download_zip.php?model_id=%1\$d&amp;set_id=%2\$d\"><img src=\"images/button_download.png\" width=\"16\" height=\"16\" alt=\"%3\$s\" title=\"%3\$s\" /></a>", $ModelID, $Set->getID(), $lang->g('LabelDownloadImages')) : sprintf("<a href=\"#\"><img src=\"images/button_download_invalid.png\" width=\"16\" height=\"16\" title=\"%1\$s\" alt=\"%1\$s\"/></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_EXPORT_VIDEO) ? sprintf("<a href=\"download_vid.php?set_id=%1\$d\"><img src=\"images/button_download.png\" width=\"16\" height=\"16\" title=\"%2\$s\" alt=\"%2\$s\"/></a>", $Set->getID(), $lang->g('LabelDownloadVideo')) : sprintf("<a href=\"#\"><img src=\"images/button_download_invalid.png\" width=\"16\" height=\"16\" title=\"%1\$s\" alt=\"%1\$s\"/></a>", $lang->g('LabelNotAllowed')));
    }
} else {
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:set.php

示例2: foreach

 /* @var $FileInfo SplFileInfo */
 foreach ($itArray as $FileInfo) {
     if (isset($argv) && $argc > 0) {
         $bi->Next();
     }
     if ($FileInfo->isFile() && $FileInfo->isReadable()) {
         $setnamematch = preg_match('/(?P<Prefix>[A-Z]+[_ -])?(?P<Name>[A-Z0-9]+)(?P<Number>\\d\\d)(?P<Suffix>[a-z])?\\.(?P<Extension>[^.]+)$/i', $FileInfo->getFilename(), $matches);
         if (isset($matches) && count($matches) > 0) {
             $Set = Set::Filter($Sets, $Model->getID(), NULL, $matches['Name'] . $matches['Number'], $matches['Prefix']);
             if (!$Set) {
                 continue;
             } else {
                 $Set = $Set[0];
             }
             /* @var $VideoInDB 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);
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:import_video.php

示例3: foreach

         $Image2Process->setFileSize((int) $Image->attributes()->filesize);
         $Image2Process->setFileCheckSum((string) $Image->attributes()->checksum);
         $Image2Process->setFileCRC32((string) $Image->attributes()->crc32);
         if ($Image2Process->getID()) {
             Image::Update($Image2Process, $CurrentUser);
         } else {
             Image::Insert($Image2Process, $CurrentUser);
         }
         $imagetags = Tag::GetTagArray((string) $Image->attributes()->tags);
         $Tag2AllThisImage = Tag2All::Filter($Tag2AllThisSet, NULL, $Model2Process->getID(), $Set2Process->getID(), $Image2Process->getID(), NULL);
         Tag2All::HandleTags($imagetags, $Tag2AllThisImage, $TagsInDB, $CurrentUser, $Model2Process->getID(), $Set2Process->getID(), $Image2Process->getID(), NULL, FALSE);
     }
 }
 if ($Set->Videos) {
     foreach ($Set->Videos->Video as $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);
开发者ID:laiello,项目名称:candydolldb,代码行数:31,代码来源:setup_data.php


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