<html>
<head>
<title>Bildergallerie</title>
</head>
<body>
<?
function _gallery($dir_use, $dir_main, $dir_thumbs, $line_pictures){
$dir_main = $dir_main . '/' . $dir_use;
$dir_thumbs = $dir_thumbs . '/' . $dir_use;
if(!is_dir($dir_main) || !is_dir($dir_thumbs)){
echo('<center><font class=black>Also <strong>Du</strong> hast irgendetwas versucht, das Du nicht sollst</font></center>');
return false;
}
$handle_dir_main = opendir($dir_main);
$handle_dir_thumbs = opendir($dir_thumbs);
if(!$handle_dir_main || !$handle_dir_thumbs){
echo('<center><font class=black>Konnte Ordner nicht öffnen</font></center>');
return false;
}
echo(' <table width="100%" align="center" cellspacing="8" cellpadding="8">' . "\n" .
' <tr>' . "\n" .
' <td class="black" colspan="4" align="center">Verzeichnis: ' . $dir_use . '</td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n");
$file_count = 0;
while($file_name = readdir($handle_dir_main)){
if($file_name != '.' && $file_name != '..'){
if(is_file($dir_main . '/' . $file_name)){
if($file_count < $line_pictures){
echo(' <td align="center"><a href="' . $dir_main . '/' . $file_name . '" rel="lightbox[galerie]"><img src="' . $dir_thumbs . '/' . $file_name . '" width="100" height="100" border="0" style="filter:alpha(opacity=40); -moz-opacity:0.4" onmouseover="init_fader(this,5,20,40,99,1)"></a></td>' . "\n");
}else{
$file_count = 0;
echo(' </tr>' . "\n" .
' <tr>' . "\n" .
' <td align="center"><a href="' . $dir_main . '/' . $file_name . '" rel="lightbox[galerie]"><img src="' . $dir_thumbs . '/' . $file_name . '" width="100" height="100" border="0" style="filter:alpha(opacity=40); -moz-opacity:0.4" onmouseover="init_fader(this,5,20,40,99,1)"></a></td>' . "\n");
}
$file_count++;
}
}
}
closedir($handle_dir_main);
closedir($handle_dir_thumbs);
echo(' </tr>' . "\n" .
' <tr>' . "\n" .
' <td colspan="4"><center><font><a href="index.php?seite=bildgal/galerien" target="_self">zurück</a></font></center></td>' . "\n" .
' </tr>' . "\n" .
' </table>' . "\n");
}
if(isset($_GET['uverz']) && !empty($_GET['uverz'])){
if(!@ereg('^[a-zA-Z0-9._-]*$', $_GET['uverz'])){
echo('<center><font class=black>Unerlaubte Zeichen im Ordnernamen</font></center>');
return false;
}else{
_gallery($_GET['uverz'], 'normal', 'klein', 4);
}
}else{
echo('<center><font class=black>Du hast vergessen einen Ordner anzugeben</font></center>');
}
?>
</body>
</html>