/** * prints the image according to the size chosen * * @param string $alt alt text for the img src Tag * @param string $default the default (initial) value for the image sizing * @param string $class if not empty will be used as the image class tag * @param string $id if not empty will be used as the image id tag */ function printUserSizeImage($alt, $default = NULL, $class = NULL, $id = NULL) { $size = $width = $height = NULL; getViewerImageSize($default, $size, $width, $height); if (empty($size)) { printCustomSizedImageMaxSpace($alt, $width, $height, $class, $id); } else { printCustomSizedImage($alt, $size, $width, $height, NULL, NULL, NULL, NULL, $class, $id, false); } }
</div> <div class="wrapper"> <div class="container"> <?php $nextimg = $_zp_current_image->getNextImage(); $previmg = $_zp_current_image->getPrevImage(); ?> <div class="ten columns"> <div class="image-wrap" id="image"> <?php if ($zpskel_ismobile) { $size = 420; } else { $size = 630; } printCustomSizedImage(getBareImageTitle(), $size, null, null, null, null, null, null, 'remove-attributes'); ?> <?php if ($nextimg) { ?> <a class="mobile-nav next" href="<?php echo html_encode(getNextImageURL()); ?> #image" title="<?php echo gettext("Next Image"); ?> ">»</a> <?php } if ($previmg) { ?>
/** * This function is considered deprecated. * Please use the new replacement get/printCustomSizedImageMaxSpace(). * * Prints out a sized image up to $maxheight tall (as width the value set in the admin option is taken) * * @param int $maxheight how bif the picture should be */ function printCustomSizedImageMaxHeight($maxheight) { trigger_error(gettext('printCustomSizedImageMaxHeight is deprecated. Use printCustomSizedImageMaxSpace().'), E_USER_NOTICE); if (getFullWidth() === getFullHeight() or getDefaultHeight() > $maxheight) { printCustomSizedImage(getImageTitle(), null, null, $maxheight, null, null, null, null, null, null); } else { printDefaultSizedImage(getImageTitle()); } }
/** * @deprecated */ function printCustomSizedImageMaxHeight($maxheight) { deprecated_function_notify(gettext('Use printCustomSizedImageMaxSpace().')); if (getFullWidth() === getFullHeight() or getDefaultHeight() > $maxheight) { printCustomSizedImage(getImageTitle(), null, null, $maxheight, null, null, null, null, null, null); } else { printDefaultSizedImage(getImageTitle()); } }
echo $wide . $high; ?> > <div id="pic_day"> <?php if ($randomImage) { ?> <a href="<?php echo html_encode(getGalleryIndexURL()); ?> " title="<?php echo gettext('Albums Index'); ?> "> <?php printCustomSizedImage(gettext('Visit the image gallery'), $size); ?> </a> <?php } else { echo '<img src="' . WEBPATH . '/' . ZENFOLDER . '/images/zen-logo.png" width="310" height="90" alt="' . gettext('There were no images from which to select the random heading.') . '" />'; } ?> </div> <?php if (!$zenpage) { ?> <p align="center"> <a href="<?php echo html_encode(getGalleryIndexURL()); ?>
// reset to start with a again; break; } ?> <a class="image<?php echo $imgclass; ?> " href="<?php echo html_encode(getImageURL()); ?> " title="<?php printBareImageTitle(); ?> "> <?php printCustomSizedImage(getAnnotatedImageTitle(), NULL, 230, 230, 230, 230, NULL, NULL, NULL, NULL, true, NULL); ?> </a> <?php } ?> </div> <br class="clearall" /> <?php if (hasPrevPage() || hasNextPage()) { printPageListWithNav(gettext("prev"), gettext("next"), false, true, 'pagelist', NULL, true, 7); } if (function_exists('printSlideShowLink')) { echo '<span id="slideshowlink">'; printSlideShowLink(); echo '</span>';
echo getImageTitle(); ?> </h3> <p><?php echo getImageDesc(); ?> </p> <a href="<?php echo htmlspecialchars(getImageLinkURL()); ?> " title="<?php echo getBareImageTitle(); ?> " class="open"></a> <?php printCustomSizedImage(getImageTitle(), null, 540, null, null, null, null, null, 'full'); ?> <?php printImageThumb(getImageTitle(), 'thumbnail'); ?> </div> <?php } } ?> </div> <!-- smoothImages --> <?php if (!$show) { if ($imagePage) { $url = htmlspecialchars(getPageURL(getTotalPages(true)));
printCustomSizedImage(getAnnotatedImageTitle(), 550); ?> </a><?php } ?> <?php if ($zpmin_finallink == 'standard-new') { ?> <a target="_blank" href="<?php echo html_encode(getFullImageURL()); ?> " title="<?php echo html_encode(getBareImageTitle()); ?> "><?php printCustomSizedImage(getAnnotatedImageTitle(), 550); ?> </a><?php } ?> </div> </div> <?php if (function_exists('printAddToFavorites')) { echo '<div class="section">'; printAddToFavorites($_zp_current_album); echo '</div>'; } ?> <?php
<?php zp_side_bar(); ?> <div id="image_left"> <div class="image_container"> <a class="thickbox" href="<?php echo getFullImageURL(); ?> " title="<?php echo getImageTitle(); ?> "> <?php printCustomSizedImage("", 480, ""); ?> </a> </div> <div id="narrow"> <?php if (function_exists('printCommentForm')) { printCommentForm(); } ?> </div> </div> <?php zp_footer(); ?>
?> <div id="padbox"> <div id="image" class="imageit"> <?php if ($width < 650) { printCustomSizedImage('', 600); } else { ?> <a href="<?php echo getFullImageURL(); ?> " title="<?php echo getImageTitle(); ?> "> <?php printCustomSizedImage('', 600); ?> </a> <?php } ?> </div> <div id="tools"> <?php if (hasPrevImage()) { ?> <a href="<?php echo getPrevImageURL(); ?> "><span class="prev"></span></a> <?php
</ul> <div class="l_clear"></div> <ul class="album"> <?php while (next_image()) { ?> <li class="grid_5"> <a href="<?php echo html_encode(getImageURL()); ?> " title="<?php echo getAnnotatedImageTitle(); ?> "> <?php printCustomSizedImage(getAnnotatedImageTitle(), NULL, 376, 140, 376, 140, NULL, NULL, NULL, NULL, true, NULL); ?> </a> <span><?php echo getAnnotatedImageTitle(); ?> </span> </li> <?php } ?> </ul> </div> <div class="clear"></div> <?php printPageListWithNav("« " . gettext("prev"), gettext("next") . " »", false, true, 'pagelist', null, true, 5);
for ($i = 1; $i <= 5; $i++) { $randomImage = getRandomImages(); if (is_object($randomImage) && $randomImage->exists) { makeImageCurrent($randomImage); } ?> <li> <a href="<?php echo html_encode(getCustomPageURL('gallery')); ?> " title="<?php html_encode(gettext('Gallery')); ?> "> <?php printCustomSizedImage(gettext('Gallery'), null, 780, 400, 780, 400); ?> </a> </li> <?php } ?> </ul> </div> </div> <?php } else { ?> <div class="span10 offset1"> <div class="flexslider"> <img src="<?php
echo "</li>\n"; } */ if (hasNextImage()) { $link = getNextImageURL(); } else { $link = "#"; } echo "<li><a href=\"{$link}\" title=\"Next Image\">»</a></li>"; ?> </ul> </div> <div id="imageList"> <?php printCustomSizedImage(getImageTitle(), 320); ?> </div> <div id="text"> <?php printImageDesc(true); ?> <div id="commentbox"> <?php if (function_exists('printCommentForm')) { printCommentForm(); } ?>
/** * Print normal video or un-cropped within the given height and width dimensions. Use for sized images or thumbnails in an album. * Note: a class of 'not_visible' or 'password_protected' will be added as appropriate * * @param string $alt Alt text for the url * @param int $width width * @param int $height height * @param string $class Optional style class * @param string $id Optional style id */ function printCustomSizedImageMaxSpace($alt, $width, $height, $class = NULL, $id = NULL, $thumb = false) { global $_zp_current_image; if (is_null($_zp_current_image)) { return; } getMaxSpaceContainer($width, $height, $_zp_current_image, $thumb); printCustomSizedImage($alt, NULL, $width, $height, NULL, NULL, NULL, NULL, $class, $id, $thumb); }
printCustomSizedImage(getAnnotatedImageTitle(), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), null, null, 'remove-attributes', null, true); } else { printImageThumb(getBareImageTitle(), 'remove-attributes'); } } else { ?> <a href="<?php echo html_encode(getImageURL()); ?> " title="<?php printBareImageTitle(); ?> "> <?php if (getOption('thumb_crop')) { printCustomSizedImage(getAnnotatedImageTitle(), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), getOption('thumb_size'), null, null, 'remove-attributes', null, true); } else { printImageThumb(getBareImageTitle(), 'remove-attributes'); } ?> </a> <?php } ?> <?php if (getOption('zpbase_magnific_masonry') || getOption('zpbase_nodetailpage')) { if (getOption('zpbase_magnific_target') == 'imagepage') { ?> <a class="masonry-image-popup" href="<?php echo html_encode(getImageURL()); ?>
?> <div class="sdscroll-item"> <?php if (getOption('zpbase_nodetailpage')) { printCustomSizedImage(getBareImageTitle(), null, null, getOption('zpbase_sds_maxheight'), null, null, null, null, 'remove-attributes', null, true); } else { ?> <a href="<?php echo html_encode(getImageURL()); ?> " title="<?php printBareImageTitle(); ?> "> <?php printCustomSizedImage(getBareImageTitle(), null, null, getOption('zpbase_sds_maxheight'), null, null, null, null, 'remove-attributes', null, true); ?> </a> <?php } ?> <?php if ((getOption('zpbase_magnific_sds') || getOption('zpbase_nodetailpage')) && isImagePhoto($_zp_current_image)) { ?> <a title ="<?php echo getBareImageTitle(); ?> " class="image-popup" <?php if (!getOption('zpbase_nodetailpage')) { ?>
$fullimage = getFullImageURL(); } else { $fullimage = NULL; } if (!empty($fullimage)) { ?> <a href="<?php echo html_encode(pathurlencode($fullimage)); ?> " title="<?php printBareImageTitle(); ?> " class="thickbox"> <?php } printCustomSizedImage(getImageTitle(), null, 520); if (!empty($fullimage)) { ?> </a> <?php } ?> </div> <?php if (function_exists('printAddToFavorites')) { printAddToFavorites($_zp_current_image); } @call_user_func('printRating'); @call_user_func('printCommentForm'); printCodeblock(2); footer();
echo $_zp_themeroot; ?> /images/shout.png" alt="Comments" /></a> <?php } ?> </div> <a class="thumb" href="<?php echo htmlspecialchars(getImageURL()); ?> " title="<?php echo getBareImageTitle(); ?> "> <?php printCustomSizedImage(getBareImageTitle(), null, 120, 160, 120, 160, null, null, 'thumb', null, true); ?> </a> <?php } ?> </li> <?php } ?> </ul> </div> <?php } ?>
<div class="image-block" style="width:<?php echo $zpmas_image_size; ?> px;height:<?php echo $zpmas_image_size; ?> px;"> <div class="back"> <a class="thumb-link" href="<?php echo html_encode(getImageURL()); ?> " title="<?php echo getBareImageTitle(); ?> "><?php printCustomSizedImage(getAnnotatedImageTitle(), null, $zpmas_image_size, $zpmas_image_size, $zpmas_image_size, $zpmas_image_size, null, null, null, null, true); ?> </a> </div> <?php if (!isImageVideo()) { ?> <div class="overlay"> <a class="zpmas-cb" href="<?php if ($zpmas_cbtarget) { echo htmlspecialchars(getDefaultSizedImage()); } else { echo htmlspecialchars(getUnprotectedImageURL()); } ?> " title="<?php
/** * support to show an image from an album * The imagename is optional. If absent the album thumb image will be * used and the link will be to the album. If present the link will be * to the image. * * @param string $albumname * @param string $imagename * @param int $size the size to make the image. If omitted image will be 50% of 'image_size' option. * @param bool $linkalbum set true to link specific image to album instead of image */ function zenpageAlbumImage($albumname, $imagename = NULL, $size = NULL, $linkalbum = false) { global $_zp_gallery; echo '<br />'; $album = newAlbum($albumname); if ($album->loaded) { if (is_null($size)) { $size = floor(getOption('image_size') * 0.5); } $image = NULL; if (is_null($imagename)) { $linkalbum = true; $image = $album->getAlbumThumbImage(); } else { $image = newImage($album, $imagename); } if ($image && $image->loaded) { makeImageCurrent($image); if ($linkalbum) { rem_context(ZP_IMAGE); echo '<a href="' . html_encode($album->getLink()) . '" title="' . sprintf(gettext('View the %s album'), $albumname) . '">'; add_context(ZP_IMAGE); printCustomSizedImage(sprintf(gettext('View the album %s'), $albumname), $size); rem_context(ZP_IMAGE | ZP_ALBUM); echo '</a>'; } else { echo '<a href="' . html_encode(getImageURL()) . '" title="' . sprintf(gettext('View %s'), $imagename) . '">'; printCustomSizedImage(sprintf(gettext('View %s'), $imagename), $size); rem_context(ZP_IMAGE | ZP_ALBUM); echo '</a>'; } } else { ?> <span style="background:red;color:black;"> <?php printf(gettext('<code>zenpageAlbumImage()</code> did not find the image %1$s:%2$s'), $albumname, $imagename); ?> </span> <?php } } else { ?> <span style="background:red;color:black;"> <?php printf(gettext('<code>zenpageAlbumImage()</code> did not find the album %1$s'), $albumname); ?> </span> <?php } }
$wide = ''; } else { $wide = "style=\"width:" . ($w + 22) . "px;\""; } ?> <div class="main" <?php echo $wide; ?> > <?php if ($show = !checkForPassword()) { ?> <p id="photo"> <strong> <?php 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());
<div class="<?php echo $colclass; ?> columns image imagegrid"> <a href="<?php echo html_encode(getImageURL()); ?> " title="<?php echo html_encode(getBareImageTitle()); ?> "> <?php if ($thumbcrop) { printCustomSizedImage(getBareImageTitle(), null, $imagesize, $imagesize, $imagesize, $imagesize, null, null, 'remove-attributes', null, true); } else { printCustomSizedImage(getBareImageTitle(), $imagesize, null, null, null, null, null, null, 'remove-attributes', null, true); } ?> </a> </div> <?php $c++; $mobilebreak = $c % 2; if ($c == $breakcount) { echo '<br class="clear clearforboth" />'; $c = 0; } else { if ($mobilebreak == 0) { echo '<br class="clear clearformobile" />'; } }
/** * 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 }