本文整理汇总了PHP中SearchEngine::getImages方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchEngine::getImages方法的具体用法?PHP SearchEngine::getImages怎么用?PHP SearchEngine::getImages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchEngine
的用法示例。
在下文中一共展示了SearchEngine::getImages方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printGalleryTitle
?>
"><?php
printGalleryTitle();
?>
</a> |
<?php
}
printGalleryTitle();
?>
</a> |
<?php
if (is_null($_zp_current_album)) {
$search = new SearchEngine();
$params = trim(zp_getCookie('zenphoto_search_params'));
$search->setSearchParams($params);
$images = $search->getImages(0);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
echo '<a href=' . html_encode($returnpath) . '><em>' . gettext('Search') . '</em></a> | ';
} else {
printParentBreadcrumb();
printAlbumBreadcrumb("", " | ");
}
?>
</span>
Slideshow
</div> <!-- navbar -->
</div> <!-- wrapnav -->
示例2: printSlideShow
static function printSlideShow($heading = true, $speedctl = false, $albumobj = "", $imageobj = "", $width = "", $height = "")
{
if (!isset($_POST['albumid']) and !is_object($albumobj)) {
echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("Invalid linking to the slideshow page.") . "</h2></div>";
echo "</div></body></html>";
exit;
}
global $_zp_flash_player, $_zp_current_image, $_zp_current_album, $_zp_gallery;
//getting the image to start with
if (!empty($_POST['imagenumber']) and !is_object($imageobj)) {
$imagenumber = $_POST['imagenumber'] - 1;
// slideshows starts with 0, but zp with 1.
} elseif (is_object($imageobj)) {
makeImageCurrent($imageobj);
$imagenumber = imageNumber() - 1;
} else {
$imagenumber = 0;
}
// set pagenumber to 0 if not called via POST link
if (isset($_POST['pagenr'])) {
$pagenumber = sanitize_numeric($_POST['pagenr']);
} else {
$pagenumber = 0;
}
// getting the number of images
if (!empty($_POST['numberofimages'])) {
$numberofimages = sanitize_numeric($_POST['numberofimages']);
} elseif (is_object($albumobj)) {
$numberofimages = $albumobj->getNumImages();
}
//getting the album to show
if (!empty($_POST['albumid']) and !is_object($albumobj)) {
$albumid = sanitize_numeric($_POST['albumid']);
} elseif (is_object($albumobj)) {
$albumid = $albumobj->id;
} else {
$albumid = -1;
}
// setting the image size
if (!empty($width) and !empty($height)) {
$width = sanitize_numeric($width);
$height = sanitize_numeric($height);
} else {
$width = getOption("slideshow_width");
$height = getOption("slideshow_height");
}
$option = getOption("slideshow_mode");
// jQuery Cycle slideshow config
// get slideshow data
$gallery = new Gallery();
if ($albumid <= 0) {
// search page
$dynamic = 2;
$search = new SearchEngine();
$params = $_POST['preserve_search_params'];
$search->setSearchParams($params);
$images = $search->getImages(0);
$searchwords = $search->words;
$searchdate = $search->dates;
$searchfields = $search->fields;
$page = $search->page;
if (empty($_POST['imagenumber'])) {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . abs($albumid));
$album = new Album($gallery, $albumq['folder']);
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
//$returnpath = rewrite_path('/'.pathurlencode($album->name).'/page/'.$pagenumber,'/index.php?album='.urlencode($album->name).'&page='.$pagenumber);
} else {
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
}
$albumtitle = gettext('Search');
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$album = new Album($gallery, $albumq['folder']);
$albumtitle = $album->getTitle();
if (!checkAlbumPassword($albumq['folder'], $hint)) {
echo gettext("This album is password protected!");
exit;
}
$dynamic = $album->isDynamic();
$images = $album->getImages(0);
// return path to get back to the page we called the slideshow from
if (empty($_POST['imagenumber'])) {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/page/' . $pagenumber, '/index.php?album=' . urlencode($album->name) . '&page=' . $pagenumber);
} else {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/' . rawurlencode($_POST['imagefile']) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile']));
}
}
// slideshow display section
switch ($option) {
case "jQuery":
$validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp');
?>
<script type="text/javascript">
$(document).ready(function(){
$(function() {
var ThisGallery = '<?php
echo html_encode($albumtitle);
?>
';
var ImageList = new Array();
//.........这里部分代码省略.........
示例3: printSlideShow
/**
* Prints the slideshow using the {@link http://http://www.malsup.com/jquery/cycle/ jQuery plugin Cycle}
*
* Two ways to use:
* a) Use on your theme's slideshow.php page and called via printSlideShowLink():
* If called from image.php it starts with that image, called from album.php it starts with the first image (jQuery only)
* To be used on slideshow.php only and called from album.php or image.php.
*
* b) Calling directly via printSlideShow() function (jQuery mode)
* Place the printSlideShow() function where you want the slideshow to appear and set create an album object for $albumobj and if needed an image object for $imageobj.
* The controls are disabled automatically.
*
* NOTE: The jQuery mode does not support movie and audio files anymore. If you need to show them please use the Flash mode.
* Also note that this function is not used for the Colorbox mode!
*
* @param bool $heading set to true (default) to emit the slideshow breadcrumbs in flash mode
* @param bool $speedctl controls whether an option box for controlling transition speed is displayed
* @param obj $albumobj The object of the album to show the slideshow of. If set this overrides the POST data of the printSlideShowLink()
* @param obj $imageobj The object of the image to start the slideshow with. If set this overrides the POST data of the printSlideShowLink(). If not set the slideshow starts with the first image of the album.
* @param int $width The width of the images (jQuery mode). If set this overrides the size the slideshow_width plugin option that otherwise is used.
* @param int $height The heigth of the images (jQuery mode). If set this overrides the size the slideshow_height plugin option that otherwise is used.
* @param bool $crop Set to true if you want images cropped width x height (jQuery mode only)
* @param bool $shuffle Set to true if you want random (shuffled) order
* @param bool $linkslides Set to true if you want the slides to be linked to their image pages (jQuery mode only)
* @param bool $controls Set to true (default) if you want the slideshow controls to be shown (might require theme CSS changes if calling outside the slideshow.php page) (jQuery mode only)
*
*/
function printSlideShow($heading = true, $speedctl = false, $albumobj = NULL, $imageobj = NULL, $width = NULL, $height = NULL, $crop = false, $shuffle = false, $linkslides = false, $controls = true)
{
global $_myFavorites, $_zp_conf_vars;
if (!isset($_POST['albumid']) and !is_object($albumobj)) {
return '<div class="errorbox" id="message"><h2>' . gettext('Invalid linking to the slideshow page.') . '</h2></div>';
}
//getting the image to start with
if (!empty($_POST['imagenumber']) and !is_object($imageobj)) {
$imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
// slideshows starts with 0, but zp with 1.
} elseif (is_object($imageobj)) {
$imagenumber = $imageobj->getIndex();
} else {
$imagenumber = 0;
}
// set pagenumber to 0 if not called via POST link
if (isset($_POST['pagenr'])) {
$pagenumber = sanitize_numeric($_POST['pagenr']);
} else {
$pagenumber = 1;
}
// getting the number of images
if (!empty($_POST['numberofimages'])) {
$numberofimages = sanitize_numeric($_POST['numberofimages']);
} elseif (is_object($albumobj)) {
$numberofimages = $albumobj->getNumImages();
} else {
$numberofimages = 0;
}
if ($imagenumber < 2 || $imagenumber > $numberofimages) {
$imagenumber = 0;
}
//getting the album to show
if (!empty($_POST['albumid']) && !is_object($albumobj)) {
$albumid = sanitize_numeric($_POST['albumid']);
} elseif (is_object($albumobj)) {
$albumid = $albumobj->getID();
} else {
$albumid = 0;
}
if (isset($_POST['preserve_search_params'])) {
// search page
$search = new SearchEngine();
$params = sanitize($_POST['preserve_search_params']);
$search->setSearchParams($params);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
$albumobj = new AlbumBase(NULL, false);
$albumobj->setTitle(gettext('Search'));
$albumobj->images = $search->getImages(0);
} else {
if (isset($_POST['favorites_page'])) {
$albumobj = $_myFavorites;
$returnpath = $_myFavorites->getLink($pagenumber);
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$albumobj = newAlbum($albumq['folder']);
if (empty($_POST['imagenumber'])) {
$returnpath = $albumobj->getLink($pagenumber);
} else {
$image = newImage($albumobj, sanitize($_POST['imagefile']));
$returnpath = $image->getLink();
}
}
}
echo slideshow::getShow($heading, $speedctl, $albumobj, $imageobj, $width, $height, $crop, $shuffle, $linkslides, $controls, $returnpath, $imagenumber);
}
示例4: printGslideshow
/**
* Prints the Galleria slideshow for albums or search results.
*
* Two ways to use (see readme/documentation):
* a) Used on the included theme slideshow.php page and called via printSlideShowLink() from the core slideshow plugin:
* b) Calling directly via printGslideshow() function in a template file or codeblock.
*
* @param obj $albumobj The object of the album to show the slideshow of. Not needed if calling slideshow from album, image, or search.
* @param obj $imageobj The object of the image to start the slideshow with. If not set the slideshow starts with the first image of the album, or current image if called from image.php. Not needed if calling slideshow from album, image, or search.
* @param bool $linkslides Set to true if you want the slides to be linked to their image pages
* @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped. Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
* @param bool $shuffle Set to true if you want random (shuffled) order of the slides
*
* */
function printGslideshow($albumobj = null, $imageobj = null, $linkslides = true, $autoplay = true, $forceheight = false, $shuffle = false)
{
$data = 'data';
// no POST data from slidehow link and $albumobj provided is not valid, exit
if (!isset($_POST['albumid']) and !is_object($albumobj)) {
echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("Invalid linking to the slideshow page.") . "</h2></div>";
echo "</div></body></html>";
exitZP();
}
global $_zp_current_image, $_zp_current_album, $_zp_gallery, $_myFavorites, $_zp_conf_vars;
$imagenumber = 0;
//getting the image to start with
if (!empty($_POST['imagenumber']) and !is_object($imageobj)) {
$imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
// slideshows starts with 0, but zp with 1.
} elseif (is_object($imageobj)) {
makeImageCurrent($imageobj);
$imagenumber = imageNumber() - 1;
}
// set pagenumber to 0 if not called via POST link
if (isset($_POST['pagenr'])) {
$pagenumber = sanitize_numeric($_POST['pagenr']);
} else {
$pagenumber = 1;
}
// getting the number of images
if (!empty($_POST['numberofimages'])) {
$numberofimages = sanitize_numeric($_POST['numberofimages']);
} elseif (is_object($albumobj)) {
$numberofimages = $albumobj->getNumImages();
} else {
$numberofimages = 0;
}
if ($imagenumber < 2 || $imagenumber > $numberofimages) {
$imagenumber = 0;
}
//getting the album to show
if (!empty($_POST['albumid']) && !is_object($albumobj)) {
$albumid = sanitize_numeric($_POST['albumid']);
$embedded = false;
} elseif (is_object($albumobj)) {
$albumid = $albumobj->getID();
$embedded = true;
} else {
$albumid = 0;
$embedded = false;
}
if ($numberofimages == 0) {
return NULL;
}
// get slideshow data
if (isset($_POST['preserve_search_params'])) {
// search page
$search = new SearchEngine();
$params = sanitize($_POST['preserve_search_params']);
$search->setSearchParams($params);
$images = $search->getImages(0);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
$albumtitle = gettext('Search');
} else {
if (isset($_POST['favorites_page'])) {
$album = $_myFavorites;
$albumtitle = gettext('My Favorites');
$images = $album->getImages(0);
$returnpath = rewrite_path(favorites::getFavorites_link() . '/' . $pagenumber, FULLWEBPATH . '/index.php?p=favorites' . '&page=' . $pagenumber);
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$album = newAlbum($albumq['folder']);
$albumtitle = $album->getTitle();
if (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumq['folder'])) {
echo gettext("This album is password protected!");
exitZP();
}
$dynamic = $album->isDynamic();
$images = $album->getImages(0);
// return path to get back to the page we called the slideshow from
if (empty($_POST['imagenumber'])) {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/page/' . $pagenumber, '/index.php?album=' . urlencode($album->name) . '&page=' . $pagenumber);
} else {
$returnpath = rewrite_path('/' . pathurlencode($album->name) . '/' . rawurlencode(sanitize($_POST['imagefile'])) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile']));
}
}
//.........这里部分代码省略.........
示例5: printBaseSlideShow
function printBaseSlideShow()
{
global $_zp_gallery, $_zp_gallery_page, $_myFavorites, $_zp_conf_vars, $_zp_themeroot, $isMobile, $isTablet;
if (!isset($_POST['albumid'])) {
return '<div class="errorbox" id="message"><h2>' . gettext('Invalid linking to the slideshow page.') . '</h2></div>';
}
//getting the image to start with
if (!empty($_POST['imagenumber'])) {
$imagenumber = sanitize_numeric($_POST['imagenumber']) - 1;
// slideshows starts with 0, but zp with 1.
} else {
$imagenumber = 0;
}
// set pagenumber to 0 if not called via POST link
if (isset($_POST['pagenr'])) {
$pagenumber = sanitize_numeric($_POST['pagenr']);
} else {
$pagenumber = 1;
}
// getting the number of images
if (!empty($_POST['numberofimages'])) {
$numberofimages = sanitize_numeric($_POST['numberofimages']);
} else {
$numberofimages = 0;
}
//if ($imagenumber < 2 || $imagenumber > $numberofimages) {
// $imagenumber = 0;
//}
//getting the album to show
if (!empty($_POST['albumid'])) {
$albumid = sanitize_numeric($_POST['albumid']);
} else {
$albumid = 0;
}
if (isset($_POST['preserve_search_params'])) {
// search page
$search = new SearchEngine();
$params = sanitize($_POST['preserve_search_params']);
$search->setSearchParams($params);
$searchwords = $search->getSearchWords();
$searchdate = $search->getSearchDate();
$searchfields = $search->getSearchFields(true);
$page = $search->page;
$returnpath = getSearchURL($searchwords, $searchdate, $searchfields, $page);
$albumobj = new AlbumBase(NULL, false);
$albumobj->setTitle(gettext('Search'));
$albumobj->images = $search->getImages(0);
$albumtitle = gettext('Search');
} else {
if (isset($_POST['favorites_page'])) {
$albumobj = $_myFavorites;
$returnpath = rewrite_path($_myFavorites->getLink() . '/' . $pagenumber, FULLWEBPATH . '/index.php?p=favorites' . '&page=' . $pagenumber);
$albumtitle = gettext('Favorites');
} else {
$albumq = query_single_row("SELECT title, folder FROM " . prefix('albums') . " WHERE id = " . $albumid);
$albumobj = newAlbum($albumq['folder']);
$albumtitle = $albumobj->getTitle();
if (empty($_POST['imagenumber'])) {
$returnpath = $albumobj->getLink($pagenumber);
} else {
$image = newImage($albumobj, sanitize($_POST['imagefile']));
$returnpath = $image->getLink();
}
}
}
if (!$albumobj->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumobj)) {
return '<div class="errorbox" id="message"><h2>' . gettext('This album is password protected!') . '</h2></div>';
}
$slideshow = '';
$numberofimages = $albumobj->getNumImages();
if ($numberofimages == 0) {
return '<div class="errorbox" id="message"><h2>' . gettext('No images for the slideshow!') . '</h2></div>';
}
$images = $albumobj->getImages(0);
// slideshow generate data for galleria
?>
<script>
var data = [
<?php
for ($c = 0, $idx = 0; $c < $numberofimages; $c++, $idx++) {
if (is_array($images[$idx])) {
$filename = $images[$idx]['filename'];
$album = newAlbum($images[$idx]['folder']);
$image = newImage($album, $filename);
} else {
$filename = $images[$idx];
$image = newImage($albumobj, $filename);
}
if (isImagePhoto($image)) {
makeImageCurrent($image);
echo '{' . "\n";
echo 'thumb: \'' . getImageThumb() . '\',' . "\n";
echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n";
echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n";
echo 'title: \'' . js_encode($image->getTitle()) . '\',' . "\n";
$desc = $image->getDesc();
$desc = str_replace("\r\n", '<br />', $desc);
$desc = str_replace("\r", '<br />', $desc);
echo 'description: \'' . js_encode($desc) . '\',' . "\n";
if (!getOption('zpbase_nodetailpage')) {
//.........这里部分代码省略.........
示例6: getRelatedItems
function getRelatedItems($type = 'news', $album = NULL)
{
global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_page, $_zp_current_zenpage_news, $_zp_gallery_page;
$tags = getTags();
if (!empty($tags)) {
// if there are tags at all
$searchstring = '';
$count = '';
foreach ($tags as $tag) {
$count++;
if ($count == 1) {
$bool = '';
} else {
$bool = '|';
// connect tags by OR to get a wide range
}
$searchstring .= $bool . $tag;
}
$paramstr = urlencode('words') . '=' . $searchstring . '&searchfields=tags';
if (!is_null($album)) {
$paramstr = '&albumname=' . urlencode($album);
}
$search = new SearchEngine();
switch ($type) {
case 'albums':
$paramstr .= '&inalbums=1';
break;
case 'images':
$paramstr .= '&inimages=1';
break;
case 'news':
$paramstr .= '&innews=1';
break;
case 'pages':
$paramstr .= '&inpages=1';
break;
case 'all':
$paramstr .= '&inalbums=1&inimages=1&innews=1&inpages=1';
break;
}
$search->setSearchParams($paramstr);
// get the results
switch ($type) {
case 'albums':
$albumresult = $search->getAlbums(0, "date", "desc");
$result = createRelatedItemsResultArray($albumresult, $type);
break;
case 'images':
$imageresult = $search->getImages(0, 0, 'date', 'desc');
$result = createRelatedItemsResultArray($imageresult, $type);
break;
case 'news':
$newsresult = $search->getArticles(0, NULL, true, "date", "desc");
$result = createRelatedItemsResultArray($newsresult, $type);
break;
case 'pages':
$pageresult = $search->getPages();
$result = createRelatedItemsResultArray($pageresult, $type);
break;
case 'all':
$albumresult = $search->getAlbums(0, "date", "desc");
$imageresult = $search->getImages(0, 0, 'date', 'desc');
$newsresult = $search->getArticles(0, NULL, true, "date", "desc");
$pageresult = $search->getPages();
$result1 = createRelatedItemsResultArray($albumresult, 'albums');
$result2 = createRelatedItemsResultArray($imageresult, 'images');
$result3 = createRelatedItemsResultArray($newsresult, 'news');
$result4 = createRelatedItemsResultArray($pageresult, 'pages');
$result = array_merge($result1, $result2, $result3, $result4);
$result = sortMultiArray($result, 'weight', true, true, false, false);
// sort by search result weight
break;
}
return $result;
}
return array();
}
示例7: printAlbumEditForm
//.........这里部分代码省略.........
?>
class="thumboption" style="background-color:#B1F7B6"<?php
}
if ($thumb === '1') {
?>
selected="selected"<?php
}
?>
value="1"><?php
echo $_thumb_field_text[getOption('AlbumThumbSelectField')];
?>
</option>
<option <?php
if ($showThumb) {
?>
class="thumboption" style="background-color:#B1F7B6" <?php
}
?>
<?php
if (empty($thumb) && $thumb !== '1') {
?>
selected="selected" <?php
}
?>
value=""><?php
echo gettext('randomly selected');
?>
</option>
<?php
if ($album->isDynamic()) {
$params = $album->getSearchParams();
$search = new SearchEngine(true);
$search->setSearchParams($params);
$images = $search->getImages(0);
$thumb = $album->get('thumb');
$imagelist = array();
foreach ($images as $imagerow) {
$folder = $imagerow['folder'];
$filename = $imagerow['filename'];
$imagelist[] = '/' . $folder . '/' . $filename;
}
if (count($imagelist) == 0) {
$subalbums = $search->getAlbums(0);
foreach ($subalbums as $folder) {
$newalbum = new Album($gallery, $folder);
if (!$newalbum->isDynamic()) {
$images = $newalbum->getImages(0);
foreach ($images as $filename) {
$imagelist[] = '/' . $folder . '/' . $filename;
}
}
}
}
foreach ($imagelist as $imagepath) {
$list = explode('/', $imagepath);
$filename = $list[count($list) - 1];
unset($list[count($list) - 1]);
$folder = implode('/', $list);
$albumx = new Album($gallery, $folder);
$image = newImage($albumx, $filename);
$selected = $imagepath == $thumb;
echo "\n<option";
if ($showThumb) {
echo " class=\"thumboption\"";
echo " style=\"background-image: url(" . html_encode($image->getSizedImage(80)) . "); background-repeat: no-repeat;\"";
}
示例8: printAlbumEditForm
//.........这里部分代码省略.........
echo "\n<td>";
$showThumb = getOption('thumb_select_images');
if ($showThumb) {
echo "\n<script type=\"text/javascript\">updateThumbPreview(document.getElementById('thumbselect'));</script>";
}
echo "\n<select id=\"\"";
if ($showThumb) {
echo " class=\"thumbselect\" onChange=\"updateThumbPreview(this)\"";
}
echo " name=\"" . $prefix . "thumb\">";
$thumb = $album->get('thumb');
echo "\n<option";
if ($showThumb) {
echo " class=\"thumboption\" value=\"\" style=\"background-color:#B1F7B6\"";
}
if ($thumb === '1') {
echo " selected=\"selected\"";
}
echo ' value="1">' . gettext('most recent');
echo '</option>';
echo "\n<option";
if ($showThumb) {
echo " class=\"thumboption\" value=\"\" style=\"background-color:#B1F7B6\"";
}
if (empty($thumb) && $thumb !== '1') {
echo " selected=\"selected\"";
}
echo ' value="">' . gettext('randomly selected');
echo '</option>';
if ($album->isDynamic()) {
$params = $album->getSearchParams();
$search = new SearchEngine();
$search->setSearchParams($params);
$images = $search->getImages(0);
$thumb = $album->get('thumb');
$imagelist = array();
foreach ($images as $imagerow) {
$folder = $imagerow['folder'];
$filename = $imagerow['filename'];
$imagelist[] = '/' . $folder . '/' . $filename;
}
if (count($imagelist) == 0) {
$subalbums = $search->getAlbums(0);
foreach ($subalbums as $folder) {
$newalbum = new Album($gallery, $folder);
if (!$newalbum->isDynamic()) {
$images = $newalbum->getImages(0);
foreach ($images as $filename) {
$imagelist[] = '/' . $folder . '/' . $filename;
}
}
}
}
foreach ($imagelist as $imagepath) {
$list = explode('/', $imagepath);
$filename = $list[count($list) - 1];
unset($list[count($list) - 1]);
$folder = implode('/', $list);
$albumx = new Album($gallery, $folder);
$image = newImage($albumx, $filename);
$selected = $imagepath == $thumb;
echo "\n<option";
if ($showThumb) {
echo " class=\"thumboption\"";
echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
}