本文整理汇总了PHP中Image::GetImages方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::GetImages方法的具体用法?PHP Image::GetImages怎么用?PHP Image::GetImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::GetImages方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
}
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;
}
$SetsThisModel = Set::Filter($Sets, $Model->getID());
if ($SetsThisModel) {
/* @var $Set Set */
foreach ($SetsThisModel as $Set) {
$ImagesThisSet = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, $Set->getID(), FALSE, $Model->getID()));
if ($ImagesThisSet) {
/* @var $Image Image */
foreach ($ImagesThisSet as $Image) {
if (Utils::_empty($Image->getFileCRC32())) {
continue;
}
printf("%1\$s,%2\$s,%3\$s,\\%4\$s\\,%5\$s%6\$s", $Image->getExportFilename(), $Image->getFileSize(), $Image->getFileCRC32(), str_replace(CANDYPATH . DIRECTORY_SEPARATOR, '', dirname($Image->getFilenameOnDisk())), $x <= $commentcount - 1 ? $commentarray[$x] . "," : NULL, PHP_EOL);
$x++;
}
}
$VideosThisSet = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, $Set->getID(), FALSE, $Model->getID()));
if ($VideosThisSet) {
/* @var $Video Video */
foreach ($VideosThisSet as $Video) {
if (Utils::_empty($Video->getFileCRC32())) {
示例2: ini_set
include 'cd.php';
ini_set('max_execution_time', '3600');
$CurrentUser = Authentication::Authenticate();
if (!$CurrentUser->hasPermission(RIGHT_IMAGE_ADD) && !$CurrentUser->hasPermission(RIGHT_IMAGE_EDIT)) {
$e = new Error(RIGHTS_ERR_USERNOTALLOWED);
Error::AddError($e);
HTMLstuff::RefererRedirect();
}
$ModelID = Utils::SafeIntFromQS('model_id');
$SetID = Utils::SafeIntFromQS('set_id');
$CacheImages = array();
$CacheImage = NULL;
$Models = Model::GetModels(new ModelSearchParameters(is_null($ModelID) ? FALSE : $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(is_null($SetID) ? FALSE : $SetID));
$Images = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, is_null($ModelID) ? FALSE : $ModelID));
$CacheImages = CacheImage::GetCacheImages();
if ($SetID && $Sets) {
$Set = $Sets[0];
$Models = array($Set->getModel());
}
/* @var $Model Model */
for ($i = 0; $i < count($Models); $i++) {
$Model = $Models[$i];
$CacheImage = CacheImage::Filter($CacheImages, NULL, $Model->getID());
CacheImage::DeleteMulti($CacheImage, $CurrentUser);
$CacheImage = CacheImage::Filter($CacheImages, NULL, NULL, $Model->getID());
CacheImage::DeleteMulti($CacheImage, $CurrentUser);
$ImageFolder = sprintf('%1$s/%2$s', CANDYPATH, $Model->GetFullName());
if (!file_exists($ImageFolder)) {
continue;
示例3: array_key_exists
$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);
}
if ($SelectedImageIDs) {
header(sprintf('location:download_zip.php?image_ids=%1$s&usesub=%2$s', join(',', $SelectedImageIDs), $UseSubfoldersInDownload ? 'true' : 'false'));
exit;
}
}
}
示例4: array
HTMLstuff::RefererRedirect();
}
$ImageID = Utils::SafeIntFromQS('image_id');
$VideoID = Utils::SafeIntFromQS('video_id');
$SetID = Utils::SafeIntFromQS('set_id');
$ModelIndexID = Utils::SafeIntFromQS('index_id');
$ModelID = Utils::SafeIntFromQS('model_id');
$Width = Utils::SafeIntFromQS('width');
$Height = Utils::SafeIntFromQS('height');
$DeleteSetsImages = Utils::SafeBoolFromQS('deleteimages');
$DeleteSetsVideos = Utils::SafeBoolFromQS('deletevideos');
$CacheImages = array();
$MultipleImageIDs = NULL;
$MultipleVideoIDs = NULL;
if (!is_null($SetID) && $DeleteSetsImages) {
$imagesThisSet = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, $SetID));
/* @var $im Image */
foreach ($imagesThisSet as $im) {
$MultipleImageIDs[] = $im->getID();
}
$cisp = new CacheImageSearchParameters(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, is_null($MultipleImageIDs) ? FALSE : $MultipleImageIDs);
if ($cisp->getValues()) {
$CacheImages = array_merge($CacheImages, CacheImage::GetCacheImages($cisp));
}
}
if (!is_null($SetID) && $DeleteSetsVideos) {
$videosThisSet = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, $SetID));
/* @var $vd Video */
foreach ($videosThisSet as $vd) {
$MultipleVideoIDs[] = $vd->getID();
}
示例5: foreach
if (!$Date->getID()) {
Date::Insert($Date, $CurrentUser);
}
}
foreach ($Set2Process->getDatesVid() as $Date) {
$dateInDb = Date::FilterDates($DatesThisModel, NULL, NULL, $Set2Process->getID(), DATE_KIND_VIDEO, $Date->getTimeStamp());
if ($dateInDb) {
$dateInDb = $dateInDb[0];
$Date->setID($dateInDb->getID());
}
if (!$Date->getID()) {
Date::Insert($Date, $CurrentUser);
}
}
if ($Set->Images) {
$ImagesInDb = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, $Set2Process->getID()));
foreach ($Set->Images->Image as $Image) {
$ImageInDb = Image::Filter($ImagesInDb, $Model2Process->getID(), $Set2Process->getID(), (string) $Image->attributes()->name);
if ($ImageInDb) {
$ImageInDb = $ImageInDb[0];
}
/* @var $Image2Process Image */
$Image2Process = $ImageInDb ? $ImageInDb : new Image();
$Image2Process->setSet($Set2Process);
$Image2Process->setFileName((string) $Image->attributes()->name);
$Image2Process->setFileExtension((string) $Image->attributes()->extension);
$Image2Process->setImageHeight((int) $Image->attributes()->height);
$Image2Process->setImageWidth((int) $Image->attributes()->width);
$Image2Process->setFileSize((int) $Image->attributes()->filesize);
$Image2Process->setFileCheckSum((string) $Image->attributes()->checksum);
$Image2Process->setFileCRC32((string) $Image->attributes()->crc32);
示例6: CacheImageSearchParameters
Image::OutputImage($filename, $Width, $Height, TRUE, $CacheImage->getFilenameOnDisk());
} else {
Image::OutputImage();
}
} else {
Image::OutputImage();
}
}
} else {
if ($ImageID) {
$CacheImage = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, $ImageID, FALSE, FALSE, FALSE, $Width, $Height));
if ($CacheImage) {
$CacheImage = $CacheImage[0];
Image::OutputImage($CacheImage->getFilenameOnDisk(), $CacheImage->getImageWidth(), $CacheImage->getImageHeight(), TRUE);
} else {
$Image = Image::GetImages(new ImageSearchParameters($ImageID));
if ($Image) {
$Image = $Image[0];
$Set = $Image->getSet();
$Model = $Set->getModel();
if (file_exists($Image->getFilenameOnDisk())) {
$CacheImage = new CacheImage();
$CacheImage->setImageID($ImageID);
$CacheImage->setKind(CACHEIMAGE_KIND_IMAGE);
$CacheImage->setImageWidth($Width);
$CacheImage->setImageHeight($Height);
CacheImage::Insert($CacheImage, $CurrentUser);
Image::OutputImage($Image->getFilenameOnDisk(), $Width, $Height, TRUE, $CacheImage->getFilenameOnDisk());
} else {
Image::OutputImage();
}
示例7: GetFileFromDisk
/**
* Returns a random image-filename of the current model.
* @return string|NULL
*/
public function GetFileFromDisk($PortraitOnly = FALSE, $LandscapeOnly = FALSE, $SetID = FALSE)
{
$folderPath = sprintf('%1$s/%2$s', CANDYPATH, $this->GetFullName());
if (!file_exists($folderPath)) {
return NULL;
}
$orderClause = sprintf('RAND()');
$limitClause = sprintf('1');
$Images = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, $this->getID(), FALSE, FALSE, $PortraitOnly, $LandscapeOnly), $orderClause, $limitClause);
if (!$Images) {
/* Work-around for returning at least ONE image when none fit the specified aspect ratio */
$Images = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, is_null($SetID) ? FALSE : $SetID, FALSE, $this->getID()), $orderClause, $limitClause);
}
if ($Images) {
$Image = $Images[0];
return $Image->getFilenameOnDisk();
} else {
return NULL;
}
}
示例8: isset
HTMLstuff::RefererRedirect();
}
$ModelID = Utils::SafeIntFromQS('model_id');
$IndexID = Utils::SafeIntFromQS('index_id');
$ModelID = isset($IndexID) ? $IndexID : $ModelID;
$finalWidth = Utils::SafeIntFromQS('width');
$finalWidth = $finalWidth ? $finalWidth : 1200;
$finalHeight = Utils::SafeIntFromQS('height');
$finalHeight = $finalHeight ? $finalHeight : 1800;
$perPage = Utils::SafeIntFromQS('perpage');
$promptDownload = Utils::SafeBoolFromQS('download');
$outputMode = EXPORT_OPTION_IMAGE;
if (array_key_exists('output', $_GET) && in_array($_GET['output'], array(EXPORT_OPTION_SERIALIZE, EXPORT_OPTION_IMAGE, EXPORT_OPTION_ZIP))) {
$outputMode = intval($_GET['output']);
}
$Images = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, FALSE, FALSE, $ModelID));
$Sets = Set::GetSets(new SetSearchParameters(FALSE, FALSE, $ModelID));
$Model = $Sets ? $Sets[0]->getModel() : NULL;
if (!$Sets || in_array($Sets[0]->getModel()->getFullName(), array('Promotions', 'Interviews'))) {
Image::OutputImage();
}
$pageIterator = 1;
$perPage = $perPage && $perPage > 0 ? $perPage : count($Sets);
$uuid = Utils::UUID();
$cacheImages = array();
while (($pageIterator - 1) * $perPage < count($Sets)) {
$Sets2Process = array_slice($Sets, ($pageIterator - 1) * $perPage, $perPage);
$img = GenerateModelIndex($Sets2Process, $Images, $finalWidth, $finalHeight);
if (is_null($img)) {
$img = imagecreatefromjpeg($pathPrefix . 'images/missing.jpg');
}
示例9: SetSearchParameters
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));
$Total = count(Video::GetVideos($vsp));
break;
}
$TotalPages = ceil($Total / $max_results);
if ($ToShow) {
switch ($searchMode) {
case "MODEL":
foreach ($ToShow as $Model) {
示例10: foreach
$MainImage = $Images[0];
$Model = $MainImage->getSet()->getModel();
foreach ($Sets as $Set) {
$zip->addEmptyDir(sprintf('%1$s/%2$s%3$s', $Model->GetFullName(), $Set->getPrefix(), $Set->getName()));
foreach (Image::Filter($Images, NULL, $Set->getID()) as $Image) {
if (!file_exists($Image->getFilenameOnDisk())) {
continue;
}
$zip->addFile($Image->getFilenameOnDisk(), sprintf('%1$s/%2$s%3$s/%4$s.%5$s', $Model->GetFullName(), $Set->getPrefix(), $Set->getName(), $Image->getFileName(), $Image->getFileExtension()));
}
}
$finalFile = sprintf('%1$s.zip', $Model->GetFullName());
}
} else {
if ($ImageIDs) {
$Images = Image::GetImages(new ImageSearchParameters(FALSE, $ImageIDs));
foreach ($Images as $Image) {
if (!file_exists($Image->getFilenameOnDisk())) {
continue;
}
$zip->addFile($Image->getFilenameOnDisk(), sprintf($UseSubfolders ? '%1$s/%2$s%3$s/%4$s.%5$s' : '%4$s.%5$s', $Image->getSet()->getModel()->GetFullName(), $Image->getSet()->getPrefix(), $Image->getSet()->getName(), $Image->getFileName(), $Image->getFileExtension()));
}
}
}
}
}
$zip->close();
}
if (file_exists($tmpFile)) {
Utils::DownloadZip($tmpFile, $finalFile, TRUE);
} else {
示例11: XmlOutputModel
function XmlOutputModel($Model, $TaggedOnly)
{
global $xmlw, $Sets, $Dates, $Tag2Alls, $IncludeImages, $IncludeVideos;
$xmlw->startElement('Model');
$xmlw->writeAttribute('firstname', $Model->getFirstName());
$xmlw->writeAttribute('lastname', $Model->getLastName());
$xmlw->writeAttribute('birthdate', $Model->getBirthdate() > 0 ? date('Y-m-d', $Model->getBirthdate()) : NULL);
$TagsThisModel = Tag2All::Filter($Tag2Alls, NULL, $Model->getID(), FALSE, FALSE, FALSE);
$TagsThisModelOnly = Tag2All::Filter($TagsThisModel, NULL, $Model->getID(), NULL, NULL, NULL);
$xmlw->writeAttribute('tags', Tag2All::Tags2AllCSV($TagsThisModelOnly));
$SetsThisModel = Set::Filter($Sets, $Model->getID());
if ($SetsThisModel) {
$xmlw->startElement('Sets');
$DatesThisModel = Date::FilterDates($Dates, NULL, $Model->getID());
if ($Model->getFirstName() == 'VIP') {
usort($SetsThisModel, array('Set', 'CompareASC'));
}
foreach ($SetsThisModel as $Set) {
$PicDatesThisSet = Date::FilterDates($DatesThisModel, NULL, NULL, $Set->getID(), DATE_KIND_IMAGE);
$VidDatesThisSet = Date::FilterDates($DatesThisModel, NULL, NULL, $Set->getID(), DATE_KIND_VIDEO);
$TagsThisSet = Tag2All::Filter($TagsThisModel, NULL, $Model->getID(), $Set->getID(), NULL, NULL);
$xmlw->startElement('Set');
if ($Model->getFirstName() == 'VIP' && !is_numeric($Set->getName())) {
$xmlw->writeAttribute('name', sprintf('SP_%1$s', $Set->getName()));
} else {
$xmlw->writeAttribute('name', $Set->getName());
}
$xmlw->writeAttribute('date_pic', Date::FormatDates($PicDatesThisSet, 'Y-m-d', FALSE, ' '));
$xmlw->writeAttribute('date_vid', Date::FormatDates($VidDatesThisSet, 'Y-m-d', FALSE, ' '));
$xmlw->writeAttribute('tags', Tag2All::Tags2AllCSV($TagsThisSet));
if ($IncludeImages) {
$ImagesThisSet = Image::GetImages(new ImageSearchParameters(FALSE, FALSE, $Set->getID(), FALSE, $Model->getID()));
if ($ImagesThisSet) {
$xmlw->startElement('Images');
/* @var $Image Image */
foreach ($ImagesThisSet as $Image) {
$TagsThisImage = Tag2All::Filter($TagsThisModel, NULL, $Model->getID(), $Set->getID(), $Image->getID(), NULL);
if ($TaggedOnly === TRUE && $TagsThisImage || $TaggedOnly === FALSE) {
$xmlw->startElement('Image');
$xmlw->writeAttribute('name', $Image->getFileName());
$xmlw->writeAttribute('extension', $Image->getFileExtension());
$xmlw->writeAttribute('filesize', $Image->getFileSize());
$xmlw->writeAttribute('height', $Image->getImageHeight());
$xmlw->writeAttribute('width', $Image->getImageWidth());
$xmlw->writeAttribute('checksum', $Image->getFileCheckSum());
$xmlw->writeAttribute('crc32', $Image->getFileCRC32());
$xmlw->writeAttribute('tags', Tag2All::Tags2AllCSV($TagsThisImage));
$xmlw->endElement();
}
}
$xmlw->endElement();
$xmlw->flush();
ob_flush();
flush();
unset($ImagesThisSet);
}
}
if ($IncludeVideos) {
$VideosThisSet = Video::GetVideos(new VideoSearchParameters(FALSE, FALSE, $Set->getID(), FALSE, $Model->getID()));
if ($VideosThisSet) {
$xmlw->startElement('Videos');
/* @var $Video Video */
foreach ($VideosThisSet as $Video) {
$TagsThisVideo = Tag2All::Filter($TagsThisModel, NULL, $Model->getID(), $Set->getID(), NULL, $Video->getID());
if ($TaggedOnly === TRUE && $TagsThisVideo || $TaggedOnly === FALSE) {
$xmlw->startElement('Video');
$xmlw->writeAttribute('name', $Video->getFileName());
$xmlw->writeAttribute('extension', $Video->getFileExtension());
$xmlw->writeAttribute('filesize', $Video->getFileSize());
$xmlw->writeAttribute('checksum', $Video->getFileCheckSum());
$xmlw->writeAttribute('crc32', $Video->getFileCRC32());
$xmlw->writeAttribute('tags', Tag2All::Tags2AllCSV($TagsThisVideo));
$xmlw->endElement();
}
}
$xmlw->endElement();
$xmlw->flush();
ob_flush();
flush();
unset($VideosThisSet);
}
}
$xmlw->endElement();
}
$xmlw->endElement();
$xmlw->flush();
ob_flush();
flush();
if ($Model->getRemarks()) {
$xmlw->startElement('Remarks');
$xmlw->text($Model->getRemarks());
$xmlw->endElement();
}
}
$xmlw->endElement();
$xmlw->flush();
ob_flush();
flush();
}