Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2008, 20:51
Avatar de xalupeao
xalupeao
 
Fecha de Ingreso: mayo-2008
Ubicación: Santiago, Chile
Mensajes: 749
Antigüedad: 16 años
Puntos: 12
read() me toma todo el directorio

Como puedo hacer que mi read() no tome todo el direcotrio y solo tome los archivos con extension .jpg ?

Gracias.

Código PHP:
<?php
    
if (!isset($dir))
    
$dir ''.$drutacod2.'/ss_pb';
else
    
$dir '/'.$dir;
if (!
is_dir($dir)){
    
$file fopen($dir,"r");
    while (!
feof ($file)) {
        
$line fgets ($file1024);
        echo 
$line."<br>";
    }
      
fclose($file);
}

$url "http://ss.serintcom.cl";
$directorio dir($dir);
print 
'<div class="maintitle tac"><b>ScreenShots Servidor</b></div>';
print 
'<div aling="center">';
while (
$file $directorio->read()) {

    echo 
"<a href=\"".$url."/".$file."\" rel=\"lightbox[promo]\"><img src=\"".$url."/".$file."\" width=\"160\" height=\"55\" ><br>";
}
print
'</div>';
?>