Salut
sache tout d'abbord que c'est une question, fréquente et que tu aurais pu chercher la solution plutot que de la poser... C'est aussi une redondance dans les codes source...
function listFolder($from){
$list = array('.','..');
$e="";
$dossier=opendir($from);
while ($fichier = readdir($dossier))
{
if (!in_array($fichier, $list))
{
if (is_dir("$from/$fichier"))
{
}else{
if (file_exists("comment/$from/$fichier.txt")){
$atribut="commentée";
}else{
$atribut="pas encore commentée";
}
if (file_exists("$from/mini/$fichier")) {
echo "<table border='1'>
<tr><td>$fichier</a></td></tr>
<tr><td><a href='main.php?image=$from/$fichier&album=$from'target='mainframe'><img src='$from/mini/$fichier'></td></tr>
<tr><td>$atribut</td></tr>
</table>
<hr>
";
}else{
echo "<table border='1'>
<tr><td>$fichier</a></td></tr>
<tr><td><a href='main.php?image=$from/$fichier&album=$from'target='mainframe'><img src='img_gd.php?&file=$fichier&album=$from'></td></tr>
<tr><td>$atribut</td></tr>
</table>
<hr>
";
}
}
}
}
}
Ceci est un code dont je me sers dans mon album photo...
In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy
[ Lien ]