session->albumName == "") { header("Location: albums.php"); return; } if (!$gallery->user->canReadAlbum($gallery->album)) { header("Location: " . makeAlbumUrl()); return; } if (!$gallery->album->isLoaded()) { header("Location: " . makeAlbumUrl()); return; } // default settings --- $defaultLoop = 0; $defaultPause = 3; $defaultFull = 0; $defaultDir = 1; if (!$slide_index) { $slide_index = 1; } if (!$slide_pause) { $slide_pause = $defaultPause; } if (!$slide_loop) { $slide_loop = $defaultLoop; } if (!$slide_full) { $slide_full = $defaultFull; } if (!$slide_dir) { $slide_dir = $defaultDir; } if ($slide_full && !$gallery->user->canViewFullImages($gallery->album)) { $slide_full = 0; } function makeSlideLowUrl($index, $loop, $pause, $full, $dir) { return makeGalleryUrl('slideshow_low.php', array('set_albumName' => $gallery->session->albumName, 'slide_index' => $index, 'slide_loop' => $loop, 'slide_pause' => $pause, 'slide_full' => $full, 'slide_dir' => $dir)); } $borderColor = $gallery->album->fields["bordercolor"]; $borderwidth = $gallery->album->fields["border"]; if (!strcmp($borderwidth, "off")) { $borderwidth = 1; } $bgcolor = $gallery->album->fields['bgcolor']; $title = $gallery->album->fields["title"]; define(PHOTO_URL, 1 << 0); define(PHOTO_CAPTION, 1 << 1); define(PHOTO_URL_AS_HREF, 1 << 2); define(PHOTO_ALL , (1<<16)-1); // all bits set function printSlideshowPhotos($slide_full, $what = PHOTO_ALL) { global $gallery; $numPhotos = $gallery->album->numPhotos(1); $numDisplayed = 0; // Find the correct starting point, accounting for hidden photos $index = getNextPhoto(0); $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 = $gallery->album->getPhoto($index); $numDisplayed++; // Skip movies and nested albums if ($photo->isMovie() || $photo->isAlbumName) { $index = getNextPhoto($index); continue; } $photo_count++; if ( ($what & PHOTO_URL) != 0 ) { $photoURL = $gallery->album->getPhotoPath($index, $slide_full); print "photo_urls[$photo_count] = \"$photoURL\";\n"; } if ( ($what & PHOTO_URL_AS_HREF) != 0 ) { $photoURL = $gallery->album->getPhotoPath($index, $slide_full); print "\n"; } if ( ($what & PHOTO_CAPTION) != 0 ) { // Now lets get the captions $caption = $gallery->album->getCaption($index); $caption .= $gallery->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 print "photo_captions[$photo_count] = \"$caption\";\n"; } // Go to the next photo $index = getNextPhoto($index); $photosLeft--; } return $photo_count; } ?>