Cioè, mi pare di capire che tu non abbia nemmeno dato uno sguardo al codice... i nomi degli album nella dropdown sono esattamente i nomi delle cartelle contenute rispettivamente in thumbs e images.
Per quanto riguarda che cosa modificare in thumbs.php, io ho fatto molto bovinamente così:
Codice PHP:
<?php
$album = $_GET['album'];
$imagesArr = array();
$i = 0;
/* read the descriptions xml file */
if(file_exists('../thumbs/'.$album.'/desc.xml')) {
$xml = simplexml_load_file('../thumbs/'.$album.'/desc.xml');
}
/* read the images from the album and get the * description from the XML file: */
if(file_exists('../thumbs/'.$album)) {
$files = array_slice(scandir('../thumbs/'.$album), 2);
if(count($files)) {
foreach($files as $file) {
if($file != '.' && $file != '..' && $file!='desc.xml') {
if($xml) {
$desc = $xml->xpath('image[name="'.$file.'"]/text');
$description = $desc[0];
if($description=='')
$description = '';
}
# Aggiunto da Andrea1979
else {
$description = '';
}
# Fine aggiunta
$imagesArr[] = array('src' => 'thumbs/'.$album.'/'.$file,
'alt' => 'images/'.$album.'/'.$file,
'desc' => $description);
}
}
}
}$json = $imagesArr;
$encoded = json_encode($json);echo $encoded;
unset($encoded);?>
(per qualche strana ragione da me, non fornendo un file xml per ogni galleria - nella cartella thumbs - il caricamento della galleria si interrompeva). Non ho indagato le ragioni (non so se si tratti di un problema con la mia configurazione oppure un bug dello script)