Topic: x on the first image
Hi,
I just found the Simple Viewer, it just works great but I have allways an x on the first image.
to be able to charge dynamically the images, I remplace the .xml file with a .php one with this script. Is it the cause of the problem ?
Thanks
Eer
<?
function GetDirArray($repertoire) {
$handle=opendir($repertoire);
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "index.html") // * 1
{
$ret[count($ret)] = $file;
}
}
closedir($handle);
sort($ret); // permet de trier les photos
return $ret;
}
$la_galerie = GetDirArray('galerie');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<simpleviewerGallery maxImageWidth="800" maxImageHeight="600" textColor="0x000000" frameColor="0xffffff" frameWidth="5" stagePadding="20" thumbnailColumns="3" thumbnailRows="3" navPosition="left" title="" enableRightClickOpen="true" backgroundImagePath="" imagePath="galerie/" thumbPath="galerie/">';
for($i=0;$i<sizeof($la_galerie);$i++) {
echo '<image><filename>'.$la_galerie[$i].'</filename><caption></caption></image>';
}
echo '</simpleviewerGallery>';
// * 1 : afin de ne PAS prendre en compte les . et .. ou même
// encore l'éventuel fichier racine index.html (ou .htm) du
// répertoire en question lors de la "génération" du XML.
?>