function getImage_AlbumCount() { $c = getNumSubalbums(); if ($c > 0) { $result = "\n " . sprintf(gettext("%u albums(s)"), $c); } else { $result = ''; } $c = getNumImages(); if ($c > 0) { $result .= "\n " . sprintf(gettext("%u images(s)"), $c); } return $result; }
function ji_show_thumb() { /* $cw - crop width $ch - crop height $iw - image width $ih - image height */ $iw = $cw = THM_WIDTH; $ih = $ch = THM_HEIGHT; ?> <li> <a href="<?php echo getAlbumURL(); ?> " title="<?php echo getAlbumTitle(); ?> "><img src="<?php echo getCustomAlbumThumb(null, $iw, $ih, $cw, $ch); ?> " alt="<?php echo getAlbumTitle(); ?> " width="<?php echo $iw; ?> " height="<?php echo $ih; ?> " /> <span><?php echo getNumImages() . ' images'; if (getAlbumDesc() == '') { echo '<br /><br />[' . getAlbumTitle() . ']'; } else { echo '<br /><br />' . getAlbumDesc(); } ?> </span></a> </li> <?php }
function loadAlbum($album) { global $gallery, $_zp_current_album, $_zp_current_image; $subalbums = $album->getSubAlbums(); $count = 0; foreach ($subalbums as $folder) { $subalbum = new Album($gallery, $folder); $count = $count + loadAlbum($subalbum); } $_zp_current_album = $album; if (getNumImages() > 0) { echo "<br />" . $album->name . "{"; while (next_image(true)) { if (isImagePhoto($_zp_current_image)) { echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | <img src="' . getDefaultSizedImage() . '" height="20" width="20" />' . "\n"; } else { echo '<img src="' . getImageThumb() . '" height="8" width="8" /> | '; } $count++; } echo "}<br/>\n"; } return $count; }
?> </a></h3> <a href="<?php echo html_encode(getAlbumLinkURL()); ?> " title="<?php printf(gettext("View album: %s"), getAnnotatedAlbumTitle()); ?> " class="img"><?php printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), null, ALBUM_THUMB_WIDTH, ALBUM_THUMB_HEIGHT, ALBUM_THUMB_WIDTH, ALBUM_THUMB_HEIGHT); ?> </a> <p> <?php $anumber = getNumAlbums(); $inumber = getNumImages(); if ($anumber > 0 || $inumber > 0) { echo '<p><em>('; if ($anumber == 0) { if ($inumber != 0) { printf(ngettext('%u image', '%u images', $inumber), $inumber); } } else { if ($anumber == 1) { if ($inumber > 0) { printf(ngettext('1 album, %u image', '1 album, %u images', $inumber), $inumber); } else { printf(gettext('1 album')); } } else { if ($inumber == 1) {
echo html_encode(getNextImageURL()); ?> " title="<?php echo gettext("Next Image"); ?> "><?php echo gettext("next"); ?> »</a><?php } ?> <span title="<?php echo gettext('Image Number/Total images'); ?> "><?php echo imageNumber() . '/' . getNumImages(); ?> </span> </div> <div class="sidebar-divide"> <div id="full-image-details"> <h2><?php printImageTitle(true); ?> </h2> <div class="sidebar-section"><?php printImageDate('', '', null, true); ?> </div> <?php if (getImageDesc() || zp_loggedin()) {
/** * Prints a link to call the slideshow (not shown if there are no images in the album) * To be used on album.php and image.php * A CSS id names 'slideshowlink' is attached to the link so it can be directly styled. * * If the mode is set to "jQuery Colorbox" and the Colorbox plugin is enabled this link starts a Colorbox slideshow * from a hidden HTML list of all images in the album. On album.php it starts with the first always, on image.php with the current image. * * @param string $linktext Text for the link * @param string $linkstyle Style of Text for the link */ function printSlideShowLink($linktext = NULL, $linkstyle = Null) { global $_zp_gallery, $_zp_current_image, $_zp_current_album, $_zp_current_search, $slideshow_instance, $_zp_gallery_page; if (is_null($linktext)) { $linktext = gettext('View Slideshow'); } if (empty($_GET['page'])) { $pagenr = 1; } else { $pagenr = sanitize_numeric($_GET['page']); } $slideshowhidden = ''; $numberofimages = 0; if (in_context(ZP_SEARCH)) { $imagenumber = ''; $imagefile = ''; $albumnr = 0; $slideshowlink = rewrite_path(_PAGE_ . '/slideshow', "index.php?p=slideshow"); $slideshowhidden = '<input type="hidden" name="preserve_search_params" value="' . html_encode($_zp_current_search->getSearchParams()) . '" />'; } else { if (in_context(ZP_IMAGE)) { $imagenumber = imageNumber(); $imagefile = $_zp_current_image->filename; } else { $imagenumber = ''; $imagefile = ''; } if (in_context(ZP_SEARCH_LINKED)) { $albumnr = -$_zp_current_album->getID(); $slideshowhidden = '<input type="hidden" name="preserve_search_params" value="' . html_encode($_zp_current_search->getSearchParams()) . '" />'; } else { $albumnr = $_zp_current_album->getID(); } if ($albumnr) { $slideshowlink = rewrite_path(pathurlencode($_zp_current_album->getFileName()) . '/' . _PAGE_ . '/slideshow', "index.php?p=slideshow&album=" . urlencode($_zp_current_album->getFileName())); } else { $slideshowlink = rewrite_path(_PAGE_ . '/slideshow', "index.php?p=slideshow"); $slideshowhidden = '<input type="hidden" name="favorites_page" value="1" />' . "\n" . '<input type="hidden" name="title" value="' . $_myFavorites->instance . '" />'; } } $numberofimages = getNumImages(); $option = getOption('slideshow_mode'); switch ($option) { case 'jQuery': if ($numberofimages > 1) { ?> <form name="slideshow_<?php echo $slideshow_instance; ?> " method="post" action="<?php echo zp_apply_filter('getLink', $slideshowlink, 'slideshow.php', NULL); ?> "> <?php echo $slideshowhidden; ?> <input type="hidden" name="pagenr" value="<?php echo html_encode($pagenr); ?> " /> <input type="hidden" name="albumid" value="<?php echo $albumnr; ?> " /> <input type="hidden" name="numberofimages" value="<?php echo $numberofimages; ?> " /> <input type="hidden" name="imagenumber" value="<?php echo $imagenumber; ?> " /> <input type="hidden" name="imagefile" value="<?php echo html_encode($imagefile); ?> " /> <?php if (!empty($linkstyle)) { echo '<p style="' . $linkstyle . '">'; } ?> <a class="slideshowlink" id="slideshowlink_<?php echo $slideshow_instance; ?> " href="javascript:document.slideshow_<?php echo $slideshow_instance; ?> .submit()"><?php echo $linktext; ?> </a> <?php if (!empty($linkstyle)) { echo '</p>'; } ?> </form> <?php } $slideshow_instance++; break; case 'colorbox': $theme = $_zp_gallery->getCurrentTheme(); $script = stripSuffix($_zp_gallery_page); if (!getOption('colorbox_' . $theme . '_' . $script)) { setOptionDefault('colorbox_' . $theme . '_' . $script, 1); $themes = $_zp_gallery->getThemes(); ?> <div class="errorbox"><?php printf(gettext('Slideshow not available because colorbox is not enabled on %1$s <em>%2$s</em> pages.'), $themes[$theme]['name'], $script); ?> </div> <?php break; } if ($numberofimages > 1) { if (in_context(ZP_SEARCH_LINKED) && !in_context(ZP_ALBUM_LINKED) || in_context(ZP_SEARCH) && is_null($_zp_current_album)) { $images = $_zp_current_search->getImages(0); } else { $images = $_zp_current_album->getImages(0); } $count = ''; ?> <script type="text/javascript"> $(document).ready(function() { $("a[rel='slideshow']").colorbox({ slideshow: true, loop: true, transition: '<?php echo getOption('slideshow_colorbox_transition'); ?> ', slideshowSpeed: <?php echo getOption('slideshow_speed'); ?> , slideshowStart: '<?php echo gettext("start slideshow"); ?> ', slideshowStop: '<?php echo gettext("stop slideshow"); ?> ', previous: '<?php echo gettext("prev"); ?> ', next: '<?php echo gettext("next"); ?> ', close: '<?php echo gettext("close"); ?> ', current: '<?php printf(gettext('image %1$s of %2$s'), '{current}', '{total}'); ?> ', maxWidth: '98%', maxHeight: '98%', photo: true }); }); </script> <?php foreach ($images as $image) { if (is_array($image)) { $suffix = getSuffix($image['filename']); } else { $suffix = getSuffix($image); } $suffixes = array('jpg', 'jpeg', 'gif', 'png'); if (in_array($suffix, $suffixes)) { $count++; if (is_array($image)) { $albobj = newAlbum($image['folder']); $imgobj = newImage($albobj, $image['filename']); } else { $imgobj = newImage($_zp_current_album, $image); } if (in_context(ZP_SEARCH_LINKED) || $_zp_gallery_page != 'image.php') { if ($count == 1) { $style = ''; } else { $style = ' style="display:none"'; } } else { if ($_zp_current_image->filename == $image) { $style = ''; } else { $style = ' style="display:none"'; } } switch (getOption('slideshow_colorbox_imagetype')) { case 'fullimage': $imagelink = getFullImageURL($imgobj); break; case 'sizedimage': $imagelink = $imgobj->getCustomImage(getOption("slideshow_width"), NULL, NULL, NULL, NULL, NULL, NULL, false, NULL); break; } $imagetitle = ''; if (getOption('slideshow_colorbox_imagetitle')) { $imagetitle = html_encode(getBare($imgobj->getTitle())); } ?> <a href="<?php echo html_encode(pathurlencode($imagelink)); ?> " rel="slideshow"<?php echo $style; ?> title="<?php echo $imagetitle; ?> "><?php echo $linktext; ?> </a> <?php } } } break; } }
function theme_content($map) { global $_zp_current_image, $points; ?> <!-- Colorbox section --> <div id="content"> <div id="main"> <div id="images"> <?php $points = array(); $firstImage = null; $lastImage = null; while (next_image()) { // Colorbox does not do video if (is_null($firstImage)) { $lastImage = imageNumber(); $firstImage = $lastImage; } else { $lastImage++; } ?> <div class="image"> <div class="imagethumb"> <?php if ($map) { $coord = getGeoCoord($_zp_current_image); if ($coord) { $points[] = $coord; } } $annotate = annotateImage(); if (isImagePhoto()) { // colorbox is only for real images echo '<a href="' . html_encode(getDefaultSizedImage()) . '" class="thickbox"'; } else { echo '<a href="' . html_encode(getImageURL()) . '"'; } echo " title=\"" . $annotate . "\">\n"; printImageThumb($annotate); echo "</a>"; ?> </div> </div> <?php } echo '<div class="clearage"></div>'; if (!empty($points) && $map) { function map_callback($map) { global $points; foreach ($points as $coord) { addGeoCoord($map, $coord); } } ?> <div id="map_link"> <?php printGoogleMap(NULL, NULL, NULL, 'album_page', 'map_callback'); ?> </div> <?php } @call_user_func('printSlideShowLink', NULL, 'text-align:center;'); ?> </div><!-- images --> <?php @call_user_func('printRating'); ?> </div><!-- main --> <div class="clearage"></div> <?php if (isset($firstImage)) { printNofM('Photo', $firstImage, $lastImage, getNumImages()); } ?> </div><!-- content --> <?php }
<div id="main"<?php if ($zpmin_switch) { echo ' class="switch"'; } ?> > <div id="albums-wrap"> <?php while (next_album()) { ?> <div class="album-maxspace"> <a class="thumb-link" href="<?php echo html_encode(getAlbumURL()); ?> " title="<?php echo getNumAlbums() . ' ' . gettext('subalbums') . ' / ' . getNumImages() . ' ' . gettext('images') . ' - ' . strip_tags(shortenContent(getBareAlbumDesc(), 300, '...')); ?> "> <?php if ($zpmin_thumb_crop) { printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), null, $zpmin_album_thumb_size, $zpmin_album_thumb_size, $zpmin_album_thumb_size, $zpmin_album_thumb_size); } else { printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), $zpmin_album_thumb_size); } ?> <span class="album-title"><?php echo shortenContent(getBareAlbumTitle(), 25, '...'); ?> </span> </a> </div>
?> "> <?php echo getGalleryTitle(); ?> </a> | <?php echo "<em>" . gettext("Search") . "</em>"; ?> </span></h2> </div> <hr /> <?php if (($total = getNumImages() + getNumAlbums()) > 0) { if (isset($_REQUEST['date'])) { $searchwords = getSearchDate(); } else { $searchwords = getSearchWords(); } echo "<p>" . sprintf(gettext('Total matches for <em>%1$s</em>: %2$u'), $searchwords, $total) . '</p>'; } $c = 0; ?> <div id="albums"> <?php while (next_album()) { $c++; ?> <div class="album">
} ?> </ul> <div class="galleryinfo"> <p>Feed for this album: <?php printRSSLink('Album', '', '', '', true, 'i'); ?> </p> <?php $params = $_zp_current_search->getSearchParams(); if (!empty($params)) { if ($results != "0") { if ($firstImage + $lastImage != 0) { echo '<em class="count">'; printf(gettext('Photos %1$u-%2$u of %3$u'), $firstImage, $lastImage, getNumImages()); echo "</em>"; if (function_exists('printSlideShowLink')) { printSlideShowLink(gettext('View Slideshow')); } } ?> <?php if (hasPrevPage()) { ?> <a href="<?php echo htmlspecialchars(getPrevPageURL()); ?> " accesskey="x">« <?php echo gettext('prev page'); ?>
</div> <?php $singletag = getTags(); $tagstring = implode(', ', $singletag); if (strlen($tagstring) > 0) { ?> <div class="tags"><i class="fa fa-tags fa-fw"></i> <?php printTags('links', '', 'taglist', ', '); ?> </div> <?php } ?> <?php if (function_exists('printSlideShowLink') && getNumImages() > 1) { ?> <hr /><div class="slideshow-link"><i class="fa fa-play fa-fw"></i> <?php printSlideShowLink(); ?> </div><?php } ?> <hr /> <?php if ($_zp_gallery_page == 'album.php') { if (class_exists('RSS') && getOption('RSS_album_image')) { ?> <div><i class="fa fa-rss fa-fw"></i> <?php printRSSLink('Collection', '', gettext('Album RSS'), '', false);
/** Prints the jQuery jCarousel HTML setup to be replaced by JS * * @param int $minitems The minimum number of thumbs to be visible always if resized regarding responsiveness. * @param int $maxitems not supported * @param int $width Width Set to NULL if you want to use the backend plugin options. * @param int $height Height Set to NULL if you want to use the backend plugin options. * @param int $cropw Crop width Set to NULL if you want to use the backend plugin options. * @param int $croph Crop heigth Set to NULL if you want to use the backend plugin options. * @param bool $crop TRUE for cropped thumbs, FALSE for un-cropped thumbs. $width and $height then will be used as maxspace. Set to NULL if you want to use the backend plugin options. * @param bool $fullimagelink Set to TRUE if you want the thumb link to link to the full image instead of the image page. Set to NULL if you want to use the backend plugin options. * @param string $vertical 'horizontal','vertical', 'fade' * @param int $speed not supported */ function printThumbNav($minitems = NULL, $maxitems = NULL, $width = NULL, $height = NULL, $cropw = NULL, $croph = NULL, $fullimagelink = NULL, $vertical = NULL, $speed = NULL, $thumbscroll = NULL) { global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_gallery_page; // Just incase the theme has not set the option, at least second try will work! setOptionDefault('slideshow_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page), 1); $items = ""; if (is_object($_zp_current_album) && $_zp_current_album->getNumImages() >= 2) { if (is_null($thumbscroll)) { $thumbscroll = getOption('jcarousel_scroll'); } else { $thumbscroll = sanitize_numeric($thumbscroll); } if (is_null($width)) { $width = getOption('jcarousel_width'); } else { $width = sanitize_numeric($width); } if (is_null($height)) { $height = getOption('jcarousel_height'); } else { $height = sanitize_numeric($height); } if (is_null($cropw)) { $cropw = getOption('jcarousel_cropw'); } else { $cropw = sanitize_numeric($cropw); } if (is_null($croph)) { $croph = getOption('jcarousel_croph'); } else { $croph = sanitize_numeric($croph); } if (is_null($fullimagelink)) { $fullimagelink = getOption('jcarousel_fullimagelink'); } else { $fullimagelink = sanitize($fullimagelink); } if (is_null($vertical)) { $vertical = getOption('jcarousel_vertical'); } else { $vertical = sanitize($vertical); } if ($vertical) { $vertical = 'true'; } else { $vertical = 'false'; } if (in_context(ZP_SEARCH_LINKED)) { if ($_zp_current_search->getNumImages() === 0) { $searchimages = false; } else { $searchimages = true; } } else { $searchimages = false; } if (in_context(ZP_SEARCH_LINKED) && $searchimages) { $jcarousel_items = $_zp_current_search->getImages(); } else { $jcarousel_items = $_zp_current_album->getImages(); } if (count($jcarousel_items) >= 2) { foreach ($jcarousel_items as $item) { if (is_array($item)) { $imgobj = newImage($_zp_current_album, $item['filename']); } else { $imgobj = newImage($_zp_current_album, $item); } if ($fullimagelink) { $link = $imgobj->getFullImageURL(); } else { $link = $imgobj->getLink(); } if (!is_null($_zp_current_image)) { if ($_zp_current_album->isDynamic()) { if ($_zp_current_image->filename == $imgobj->filename && $_zp_current_image->getAlbum()->name == $imgobj->getAlbum()->name) { $active = 'active'; } else { $active = ''; } } else { if ($_zp_current_image->filename == $imgobj->filename) { $active = 'active'; } else { $active = ''; } } } else { $active = ''; } $imageurl = $imgobj->getCustomImage(NULL, $width, $height, $cropw, $croph, NULL, NULL, true); $items .= ' {url: "' . html_encode($imageurl) . '", title: "' . html_encode($imgobj->getTitle()) . '", link: "' . html_encode($link) . '", active: "' . $active . '"},'; $items .= "\n"; } } $items = substr($items, 0, -2); $numimages = getNumImages(); if (!is_null($_zp_current_image)) { $imgnumber = imageNumber(); } else { $imgnumber = 1; } ?> <script type="text/javascript"> // <!-- <![CDATA[ var mycarousel_itemList = [ <?php echo $items; ?> ]; function mycarousel_itemLoadCallback(carousel, state) { for (var i = carousel.first; i <= carousel.last; i++) { if (carousel.has(i)) { continue; } if (i > mycarousel_itemList.length) { break; } carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[i - 1])); } } function mycarousel_getItemHTML(item) { if (item.active === "") { html = '<a href="' + item.link + '" title="' + item.title + '"><img src="' + item.url + '" width="<?php echo $width; ?> " height="<?php echo $height; ?> " alt="' + item.url + '" /></a>'; } else { html = '<a href="' + item.link + '" title="' + item.title + '"><img class="activecarouselimage" src="' + item.url + '" width="<?php echo $width; ?> " height="<?php echo $height; ?> " alt="' + item.url + '" /></a>'; } return html; } jQuery(document).ready(function() { jQuery("#mycarousel").jcarousel({ vertical: <?php echo $vertical; ?> , size: mycarousel_itemList.length, start: <?php echo $imgnumber; ?> , scroll: <?php echo $thumbscroll; ?> , itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback} }); }); // ]]> --> </script> <ul id="mycarousel"> <!-- The content will be dynamically loaded in here --> </ul> <?php } }
echo 'thumb: \'' . getAlbumThumb() . '\',' . "\n"; echo 'image: \'' . getCustomAlbumThumb(getOption('image_size')) . '\',' . "\n"; echo 'big: \'' . getCustomAlbumThumb(getOption('zpbase_galbigsize')) . '\',' . "\n"; echo 'title: \'' . html_encode(getBareAlbumTitle()) . '\',' . "\n"; if (getNumAlbums() > 0 && getNumImages() > 0) { $divider = '/ '; } else { $divider = ''; } if (getNumAlbums() > 0) { $albumcount = getNumAlbums() . ' ' . gettext('albums'); } else { $albumcount = ''; } if (getNumImages() > 0) { $imagecount = getNumImages() . ' ' . gettext('images'); } else { $imagecount = ''; } $desc1 = $albumcount . $divider . $imagecount . ' ... <a href="' . html_encode(getAlbumURL()) . '">' . gettext('Goto Album') . ' →</a>'; $desc2 = '<p>' . getBareAlbumDesc() . '</p>'; $desc2 = str_replace("\r\n", '<br />', $desc2); $desc2 = str_replace("\r", '<br />', $desc2); $desc = $desc1 . $desc2; echo 'description: \'' . js_encode($desc) . '\',' . "\n"; echo 'link: \'' . html_encode(getAlbumURL()) . '\'' . "\n"; echo '}' . "\n"; $c++; } } while (next_image(true)) {
/** * Prints a link to call the prettyphoto slideshow (not shown if there are no images in the album) * Modified from core slideshow plugin to work with prettyphoto (http://www.no-margin-for-errors.com) * * @param string $linktext Text for the link * @param string $linkstyle Style of Text for the link */ function printPPSlideShowLink($linktext = '', $linkstyle = '') { global $_zp_gallery, $_zp_current_image, $_zp_current_album, $_zp_current_search, $slideshow_instance, $_zp_gallery_page, $zpskel_pptarget; $numberofimages = getNumImages(); if ($numberofimages > 1) { if (in_context(ZP_SEARCH_LINKED) && !in_context(ZP_ALBUM_LINKED) || in_context(ZP_SEARCH) && is_null($_zp_current_album)) { $images = $_zp_current_search->getImages(0); } else { $images = $_zp_current_album->getImages(0); } $count = ''; foreach ($images as $image) { if (is_array($image)) { $suffix = getSuffix($image['filename']); } else { $suffix = getSuffix($image); } $suffixes = array('jpg', 'jpeg', 'gif', 'png'); if (in_array($suffix, $suffixes)) { $count++; if (is_array($image)) { $albobj = new Album($image['folder']); $imgobj = newImage($albobj, $image['filename']); } else { $imgobj = newImage($_zp_current_album, $image); } if ($_zp_gallery_page == 'image.php' || in_context(ZP_SEARCH_LINKED)) { if (in_context(ZP_SEARCH_LINKED)) { if ($count == 1) { $style = ''; } else { $style = ' style="display:none"'; } } else { if ($_zp_current_image->filename == $image) { $style = ''; } else { $style = ' style="display:none"'; } } } elseif ($_zp_gallery_page == 'album.php' || $_zp_gallery_page == 'search.php') { if ($count == 1) { $style = ''; } else { $style = ' style="display:none"'; } } if ($zpskel_pptarget == 'sized') { $imagelink = $imgobj->getSizedImage(630); } else { $imagelink = $imgobj->getFullImage(); } $imagedetaillink = $imgobj->getLink(); ?> <div class="ss-link noshow-mobile"> <a class="ss button" href="<?php echo html_encode($imagelink); ?> " rel="slideshow[group]"<?php echo $style; ?> title="<a href='<?php echo $imagedetaillink; ?> '><?php echo html_encode(strip_tags($imgobj->getTitle())) . ' (' . gettext('Click for Detail Page') . ')'; ?> </a>"><?php echo $linktext; ?> </a> </div> <?php } } } }
static function pageCount($count, $gallery_page, $page) { global $_firstPageImages, $_oneImagePage; if (stripSuffix($gallery_page) == 'favorites') { $albums_per_page = max(1, getOption('albums_per_page')); $pageCount = (int) ceil(getNumAlbums() / $albums_per_page); $imageCount = getNumImages(); if ($_oneImagePage) { if ($_oneImagePage === true) { $imageCount = min(1, $imageCount); } else { $imageCount = 0; } } $images_per_page = max(1, getOption('images_per_page')); $count = $pageCount + (int) ceil(($imageCount - $_firstPageImages) / $images_per_page); if ($count < $page && isset($_POST['addToFavorites']) && !$_POST['addToFavorites']) { //We've deleted last item on page, need a place to land when we return global $_zp_page; header('location: ' . FULLWEBPATH . '/' . $this->getLink($_zp_page - 1)); exitZP(); } } return $count; }
$divider = '- '; } else { $divider = ''; } ?> <?php if (getNumAlbums() > 0) { echo getNumAlbums() . ' ' . gettext("subalbums"); } ?> <?php echo $divider; ?> <?php if (getNumImages() > 0) { echo getNumImages() . ' ' . gettext("images"); } ?> </div> </div> </div> <?php } } else { // or latest images require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php'; $images = getImageStatistic(getOption('zpbase_galhomecount'), 'latest'); foreach ($images as $image) { if (isImagePhoto($image)) { makeImageCurrent($image); ?>
function zp_side_bar() { ?> <div id="sidebar"> <?php //-------------If you are in the Image Page if (in_context(ZP_IMAGE)) { ?> <div class="imgnav"> <?php if (hasPrevImage()) { ?> <div class="imgprevious"><a href="<?php echo getPrevImageURL(); ?> " title="Previous Image"><img src="<?php echo getPrevImageThumb(); ?> " /><br /><small>« prev |</small></a></div> <?php } if (hasNextImage()) { ?> <div class="imgnext"><a href="<?php echo getNextImageURL(); ?> " title="Next Image"><img src="<?php echo getNextImageThumb(); ?> " /><br /><small>| next »</small></a></div> <?php } ?> </div> <div id="sbinfo"> <b>Album Name:</b> <?php printAlbumTitle(true); ?> <br /> <b>Number of Photos:</b> <?php echo getNumImages(); ?> <br /> <b>Album Date:</b> <?php printAlbumDate($before = "Date: ", $format = "%F"); ?> <br /> <b>Album Description:</b> <?php printAlbumDesc(true); ?> <br /> <b>Image Name:</b> <?php echo getImageTitle(); ?> <br /> <b>Image Description:</b> <?php printImageDesc(true); ?> <br /> </div> <?php //--------------- If you are in the Album Page } else { if (in_context(ZP_ALBUM)) { ?> <b>Album Name:</b> <?php printAlbumTitle(true); ?> <br /> <b>Number of Pictures:</b> <?php echo getNumImages(); ?> <br /> <b>Album Date:</b> <?php printAlbumDate($before = "Date: ", $format = "%F"); ?> <br /> <b>Album Description:</b> <?php printAlbumDesc(true); ?> <br /> <?php //--------------- If you are in the Index Page } else { if (in_context(ZP_INDEX)) { } } } ?> </div> <?php }
?> <div class="pagination-nogal clearfix"> <?php printPageListWithNav(' « ', ' » ', false, true, 'clearfix', NULL, true, 7); ?> </div> </noscript> <!-- End of noscript display --> <?php } else { include 'inc_print_image_thumb.php'; } } if (!(getNumImages() > 0 && getOption('use_galleriffic'))) { ?> <div class="pagination-nogal"> <?php printPageListWithNav(' « ', ' » ', false, true, 'clearfix', NULL, true, 7); ?> </div> <?php } ?> <?php include 'inc_footer.php'; } else { include SERVERPATH . '/' . ZENFOLDER . '/404.php'; }
</div> </div> <?php } echo '<div class="clearage"></div>'; ?> </div><!-- images --> </div> <!-- main --> <div class="clearage"></div> <span style="text-align:center"><?php @call_user_func('printSlideShowLink'); ?> </span> <?php if (isset($firstImage)) { printNofM('Photo', $firstImage, $lastImage, getNumImages()); } ?> </div> <!-- content --> <?php } else { /* no images to display */ if (getNumAlbums() == 0) { ?> <div id="main3"> <div id="main2"> <br /> <p align="center"><?php echo gettext('Album is empty'); ?> </p>
?> <ul class="album-info"> <li class="counts <?php if ($zpmas_thumbsize == 'small' && getNumAlbums() > 0) { echo 'smallthumbs'; } ?> "> <?php if (getNumAlbums() > 0) { echo getNumAlbums() . ' ' . gettext('subalbums'); } ?> <?php if (getNumImages() > 0) { echo getNumImages() . ' ' . gettext('images'); } ?> </li> <?php if (strlen(getAlbumDate()) > 0) { ?> <li class="date"><?php printAlbumDate(''); ?> </li><?php } ?> <?php if (strlen(getAlbumDesc()) > 0) { ?>
jQuery('.' + category + '_showmore').hide(); jQuery('.' + category + '_extrashow').show(); } else { jQuery('.' + category + '_showless').hide(); jQuery('.' + category + '_showmore').show(); jQuery('.' + category + '_extrashow').hide(); } } // ]]> --> </script> </head> <body onload="blurAnchors()"> <?php zp_apply_filter('theme_body_open'); $numimages = getNumImages(); $numalbums = getNumAlbums(); $total = $numimages + $numalbums; $zenpage = extensionEnabled('zenpage'); if ($zenpage && !isArchive()) { $numpages = getNumPages(); $numnews = getNumNews(); $total = $total + $numnews + $numpages; } else { $numpages = $numnews = 0; } $searchwords = getSearchWords(); $searchdate = getSearchDate(); if (!empty($searchdate)) { if (!empty($seachwords)) { $searchwords .= ": ";
/** * Prints the image/subalbum count for the album loop */ function jqm_printImageAlbumCount() { $numalb = getNumAlbums(); $numimg = getNumImages(); if ($numalb != 0) { printf(ngettext("%d album", "%d albums", $numalb), $numalb); } if ($numalb != 0 && $numimg != 0) { echo ' / '; } if ($numimg != 0) { printf(ngettext("%d image", "%d images", $numimg), $numimg); } }
if (getOption('show_archive')) { printCustomPageURL(gettext('Archive View'), 'archive', '', ' | '); } if (extensionEnabled('user_login-out')) { printUserLogin_out(' | ', '', 2); } if (!zp_loggedin() && extensionEnabled('register_user')) { printRegisterURL(gettext('Register'), ' | '); } ?> </div> <div id="zpcredit"> <?php printZenphotoLink(getOption('css_style')); if ($_zp_gallery_page == 'image.php' || $_zp_gallery_page == 'album.php' && getOption('use_galleriffic') && getNumImages() > 0 || $_zenpage_enabled && is_NewsArticle()) { ?> <img id="icon-help" src="<?php echo $_zp_themeroot; ?> /images/help.png" title="<?php echo gettext('You can browse with the arrows keys of your keyboard'); ?> " alt="help" /> <?php } ?> </div> <!-- END #zpcredit--> </div> <!-- END #foot-left --> </div> <!-- END #FOOTER --> </div> <!-- END #PAGE -->
printCustomSizedImage(getImageTitle(), null, $ls ? 480 : null, $ls ? null : 480); ?> </strong> </p> <?php } ?> </div> <?php if ($show) { ?> <div id="meta"> <ul> <li class="count"><?php if (($num = getNumImages()) > 1) { printf(gettext('%1$u of %2$u photos'), imageNumber(), getNumImages()); } ?> </li> <li class="date"><?php printImageDate(); ?> </li> <li class="tags"><?php echo getAlbumPlace(); ?> </li> <li class="exif"> <?php if (getImageEXIFData()) { echo "<a href=\"#TB_inline?height=345&width=300&inlineId=imagemetadata\" title=\"" . gettext("image details") . "\" class=\"thickbox\">" . gettext('Image Info') . "</a>";
" title="<?php gettext('Index'); ?> "><?php echo gettext("Index"); ?> </a> » <?php echo gettext("Gallery"); printParentBreadcrumb(" » ", " » ", " » "); printAlbumBreadcrumb(" ", " » "); ?> <strong><?php printImageTitle(true); ?> </strong> (<?php echo imageNumber() . "/" . getNumImages(); ?> ) </h2> </div> <div id="content-left"> <!-- The Image --> <?php // if (function_exists('printjCarouselThumbNav')) { printjCarouselThumbNav(6, 50, 50, 50, 50, FALSE); } else { if (function_exists("printPagedThumbsNav")) { printPagedThumbsNav(6, FALSE, gettext('« prev thumbs'), gettext('next thumbs »'), 40, 40); }
function printPagedThumbsNav($imagesperpage = '', $counter = '', $prev = '', $next = '', $width = NULL, $height = NULL, $crop = false) { global $_zp_current_album, $_zp_current_image; // in case someone wants to override the options by parameter if (empty($imagesperpage)) { $imagesperpage = getOption("pagedthumbs_imagesperpage"); } if (empty($width)) { $width = getOption("pagedthumbs_width"); } else { $width = sanitize_numeric($width); } if (empty($height)) { $height = getOption("pagedthumbs_height"); } else { $height = sanitize_numeric($height); } if (empty($prev)) { $prev = getOption("pagedthumbs_prevtext"); } if (empty($next)) { $next = getOption("pagedthumbs_nexttext"); } if (empty($counter)) { $counter = getOption("pagedthumbs_counter"); } // get the image of current album $images = $_zp_current_album->getImages(); $totalimages = getNumImages(); $totalpages = ceil($totalimages / $imagesperpage); $currentimgnr = imageNumber(); for ($nr = 1; $nr <= $totalpages; $nr++) { $startimg[$nr] = $nr * $imagesperpage - ($imagesperpage - 1); // get start image number for thumb pagination $endimg[$nr] = $nr * $imagesperpage; // get end image number for thumb pagination } // get current page number for ($nr = 1; $nr <= $totalpages; $nr++) { if ($startimg[$nr] <= $currentimgnr) { $currentpage = $nr; } if ($endimg[$nr] >= $currentimgnr) { $currentpage = $nr; break; } } echo "<div id=\"pagedthumbsnav\">\n"; echo "<div class=\"pagedthumbsnav-prev\">\n"; // Prev thumbnails - show only if there is a prev page if ($totalpages > 1) { $prevpageimagenr = $currentpage * $imagesperpage - ($imagesperpage + 1); if ($currentpage > 1) { $prevpageimage = newImage($_zp_current_album, $images[$prevpageimagenr]); echo "<a href=\"" . $prevpageimage->getImageLink() . "\" title=\"" . gettext("previous thumbs") . "\">" . $prev . "</a>\n"; } } echo "</div>\n"; // the thumbnails $number = $startimg[$currentpage] - 2; for ($nr = 1; $nr <= $imagesperpage; $nr++) { $number++; if ($number == $totalimages) { break; } $image = newImage($_zp_current_album, $images[$number]); if ($image->id === getImageID()) { $css = " id='pagedthumbsnav-active' "; } else { $css = ""; } echo "<a {$css} href=\"" . $image->getImageLink() . "\" title=\"" . strip_tags($image->getTitle()) . "\">"; if (getOption("pagedthumbs_crop") or $crop) { echo "<img src='" . $image->getCustomImage(null, $width, $height, $width, $height, null, null, true) . "' alt=\"" . strip_tags($image->getTitle()) . "\" width='" . $width . "' height='" . $height . "' />"; } else { $_zp_current_image = $image; printCustomSizedImageThumbMaxSpace(strip_tags($image->getTitle()), $width, $height); } echo "</a>\n"; if ($number == $endimg[$currentpage]) { break; } } // next thumbnails - show only if there is a next page echo "<div class=\"pagedthumbsnav-next\">\n"; if ($totalpages > 1) { if ($currentpage < $totalpages) { $nextpageimagenr = $currentpage * $imagesperpage; $nextpageimage = newImage($_zp_current_album, $images[$nextpageimagenr]); echo "<a href=\"" . $nextpageimage->getImageLink() . "\" title=\"" . gettext("next thumbs") . "\">" . $next . "</a>\n"; } } //first if echo "</div>\n"; // image counter if ($counter) { $fromimage = $startimg[$currentpage]; if ($totalimages < $endimg[$currentpage]) { $toimage = $totalimages; } else { $toimage = $endimg[$currentpage]; } echo "<p id=\"pagedthumbsnav-counter\">" . sprintf(gettext('Images %1$u-%2$u of %3$u (%4$u/%5$u)'), $fromimage, $toimage, $totalimages, $currentpage, $totalpages) . "</p>\n"; } echo "</div>\n"; }
<?php $x = $x + 1; } ?> <?php } ?> <?php } ?> <span><?php echo gettext('Images in '); echo getBareAlbumTitle(); ?> (<?php echo getNumImages(); ?> )</span> </h4> <div class="image-wrap"> <ul> <?php while (next_image()) { ?> <?php if (isLandscape()) { ?> <li class="thumb-landscape"> <div class="album-tools-landscape"> <?php
/** Prints the jQuery bxslider HTML setup to be replaced by JS * * @param int $minitems The minimum number of thumbs to be visible always if resized regarding responsiveness. * @param int $maxitems The maximum number of thumbs to be visible always if resized regarding responsiveness. * @param int $width Width Set to NULL if you want to use the backend plugin options. * @param int $height Height Set to NULL if you want to use the backend plugin options. * @param int $cropw Crop width Set to NULL if you want to use the backend plugin options. * @param int $croph Crop heigth Set to NULL if you want to use the backend plugin options. * @param bool $crop TRUE for cropped thumbs, FALSE for un-cropped thumbs. $width and $height then will be used as maxspace. Set to NULL if you want to use the backend plugin options. * @param bool $fullimagelink Set to TRUE if you want the thumb link to link to the full image instead of the image page. Set to NULL if you want to use the backend plugin options. * @param string $mode 'horizontal','vertical', 'fade' * @param int $speed The speed in miliseconds the slides advance when clicked */ function printThumbNav($minitems = NULL, $maxitems = NULL, $width = NULL, $height = NULL, $cropw = NULL, $croph = NULL, $fullimagelink = NULL, $mode = NULL, $speed = NULL) { global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_gallery_page; // Just incase the theme has not set the option, at least second try will work! setOptionDefault('bxslider_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page), 1); $items = ""; if (is_object($_zp_current_album) && $_zp_current_album->getNumImages() >= 2) { if (is_null($minitems)) { $minitems = getOption('bxslider_minitems'); } else { $minitems = sanitize_numeric($minitems); } $minitems = max(1, (int) $minitems); if (is_null($maxitems)) { $maxitems = getOption('bxslider_maxitems'); } else { $maxitems = sanitize_numeric($maxitems); } $maxitems = max(1, (int) $maxitems); if (is_null($width)) { $width = getOption('bxslider_width'); } else { $width = sanitize_numeric($width); } if (is_null($height)) { $height = getOption('bxslider_height'); } else { $height = sanitize_numeric($height); } if (is_null($cropw)) { $cropw = getOption('bxslider_cropw'); } else { $cropw = sanitize_numeric($cropw); } if (is_null($croph)) { $croph = getOption('bxslider_croph'); } else { $croph = sanitize_numeric($croph); } if (is_null($fullimagelink)) { $fullimagelink = getOption('bxslider_fullimagelink'); } else { $fullimagelink = sanitize($fullimagelink); } if (is_null($mode)) { $mode = getOption('bxslider_mode'); } else { $mode = sanitize($mode); } if (is_null($speed)) { $speed = getOption('bxslider_speed'); } else { $speed = sanitize_numeric($speed); } if (in_context(ZP_SEARCH_LINKED)) { if ($_zp_current_search->getNumImages() === 0) { $searchimages = false; } else { $searchimages = true; } } else { $searchimages = false; } if (in_context(ZP_SEARCH_LINKED) && $searchimages) { $bxslider_items = $_zp_current_search->getImages(); } else { $bxslider_items = $_zp_current_album->getImages(); } if (count($bxslider_items) >= 2) { foreach ($bxslider_items as $item) { if (is_array($item)) { $imgobj = newImage(newAlbum($item['folder']), $item['filename']); } else { $imgobj = newImage($_zp_current_album, $item); } if ($fullimagelink) { $link = $imgobj->getFullImageURL(); } else { $link = $imgobj->getLink(); } if (!is_null($_zp_current_image)) { if ($_zp_current_album->isDynamic()) { if ($_zp_current_image->filename == $imgobj->filename && $_zp_current_image->getAlbum()->name == $imgobj->getAlbum()->name) { $active = ' class="activeimg" '; } else { $active = ''; } } else { if ($_zp_current_image->filename == $imgobj->filename) { $active = ' class="activeimg" '; } else { $active = ''; } } } else { $active = ''; } $imageurl = $imgobj->getCustomImage(NULL, $width, $height, $cropw, $croph, NULL, NULL, true); $items[] = '<li' . $active . '><a href="' . $link . '"><img src="' . html_encode($imageurl) . '" alt="' . html_encode($imgobj->getTitle()) . '"></a></li>'; } } $albumid = $_zp_current_album->get('id'); //$items = substr($items, 0, -2); $numimages = getNumImages(); if (!is_null($_zp_current_image)) { $imgnumber = imageNumber() - 1; } else { $imgnumber = 0; } ?> <ul class="bxslider<?php echo $albumid; ?> "> <?php $count = ''; foreach ($items as $item) { echo $item; } ?> </ul> <script type="text/javascript"> $(document).ready(function() { var index = $('.bxslider<?php echo $albumid; ?> li.activeimg').index(); index = ++index; currentPager = parseInt(index / <?php echo $maxitems; ?> ) $('.bxslider<?php echo $albumid; ?> ').bxSlider({ mode: '<?php echo $mode; ?> ', minSlides: <?php echo $minitems; ?> , maxSlides: <?php echo $maxitems; ?> , speed: <?php echo $speed; ?> , slideWidth: <?php echo $width; ?> , slideMargin: 5, moveSlides: <?php echo $maxitems; ?> - 1, pager: false, adaptiveHeight: true, useCSS: false, startSlide: currentPager }); }); </script> <?php } }
?> <p><?php echo truncate_string(getAlbumDesc(), 45); ?> </p> </div> </div> <?php } ?> </div> <?php } ?> <?php if (getNumImages() > 0) { ?> <div id="images"> <?php while (next_image()) { ?> <div class="image"> <div class="imagethumb"><a href="<?php echo html_encode(getImageURL()); ?> " title="<?php printBareImageTitle(); ?> "><?php printImageThumb(getBareImageTitle()); ?>
/** * Checks for URL page out-of-bounds for "standard" themes * Note: This function assumes that an "index" page will display albums * and the pagination be determined by them. Any other "index" page strategy needs to be * handled by the theme itself. * * @param boolean $request * @param string $gallery_page * @param int $page * @return boolean will be true if all is well, false if a 404 error should occur */ function checkPageValidity($request, $gallery_page, $page) { global $_zp_gallery, $_firstPageImages, $_oneImagePage, $_zp_zenpage, $_zp_current_category; $count = NULL; switch ($gallery_page) { case 'album.php': case 'search.php': $albums_per_page = max(1, getOption('albums_per_page')); $pageCount = (int) ceil(getNumAlbums() / $albums_per_page); $imageCount = getNumImages(); if ($_oneImagePage) { if ($_oneImagePage === true) { $imageCount = min(1, $imageCount); } else { $imageCount = 0; } } $images_per_page = max(1, getOption('images_per_page')); $count = $pageCount + (int) ceil(($imageCount - $_firstPageImages) / $images_per_page); break; case 'index.php': if (galleryAlbumsPerPage() != 0) { $count = (int) ceil($_zp_gallery->getNumAlbums() / galleryAlbumsPerPage()); } break; case 'news.php': if (in_context(ZP_ZENPAGE_NEWS_CATEGORY)) { $count = count($_zp_current_category->getArticles()); } else { $count = count($_zp_zenpage->getArticles()); } $count = (int) ceil($count / ZP_ARTICLES_PER_PAGE); break; default: $count = zp_apply_filter('checkPageValidity', NULL, $gallery_page, $page); break; } if ($page > $count) { $request = false; // page is out of range } return $request; }