|
[ Autoren gesucht! ]
|
PHP-Homepage.de sucht laufend Autoren für News und Artikel
Interesse?
|
|
 |
|
[Start] [Suche] [Neue Einträge]
| Dynamische Bilder Gallery | <b> gallery.php </b>
<?php
# Save as gallery.php
# Script by Roger Murer,r.murer@tiscalinet.ch
#configuration
#specify subdirectory with a / at the end
$subdir = "gallerien/";
#Thumpnail directory
$thumpdir = "thump";
#configuration end
print "<h1 align=\"center\"><strong><u>".ucwords($gal)."</u></strong></h1><center>\n";
$verzeichnis = opendir("./".$subdir.$gal);
while($img = readdir($verzeichnis))
{
$parts = explode(".", $img);
if(($parts[1] == "gif") OR ($parts[1] == "jpg") OR ($parts[1] == "png"))
{
$images[] = $img;
}
}
closedir($verzeichnis);
if (count($images) > 0)
{
foreach ($images as $image)
{
print "<a href=\"bild.php?image=".$image."&gal=".$gal."\" target=\"main\"
onmouseover=\"self.status='".$image."'; return true;\"
onmouseout=\"self.status=''; return true;\">";
print "<img src=\"./".$subdir.$gal."/".$thumpdir."/tn_".$image."\" alt=\"$image\"
border=\"0\"></a>\n";
}
}
else
{
print "<b> Sorry, no Images available in this gallery: ".$subdir.$gal."<b>\n";
}
?>
<hr>
<b> bild.php </b>
<?php
#Save as bild.php
# Script by Roger Murer r.murer@tiscalinet.ch
#configuration
#specifiy your subdirectory with a / at the end
$subdir = "gallerien/";
#configuration end
print "<div align=\"center\">\n";
print "<img src=\"./".$subdir.$gal."/".$image."\" alt=\"".$image."\"><br>\n";
$verzeichnis = opendir("./".$subdir.$gal);
while($img = readdir($verzeichnis))
{
$parts = explode(".", $img);
if(($parts[1] == "gif") OR ($parts[1] == "jpg") OR ($parts[1] == "png"))
{
$images[] = $img;
}
}
closedir($verzeichnis);
$trans = array_flip($images);
$pointer = $trans[$image];
$size = count($images);
if (($pointer -1) >= 0)
{
$previmage = $images[$pointer - 1];
print "<a href=\"bild.php?image=".$previmage."&gal=".$gal."\" target=\"main\"
onmouseover=\"self.status='Zurück'; return true;\"
onmouseout=\"self.status=''; return true;\">Bild zurück</a>\n";
}
if (($pointer + 1) < $size)
{
$neximage = $images[$pointer + 1];
print "<a href=\"bild.php?image=".$neximage."&gal=".$gal."\" target=\"main\"
onmouseover=\"self.status='Vor'; return true;\" onmouseout=\"self.status='';
return true;\">Bild vor</a>\n";
}
print "</div>";
?> |
|