par
dogmongo » 21 mars 2011, 11:53
je te montre la fonction peu être qu etu y verra quelques chose qui m'a échappé
function list_rep($newRep,$niveau,$racine,$parts)
{
$icoExtention = array (".jpg" => "ico_jpg.jpg", ".gif" => "ico_gif.jpg", ".png" => "ico_png.jpg", ".JPG" => "ico_jpg.jpg", ".GIF" => "ico_gif.jpg", ".PNG" => "ico_png.jpg");
$extensions = array('.jpg','.gif','.JPG','.GIF');
$repertoire = opendir("photo/$newRep");
$table = array();
while($varFichier = readdir($repertoire))
{
$extension = strrchr($varFichier, '.');
if(in_array($extension, $extensions)){
$table[].= $varFichier;
}
}
sort($table);
for ( $i=0 ; $i < count($table); $i ++){
$BT_date = date ("j-m-Y", filemtime("photo/$newRep".'/'.$table[$i]));
$type = strstr("photo/$newRep".'/'.$table[$i] , ".");
$lien ="photo/$newRep".'/'.$table[$i];
$BT_type = substr($lien , -3);
$BT_type = "<img src=\"../image/".$icoExtention[$type]."\" alt=\"type d'image $type\" />";
echo"<tr><td><label><input name=\"listchoix[]\" type=\"checkbox\" value=\"photo\$newRep\$table[$i]\"></label></td><td>$BT_date</td><td>$table[$i]</td><td>$BT_type</td></tr>";
}
closedir($dp);
}
merci de ton aide
je te montre la fonction peu être qu etu y verra quelques chose qui m'a échappé
[php]
function list_rep($newRep,$niveau,$racine,$parts)
{
$icoExtention = array (".jpg" => "ico_jpg.jpg", ".gif" => "ico_gif.jpg", ".png" => "ico_png.jpg", ".JPG" => "ico_jpg.jpg", ".GIF" => "ico_gif.jpg", ".PNG" => "ico_png.jpg");
$extensions = array('.jpg','.gif','.JPG','.GIF');
$repertoire = opendir("photo/$newRep");
$table = array();
while($varFichier = readdir($repertoire))
{
$extension = strrchr($varFichier, '.');
if(in_array($extension, $extensions)){
$table[].= $varFichier;
}
}
sort($table);
for ( $i=0 ; $i < count($table); $i ++){
$BT_date = date ("j-m-Y", filemtime("photo/$newRep".'/'.$table[$i]));
$type = strstr("photo/$newRep".'/'.$table[$i] , ".");
$lien ="photo/$newRep".'/'.$table[$i];
$BT_type = substr($lien , -3);
$BT_type = "<img src=\"../image/".$icoExtention[$type]."\" alt=\"type d'image $type\" />";
echo"<tr><td><label><input name=\"listchoix[]\" type=\"checkbox\" value=\"photo\$newRep\$table[$i]\"></label></td><td>$BT_date</td><td>$table[$i]</td><td>$BT_type</td></tr>";
}
closedir($dp);
}
[/php]
merci de ton aide