diff options
author | deva <deva> | 2008-10-06 18:13:56 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-06 18:13:56 +0000 |
commit | 415e90a2e059ea32f6851dfb9b3c018b0a731a81 (patch) | |
tree | a2e7d809f4783f521a3a985716a26a6543acfc9d /pages/gallery.php | |
parent | cce5e7710295021b41d9aaecc503a60fb99256be (diff) |
Put the webpages in.
Diffstat (limited to 'pages/gallery.php')
-rw-r--r-- | pages/gallery.php | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/pages/gallery.php b/pages/gallery.php new file mode 100644 index 0000000..cf7e052 --- /dev/null +++ b/pages/gallery.php @@ -0,0 +1,135 @@ +<div class="header"> + <div class="header_gallery"> + <div class="header_text">Gallery</div> + </div> +</div> +<?php +include_once($UTIL_DIR."/thumbnail.php"); +include_once($UTIL_DIR."/album.php"); + +$width = 100; +$height = 75; + +/************* + Select album +*************/ +if($album == "") { + // echo "Select the group of images you want to see...\n"; + + $handle = opendir($ALBUMS_DIR . "/"); + $albumdirs = array(); + while($albumdir = readdir($handle)) { + array_push($albumdirs, $albumdir); + } + + rsort($albumdirs); + + foreach($albumdirs as $albumdir) { + if(!strstr($albumdir, ".") && !strstr($albumdir, "..")) { + $album = new Album($albumdir); + echo " <div class=\"album\">\n"; + echo " <div class=\"icon\">\n"; + echo " <a href=\"?page=gallery&album=" . $album->album . "\">\n"; + echo " <img alt=\"" . $album->title . "\" src=\"" . + thumbnail($albumdir, $album->icon, 100, 75) . "\"/>\n"; + echo " </a>\n"; + echo " </div>\n"; + echo " <div class=\"title\">" . $album->title . "</div>\n"; + echo " </div>\n"; + } + } + + echo "<div class=\"foot\">Select the group of images you want to see.</div>\n"; +} + +/************* + View photo +*************/ +else { + function image($album, $file) { + global $ALBUMS_DIR; + echo $ALBUMS_DIR . "/" . $album . "/" . $file; + } + + if($album) { + $a = new Album($album); + + if($image) { + $photo = new Photo("", ""); + $prev = ""; + $next = ""; + + foreach($a->photos as $p) { + if($image == $p->file) { + $photo = $p; + } + if($image == $last->file) { + $next = $p; + break; + } + $prev = $last; + $last = $p; + } +?> +<div class="gallery"> + <div class="gallery_album_title">Album: <?php echo $a->title; ?></div> + <div class="gallery_copyright">Copyright: <?php echo $a->copyright; ?></div> + <div class="gallery_photo"> + <img alt="<?php echo $photo->text ?>" src="<?php image($album, $photo->file); ?>"/> + </div> + <div class="gallery_photo_title"><?php echo $photo->text; ?></div> + <div class="gallery_buttons"> +<?php if($prev) { ?> + <div class="gallery_button"> + <a href="?page=gallery&image=<?php echo $prev->file ?>&album=<?php echo $album ?>" > + <img alt="prev" src="<?php echo thumbnail($album, $prev->file, $width, $height); ?>"/> + </a> + </div> +<?php } else { ?> + <div class="gallery_button"> + <img alt="stop" src="gfx/stop.png"/> + </div> +<?php } ?> + <div class="gallery_button"> + <a href="?page=gallery&album=<?php echo $album ?>" > + <img alt="home" src="gfx/home.png"/> + </a> + </div> +<?php if($next) { ?> + <div class="gallery_button"> + <a href="?page=gallery&image=<?php echo $next->file; ?>&album=<?php echo $album ?>" > + <img alt="next" src="<?php echo thumbnail($album, $next->file, $width, $height); ?>"/> + </a> + </div> +<?php } else { ?> + <div class="gallery_button"> + <img alt="stop" src="gfx/stop.png"/> + </div> +<?php } ?> + </div> +</div> +<?php + } else { +/************* + Show album +*************/ + +// echo "<div class=\"headline\">" . $a->title . "</div>\n"; + echo "<div class=\"gallery\">\n"; + foreach($a->photos as $photo) { +?> + <div class="gallery_image"> + <a href="?page=gallery&image=<?php echo $photo->file ?>&album=<?php echo $album ?>"> + <img alt="<?php echo $photo->file; ?>" src="<?php echo thumbnail($album, $photo->file, 100, 75); ?>"/> + </a> + </div> +<?php + } + echo "</div>\n"; + echo "<div class=\"foot\">". $a->title . "</div>\n"; + } +} +} +?> + + |