This repository has been archived on 2025-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
host_rhein/content/galerie.php
2014-04-28 19:37:51 +02:00

24 lines
852 B
PHP

<div id="gallery_frame">
<?php
//Request imageid
$img = $_REQUEST['img'];
if(!isset($img)) $img = 0;
$gallerydir = scandir('gallery');
$imglist = array();
for($i=0;$i<=count($gallerydir)-1; $i++)
{
if(strtolower(substr($gallerydir[$i], strlen($gallerydir[$i])-4, 4))== ".jpg") $imglist[]=$gallerydir[$i];
}
if($img > count($imglist)-1) $img = count($imglist)-1;
echo '<div id="gallery_box"><img id="gallery_pic" alt="Bilder-Galerie-" src="gallery/'.$imglist[$img].'"/></div><br/>';
if($img > 0) $back = $img -1; else $back = count($imglist)-1;
if($img < count($imglist)-1) $next = $img +1; else $next = 0;
echo '<div id="gallery_back"><a href="index.php?page=galerie&amp;img='.$back.'">Zur&uuml;ck</a></div><div id="gallery_next"><a href="index.php?page=galerie&amp;img='.$next.'">Vorw&auml;rts</a></div>';
?>
</div>