Hallo!
Habe 4 Dateien in einem Verzeichnis (2 x *.txt & 2 x MD5("*").gif).
Mein Code:
Aber warum gibt der nur eines aus? -> Bin verzweifelt!
Habe 4 Dateien in einem Verzeichnis (2 x *.txt & 2 x MD5("*").gif).
Mein Code:
PHP-Code:
<?
if($action == "anzeigen" || !$action){
$tmpl = new Template('templates/standart/gcp0.htm');
//$tmpl->out();
$a = 0;
$verz=opendir ("./gallery/".details_user('Nickname')."/");
while ($file = readdir ($verz)){ $fila = explode(".", $file);
if($fila[1] == "txt"){
if(file_exists("./gallery/".details_user('Nickname')."/".MD5($fila[0]).".gif")){ $end = ".gif"; }
if(file_exists("./gallery/".details_user('Nickname')."/".MD5($fila[0]).".jpg")){ $end = ".jpg"; }
if(file_exists("./gallery/".details_user('Nickname')."/".MD5($fila[0]).".jpeg")){ $end = ".jpeg"; }
$tnpl[$a] = new Template('templates/standart/gcp_anzeigen.htm');
$tnpl[$a]->assign("bild", "<img border=\"0\" src=\"./gallery/".details_user('Nickname')."/".MD5($fila[0]).$end."\">");
$tnpl[$a]->assign("beschreibung", join('', file("./gallery/".details_user('Nickname')."/".$file)));
$tnpl[$a]->assign("link","LINK");
//$tnpl->out();
$a++;
}
}
closedir($verz);
$tbpl = new Template('templates/standart/gcp1.htm');
$for = "";
for($i=0;$i<sizeof($a);$i++){
$for .= $tnpl[$i]->get();
}
$tpl->assign("bilder", $tmpl->get().$for.$tbpl->get());
}
?>
Kommentar