Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/03/2008, 10:49
Avatar de rogertm
rogertm
Mod->Cuba
 
Fecha de Ingreso: julio-2005
Ubicación: /home/Cuba/Habana/rogertm/
Mensajes: 2.922
Antigüedad: 18 años, 9 meses
Puntos: 638
Re: gererar tabla para imagenes

valla, si que me han hecho trabajar, jejeje, creo que casi casi, pero...:
Código PHP:
<?php
// leer imagenes en el diractorio fotos
$dir "fotos/";
$explorar scandir($dir);
$totalFotos count($explorar);
$total 0;
for (
$k 0$k<=$totalFotos$k++) {
    if (
$explorar[$k] != "." && $explorar[$k] != ".." && $explorar[$k] != "index.php") {
    
$total++;
    }    
}

$list_ignore = array('.','..','index.php');
if(
$getdir opendir($dir)){
    echo 
"<table border='1'>";
    
$col 3;
    while((
$foto readdir($getdir)) !== false){
        for(
$i 1$row $total$i++){
            
$resto = ($i $col);
            if(
$resto == 1){echo "<tr>";}
            if(!
in_array($foto$list_ignore)){
                echo 
"<td colspan='$col'>";
                echo 
"Nombre: $foto: Tipo: "filetype ($dir $foto) . "<br>";
                echo 
"<img src='$dir$foto'>";
                echo 
"</td>";
            }
            if(
$resto == 0){echo "</tr>";}    // Fatal error: Maximum execution time of 30 seconds exceeded in esta linea        
        
}
        if(
$resto <> 0){
            
$ajust $col $resto;
            for(
$j 0$j $ajust$j++) {echo "<td>&nbsp;</td>";}
            echo 
"</tr>";
        }                    
    }
    echo 
"</table>";
    
closedir($getdir);
}
?>
__________________
Friki y Blogger por Cuenta Propia:213
Twenty'em: Theming is Prose