function printNewsHTML($num)
 {
     if (!$_REQUEST['words']) {
         return;
     }
     global $_zp_current_zenpage_news, $_zp_current_search;
     if (!defined('CROP_NEWS')) {
         define('CROP_NEWS', TRUE);
     }
     save_context();
     add_context(ZP_ZENPAGE_NEWS_ARTICLE);
     $u = 0;
     processExpired('zenpage_news');
     $articles = $_zp_current_search->getSearchNews();
     if (count($articles) == 0) {
         return;
     }
     $articles = $this->sortArticles($articles, 'id');
     echo "<div id='snr'>";
     echo "<div>Also found " . count($articles) . " news";
     if (count($articles) > 3) {
         echo " - showing the last 3</div>";
     } else {
         echo "</div>";
     }
     echo "</div>";
     $len = count($articles);
     for ($u = $len - 1; $u >= 0 && $u > $len - 4; $u--) {
         $news = $articles[$u];
         $_zp_current_zenpage_news = new ZenpageNews($news['titlelink']);
         Utils::render("tiles/news/template.php");
     }
     restore_context();
 }
/**
 * Returns pages from the current page object/search/or parent pages based on context
 * Updates $_zp_zenpage_curent_page and returns true if there is another page to be delivered
 * @return boolean
 */
function next_page()
{
    global $_zp_zenpage, $_zp_next_pagelist, $_zp_current_search, $_zp_current_zenpage_page, $_zp_current_page_restore;
    if (func_num_args() != 0) {
        //	These parameters are deprecated
        Zenpage_internal_deprecations::next_page();
    }
    if (is_null($_zp_next_pagelist)) {
        if (in_context(ZP_SEARCH)) {
            $_zp_next_pagelist = $_zp_current_search->getPages(NULL, false, NULL, NULL, NULL);
        } else {
            if (in_context(ZP_ZENPAGE_PAGE)) {
                if (!is_null($_zp_current_zenpage_page)) {
                    $_zp_next_pagelist = $_zp_current_zenpage_page->getPages(NULL, false, NULL, NULL, NULL);
                }
            } else {
                $_zp_next_pagelist = $_zp_zenpage->getPages(NULL, true, NULL, NULL, NULL);
            }
        }
        save_context();
        add_context(ZP_ZENPAGE_PAGE);
        $_zp_current_page_restore = $_zp_current_zenpage_page;
    }
    while (!empty($_zp_next_pagelist)) {
        $page = new ZenpagePage(array_shift($_zp_next_pagelist));
        if (zp_loggedin() && $page->isMyItem(LIST_RIGHTS) || $page->checkForGuest()) {
            $_zp_current_zenpage_page = $page;
            return true;
        }
    }
    $_zp_next_pagelist = NULL;
    $_zp_current_zenpage_page = $_zp_current_page_restore;
    restore_context();
    return false;
}
/**
 * Returns the next image on a page.
 * sets $_zp_current_image to the next image in the album.
 * Returns true if there is an image to be shown
 *
 * @param bool $all set to true disable pagination
 * @param int $firstPageCount the number of images which can go on the page that transitions between albums and images
 * 							Normally this parameter should be NULL so as to use the default computations.
 * @param bool $mine overridePassword the password check
 * @return bool
 *
 * @return bool
 */
function next_image($all = false, $firstPageCount = NULL, $mine = NULL)
{
    global $_zp_images, $_zp_current_image, $_zp_current_album, $_zp_page, $_zp_current_image_restore, $_zp_current_search, $_zp_gallery, $_firstPageImages;
    if ($mine != NULL && gettype($mine) != 'boolean' || func_num_args() > 3) {
        internal_deprecations::next_image();
    }
    if (is_null($firstPageCount)) {
        $firstPageCount = $_firstPageImages;
    }
    $imagePageOffset = getTotalPages(2);
    /* gives us the count of pages for album thumbs */
    if ($all) {
        $imagePage = 1;
        $firstPageCount = 0;
    } else {
        $_firstPageImages = $firstPageCount;
        /* save this so pagination can see it */
        $imagePage = $_zp_page - $imagePageOffset;
    }
    if ($firstPageCount > 0 && $imagePageOffset > 0) {
        $imagePage = $imagePage + 1;
        /* can share with last album page */
    }
    if ($imagePage <= 0) {
        return false;
        /* we are on an album page */
    }
    if (is_null($_zp_images)) {
        if (in_context(ZP_SEARCH)) {
            $_zp_images = $_zp_current_search->getImages($all ? 0 : $imagePage, $firstPageCount, NULL, NULL, true, $mine);
        } else {
            $_zp_images = $_zp_current_album->getImages($all ? 0 : $imagePage, $firstPageCount, NULL, NULL, true, $mine);
        }
        if (empty($_zp_images)) {
            return NULL;
        }
        $_zp_current_image_restore = $_zp_current_image;
        $img = array_shift($_zp_images);
        $_zp_current_image = newImage($_zp_current_album, $img, true, true);
        save_context();
        add_context(ZP_IMAGE);
        return true;
    } else {
        if (empty($_zp_images)) {
            $_zp_images = NULL;
            $_zp_current_image = $_zp_current_image_restore;
            restore_context();
            return false;
        } else {
            $img = array_shift($_zp_images);
            $_zp_current_image = newImage($_zp_current_album, $img, true, true);
            return true;
        }
    }
}
Esempio n. 4
0
												</a>
												<div class="caption">
													<div class="download">
														<a href="<?php 
                echo html_encode($image->getLink());
                ?>
" title="<?php 
                echo html_encode($image->getTitle());
                ?>
"></a>
													</div>
												</div>
											</li>
		<?php 
            }
            restore_context();
            ?>

									<?php 
        } else {
            if ($zpgal_minigaloption == 'random') {
                ?>
		<?php 
                for ($i = 1; $i <= $minigalcount; $i++) {
                    $randomImage = getRandomImages();
                    if (is_object($randomImage) && $randomImage->exists) {
                        $randomImageURL = html_encode(getURL($randomImage));
                        ?>
												<li>
													<a class="thumb" href="<?php 
                        echo html_encode($randomImage->getCustomImage(null, 412, $minigalimageheight, 412, $minigalimageheight, null, null, true));
Esempio n. 5
0
/**
 * Prints an image or album statistic slideshow using the {@link http://galleria.io/  jQuery plugin Galleria}
 *
 * See readme/documentation for usage:
 * Call directly in a template file or codeblock.
 *
 * NOTE: movie and audio files not supported.
 *
 * @param string $type return statistics of either 'images' or 'albums'
 * @param integer $number the number of items to get (images or albums, depending on $type set)
 * @param string $option
 *  	"popular" for the most popular
 *		"latest" for the latest uploaded by id (Discovery)
 * 		"latest-date" for the latest by date
 * 		"latest-mtime" for the latest by mtime
 *   	"latest-publishdate" for the latest by publishdate
 *      "mostrated" for the most voted
 *		"toprated" for the best voted
 *		"latestupdated" for the latest updated
 *		"random" for random order (yes, strictly no statistical order...)
 * @param string $albumfolder foldername of a specific album to pull items from
 * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
 * @param bool $linkslides true to link to image or album on slide, else click advances slideshow instead
 * @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped.  Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
 * @param integer $threshold the minimum number of ratings an image must have to be included in the list. (Default 0)
 *
 */
function printGslideshowStatistic($type, $number, $option, $albumfolder = '', $collection = false, $linkslides = true, $autoplay = true, $threshold = 0)
{
    save_context();
    $data = 'data';
    $embedded = true;
    $forceheight = true;
    $imagenumber = 0;
    $albumtitle = '';
    $returnpath = '';
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
    if ($type == 'album' || $type == 'albums') {
        $albums = getAlbumStatistic($number, $option, $albumfolder);
    } else {
        $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
    }
    ?>

			<script>
				var data = [

	<?php 
    if ($type == 'album' || $type == 'albums') {
        $c = 1;
        foreach ($albums as $album) {
            $tempalbum = newAlbum($album['folder']);
            $albumpath = html_encode(rewrite_path("/" . pathurlencode($tempalbum->name), "index.php?album=" . pathurlencode($tempalbum->name)));
            $albumthumb = $tempalbum->getAlbumThumbImage();
            $image = newImage($tempalbum, $albumthumb->filename);
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($tempalbum->getTitle()) . '\',' . "\n";
                $desc = $tempalbum->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . $albumpath . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    } else {
        $c = 1;
        foreach ($images as $image) {
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_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";
                echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    }
    ?>
				];
			</script>
			<?php 
    printGalleriaRun($data, $linkslides, $autoplay, $embedded, $forceheight, $imagenumber, $albumtitle, $returnpath);
    restore_context();
    // needed if the slideshow is for example called directly via album object before the next_album loop on index.php
}
Esempio n. 6
0
/**
 * Places album and all of its album pages on one sitemap
 *
 * Gets links to all albums incl. pagination and if the Google image video extension is enabled for images using this as well.
 * This is independent from the images fetched by getSitemapImages().
 *
 * NOTE: Using the Google extension is currently NOT recommended if you have a huge gallery.
 *
 * @return string
 */
function getSitemapAlbums()
{
    global $_zp_gallery, $sitemap_number;
    $data = '';
    $sitemap_locales = generateLanguageList();
    $albumchangefreq = getOption('sitemap_changefreq_albums');
    $imagechangefreq = getOption('sitemap_changefreq_images');
    $albumlastmod = getOption('sitemap_lastmod_albums');
    $albumlastmod = sanitize($albumlastmod);
    $imagelastmod = getOption('sitemap_lastmod_images');
    $albums = array();
    getSitemapAlbumList($_zp_gallery, $albums, 'passAlbums');
    $offset = $sitemap_number - 1;
    $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
    if (!empty($albums)) {
        $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
        $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
        foreach ($albums as $album) {
            $albumobj = newAlbum($album['folder']);
            set_context(ZP_ALBUM);
            makeAlbumCurrent($albumobj);
            $pageCount = getTotalPages();
            //$imageCount = getNumImages();
            //$images = $albumobj->getImages();
            $date = sitemap_getDateformat($albumobj, $albumlastmod);
            switch (SITEMAP_LOCALE_TYPE) {
                case 1:
                    foreach ($sitemap_locales as $locale) {
                        $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name);
                        $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                        $data .= sitemap_echonl("\t</url>");
                    }
                    break;
                case 2:
                    foreach ($sitemap_locales as $locale) {
                        $url = rewrite_path(pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), dynamic_locale::fullHostPath($locale));
                        $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                        $data .= sitemap_echonl("\t</url>");
                    }
                    break;
                default:
                    $url = rewrite_path(pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), FULLWEBPATH);
                    $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                    $data .= sitemap_echonl("\t</url>");
                    break;
            }
            // print album pages if avaiable
            if ($pageCount > 1) {
                for ($x = 2; $x <= $pageCount; $x++) {
                    switch (SITEMAP_LOCALE_TYPE) {
                        case 1:
                            foreach ($sitemap_locales as $locale) {
                                $url = seo_locale::localePath(true, $locale) . '/' . pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x;
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                                $data .= sitemap_echonl("\t</url>");
                            }
                            break;
                        case 2:
                            foreach ($sitemap_locales as $locale) {
                                $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, dynamic_locale::fullHostPath($locale));
                                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                                $data .= sitemap_echonl("\t</url>");
                            }
                            break;
                        default:
                            $url = rewrite_path(pathurlencode($albumobj->name) . '/' . _PAGE_ . '/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, FULLWEBPATH);
                            $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                            $data .= sitemap_echonl("\t</url>");
                            break;
                    }
                }
            }
        }
        $data .= sitemap_echonl('</urlset>');
        // End off the <urlset> tag
    }
    restore_context();
    return $data;
}
/**
 * Returns pages from the current page object/search/or parent pages based on context
 * Updates $_zp_CMS_curent_page and returns true if there is another page to be delivered
 * @return boolean
 */
function next_page()
{
    global $_zp_CMS, $_zp_next_pagelist, $_zp_current_search, $_zp_current_page, $_zp_current_page_restore;
    if ($_zp_CMS->pages_enabled && is_null($_zp_next_pagelist)) {
        if (in_context(ZP_SEARCH)) {
            $_zp_next_pagelist = $_zp_current_search->getPages(NULL, false, NULL, NULL, NULL);
        } else {
            if (in_context(ZP_ZENPAGE_PAGE)) {
                if (!is_null($_zp_current_page)) {
                    $_zp_next_pagelist = $_zp_current_page->getPages(NULL, false, NULL, NULL, NULL);
                }
            } else {
                $_zp_next_pagelist = $_zp_CMS->getPages(NULL, true, NULL, NULL, NULL);
            }
        }
        save_context();
        add_context(ZP_ZENPAGE_PAGE);
        $_zp_current_page_restore = $_zp_current_page;
    }
    while (!empty($_zp_next_pagelist)) {
        $page = newPage(array_shift($_zp_next_pagelist));
        if (zp_loggedin() && $page->isMyItem(LIST_RIGHTS) || $page->checkForGuest()) {
            $_zp_current_page = $page;
            return zp_apply_filter('next_object_loop', true, $_zp_current_page);
        }
    }
    $_zp_next_pagelist = NULL;
    $_zp_current_page = $_zp_current_page_restore;
    restore_context();
    return zp_apply_filter('next_object_loop', false, $_zp_current_page);
}
/**
 * Returns the next image on a page.
 * sets $_zp_current_image to the next image in the album.
 * Returns true if there is an image to be shown
 *
 * @param bool $all set to true disable pagination
 * @param int $firstPageCount the number of images which can go on the page that transitions between albums and images
 * 							Normally this parameter should be NULL so as to use the default computations.
 * @param bool $mine overridePassword the password check
 * @return bool
 *
 * @return bool
 */
function next_image($all = false, $firstPageCount = NULL, $mine = NULL)
{
    global $_zp_images, $_zp_current_image, $_zp_current_album, $_zp_page, $_zp_current_image_restore, $_zp_current_search, $_zp_gallery, $_firstPageImages, $_imagePageOffset;
    if (is_null($firstPageCount)) {
        $firstPageCount = $_firstPageImages;
    }
    if (is_null($_imagePageOffset)) {
        $_imagePageOffset = getTotalPages(2);
        /* gives us the count of pages for album thumbs */
    }
    if ($all) {
        $imagePage = 1;
        $firstPageCount = 0;
    } else {
        $_firstPageImages = $firstPageCount;
        /* save this so pagination can see it */
        $imagePage = $_zp_page - $_imagePageOffset;
    }
    if ($firstPageCount > 0 && $_imagePageOffset > 0) {
        $imagePage = $imagePage + 1;
        /* can share with last album page */
    }
    if ($imagePage <= 0) {
        $result = false;
        /* we are on an album page */
    } else {
        if (is_null($_zp_images)) {
            if (in_context(ZP_SEARCH)) {
                $_zp_images = $_zp_current_search->getImages($all ? 0 : $imagePage, $firstPageCount, NULL, NULL, true, $mine);
            } else {
                $_zp_images = $_zp_current_album->getImages($all ? 0 : $imagePage, $firstPageCount, NULL, NULL, true, $mine);
            }
            if (empty($_zp_images)) {
                $result = NULL;
            } else {
                $_zp_current_image_restore = $_zp_current_image;
                $img = array_shift($_zp_images);
                $_zp_current_image = newImage($_zp_current_album, $img, true, true);
                save_context();
                add_context(ZP_IMAGE);
                $result = true;
            }
        } else {
            if (empty($_zp_images)) {
                $_zp_images = NULL;
                $_zp_current_image = $_zp_current_image_restore;
                restore_context();
                $result = false;
            } else {
                $img = array_shift($_zp_images);
                $_zp_current_image = newImage($_zp_current_album, $img, true, true);
                $result = true;
            }
        }
    }
    return zp_apply_filter('next_object_loop', $result, $_zp_current_image);
}
/**
 * Places album and all of its album pages on one sitemap
 *
 * Gets links to all albums incl. pagination and if the Google image video extension is enabled for images using this as well.
 * This is independent from the images fetched by getSitemapImages().
 *
 * NOTE: Using the Google extension is currently NOT recommended if you have a huge gallery.
 *
 * @return string
 */
function getSitemapAlbums()
{
    global $_zp_gallery, $sitemap_number;
    $data = '';
    $sitemap_locales = generateLanguageList();
    $albumchangefreq = getOption('sitemap_changefreq_albums');
    $imagechangefreq = getOption('sitemap_changefreq_images');
    $albumlastmod = getOption('sitemap_lastmod_albums');
    $albumlastmod = sanitize($albumlastmod);
    $imagelastmod = getOption('sitemap_lastmod_images');
    $albums = array();
    getSitemapAlbumList($_zp_gallery, $albums, 'passAlbums');
    $offset = $sitemap_number - 1;
    $albums = array_slice($albums, $offset, SITEMAP_CHUNK);
    if (!empty($albums)) {
        $data .= sitemap_echonl('<?xml version="1.0" encoding="UTF-8"?>');
        if (getOption('sitemap_google')) {
            $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">');
        } else {
            $data .= sitemap_echonl('<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
        }
        foreach ($albums as $album) {
            $albumobj = new Album($_zp_gallery, $album['folder']);
            set_context(ZP_ALBUM);
            makeAlbumCurrent($albumobj);
            //getting the album pages
            /* Custom images/albums per page taken out as it is not possible to set these now anymore. Maybe later becomes an options
            			$images_per_page = getOption('images_per_page');
            			$albums_per_page = getOption('albums_per_page');
            			if(is_array($imagesperpage)) {
            				foreach($imagesperpage as $alb=>$number) {
            					if($alb == $albumobj->name) {
            						setOption('images_per_page',$number,false);
            					} else {
            						setOption('images_per_page',$images_per_page);
            					}
            				}
            			}
            			if(is_array($albumsperpage)) {
            				foreach($albumsperpage as $alb=>$number) {
            					if($alb == $albumobj->name) {
            						setOption('albums_per_page',$number,false);
            					} else {
            						setOption('albums_per_page',$albums_per_page);
            					}
            				}
            			} */
            $pageCount = getTotalPages();
            $imageCount = getNumImages();
            $images = $albumobj->getImages();
            $loop_index = getSitemapGoogleLoopIndex($imageCount, $pageCount);
            $date = sitemap_getDateformat($albumobj, $albumlastmod);
            if (sitemap_multilingual()) {
                foreach ($sitemap_locales as $locale) {
                    $url = FULLWEBPATH . '/' . rewrite_path($locale . '/' . pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), false);
                    $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                    printSitemapGoogleImageVideoExtras(1, $loop_index, $albumobj, $images);
                    $data .= sitemap_echonl("\t</url>");
                }
            } else {
                $url = FULLWEBPATH . '/' . rewrite_path(pathurlencode($albumobj->name), '?album=' . pathurlencode($albumobj->name), false);
                $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                $data .= getSitemapGoogleImageVideoExtras(1, $loop_index, $albumobj, $images);
                $data .= sitemap_echonl("\t</url>");
            }
            // print album pages if avaiable
            if ($pageCount > 1) {
                for ($x = 2; $x <= $pageCount; $x++) {
                    if (sitemap_multilingual()) {
                        foreach ($sitemap_locales as $locale) {
                            $url = FULLWEBPATH . '/' . rewrite_path($locale . '/' . pathurlencode($albumobj->name) . '/page/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, false);
                            $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                            $data .= getSitemapGoogleImageVideoExtras($x, $loop_index, $albumobj, $images);
                            $data .= sitemap_echonl("\t</url>");
                        }
                    } else {
                        $url = FULLWEBPATH . '/' . rewrite_path(pathurlencode($albumobj->name) . '/page/' . $x, '?album=' . pathurlencode($albumobj->name) . '&amp;page=' . $x, false);
                        $data .= sitemap_echonl("\t<url>\n\t\t<loc>" . $url . "</loc>\n\t\t<lastmod>" . $date . "</lastmod>\n\t\t<changefreq>" . $albumchangefreq . "</changefreq>\n\t\t<priority>0.8</priority>\n");
                        $data .= getSitemapGoogleImageVideoExtras($x, $loop_index, $albumobj, $images);
                        $data .= sitemap_echonl("\t</url>");
                    }
                }
            }
        }
        $data .= sitemap_echonl('</urlset>');
        // End off the <urlset> tag
    }
    restore_context();
    return $data;
}
/**
 * Returns the next image on a page.
 * sets $_zp_current_image to the next image in the album.
 * Returns true if there is an image to be shown
 *
 * @param bool $all set to true disable pagination
 * @param int $firstPageCount the number of images which can go on the page that transitions between albums and images
 * @param string $sorttype overrides the default sort type
 * @param string $sortdirection overrides the default sort direction.
 * @param bool $overridePassword the password check
 * @return bool
 *
 * @return bool
 */
function next_image($all = false, $firstPageCount = 0, $sorttype = null, $sortdirection = NULL, $overridePassword = false)
{
    global $_zp_images, $_zp_current_image, $_zp_current_album, $_zp_page, $_zp_current_image_restore, $_zp_conf_vars, $_zp_current_search, $_zp_gallery;
    if (!$overridePassword) {
        if (checkforPassword()) {
            return false;
        }
    }
    $imagePageOffset = getTotalPages(true) - 1;
    /* gives us the count of pages for album thumbs */
    if ($all) {
        $imagePage = 1;
    } else {
        $_zp_conf_vars['images_first_page'] = $firstPageCount;
        /* save this so pagination can see it */
        $imagePage = $_zp_page - $imagePageOffset;
    }
    if ($firstPageCount > 0 && $imagePageOffset > 0) {
        $imagePage = $imagePage + 1;
        /* can share with last album page */
    }
    if ($imagePage <= 0) {
        return false;
        /* we are on an album page */
    }
    if (is_null($_zp_images)) {
        if (in_context(ZP_SEARCH)) {
            $searchtype = true;
            $_zp_images = $_zp_current_search->getImages($all ? 0 : $imagePage, $firstPageCount);
        } else {
            if ($_zp_current_album->isDynamic()) {
                $searchtype = true;
                $search = $_zp_current_album->getSearchEngine();
                $_zp_images = $search->getImages($all ? 0 : $imagePage, $firstPageCount);
            } else {
                $_zp_images = $_zp_current_album->getImages($all ? 0 : $imagePage, $firstPageCount, $sorttype, $sortdirection);
            }
        }
        if (empty($_zp_images)) {
            return false;
        }
        $_zp_current_image_restore = $_zp_current_image;
        $img = array_shift($_zp_images);
        if (is_array($img)) {
            $_zp_current_image = newImage(new Album($_zp_gallery, $img['folder']), $img['filename']);
        } else {
            $_zp_current_image = newImage($_zp_current_album, $img);
        }
        save_context();
        add_context(ZP_IMAGE);
        return true;
    } else {
        if (empty($_zp_images)) {
            $_zp_images = NULL;
            $_zp_current_image = $_zp_current_image_restore;
            restore_context();
            return false;
        } else {
            $img = array_shift($_zp_images);
            if (is_array($img)) {
                $_zp_current_image = newImage(new Album($_zp_gallery, $img['folder']), $img['filename']);
            } else {
                $_zp_current_image = newImage($_zp_current_album, $img);
            }
            return true;
        }
    }
}
Esempio n. 11
0
 function getGalleryPageAlbums()
 {
     global $_zp_gallery, $_zp_page, $_zp_themeroot;
     $res = "<div id='albums'>";
     save_context();
     set_context(ZP_INDEX);
     $_zp_page = $contextPage;
     $u = 0;
     $folders = $_zp_gallery->getAlbums($this->galleryPage ? $this->galleryPage : 1);
     $_zp_page = NULL;
     $arr = array();
     $top = $this->getAncestorAlbum();
     foreach ($folders as $folder) {
         $cls = '';
         //Workaround the (breaking) weird thumb url if album is empty. Note that we really should check recursively
         $alb = new Album($_zp_gallery, $folder);
         $subalbs = method_exists($alb, 'getSubalbums') ? $alb->getSubalbums() : $alb->getAlbums();
         if (count($subalbs) == 0 && $alb->getNumImages() == 0) {
             $customThumb = "{$_zp_themeroot}/resources/images/opa/bg-b-20.png";
         } else {
             $thumb = $alb->getAlbumThumbImage();
             $customThumb = $thumb->getCustomImage(NULL, 90, 90, 90, 90, NULL, NULL, false);
         }
         if (isset($top) && method_exists($top, 'getFolder') && $folder == $top->getFilename()) {
             $cls = ' over';
         }
         $res .= "<span class='album{$cls}'> " . "<a href='" . $alb->getAlbumLink() . "'>" . "<img width='90' height='90' src='{$customThumb}' " . "\t   album='" . $alb->name . "' /> " . "</a>" . "<div class='caption'>" . $alb->getTitle() . "</div>" . "</span>";
         $u++;
     }
     while ($u < 3) {
         $res .= "<span class='subalbum subalbum-{$u}'> " . "<img width='90' height='90' class='empty' src='{$_zp_themeroot}/resources/images/opa/bg-b-20.png' /> " . "</span>";
         $u++;
     }
     restore_context($context);
     $_zp_page = $pageParam;
     $res .= "</div>";
     return $res;
 }
Esempio n. 12
0
/**
 * 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
}