![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/07/2006, 12:35
|
| | Fecha de Ingreso: diciembre-2004
Mensajes: 103
Antigüedad: 20 años, 2 meses Puntos: 0 | |
Gracias Cluster !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!
Le agregue los datos de las variables que tenia y anduvo perfecto para mis necesidades. Asi quedo el codigo
Código:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#000000">
<?
$files = array ();
$myDirectory = opendir("imgs/thumbs");
while ($file = readdir($myDirectory)) {
if (($file != ".") && ($file != "..") && ($file != "index.php") && !(is_dir("imgs/$file")) ){
// aquí los acomulas en el array $files ...
$files[] = $file;
}
}
closedir($myDirectory);
$archivos = array_reverse($files);
// me deshago de $files (mi array original) .. no lo necesito .. ya lo tengo en $archivos y ordenado como necesito.
unset($files);
?> <?
$cols = 5; // columns number
$table_bg_color = "black"; // table background color
$table_border = "0"; // table border size
$table_width = "100%"; // table width
$i =1;
echo "<table width='$table_width' bgcolor = '$table_bg_color' border ='$table_border' cellpadding='5' cellspacing='0'><tr>";
foreach ($archivos as $archivo) {
if (is_int($i / $cols)) {
list($width, $height) = getimagesize("imgs/$archivo");
echo "<td align='center'>";
?> <a href="#" onClick="MyWindow=window.open('viewer.php?file=<?php echo $archivo;?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=<?php echo "$width";?>,height=<?php echo "$height";?>,left=20,top=20'); return false;">
<?
echo "<img src='imgs/thumbs/$archivo' border='0'></a>";
echo "</td></tr><tr>";
}
else
{
list($width, $height, $type, $attr) = getimagesize("imgs/$archivo");
echo "<td align='center'>";
?> </a><a href="#" onClick="MyWindow=window.open('viewer.php?file=<?php echo $archivo;?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=<?php echo "$width";?>,height=<?php echo "$height";?>,left=20,top=20'); return false;">
<?
echo "<img src='imgs/thumbs/$archivo' border='0'></a>";
echo "</td>";
}
$i++;
}
echo "</tr></table>";
?></a>
</body>
</html>
|