<?php
include_once("Album.class.php");
include_once(
"Gallery.class.php");

/* 

dseelig - circa 2004 - gallery viewer

Description:

    the page people need to hit to view the images.

    cases:
        1: it receives no variables, it shows all the albums that exist in the top level directory
        2: it receives just an album name: it shows the contents of that album
        3: it receives an album name and an image name: it shows the image and the previous and next image

    Most of the real work is done by Album2.class and Gallery2.class 
    
*/


// The only variables you ought to need to configure, hopefully.
$local_root "/home/seeligd/dysphemism.net/photos/";                   //where the directories that contain images reside (local filesystem)
$web_root   "http://dysphemism.net/photos/";                          //the url that corresponds to $local_root
$thumbdir   "thumbs";                                                 //the name of the thumbnail directory (within $local_root/album_name)
$max5dir    "5max";                                                   //the name of the medium sized image directory (within $local_root/album_name)
$rweb_root  "http://gridley.res.carleton.edu/~seeligd/photos/";       //the url of the server that hosts the original-size images
$origdir    "orig";                                                   //the name of the directory that contains these orignal images (per album)
$site_title "dysphemism photos";                                      //the title of the website


//we might be looking at an album, or an image with an album
$album=$_GET["album"];
$image=$_GET["image"];


    
//we're at least looking at an album
    
if (isset($album)) {

        
$sheet = new Album($album,$local_root,$web_root,$thumbdir,$max5dir,$origdir,$rweb_root,$site_title);
        
$sheet->print_header();


        
//if both image and album are set, show the image
        
if(isset($image) && ($image != '')) {
            
$sheet->show_image($image);
        }


        
//otherwise just display the full album
        
else {
        
$sheet->show_album();
        }


    }

    
// we're not looking at an individual album - show whole gallery
    
else {
        
$sheet = new Gallery($local_root,$web_root,$thumbdir,$site_title);
        
$sheet->print_header();
        
$sheet->show_gallery(); 
    }

    
$sheet->print_footer();

?>