adesso funziona.
Però vorrei mettere le immagini 3 per riga.Come diavolo si fà?
Sto cercando di fare cosi:
ma niente, me le mette tutte in sequenza.codice:echo "<table style=\"text-align:center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"; echo "<tr>"; function read_dir($dirname) { $path = opendir($dirname . "/tmb/"); //$path = opendir($dirname); while (false !== ($file = readdir($path))) { if($file!="." && $file!="..") { if(is_file($dirname."/tmb/".$file)) $files[]=$file; else $dirs[]=$dirname."/tmb/".$file; } } if($dirs) { natcasesort($dirs); foreach($dirs as $dirname) { echo $dirname; read_dir($dirname); } } if($files) { natcasesort($files); $i = 0; foreach ($files as $file) echo " <td width='25%' align='center'> <a href=\"#\" onclick=\"workaround('$dirname/web/$file',$width+400,$height+400); return false;\">[img]$dirname/tmb/$file[/img]</a> </td> "; $i++; //se sono alla 4° riga o un multiplo di 2 cambio riga if($i%3==0){ echo "</tr><tr>"; } } } if($i%3!=0){ $mancano = 3-($i%3);//righe mancanti for($j=1;$j<=$mancano;$j++){ echo "<td></td>"; } } //closedir($path); //} //Start with: $path=$dirname; read_dir($path);
Aiuto...grazie mille...

Rispondi quotando