Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/02/2002, 14:56
cholyberreteaga
 
Fecha de Ingreso: enero-2002
Ubicación: Buenos Aires, Argentina
Mensajes: 193
Antigüedad: 22 años, 3 meses
Puntos: 0
regalito sencillo pero util | galeria imagenes

ok, estaba sin nada q hacer y dije, bueh voy a devolverle algo a esta comunidad q tanto me ha dado, auqnue no es nada de otro mundo es un sencillo script q toma imagenes gif o jpg d eun directorio y hace una galeria, con nombre, fecha y tamaño, espero a alguien le sirva...

nota: las imagenes deben estar en un directorio llamado "img" y el directorio se debe encontrar junto al al fichero donde pegues este código, ojo, no el fichero junto con la imagenes.

galeria.php
----------------------------
<table border=1 bordercolor=black cellpadding=4 cellspacing=2><tr><?
$max = "3"; // máximo de fotos por fila
$num = 0;
$abrir=opendir("img/");
while ($img=readdir($abrir)){
$x1 = explode(".", "$img");
$x2 = count($x1);
if(($x1[$x2-1] == jpg) || ($x1[$x2-1] == JPG) || ($x1[$x2-1] == gif) || ($x1[$x2-1] == GIF)){
$num++;
if($num > $max){
echo"<tr>";
}
$fecha = filectime("img/$img");
$fecha = date("d/m/Y", $fecha);
$tamano = filesize("img/$img");
echo"<td><center><a href='img/$img'><img scr='img/$img' border=0 width=100 height=100></a></center><br><font size=1 face=verdana><b>Nombre</b> : $img<br><b>Fecha</b> : $fecha<br><b>Tamaño</b> : $tamano bytes</font></td>";
if($num == $max){
echo"</tr>";
$num=0;
}
$fecha = "";
$tamano = "";
}
}
?>
</tr>
</table>
-----------------------

a todo a que q le quiciese agregar o cambiar algo, sientace libre de hacerlo y publicarlo obviamente je...

saludos...

<iframe target="_top" src="http://genteloca.com/firma.htm" width="100%" height="70" border="0" framespacing="0" border="0" frameborder="0"> </iframe>