voila j'ai récupéré un script php sur le net pour créer un album photos suivant des images jpeg d'un dossier
le script crée les minaitures et apres on clique sur la miniature pour agrandir ..bref normal
les miniatures ne s'affiche plus et ca marche donc pas....
j'ai essayé de remplacer les "é" ds le nom du fichier par "é" mais ca ne marche tjs plus....
Code :<?
// CONFIGURATION DU SCRIPT PHP
$doc_title = "Album Photos "; // TITRE DE LA PAGE WEB
$columns=4; // NOMBRE D'IMAGES PAR LIGNE
$ratio=5; // RATIO DE LA MINIATURE
$quality=5; // QUALITE DE LA MINIATURE (0: LE PLUS BAS A 100: LE PLUS ELEVE)
$scriptname= "index.php"; // NOM DU FICHIER DU SCRIPT
$thumb_dir = "thumb"; // NOM DU DOSSIER OU SONT STOCKRRS LES MINIATURES CREES
$thumb_prefix = "thumb_"; // PREFIXE DES MINIATURES GENEREES
// FIN DES PARAMETRES DE CONFIGURATION DU SCRIPT
echo "<html>\n<head>\n<title>$doc_title</title>\n";
echo "<body bgcolor=white>\n</head>\n\n\n";
echo "<center>\n<P><BR><BR>\n\n";
$mydirectory= '.'; //DOSSIER OU LES IMAGES SONT CHARGEES
$counter=0;
$nbfiles = 0;
$currfile = "";
$filestab[0] = "";
$handle=opendir($mydirectory);
//CREATION D'UN DOSSIER POUR LES MINIATURES
if (! is_dir($thumb_dir))
{
mkdir($thumb_dir, 0777);
}
while ($currfile = readdir($handle))
{
// We get the extension of the current file and keep only image files
$extension= strtolower(substr( strrchr( $currfile, "." ), 1 ));
if ($extension== "gif" || $extension== "jpg" || $extension== "jpeg" ||
$extension== "png")
{
$nbfiles++;
$currfile = trim($currfile); //supprime les espaces en debut et fin de chaine
$filestab[$nbfiles] = $currfile;
if ($ishome == "")
{
$size = GetImageSize($currfile);
$width = $size[0] / $ratio;
$height = $size[1] / $ratio;
$format = $size[2]; //1 = GIF, 2 = JPG, 3 = PNG, 5 = PSD, 6 = BMP
$currthumbfile = "./" . $thumb_dir . "/" . $thumb_prefix . $currfile;
if (! file_exists($currthumbfile))
{
$im = "";
//GIF format is not supported anymore by GD lib...
if ($format == 2) //JPG
$im = imagecreatefromjpeg($currfile);
else if ($format == 3) //PNG
$im = imagecreatefrompng($currfile);
if (!$im)
{
$currthumbfile = $currfile;
}
else
{
Imagejpeg($im, $currthumbfile, $quality);
ImageDestroy($im);
}
}
//$currfile = str_replace("é","&eacute",$currfile);
//$currthumbfile = str_replace("é","&eacute",$currthumbfile); NE MARCHE PAS
$currfile = str_replace(" ","%20",$currfile); // Allow filenames with space characters
$currthumbfile = str_replace(" ","%20",$currthumbfile); // Allow filenames with space characters
echo "<A HREF=$scriptname?ishome=1&filename=$currfile&filenumber=$nbfiles>\n";
echo "<IMG SRC=$currthumbfile WIDTH=$width HEIGHT=$height";
//$currfile = str_replace("&eacute","é",$currfile);
$currfile = str_replace("%20"," ",$currfile); // Clean display of filenames with space characters
echo " alt=\"Enlarge $currfile\">\n";
//$currfile = str_replace("é","&eacute",$currfile);
$currfile = str_replace(" ","%20",$currfile); //Clean display of filenames with space characters
echo "</A>\n";
$counter++;
if ($counter == $columns)
{
$counter = 0;
echo "<P><P><BR>";
}
}
}
}
closedir($handle);
if ($ishome == 1)
{
echo "<P>\n";
// $filename = str_replace("é","&eacute",$filename);
$filename = str_replace(" ","%20",$filename); // Allow filenames with space characters
$filename = stripslashes($filename); // Allow filenames with ' characters
echo "<IMG SRC=$filename>\n";
// $display = str_replace("é","&eacute",$filename);
$display = str_replace("%20"," ",$filename); // Clean display of filenames with space characters
echo "<br><b> $display </b><br>";
echo "<P><BR>\n\n";
if ($filenumber != 1)
{
$prevnumber = $filenumber - 1;
// $filestab[$prevnumber] = str_replace("é","&eacute",$filestab[$prevnumber]);
$filestab[$prevnumber] = str_replace(" ","%20",$filestab[$prevnumber]); // Allow filenames with space characters
echo "[<A HREF=$scriptname?ishome=1&filename=$filestab[$prevnumber]&filenumber=$prevnumber>";
echo " << Prec&eacutedent</A>] \n";
}
echo " &nbsp;&nbsp;[<A HREF=$scriptname>Menu Principal</A>]&nbsp;&nbsp;\n";
echo " \n";
if ($filenumber != $nbfiles)
{
$nextnumber = $filenumber + 1;
//$filestab[$nextnumber] = str_replace("é","&eacute",$filestab[$nextnumber]); // Allow filenames with space characters
$filestab[$nextnumber] = str_replace(" ","%20",$filestab[$nextnumber]); // Allow filenames with space characters
echo "[<A HREF=$scriptname?ishome=1&filename=$filestab[$nextnumber]&filenumber=$nextnumber>";
echo "Suivant >></A>]\n";
}
echo "\n\n";
}
?>
<P><P><P><P><HR>
</center>
</html>