function __construct(PageInfo $pageInfo, ImagickTaskQueue $taskQueue) { $activeCategory = $pageInfo->getCategory(); $activeExample = $pageInfo->getExample(); $this->imageBaseURL = getImageURL($activeCategory, $activeExample); $this->customImageBaseURL = getCustomImageURL($activeCategory, $activeExample); $this->imageStatusBaseURL = getImageStatusURL($activeCategory, $activeExample); $this->taskQueue = $taskQueue; }
public function getCustomImageURL(array $extraParams = array()) { $paramString = ''; $separator = '?'; foreach ($extraParams as $key => $value) { $paramString .= $separator . $key . "=" . $value; $separator = '&'; } return getCustomImageURL($this->activeCategory, $this->activeExample) . $paramString; }
echo 'description: \'' . js_encode($desc) . '\',' . "\n"; echo 'link: \'' . html_encode(getAlbumURL()) . '\'' . "\n"; echo '}' . "\n"; $c++; } } while (next_image(true)) { if (isImagePhoto($_zp_current_image)) { if ($c == 0) { echo '{' . "\n"; } else { echo ',{' . "\n"; } echo 'thumb: \'' . getImageThumb() . '\',' . "\n"; echo 'image: \'' . getDefaultSizedImage() . '\',' . "\n"; echo 'big: \'' . getCustomImageURL(getOption('zpbase_galbigsize')) . '\',' . "\n"; echo 'title: \'' . html_encode(getBareImageTitle()) . '\',' . "\n"; $desc = getBareImageDesc(); $desc = str_replace("\r\n", '<br />', $desc); $desc = str_replace("\r", '<br />', $desc); echo 'description: \'' . js_encode($desc) . '\',' . "\n"; if (!getOption('zpbase_nodetailpage')) { echo 'link: \'' . html_encode(getImageURL()) . '\'' . "\n"; } echo '}' . "\n"; $c++; } } ?> ]; </script>
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')) { echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n"; } if ($c == $numberofimages - 1) { echo '}' . "\n"; } else { echo '},' . "\n"; } } else { if ($imagenumber > 0 && $imagenumber > $c) { $imagenumber--; } } } echo "\n"; ?> ]; </script> <?php $sspage = true; require_once 'inc/galleria-jscall.php'; }
if (!($personality == 'Slimbox' && !isImagePhoto())) { // Slimbox does not do video if (is_null($firstImage)) { $lastImage = imageNumber(); $firstImage = $lastImage; } else { $lastImage++; } ?> <!-- Image thumbnails or no flash --> <div class="image"> <div class="imagethumb"> <?php $annotate = annotateImage(); if ($personality == 'Slimbox') { echo "<a href=\"" . htmlspecialchars(getCustomImageURL(550, null)) . "\""; echo "rel=\"lightbox[" . getAlbumTitle() . "]\"\n"; } else { echo '<a href="' . htmlspecialchars(getImageLinkURL()) . '"'; } echo " title=\"" . $annotate . "\">\n"; printImageThumb($annotate); echo "</a>"; ?> </div> </div> <?php } } echo '<div class="clearage"></div>'; if (function_exists('printSlideShowLink') && $personality != 'Smoothgallery') {
?> " title="<?php echo getBareImageTitle(); ?> "><?php printImageThumb(getAnnotatedImageTitle()); ?> </a> <?php } else { ?> <a name="<?php echo $_zp_current_image->getFileName(); ?> " class="thumb" href="<?php echo getCustomImageURL(475, null, null, null, null, null, null, true, null); ?> " title="<?php echo getBareImageTitle(); ?> "><?php printImageThumb(getAnnotatedImageTitle()); ?> </a> <?php } ?> <a rel="zoom" href="<?php if ($zpgal_cbtarget) { echo htmlspecialchars(getDefaultSizedImage()); } else {
function getSubalbumsHTML() { $numAlbums = $this->getNumAlbums(); if ($numAlbums <= 0 || $this->albumPage >= $this->getFirstImagePage()) { return ''; } global $_zp_themeroot, $_zp_gallery, $_zp_current_image, $_zp_current_album; $w = 318; $slideshowLink = $this->getSlideshowLink(); $subalbums = "<div id='subalbums'>"; $i = 0; $albums = $this->getAlbums(); $page = $this->getAlbumPage(); $start = ($page - 1) * getOption('albums_per_page'); $albums = array_slice($albums, $start, getOption('albums_per_page')); for ($u = 0; $u < count($albums); $u++) { $a = new Album($_zp_gallery, $albums[$u]); $thumb = $a->getAlbumThumbImage(); $title = $a->getTitle(); $desc = $a->getDesc(); $customThumb = $thumb->getCustomImage(NULL, 104, 56, 104, 56, NULL, NULL, false); $subalbums .= "<span class='subalbum' id='subalbum-{$u}' width='104' height='56' >" . "<a href='" . getAlbumURL($a) . "' >" . "<img width='104' height='56' src='{$customThumb}'/></a></span>"; $i++; } $m = $i; $i++; while ($i <= getOption('albums_per_page')) { $subalbums .= "<span class='subalbum' id='subalbum-{$i}'>" . "<img width='104' height='56' src='{$_zp_themeroot}/resources/images/opa/bg-b-20.png'/>" . "</span>"; $i++; } $subalbums .= "</div>"; $s = ($this->getAlbumPage() - 1) * getOption('albums_per_page'); $batch = $s + 1 . "-" . ($s + $m); $subalbums = "<div id='subalbum-count' class='count'>" . (isset($slideshowLink) && $this->getNumImages() > 0 ? "<span id='album-slideshow-link' class='unselected'><a href='{$slideshowLink}'>Slideshow</a></span>" : "") . "<span class='selected'>{$batch} / " . $numAlbums . " " . gettext($this->getAlbumTabText($numAlbums)) . "</span>" . ($this->getNumImages() > 0 ? "<span class='unselected last'><a href='" . $this->getImageTabLink() . "'>" . $this->getNumImages() . " " . gettext("images") . "</a></span>" : "<span class='unselected last'>" . $this->getNumImages() . " " . gettext("image") . "</span>") . "</div>" . $subalbums; if ($this->showRandomImage()) { $img = $this->getRandomAlbumImage(); $subalbums .= "<div id='random-album-image'>"; $previous = $_zp_current_image; $_zp_current_image = $img; $size = getSizeCustomImage(NULL, $w + 2); $small = getCustomImageURL(NULL, $w + 2); $width = $img->getWidth(); $height = $img->getHeight(); $ratio = ($w + 2) / $width; $height = $height * $ratio; $subalbums .= "<img src='{$small}' width='" . ($w + 2) . "' height='{$height}'/>"; $subalbums .= "<div class='caption'>Random selection</div>"; $subalbums .= "</div>"; $_zp_current_image = $previous; } return $subalbums; }
<?php echo $prevNext['prev']; ?> <div id="image-thumb-container"> <?php $u = 0; while (next_image()) { $imageTitle = getImageTitle(); $size = getSizeCustomImage(NULL, 383); $desc = getImageDesc(); if (!empty($desc)) { $desc = ThemeUtil::clean($desc); } else { $desc = ''; } ThemeUtil::$script .= "images.push({" . " title: '{$imageTitle}', \n" . " description: '{$desc}', \n" . " location: '" . getCustomImageURL(NULL, 383) . "', \n" . " url: '" . getFullImageURL() . "',\n" . " width: " . $size[0] . ",\n" . " height: " . $size[1] . "\n" . "});\n"; if (isset($_highlight_image) && $_highlight_image == $_zp_current_image->filename) { ThemeUtil::$script .= "initialImageThumbSelection = {$u}; \n"; } ?> <div class="image-thumb left opa60 <?php echo $u % 2 == 0 ? 'even' : 'odd'; ?> "> <img index="<?php echo $u; ?> " id="img-<?php echo $u;
/** * Returns a link to a un-cropped custom sized version of the current image within the given height and width dimensions. * Use for sized thumbnails. * * @param int $width width * @param int $height height * @return string */ function getCustomSizedImageThumbMaxSpace($width, $height) { global $_zp_current_image; if (is_null($_zp_current_image)) { return false; } getMaxSpaceContainer($width, $height, $_zp_current_image, true); return getCustomImageURL(NULL, $width, $height, NULL, NULL, NULL, NULL, true); }
/** * $returns coordinate informations for an image * @param $image image object */ function getGeoCoord($image) { global $_zp_current_image; $result = false; if (isImageClass($image)) { $_zp_current_image = $image; $exif = $_zp_current_image->getMetaData(); if (!empty($exif['EXIFGPSLatitude']) && !empty($exif['EXIFGPSLongitude'])) { $lat_c = explode('.', str_replace(',', '.', $exif['EXIFGPSLatitude']) . '.0'); $lat_f = round((double) abs($lat_c[0]) + $lat_c[1] / pow(10, strlen($lat_c[1])), 12); if (strtoupper(@$exif['EXIFGPSLatitudeRef'][0]) == 'S') { $lat_f = -$lat_f; } $long_c = explode('.', str_replace(',', '.', $exif['EXIFGPSLongitude']) . '.0'); $long_f = round((double) abs($long_c[0]) + $long_c[1] / pow(10, strlen($long_c[1])), 12); if (strtoupper(@$exif['EXIFGPSLongitudeRef'][0]) == 'W') { $long_f = -$long_f; } $thumb = '<a href="javascript:image(\'' . $_zp_current_image->albumname . '\',\'' . $_zp_current_image->filename . '\');"><img src="' . getCustomImageURL(150) . '" /></a>'; $result = array('lat' => $lat_f, 'long' => $long_f, 'title' => $_zp_current_image->getTitle(), 'desc' => $_zp_current_image->getDesc(), 'thumb' => $thumb); } } return $result; }
/** * prints the radio button image size selection list * * @param string $text text to introduce the radio button list * @param string $default the default (initial) for the image sizing * @param array $usersizes an array of sizes which may be choosen. */ function printUserSizeSelectior($text = '', $default = NULL, $usersizes = NULL) { $size = $width = $height = NULL; getViewerImageSize($default, $size, $width, $height); if (!empty($size)) { $current = $size; } else { $current = $width . 'x' . $height; } $sizes = array(); if (empty($text)) { $text = gettext('Select image size'); } if (is_null($usersizes)) { $inputs = explode(';', trim(getOption('viewer_size_image_sizes'))); if (!empty($inputs)) { foreach ($inputs as $size) { if (!empty($size)) { $size = str_replace(',', ';', $size) . ';'; $s = $w = $h = NULL; if (false === eval($size)) { trigger_error(gettext('There is a format error in your <em>viewer_size_image_sizes</em> option string.'), E_USER_NOTICE); } if (!empty($s)) { $key = $s; } else { $key = $w . 'x' . $h; } $sizes[$key] = array('$s' => $s, '$h' => $h, '$w' => $w); } } } } else { foreach ($usersizes as $key => $size) { if (!empty($size)) { $size = str_replace(',', ';', $size) . ';'; $s = $w = $h = NULL; if (false === eval($size)) { trigger_error(gettext('There is a format error in your $usersizes string.'), E_USER_NOTICE); } if (!empty($s)) { $key = $s; } else { $key = $w . 'x' . $h; } $sizes[$key] = array('$s' => $s, '$h' => $h, '$w' => $w); } } } $cookiepath = WEBPATH; if (WEBPATH == '') { $cookiepath = '/'; } ?> <script> function switchimage(obj){ var url = $(obj).attr('url'); $('#image img').attr('src',url); document.cookie='viewer_size_image_saved='+$(obj).attr('value')+'; expires=<?php echo time() + COOKIE_PESISTENCE; ?> ; path=<?php echo $cookiepath; ?> ;'; console.log(document.cookie); } </script> <div> <?php echo $text; foreach ($sizes as $key => $size) { if (empty($size['$s'])) { $display = sprintf(gettext('%1$s x %2$s px'), $size['$w'], $size['$h']); $url = getCustomImageURL(null, $size['$w'], $size['$h'], null, null, null, null, false); $value = '$h=' . $size['$h'] . ',$w=' . $size['$w']; } else { $display = sprintf(gettext('%s px'), $size['$s']); $url = getCustomImageURL($size['$s'], null, null, null, null, null, null, false); $value = '$s=' . $size['$s']; } $checked = ""; if ($key == $current) { $checked = 'checked="CHECKED" '; } ?> <input type="radio" name="viewer_size_image_selection" id="s<?php echo $key; ?> " url="<?php echo $url; ?> " value="<?php echo $value; ?> " <?php echo $checked; ?> onclick="switchimage(this);" /> <label for="s<?php echo $key; ?> "> <?php echo $display; ?> </label> <?php } ?> </div> <?php }
<?php while (next_image()) { ?> <li id="<?php echo ' image-' . $_zp_current_image->getID(); ?> " class="image"> <a title="<?php echo html_encode(getImageTitle()); ?> " href="<?php echo getImageURL(); ?> "> <img src="<?php echo getCustomImageURL(298, NULL, NULL, 298, 178, NULL, NULL, true); ?> " alt="<?php echo html_encode(getAlbumTitle()); ?> " /> </a> </li> <?php } ?> </div> </ul> </div> <div id="rightbox"> <div class="data">
} ?> <!-- Image thumbnails or no flash --> <div class="image"> <div class="imagethumb"> <?php if ($map) { $coord = getGeoCoord($_zp_current_image); if ($coord) { $coord['desc'] = '<p align=center>' . $coord['desc'] . '</p>'; $points[] = $coord; } } $annotate = annotateImage(); if ($personality == 'Slimbox') { echo "<a href=\"" . html_encode(getCustomImageURL(550, null)) . "\""; echo "rel=\"lightbox[" . getAlbumTitle() . "]\"\n"; } else { echo '<a href="' . html_encode(getImageLinkURL()) . '"'; } echo " title=\"" . $annotate . "\">\n"; printImageThumb($annotate); echo "</a>"; ?> </div> </div> <?php } } echo '<div class="clearage"></div>'; if (!empty($points) && map) {
list($nw, $nh) = getSizeCustomImage(null, $mw); $iw = $nw; $ih = null; } } /* echo 'o: ' . getFullWidth() . 'x' . getFullHeight() . "<br />\n"; echo 'i: ' . $iw . 'x' . $ih . "<br />\n"; echo 'm: ' . $mw . 'x' . $mh . "<br />\n"; echo 'n: ' . $nw . 'x' . $nh . "<br />\n"; */ } list($imgw, $imgh) = getSizeCustomImage(null, $iw, $ih); ?> <img src="<?php echo getCustomImageURL(null, $iw, $ih); ?> " alt="<?php echo getImageTitle(); ?> " width="<?php echo $imgw; ?> " height="<?php echo $imgh; ?> " /></a> </div> </div>
echo $prevNext['prev']; ?> <div id="image-thumb-container"> <?php $u = 0; while (next_image()) { $imageTitle = getImageTitle(); $size = getSizeCustomImage(NULL, 383); $desc = getImageDesc(); if (!empty($desc)) { $desc = ThemeUtil::clean($desc); } else { $desc = ''; } $rating = $_zp_current_image->get('rating'); ThemeUtil::$script .= "images.push({" . " title: '{$imageTitle}', \n" . " description: '{$desc}', \n" . " location: '" . getCustomImageURL(NULL, 383) . "', \n" . " url: '" . getFullImageURL() . "',\n" . " width: " . $size[0] . ",\n" . " height: " . $size[1] . ",\n" . " rating: " . (isset($rating) ? $rating : 0) . ", \n" . " object_id: " . $_zp_current_image->id . "});\n"; if (isset($_highlight_image) && $_highlight_image == $_zp_current_image->filename) { ThemeUtil::$script .= "initialImageThumbSelection = {$u}; \n"; } ?> <div class="image-thumb left opa60 <?php echo $u % 2 == 0 ? 'even' : 'odd'; ?> "> <img index="<?php echo $u; ?> " id="img-<?php echo $u;
/** * prints the radio button image size selection list * * @param string $text text to introduce the radio button list * @param string $default the default (initial) for the image sizing * @param array $usersizes an array of sizes which may be choosen. */ function printUserSizeSelector($text = '', $default = NULL, $usersizes = NULL) { $size = $width = $height = NULL; getViewerImageSize($default, $size, $width, $height); if (!empty($size)) { $current = $size; } else { $current = $width . 'x' . $height; } $sizes = array(); if (empty($text)) { $text = gettext('Select image size'); } if (is_null($usersizes)) { $inputs = explode(';', trim(getOption('viewer_size_image_sizes'))); if (!empty($inputs)) { foreach ($inputs as $size) { if (!empty($size)) { $size = str_replace(',', ';', $size) . ';'; $s = $w = $h = NULL; if (false === eval($size)) { zp_error(gettext('There is a format error in your <em>viewer_size_image_sizes</em> option string.'), E_USER_NOTICE); } if (!empty($s)) { $key = $s; } else { $key = $w . 'x' . $h; } $sizes[$key] = array('$s' => $s, '$h' => $h, '$w' => $w); } } } } else { foreach ($usersizes as $key => $size) { if (!empty($size)) { $size = str_replace(',', ';', $size) . ';'; $s = $w = $h = NULL; if (false === eval($size)) { zp_error(gettext('There is a format error in your $usersizes string.'), E_USER_NOTICE); } if (!empty($s)) { $key = $s; } else { $key = $w . 'x' . $h; } $sizes[$key] = array('$s' => $s, '$h' => $h, '$w' => $w); } } } if (($cookiepath = WEBPATH) == '') { $cookiepath = '/'; } ?> <script type="text/javascript"> // <!-- <![CDATA[ <?php $selector = getOption('viewer_size_image_radio') == 1; if ($selector) { ?> function switchselection() { var selection = $("#viewer_size_image_selection").val(); var items = selection.split(':'); $('#image img').attr('width', items[1]); $('#image img').attr('height', items[2]); $('#image img').attr('src', items[3]); document.cookie = 'viewer_size_image_saved=' + items[0] + '; expires=<?php echo date('Y-m-d H:i:s', time() + COOKIE_PESISTENCE); ?> ; path=<?php echo $cookiepath; ?> '; } <?php } else { // radio buttons ?> function switchimage(obj) { var url = $(obj).attr('url'); var w = $(obj).attr('im_w'); var h = $(obj).attr('im_h'); $('#image img').attr('width', w); $('#image img').attr('height', h); $('#image img').attr('src', url); document.cookie = 'viewer_size_image_saved=' + $(obj).attr('value') + '; expires=<?php echo date('Y-m-d H:i:s', time() + COOKIE_PESISTENCE); ?> ; path=<?php echo $cookiepath; ?> '; } <?php } ?> // ]]> --> </script> <div> <?php echo $text; if ($selector) { ?> <select id="viewer_size_image_selection" name="viewer_size_image_selection" onchange="switchselection();" > <?php } foreach ($sizes as $key => $size) { if (empty($size['$s'])) { $display = sprintf(gettext('%1$s x %2$s px'), $size['$w'], $size['$h']); $url = getCustomImageURL(null, $size['$w'], $size['$h'], null, null, null, null, false); $value = '$h=' . $size['$h'] . ',$w=' . $size['$w']; $dims = array($size['$w'], $size['$h']); } else { $dims = getSizeCustomImage($size['$s']); $display = sprintf(gettext('%s px'), $size['$s']); $url = getCustomImageURL($size['$s'], null, null, null, null, null, null, false); $value = '$s=' . $size['$s']; } if ($selector) { $selected = ''; if ($key == $current) { $selected = ' selected="selected"'; } ?> <option id="s<?php echo $key; ?> " value="<?php echo $value . ':' . implode(':', $dims) . ':' . $url; ?> "<?php echo $selected; ?> /> <?php echo $display; ?> </option> <?php } else { $checked = ""; if ($key == $current) { $checked = ' checked="checked"'; } ?> <input type="radio" name="viewer_size_image_selection" id="s<?php echo $key; ?> " url="<?php echo $url; ?> " im_w="<?php echo $dims[0]; ?> " im_h="<?php echo $dims[1]; ?> " value="<?php echo $value; ?> "<?php echo $checked; ?> onclick="switchimage(this);" /> <label for="s<?php echo $key; ?> "> <?php echo $display; ?> </label> <?php } } if ($selector) { ?> </select> <?php } ?> </div> <?php }
<div class="clear_left"></div> <div id="images"> <?php while (next_image(false, $firstPageImages)) { $c++; ?> <li class="thumb image"> <a title="<?php echo html_encode(getBareImageDesc()); ?> " href="<?php echo htmlspecialchars(getImageURL()); ?> "> <img src="<?php echo getCustomImageURL(250, NULL, NULL, 250, 150, NULL, NULL, true); ?> " alt="<?php echo html_encode(getBareImageTitle() . ' (' . getImageDate(getOption('date_format')) . ')'); ?> " /> <span><?php echo getBareImageTitle() . '<br />(' . getImageDate(getOption('date_format')) . ')'; ?> </span> </a> </li> <?php } if ($c == 0) { echo "<p>" . gettext("Sorry, no image matches. Try refining your search.") . "</p>";
<div class="image"> <a href="<?php echo getImageURL(); ?> " title="<?php if (getImageDesc() == "") { echo getImageTitle(); } else { echo getImageTitle() . ' - ' . getImageDesc(); } ?> "><img src="<?php echo getCustomImageURL(100, 100, 100, 100); ?> " alt="<?php echo 'Image ' . ($count + ($currentPage - 1) * $imagesPerPage) . ' of ' . getNumImages(); ?> " width="100" height="100"<?php if ($pc_AjaxFx) { echo ' onLoad="new Effect.Fade(this, {from: 1 , to: .5, queue: \'parallel\', duration: .3});" onMouseOver="new Effect.Appear(this, {from: .5 , to: 1, queue: \'parallel\', duration: .3});" onMouseOut="new Effect.Fade(this, {from: 1 , to: .5, queue: \'parallel\', duration: .3});" '; } ?>
/** * $returns coordinate informations for an image * @param $image image object */ function getGeoCoord($image) { global $_zp_current_image; if (isImageClass($image)) { $_zp_current_image = $image; $lat = $_zp_current_image->get('GPSLatitude'); $long = $_zp_current_image->get('GPSLongitude'); if (!empty($lat) && !empty($long)) { $lat_f = inputConvert($lat); $long_f = inputConvert($long); $thumb = '<a href="javascript:image(\'' . $_zp_current_image->albumname . '\',\'' . $_zp_current_image->filename . '\');"><img src="' . getCustomImageURL(150, NULL, NULL, NULL, NULL, NULL, NULL, true) . '" /></a>'; return array('lat' => $lat_f, 'long' => $long_f, 'title' => $_zp_current_image->getTitle(), 'desc' => $_zp_current_image->getDesc(), 'thumb' => $thumb); } } else { return false; } }
<li id="<?php echo ' image-' . $_zp_current_image->getID(); ?> " class="image"> <a title="<?php echo html_encode(getImageTitle()); ?> " href="<?php echo html_encode($imgURL); ?> "<?php echo $boxclass . $cbRel; ?> > <img src="<?php echo getCustomImageURL(NULL, 298, 187, 298, 187, NULL, NULL, true); ?> " alt="<?php echo html_encode(getImageTitle()); ?> " /> </a> </li> <?php } ?> </ul> <div class="data"> <?php if (getAlbumTitle()) { echo '<div class="c"><h4 class="box title">' . getAlbumTitle() . '</h4></div>';
$desc = $a->getDesc(); $customThumb = $thumb->getCustomImage(NULL, 202, 56, 202, 56, NULL, NULL, false); $url = getAlbumURL(); echo "\t<div class='thumb' index='{$u}' title='{$title}' location='{$customThumb}' url='{$url}'><description>{$desc}</description></div>\n"; $u++; } } else { $u = 0; while (next_image()) { $title = getImageTitle(); $size = getSizeCustomImage(NULL, 383); $desc = getImageDesc(); if (!empty($desc)) { $desc = theme_clean($desc); } else { $desc = ''; } $thumb = getImageThumb(); $small = getCustomImageURL(NULL, 383); $full = getFullImageURL(); $width = $size[0]; $height = $size[1]; $rating = $_zp_current_image->get('rating'); echo "\t<div class='thumb' index='{$u}' title='{$title}' \n\t\twidth='{$width}' " . "\n\t\theight='{$height}' \n\t\turl='{$full}' \n\t\tpreviewUrl='{$small}'" . "\n\t\tlocation='{$thumb}' \n\t\trating='{$rating}' \n\t\tobject_id='" . $_zp_current_image->id . "'>" . "\n\t\t<description>\n\t\t\t{$desc}\n\t\t</description>\n\t</div>\n"; $u++; } } ?> </div>
/** * Prints the slideshow using the jQuery plugin Cycle (http://http://www.malsup.com/jquery/cycle/) * or Flash based using Flowplayer3 http://flowplayer.org if installed * * 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 recommended) * Call printSlideShowJS() function in the head section of the theme page you want to use the slideshow on. * Then place the printSlideShow() function where you want the slideshow to appear and set $albumobj and if needed $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 * */ function printSlideShow($heading = true, $speedctl = false, $albumobj = "", $imageobj = "", $width = "", $height = "", $crop = false, $shuffle = false) { 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; $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 = 0; } // 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']) 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"); } if ($numberofimages == 0) { return NULL; } $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 = sanitize($_POST['preserve_search_params']); $search->setSearchParams($params); $images = $search->getImages(0); $searchwords = $search->words; $searchdate = $search->dates; $searchfields = $search->getSearchFields(true); $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 (!$album->isMyItem(LIST_RIGHTS) && !checkAlbumPassword($albumq['folder'])) { 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(sanitize($_POST['imagefile'])) . getOption('mod_rewrite_image_suffix'), '/index.php?album=' . urlencode($album->name) . '&image=' . urlencode($_POST['imagefile'])); } } if ($shuffle) { shuffle($images); } $showdesc = getOption("slideshow_showdesc"); // slideshow display section switch ($option) { case "jQuery": $validtypes = array('jpg', 'jpeg', 'gif', 'png', 'mov', '3gp'); ?> <script type="text/javascript"> // <!-- <![CDATA[ $(document).ready(function(){ $(function() { var ThisGallery = '<?php echo html_encode($albumtitle); ?> '; var ImageList = new Array(); var TitleList = new Array(); var DescList = new Array(); var ImageNameList = new Array(); var DynTime=(<?php echo getOption("slideshow_timeout"); ?> ) * 1.0; // force numeric <?php for ($imgnr = 0, $cntr = 0, $idx = $imagenumber; $imgnr < $numberofimages; $imgnr++, $idx++) { if ($dynamic) { $filename = $images[$idx]['filename']; $album = new Album($gallery, $images[$idx]['folder']); $image = newImage($album, $filename); } else { $filename = $images[$idx]; $image = newImage($album, $filename); } $ext = is_valid($filename, $validtypes); if ($ext) { makeImageCurrent($image); if ($crop) { $img = getCustomImageURL(NULL, $width, $height, $width, $height); } else { $img = getCustomSizedImageMaxSpace($width, $height); } //$img = WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . pathurlencode($image->album->name) . '&i=' . pathurlencode($filename) . '&s=' . $imagesize; echo 'ImageList[' . $cntr . '] = "' . $img . '";' . "\n"; echo 'TitleList[' . $cntr . '] = "' . js_encode($image->getTitle()) . '";' . "\n"; if ($showdesc) { $desc = $image->getDesc(); $desc = str_replace("\r\n", '<br />', $desc); $desc = str_replace("\r", '<br />', $desc); echo 'DescList[' . $cntr . '] = "' . js_encode($desc) . '";' . "\n"; } else { echo 'DescList[' . $cntr . '] = "";' . "\n"; } if ($idx == $numberofimages - 1) { $idx = -1; } echo 'ImageNameList[' . $cntr . '] = "' . urlencode($filename) . '";' . "\n"; $cntr++; } } echo "\n"; $numberofimages = $cntr; ?> var countOffset = <?php echo $imagenumber; ?> ; var totalSlideCount = <?php echo $numberofimages; ?> ; var currentslide = 2; function onBefore(curr, next, opts) { if (opts.timeout != DynTime) { opts.timeout = DynTime; } if (!opts.addSlide) return; var currentImageNum = currentslide; currentslide++; if (currentImageNum == totalSlideCount) { opts.addSlide = null; return; } var relativeSlot = (currentslide + countOffset) % totalSlideCount; if (relativeSlot == 0) {relativeSlot = totalSlideCount;} var htmlblock = "<span class='slideimage'><h4><strong>" + ThisGallery + ":</strong> "; htmlblock += TitleList[currentImageNum] + " (" + relativeSlot + "/" + totalSlideCount + ")</h4>"; htmlblock += "<img src='" + ImageList[currentImageNum] + "'/>"; htmlblock += "<p class='imgdesc'>" + DescList[currentImageNum] + "</p></span>"; opts.addSlide(htmlblock); } function onAfter(curr, next, opts){ <?php if (!$album->isMyItem(LIST_RIGHTS)) { ?> //Only register at hit count the first time the image is viewed. if ($(next).attr( 'viewed') != 1) { $.get("<?php echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER; ?> /slideshow/slideshow-counter.php?album=<?php echo pathurlencode($album->name); ?> &img="+ImageNameList[opts.currSlide]); $(next).attr( 'viewed', 1 ); } <?php } ?> } $('#slides').cycle({ fx: '<?php echo getOption("slideshow_effect"); ?> ', speed: <?php echo getOption("slideshow_speed"); ?> , timeout: DynTime, next: '#next', prev: '#prev', cleartype: 1, before: onBefore, after: onAfter }); $('#speed').change(function () { DynTime = this.value; return false; }); $('#pause').click(function() { $('#slides').cycle('pause'); return false; }); $('#play').click(function() { $('#slides').cycle('resume'); return false; }); }); }); // Documentready() // ]]> --> </script> <div id="slideshow" align="center"> <?php // 7/21/08dp if ($speedctl) { echo '<div id="speedcontrol">'; // just to keep it away from controls for sake of this demo $minto = getOption("slideshow_speed"); while ($minto % 500 != 0) { $minto += 100; if ($minto > 10000) { break; } // emergency bailout! } $dflttimeout = getOption("slideshow_timeout"); /* don't let min timeout = speed */ $thistimeout = $minto == getOption("slideshow_speed") ? $minto + 250 : $minto; echo 'Select Speed: <select id="speed" name="speed">'; while ($thistimeout <= 60000) { // "around" 1 minute :) echo "<option value={$thistimeout} " . ($thistimeout == $dflttimeout ? " selected='selected'>" : ">") . round($thistimeout / 1000, 1) . " sec</option>"; /* put back timeout to even increments of .5 */ if ($thistimeout % 500 != 0) { $thistimeout -= 250; } $thistimeout += $thistimeout < 1000 ? 500 : ($thistimeout < 10000 ? 1000 : 5000); } echo "</select> </div>"; } if (!is_object($albumobj)) { // disable controls if calling the slideshow directly on homepage for example ?> <div id="controls"> <div><span><a href="#" id="prev" title="<?php echo gettext("Previous"); ?> "></a></span> <a href="<?php echo html_encode($returnpath); ?> " id="stop" title="<?php echo gettext("Stop and return to album or image page"); ?> "></a> <a href="#" id="pause" title="<?php echo gettext("Pause (to stop the slideshow without returning)"); ?> "></a> <a href="#" id="play" title="<?php echo gettext("Play"); ?> "></a> <a href="#" id="next" title="<?php echo gettext("Next"); ?> "></a> </div> </div> <?php } ?> <div id="slides" class="pics"> <?php if ($cntr > 1) { $cntr = 1; } for ($imgnr = 0, $idx = $imagenumber; $imgnr <= $cntr; $idx++) { if ($idx >= $numberofimages) { $idx = 0; } if ($dynamic) { $folder = $images[$idx]['folder']; $dalbum = new Album($gallery, $folder); $filename = $images[$idx]['filename']; $image = newImage($dalbum, $filename); $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . pathurlencode($folder) . "/" . urlencode($filename); } else { $folder = $album->name; $filename = $images[$idx]; //$filename = $animage; $image = newImage($album, $filename); $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . pathurlencode($folder) . "/" . urlencode($filename); } $ext = is_valid($filename, $validtypes); if ($ext) { $imgnr++; echo "<span class='slideimage'><h4><strong>" . $albumtitle . gettext(":") . "</strong> " . $image->getTitle() . " (" . ($idx + 1) . "/" . $numberofimages . ")</h4>"; if ($ext == "3gp") { echo '</a> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="352" height="304" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="' . $imagepath . '"/> <param name="autoplay" value="false" /> <param name="type" value="video/quicktime" /> <param name="controller" value="true" /> <embed src="' . $imagepath . '" width="352" height="304" autoplay="false" controller"true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed> </object> <a>'; } elseif ($ext == "mov") { echo '</a> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="640" height="496" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="' . $imagepath . '"/> <param name="autoplay" value="false" /> <param name="type" value="video/quicktime" /> <param name="controller" value="true" /> <embed src="' . $imagepath . '" width="640" height="496" autoplay="false" controller"true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" cache="true"></embed> </object> <a>'; } else { makeImageCurrent($image); if ($crop) { printCustomSizedImage('', NULL, $width, $height, $width, $height, NULL, NULL, NULL, NULL, false); } else { printCustomSizedImageMaxSpace($alt = '', $width, $height, NULL, NULL, false); } //echo "<img src='".WEBPATH."/".ZENFOLDER."/i.php?a=".pathurlencode($folder)."&i=".urlencode($filename)."&s=".$imagesize."' alt='".html_encode($image->getTitle())."' title='".html_encode($image->getTitle())."' />\n"; } if ($showdesc) { $desc = $image->getDesc(); $desc = str_replace("\r\n", '<br />', $desc); $desc = str_replace("\r", '<br />', $desc); echo "<p class='imgdesc'>" . $desc . "</p>"; } echo "</span>"; } } break; case "flash": if ($heading) { echo "<span class='slideimage'><h4><strong>" . $albumtitle . "</strong> (" . $numberofimages . " images) | <a style='color: white' href='" . html_encode($returnpath) . "' title='" . gettext("back") . "'>" . gettext("back") . "</a></h4>"; } echo "<span id='slideshow' style='display: block; margin: 0 auto; width:" . getOption('slideshow_flow_player_width') . "px; height: " . getOption('slideshow_flow_player_height') . "px'></span>"; $curdir = getcwd(); chdir(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer3'); $filelist = safe_glob('flowplayer-*.swf'); $swf = array_shift($filelist); $filelist = safe_glob('flowplayer.controls-*.swf'); $controls = array_shift($filelist); chdir($curdir); ?> <script type="text/javascript"> // <!-- <![CDATA[ flowplayer('slideshow','<?php echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER; ?> /flowplayer3/<?php echo $swf; ?> ', { clip: { onLastSecond: function() { this.getScreen().animate({opacity: 0}, <?php echo getOption('slideshow_speed') / 2; ?> ); }, onFinish: function(){ this.getScreen().animate({opacity: 1}, 1000); }, onStart: function() { this.getScreen().animate({opacity: 1}, <?php echo getOption('slideshow_speed') / 2; ?> ); } }, playlist: [ <?php echo "\n"; $count = 0; foreach ($images as $animage) { if ($dynamic) { $folder = $animage['folder']; $filename = $animage['filename']; $salbum = new Album($_zp_gallery, $folder); $image = newImage($salbum, $filename); $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . pathurlencode($salbum->name) . "/" . urlencode($filename); } else { $folder = $album->name; $filename = $animage; $image = newImage($album, $filename); $imagepath = FULLWEBPATH . ALBUM_FOLDER_EMPTY . pathurlencode($folder) . "/" . pathurlencode($filename); } $ext = is_valid($filename, array('jpg', 'jpeg', 'gif', 'png', 'flv', 'mp3', 'mp4')); if ($ext) { if ($ext == "flv" || $ext == "mp3" || $ext == "mp4") { $duration = ""; } else { $duration = ", duration: " . getOption("slideshow_timeout") / 1000; } if ($count > 0) { echo ",\n"; } echo "{ url: '" . FULLWEBPATH . ALBUM_FOLDER_EMPTY . pathurlencode($folder) . "/" . urlencode($filename) . "'" . $duration . ", scaling: 'fit', autoBuffering: true }"; $count++; } } echo "\n"; ?> ], plugins: { controls: { url: '<?php echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER; ?> /flowplayer3/<?php echo $controls; ?> ', playlist: true, autoHide: 'always' } } }); // ]]> --> </script> <?php echo "</span>"; echo "<p>"; echo gettext("Click on the right in the player control bar to view full size."); echo "</p>"; break; } ?> </div> </div> <?php restore_context(); // needed if the slideshow is for example called directly via album object before the next_album loop on index.php }