0) { if ($number == 0 || $number > $photo_count) { $number = $photo_count; } if ($random) { $random_full_urls = array(); $random_photos = array(); srand ((float) microtime() * 10000000); $rand_keys = array_rand ($urls, $number); if ($number == 1) { $rand_keys = array($rand_keys); } foreach ($rand_keys as $key) { $random_urls[] = $urls[$key]; $random_full_urls[] = $full_urls[$key]; $random_captions[] = $captions[$key]; } $urls = $random_urls; $full_urls = $random_full_urls; $captions = $random_captions; } if (empty($albumName)) { if ($random) { $title = sprintf(_("%s Random Images from %s"), $number, $gallery->app->galleryTitle); } else { $title = sprintf(_("Slide Show for Gallery :: %s"), $gallery->app->galleryTitle); } } else { if ($random) { $title = sprintf(_("%d Random Images from album :: %s"), $number, $gallery->album->fields["title"]); } else { $title = sprintf(_("Slide Show for album :: %s"), $gallery->album->fields["title"]); } } } } function buildSlideshowPhotos(&$full_urls, &$urls, &$captions, $album = null, $recursive = true) { global $gallery, $full_option; $photo_count = 0; if (!$album) { // Top level $albumDB = new AlbumDB(false); $numAlbums = $albumDB->numAlbums($gallery->user); for ($i = 1; $i <= $numAlbums; $i++) { $subAlbum = $albumDB->getAlbum($gallery->user, $i); if (!$gallery->user->canReadAlbum($subAlbum)) { continue; } $photo_count += buildSlideshowPhotos($full_urls, $urls, $captions, $subAlbum, $recursive); } return $photo_count; } if (!$gallery->user->canReadAlbum($album)) { return $photo_count; } $numPhotos = $album->numPhotos(1); $numDisplayed = 0; // Find the correct starting point, accounting for hidden photos $index = getNextPhoto(0, $album); $photo_count = 0; while ($numDisplayed < $numPhotos) { if ($index > $numPhotos) { /* * We went past the end -- this can happen if the last element is * an album that we can't read. */ break; } $photo = $album->getPhoto($index); $numDisplayed++; // Skip movies if ($photo->isMovie()) { $index = getNextPhoto($index, $album); continue; } if ($photo->isAlbum()) { if ($recursive) { $subAlbumName = $album->getAlbumName($index); $subAlbum = new Album(); $subAlbum->load($subAlbumName); if ($gallery->user->canReadAlbum($subAlbum)) { $photo_count += buildSlideshowPhotos($full_urls, $urls, $captions, $subAlbum, $recursive); } } $index = getNextPhoto($index, $album); continue; } $photo_count++; $urls[] = $album->getPhotoPath($index, 0); if ($gallery->user->canViewFullImages($album)) { $full_option = true; $full_urls[] = $album->getPhotoPath($index, 1); } else { $full_urls[] = $album->getPhotoPath($index, 0); } $caption = $album->getCaption($index); if ($recursive) { $caption .= ' (' . $album->fields['title'] . ')'; } $caption .= $album->getCaptionName($index); $caption = str_replace("\"", " ", $caption); $caption = str_replace("\n", " ", $caption); $caption = str_replace("\r", " ", $caption); // Print out the entry for this image as Javascript $captions[] = $caption; // Go to the next photo $index = getNextPhoto($index, $album); } return $photo_count; } function printSlideshowPhotos($full_urls, $urls, $captions, $what, $photo_count) { $count = 0; for ($index = 0; $index < $photo_count; $index++) { $count++; if (($what &PHOTO_URL) != 0) { print "photo_urls[$count] = \"" . $urls[$index] . "\";\n"; } if (($what &PHOTO_URL_AS_HREF) != 0) { print "\n"; print "\n"; } if (($what &PHOTO_CAPTION) != 0) { // Print out the entry for this image as Javascript print "photo_captions[$count] = \"" . $captions[$index] . "\";\n"; } } } function slideshow_body() { global $gallery, $albumName, $defaultLoop, $defaultPause, $defaultTransition, $full_option, $album, $recursive, $number, $random, $loop, $borderColor, $borderwidth, $bgcolor, $url, $full_urls, $urls, $caption, $captions, $photo_count, $title, $transitionNames, $transitionCount, $pixelImage; $photo_count = $number; /* Here are the URLs of the images written down as links. This is to make wget able to convert these links. It will not convert them, if they are written inside JavaScript. JavaScript will then take the images out of these links with "document.getElementById()". */ printSlideshowPhotos($full_urls, $urls, $captions, PHOTO_URL_AS_HREF, $photo_count); ?>
[" . _("stop") . "]"; echo " [" . _("reverse direction") . "]"; if ($full_option) { echo " [" . _("full size") . "]"; } echo "  ||"; ?>   "1 " . _("second"), 2 => "2 " . _("seconds"), 3 => "3 " . _("seconds"), 4 => "4 " . _("seconds"), 5 => "5 " . _("seconds"), 10 => "10 " . _("seconds"), 15 => "15 " . _("seconds"), 30 => "30 " . _("seconds"), 45 => "45 " . _("seconds"), 60 => "60 " . _("seconds")), $defaultPause, // default value 1, // select size array('onchange' => 'reset_timer()', 'style' => 'font-size:10px;')); ?>   onclick='toggleLoop();'>
0) { ?>




$gallery->session->albumName)) ?>">[]