本文整理汇总了PHP中Album::getShow方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::getShow方法的具体用法?PHP Album::getShow怎么用?PHP Album::getShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::getShow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prefix
$albumidlist .= ' OR ';
$albumids .= ' OR ';
}
$albumidlist .= prefix('images') . '.albumid=' . $ID;
$albumids .= '`id`=' . $ID;
$i++;
}
if (!empty($albumlist)) {
$albumids = ' AND (' . $albumids . ')';
$albumidlist = ' AND (' . $albumidlist . ')';
}
}
if (isset($_GET['propagate_unpublished'])) {
foreach ($albumlist as $albumname) {
$album = new Album($gallery, $albumname);
if (!$album->getShow()) {
unpublishSubalbums($album);
}
}
}
$mtime = dateTimeConvert($requestdate, true);
$sql = "SELECT `folder`, `id` FROM " . prefix('albums') . ' WHERE `show`="0"' . $albumids;
$result = query_full_array($sql);
if (is_array($result)) {
foreach ($result as $row) {
$publish_albums_list[$row['folder']] = $row['id'];
}
}
$sql = 'SELECT `filename`, ' . prefix('images') . '.id as id, folder FROM ' . prefix('images') . ',' . prefix('albums') . ' WHERE ' . prefix('images') . '.show="0" AND ' . prefix('images') . '.mtime < "' . $mtime . '" AND ' . prefix('albums') . '.id=' . prefix('images') . '.albumid' . $albumidlist;
$result = query_full_array($sql);
if (is_array($result)) {
示例2: getSitemapAlbumList
/**
*
* Enter description here ...
* @param object $obj the starting point
* @param array $albumlist the container for the results
* @param string $gateway name of validation function
*/
function getSitemapAlbumList($obj, &$albumlist, $gateway)
{
global $_zp_gallery;
$locallist = $obj->getAlbums();
foreach ($locallist as $folder) {
$album = new Album($_zp_gallery, $folder);
if ($album->getShow() && $gateway($album)) {
$albumlist[] = array('folder' => $album->name, 'date' => $album->getDateTime(), 'title' => $album->getTitle());
getSitemapAlbumList($album, $albumlist, $gateway);
}
}
}
示例3: getAlbumThumbImage
/**
* Gets the album's set thumbnail image from the database if one exists,
* otherwise, finds the first image in the album or sub-album and returns it
* as an Image object.
*
* @return Image
*/
function getAlbumThumbImage()
{
if (!is_null($this->albumthumbnail)) {
return $this->albumthumbnail;
}
$albumdir = $this->localpath;
$thumb = $this->get('thumb');
$i = strpos($thumb, '/');
if ($root = $i === 0) {
$thumb = substr($thumb, 1);
// strip off the slash
$albumdir = ALBUM_FOLDER_SERVERPATH;
}
$shuffle = empty($thumb);
$field = getOption('AlbumThumbSelectField');
$direction = getOption('AlbumThumbSelectDirection');
if (!empty($thumb) && !is_numeric($thumb) && file_exists($albumdir . internalToFilesystem($thumb))) {
if ($i === false) {
return newImage($this, $thumb);
} else {
$pieces = explode('/', $thumb);
$i = count($pieces);
$thumb = $pieces[$i - 1];
unset($pieces[$i - 1]);
$albumdir = implode('/', $pieces);
if (!$root) {
$albumdir = $this->name . "/" . $albumdir;
} else {
$albumdir = $albumdir . "/";
}
$this->albumthumbnail = newImage(new Album($this->gallery, $albumdir), $thumb);
return $this->albumthumbnail;
}
} else {
$this->getImages(0, 0, $field, $direction);
$thumbs = $this->images;
if (!is_null($thumbs)) {
if ($shuffle) {
shuffle($thumbs);
}
$mine = $this->isMyItem(LIST_RIGHTS);
$other = NULL;
while (count($thumbs) > 0) {
// first check for images
$thumb = array_shift($thumbs);
$thumb = newImage($this, $thumb);
if ($mine || $thumb->getShow()) {
if (isImagePhoto($thumb)) {
// legitimate image
$this->albumthumbnail = $thumb;
return $this->albumthumbnail;
} else {
if (!is_null($thumb->objectsThumb)) {
// "other" image with a thumb sidecar
$this->albumthumbnail = $thumb;
return $this->albumthumbnail;
} else {
if (is_null($other)) {
$other = $thumb;
}
}
}
}
}
if (!is_null($other)) {
// "other" image, default thumb
$this->albumthumbnail = $other;
return $this->albumthumbnail;
}
}
}
// Otherwise, look in sub-albums.
$subalbums = $this->getAlbums();
if (!is_null($subalbums)) {
if ($shuffle) {
shuffle($subalbums);
}
while (count($subalbums) > 0) {
$folder = array_pop($subalbums);
$subalbum = new Album($this->gallery, $folder);
$pwd = $subalbum->getPassword();
if ($subalbum->getShow() && empty($pwd) || $subalbum->isMyItem(LIST_RIGHTS)) {
$thumb = $subalbum->getAlbumThumbImage();
if (strtolower(get_class($thumb)) !== 'transientimage' && $thumb->exists) {
$this->albumthumbnail = $thumb;
return $thumb;
}
}
}
}
$nullimage = SERVERPATH . '/' . ZENFOLDER . '/images/imageDefault.png';
if (OFFSET_PATH == 0) {
// check for theme imageDefault.png if we are in the gallery
//.........这里部分代码省略.........
示例4: getAlbumThumbImage
/**
* Gets the album's set thumbnail image from the database if one exists,
* otherwise, finds the first image in the album or sub-album and returns it
* as an Image object.
*
* @return Image
*/
function getAlbumThumbImage()
{
if (!is_null($this->albumthumbnail)) {
return $this->albumthumbnail;
}
$albumdir = $this->localpath;
$thumb = $this->get('thumb');
$i = strpos($thumb, '/');
if ($root = $i === 0) {
$thumb = substr($thumb, 1);
// strip off the slash
$albumdir = getAlbumFolder();
}
$shuffle = $thumb != '1';
if (!empty($thumb) && $thumb != '1' && file_exists($albumdir . UTF8ToFilesystem($thumb))) {
if ($i === false) {
return newImage($this, $thumb);
} else {
$pieces = explode('/', $thumb);
$i = count($pieces);
$thumb = $pieces[$i - 1];
unset($pieces[$i - 1]);
$albumdir = implode('/', $pieces);
if (!$root) {
$albumdir = $this->name . "/" . $albumdir;
} else {
$albumdir = $albumdir . "/";
}
$this->albumthumbnail = newImage(new Album($this->gallery, $albumdir), $thumb);
return $this->albumthumbnail;
}
} else {
if ($this->isDynamic()) {
$this->getImages(0, 0, 'ID', 'DESC');
$thumbs = $this->images;
if (!is_null($thumbs)) {
if ($shuffle) {
shuffle($thumbs);
}
while (count($thumbs) > 0) {
$thumb = array_shift($thumbs);
if (is_valid_image($thumb['filename'])) {
$alb = new Album($this->gallery, $thumb['folder']);
$thumb = newImage($alb, $thumb['filename']);
if ($thumb->getShow()) {
$this->albumthumbnail = $thumb;
return $thumb;
}
}
}
}
} else {
$this->getImages(0, 0, 'ID', 'DESC');
$thumbs = $this->images;
if (!is_null($thumbs)) {
if ($shuffle) {
shuffle($thumbs);
}
while (count($thumbs) > 0) {
$thumb = array_shift($thumbs);
if (is_valid_image($thumb)) {
$thumb = newImage($this, $thumb);
if ($thumb->getShow()) {
$this->albumthumbnail = $thumb;
return $thumb;
}
}
}
}
// Otherwise, look in sub-albums.
$subalbums = $this->getSubAlbums();
if (!is_null($subalbums)) {
if ($shuffle) {
shuffle($subalbums);
}
while (count($subalbums) > 0) {
$folder = array_pop($subalbums);
$subalbum = new Album($this->gallery, $folder);
$pwd = $subalbum->getPassword();
if ($subalbum->getShow() && empty($pwd) || isMyALbum($folder, ALL_RIGHTS)) {
$thumb = $subalbum->getAlbumThumbImage();
if (strtolower(get_class($thumb)) !== 'transientimage' && $thumb->exists) {
$this->albumthumbnail = $thumb;
return $thumb;
}
}
}
}
//jordi-kun - no images, no subalbums, check for videos
$dp = opendir($albumdir);
while ($thumb = readdir($dp)) {
if (is_file($albumdir . $thumb) && is_valid_video($thumb)) {
$othersThumb = checkObjectsThumb($albumdir, $thumb);
//.........这里部分代码省略.........