本文整理汇总了PHP中Set::GetSets方法的典型用法代码示例。如果您正苦于以下问题:PHP Set::GetSets方法的具体用法?PHP Set::GetSets怎么用?PHP Set::GetSets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Set
的用法示例。
在下文中一共展示了Set::GetSets方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ini_set
<?php
include 'cd.php';
ini_set('max_execution_time', '3600');
$CurrentUser = Authentication::Authenticate();
if (!$CurrentUser->hasPermission(RIGHT_VIDEO_ADD) && !$CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) {
$e = new Error(RIGHTS_ERR_USERNOTALLOWED);
Error::AddError($e);
HTMLstuff::RefererRedirect();
}
$ModelID = Utils::SafeIntFromQS('model_id');
$SetID = Utils::SafeIntFromQS('set_id');
$Models = Model::GetModels(new ModelSearchParameters(is_null($ModelID) ? FALSE : $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(is_null($SetID) ? FALSE : $SetID));
$Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ModelID) ? FALSE : $ModelID));
$CacheImages = CacheImage::GetCacheImages();
if ($SetID) {
$Set = $Sets[0];
$Models = array($Set->getModel());
}
/* @var $Model Model */
for ($i = 0; $i < count($Models); $i++) {
$Model = $Models[$i];
$VideoFolder = sprintf('%1$s/%2$s', CANDYPATH, $Model->GetFullName());
if (!file_exists($VideoFolder)) {
continue;
}
/* @var $it RecursiveIteratorIterator */
$it = new RecursiveDirectoryIterator($VideoFolder, FileSystemIterator::SKIP_DOTS | FileSystemIterator::CURRENT_AS_FILEINFO);
$itArray = array();
foreach ($it as $file) {
示例2: array_key_exists
$ModelsOptions = NULL;
$SetsOptions = NULL;
$ImagesOptions = NULL;
$ButtonText = $lang->g('ButtonNext');
$Models = Model::GetModels();
$UseSubfoldersInDownload = array_key_exists('chkSubfolders', $_POST) && isset($_POST['chkSubfolders']);
if (array_key_exists('hidAction', $_POST) && $_POST['hidAction'] == 'DownloadMulti') {
$ModelsOptions = NULL;
$SetsOptions = NULL;
$SelectedModelIDs = array_key_exists('selModels', $_POST) ? Utils::SafeInts($_POST['selModels']) : array();
/* @var $Model Model */
foreach ($Models as $Model) {
$ModelsOptions .= sprintf("<option value=\"%1\$d\"%3\$s>%2\$s</option>", $Model->getID(), htmlentities($Model->GetFullName()), in_array($Model->getID(), $SelectedModelIDs) ? ' selected="selected"' : NULL);
}
if ($SelectedModelIDs) {
$Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, FALSE, $SelectedModelIDs));
$SelectedSetIDs = array_key_exists('selSets', $_POST) ? Utils::SafeInts($_POST['selSets']) : array();
/* @var $Set Set */
foreach ($Sets as $Set) {
$SetsOptions .= sprintf("<option value=\"%1\$d\"%5\$s>%2\$s - %3\$s%4\$s</option>", $Set->getID(), htmlentities($Set->getModel()->GetFullName()), htmlentities($Set->getPrefix()), htmlentities($Set->getName()), in_array($Set->getID(), $SelectedSetIDs) ? ' selected="selected"' : NULL);
}
if ($SelectedSetIDs) {
$Images = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, FALSE, $SelectedSetIDs));
$SelectedImageIDs = array_key_exists('selImages', $_POST) ? Utils::SafeInts($_POST['selImages']) : array();
$ButtonText = $lang->g('ButtonDownload');
/* @var $Image Image */
foreach ($Images as $Image) {
if (!in_array($Image->getSet()->getModel()->getID(), $SelectedModelIDs)) {
continue;
}
$ImagesOptions .= sprintf("<option value=\"%1\$d\"%7\$s>%2\$s - %5\$s.%6\$s</option>", $Image->getID(), htmlentities($Image->getSet()->getModel()->GetFullName()), htmlentities($Image->getSet()->getPrefix()), htmlentities($Image->getSet()->getName()), htmlentities($Image->getFileName()), htmlentities($Image->getFileExtension()), in_array($Image->getID(), $SelectedImageIDs) ? ' selected="selected"' : NULL);
示例3: ini_set
<?php
include 'cd.php';
ini_set('max_execution_time', '3600');
ob_start();
$CurrentUser = Authentication::Authenticate();
if (!$CurrentUser->hasPermission(RIGHT_EXPORT_CSV)) {
$e = new Error(RIGHTS_ERR_USERNOTALLOWED);
Error::AddError($e);
HTMLstuff::RefererRedirect();
}
$ModelID = Utils::SafeIntFromQS('model_id');
$includepath = Utils::SafeIntFromQS('includepath');
$includepath = in_array($includepath, array(EXPORT_PATH_OPTION_NONE, EXPORT_PATH_OPTION_RELATIVE, EXPORT_PATH_OPTION_FULL)) ? $includepath : EXPORT_PATH_OPTION_NONE;
$Models = Model::GetModels(new ModelSearchParameters(is_NULL($ModelID) ? FALSE : $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, is_null($ModelID) ? FALSE : $ModelID));
$outfile = 'CandyDollDB.csv';
if ($ModelID && count($Models) > 0) {
$Model = $Models[0];
$outfile = sprintf('CandyDollDB %1$s.csv', $Model->GetFullName());
}
header(sprintf('Content-type: %1$s', Utils::GetMime('csv')));
header(sprintf('Content-Disposition: attachment; filename="%1$s"', $outfile));
$commentarray = array(sprintf("Generated by CandyDollDB v%1\$s on %2\$s at %3\$s", CANDYDOLLDB_VERSION, date('Y-m-d'), date('H:i;s')), sprintf("Author: %1\$s", $CurrentUser->getUserName()), "Project website: https://code.google.com/p/candydolldb/");
$commentcount = count($commentarray);
$x = 0;
/* @var $Model Model */
foreach ($Models as $Model) {
if ($ModelID && $Model->getID() !== $ModelID) {
continue;
}
示例4: CacheImageSearchParameters
$CacheImage->setImageHeight($Height);
CacheImage::Insert($CacheImage, $CurrentUser);
}
Image::OutputImage($imagefileondisk, $Width, $Height, TRUE, $imagefileondisk ? $CacheImage->getFilenameOnDisk() : NULL);
} else {
Image::OutputImage();
}
}
} else {
if ($SetID) {
$CacheImage = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $SetID, FALSE, FALSE, FALSE, FALSE, FALSE, $Width, $Height));
if ($CacheImage) {
$CacheImage = $CacheImage[0];
Image::OutputImage($CacheImage->getFilenameOnDisk(), $CacheImage->getImageWidth(), $CacheImage->getImageHeight(), TRUE);
} else {
$Set = Set::GetSets(new SetSearchParameters($SetID));
if ($Set) {
$Set = $Set[0];
if ($Set->getModel()->getFirstName() == 'VIP' && preg_match('/^[0-9]{2,3}$/i', $Set->getName())) {
Image::OutputImage();
}
$imagefileondisk = $Set->getModel()->GetFileFromDisk($PortraitOnly, $LandscapeOnly, $Set->getID());
if ($imagefileondisk) {
$CacheImage = new CacheImage();
$CacheImage->setSetID($SetID);
$CacheImage->setKind(CACHEIMAGE_KIND_SET);
$CacheImage->setImageWidth($Width);
$CacheImage->setImageHeight($Height);
CacheImage::Insert($CacheImage, $CurrentUser);
}
Image::OutputImage($imagefileondisk, $Width, $Height, TRUE, $imagefileondisk ? $CacheImage->getFilenameOnDisk() : NULL);
示例5: header
<?php
include 'cd.php';
$CurrentUser = Authentication::Authenticate();
HTMLstuff::RefererRegister($_SERVER['REQUEST_URI']);
$ModelID = Utils::SafeIntFromQS('model_id');
if (!isset($ModelID)) {
header('location:index.php');
exit;
}
$Model = NULL;
$SetRows = '';
$SetCount = 0;
$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];
示例6: SimpleXMLElement
$TagsInDB = Tag::GetTags();
if (array_key_exists('file', $_GET) && isset($_GET['file'])) {
$fileToProcess = $_GET['file'];
}
if (isset($argv) && $argc > 0) {
if (file_exists(sprintf('%1$s/%2$s', dirname($_SERVER['PHP_SELF']), $fileToProcess))) {
$XmlFromFile = new SimpleXMLElement(file_get_contents(sprintf('%1$s/%2$s', dirname($_SERVER['PHP_SELF']), $fileToProcess)));
}
} else {
if (file_exists($fileToProcess)) {
$XmlFromFile = new SimpleXMLElement(file_get_contents($fileToProcess));
}
}
if ($XmlFromFile) {
$ModelsInDb = Model::GetModels();
$SetsInDb = Set::GetSets();
$DatesInDb = Date::GetDates();
$VideosInDb = Video::GetVideos();
if (isset($argv) && $argc > 0) {
$bi = new BusyIndicator(count($XmlFromFile->Model), 0);
}
foreach ($XmlFromFile->Model as $Model) {
if (isset($argv) && $argc > 0) {
$bi->Next();
}
$ModelInDb = Model::Filter($ModelsInDb, NULL, (string) $Model->attributes()->firstname, (string) $Model->attributes()->lastname);
if ($ModelInDb) {
$ModelInDb = $ModelInDb[0];
}
/* @var $Model2Process Model */
$Model2Process = $ModelInDb ? $ModelInDb : new Model();
示例7: VideoSearchParameters
$Videos = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, $SetID, FALSE, $ModelID));
if ($Videos) {
/* @var $Video Video */
foreach ($Videos as $Video) {
$VideoCount++;
if (!$Set) {
$Set = $Video->getSet();
}
if (!$Model) {
$Model = $Set->getModel();
}
$VideoRows .= sprintf("\n<tr class=\"Row%10\$d\">" . "<td>%17\$s</td>" . "<td class=\"Center\">%5\$s</td>" . "<td class=\"Center\">%6\$s</td>" . "<td><code>%7\$s</code></td>" . "<td><code>%14\$s</code></td>" . "<td class=\"Center\">%15\$s</td>" . "<td class=\"Center\"><a href=\"download_image.php?video_id=%1\$d&width=800&height=600\" rel=\"lightbox-thumb\" title=\"Thumbnails of %4\$s\"><img src=\"images/button_view.png\" width=\"16\" height=\"16\" alt=\"Thumbnails of %4\$s\" /></a></td>" . "<td class=\"Center\">%16\$s</td>" . "</tr>", $Video->getID(), $Set->getID(), $Model->getID(), htmlentities($Video->getFileName()), htmlentities($Video->getFileExtension()), Utils::ReadableFilesize($Video->getFileSize()), htmlentities($Video->getFileCheckSum()), NULL, COMMAND_DELETE, $VideoCount % 2 == 0 ? 2 : 1, $lang->g('LabelDownloadVideo'), $lang->g('ButtonDelete'), $lang->g('LabelDeleteVideo'), $Video->getFileCRC32(), $CurrentUser->hasPermission(RIGHT_EXPORT_VIDEO) ? sprintf("<a href=\"download_vid.php?video_id=%1\$d\"><img src=\"images/button_download.png\" width=\"16\" height=\"16\" alt=\"%2\$s\" title=\"%2\$s\" /></a>", $Video->getID(), $Video->getFileName()) : sprintf("<a href=\"#\"><img src=\"images/button_download_invalid.png\" width=\"16\" height=\"16\" alt=\"%1\$s\" title=\"%1\$s\" /></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_VIDEO_DELETE) ? sprintf("<a href=\"video_view.php?model_id=%1\$d&set_id=%2\$d&video_id=%3\$d&cmd=%4\$s\" title=\"%5\$s\"><img src=\"images/button_delete.png\" width=\"16\" height=\"16\" alt=\"%5\$s\" /></a>", $ModelID, $SetID, $Video->getID(), COMMAND_DELETE, $lang->g('ButtonDelete')) : sprintf("<a href=\"#\"><img src=\"images/button_delete_invalid.png\" width=\"16\" height=\"16\" alt=\"%1\$s\" title=\"%1\$s\" /></a>", $lang->g('LabelNotAllowed')), $CurrentUser->hasPermission(RIGHT_VIDEO_EDIT) ? sprintf("<a href=\"video_view.php?model_id=%1\$d&set_id=%2\$d&video_id=%3\$d\">%4\$s</a>", $ModelID, $SetID, $Video->getID(), $Video->getFileName()) : sprintf("<a href=\"#\">%1\$s</a>", $Video->getFileName()));
}
}
if (!$Set) {
$Set = Set::GetSets(new SetSearchParameters($SetID, FALSE, $ModelID));
if ($Set) {
$Set = $Set[0];
$Model = $Set->getModel();
} else {
header('location:index.php');
exit;
}
}
echo HTMLstuff::HtmlHeader(sprintf('%1$s - %3$s %2$s - %4$s', $Model->GetShortName(TRUE), $Set->getName(), $lang->g('NavigationSet'), $lang->g('NavigationVideos')), $CurrentUser);
?>
<h2><?php
echo sprintf('<a href="index.php">%5$s</a> - <a href="model_view.php?model_id=%1$d">%3$s</a> - <a href="set.php?model_id=%1$d">%6$s</a> - <a href="set_view.php?model_id=%1$d&set_id=%2$d">%7$s %4$s</a> - %8$s', $ModelID, $SetID, htmlentities($Model->GetShortName(TRUE)), htmlentities($Set->getName()), $lang->g('NavigationHome'), $lang->g('NavigationSets'), $lang->g('NavigationSet'), $lang->g('NavigationVideos'));
?>
</h2>
示例8: ModelSearchParameters
break;
case 3:
$OrderClause = 'model_birthdate ' . $OrderMode . ', model_firstname ASC, model_lastname ASC';
break;
case 4:
$OrderClause = 'model_setcount ' . $OrderMode . ', model_firstname ASC, model_lastname ASC';
break;
case 5:
$OrderClause = 'model_firstset ' . $OrderMode . ', model_firstname ASC, model_lastname ASC';
break;
case 6:
$OrderClause = 'model_lastset ' . $OrderMode . ', model_firstname ASC, model_lastname ASC';
break;
}
$Models = Model::GetModels(new ModelSearchParameters(FALSE, FALSE, FALSE, FALSE, $SearchModel), $OrderClause);
$Sets = Set::GetSets();
if ($Models) {
/* @var $Model Model */
foreach ($Models as $Model) {
$SetPicCount = 0;
$SetVidCount = 0;
$DirtySetCount = 0;
$DirtySetPicCount = 0;
$DirtySetVidCount = 0;
$Dates = Date::GetDates(new DateSearchParameters(FALSE, FALSE, FALSE, FALSE, $Model->getID()));
if ($Dates) {
$datestart = Date::SmallestDate($Dates);
$datestartshow = date($CurrentUser->getDateFormat(), $datestart->getTimeStamp());
$dateend = Date::LargestDate($Dates);
$dateendshow = date($CurrentUser->getDateFormat(), $dateend->getTimeStamp());
} else {
示例9: switch
}
switch ($searchMode) {
case 'MODEL':
if (!$ModelIDsToShow) {
break;
}
$ToShow = Model::GetModels(new ModelSearchParameters(FALSE, $ModelIDsToShow), NULL, sprintf("%1\$d, %2\$d", $from, $max_results));
$Total = count(Model::GetModels(new ModelSearchParameters(FALSE, $ModelIDsToShow)));
break;
case 'SET':
if (!$SetIDsToShow || !$ModelIDsToShow) {
break;
}
$ssp = new SetSearchParameters(FALSE, $SetIDsToShow);
$ToShow = Set::GetSets($ssp, NULL, sprintf("%1\$d, %2\$d", $from, $max_results));
$Total = count(Set::GetSets($ssp));
break;
case 'IMAGE':
if (!$SetIDsToShow || !$ModelIDsToShow) {
break;
}
$isp = new ImageSearchParameters(FALSE, $ImageIDsToShow, FALSE, $SetIDsToShow, FALSE, FALSE, TRUE);
$ToShow = Image::GetImages($isp, NULL, sprintf("%1\$d, %2\$d", $from, $max_results));
$Total = count(Image::GetImages($isp));
break;
case 'VIDEO':
if (!$SetIDsToShow || !$ModelIDsToShow) {
break;
}
$vsp = new VideoSearchParameters(FALSE, $VideoIDsToShow, FALSE, $SetIDsToShow, FALSE, FALSE, TRUE);
$ToShow = Video::GetVideos($vsp, NULL, sprintf("%1\$d, %2\$d", $from, $max_results));
示例10: preg_replace
$result = preg_replace('/(VIP).+?([0-9]{2,3}).+?([0-9]{2,3})/i', '\\1\\2_\\1\\3', $vip);
if ($result) {
$vip = explode("_", $result);
$UpdatesPic .= $vip[0];
$UpdatesVid .= $vip[1];
} else {
$UpdatesPic += "WTF";
}
} else {
$i < $key + 4 ? $UpdatesPic .= str_replace(".", "", substr(strip_tags($lines[$i]), 4)) . "\n" : ($UpdatesVid .= str_replace(".", "", substr(strip_tags($lines[$i]), 4)) . "\n");
}
}
$UpdatesPic = preg_replace('/ Photo/i', '', $UpdatesPic);
$UpdatesVid = preg_replace('/ Movie/i', '', $UpdatesVid);
$Models = Model::GetModels(new ModelSearchParameters());
$Sets = Set::GetSets(new SetSearchParameters());
$Dates = Date::GetDates();
$Tag2Alls = Tag2All::GetTag2Alls();
//if(array_key_exists('date', $_GET))
//{
// $Date = strtotime($_GET['date']);
// { $Date = $Date === FALSE ? NULL : $Date; }
//}
if (!array_key_exists('hidAction', $_POST)) {
if (!is_null($Date) && $Date != -1) {
$DatesToShow = Date::FilterDates($Dates, NULL, NULL, NULL, NULL, $Date);
if ($DatesToShow) {
/* @var $d Date */
/* @var $m Model */
/* @var $s Set */
foreach ($DatesToShow as $d) {