Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/05/2011, 16:38
Avatar de reforma_sub06
reforma_sub06
 
Fecha de Ingreso: marzo-2011
Mensajes: 2
Antigüedad: 13 años, 2 meses
Puntos: 0
Pregunta tabla sin usar base de datos

necesito organizar imagenes que estan en una carpeta, eso ya lo hace el codigo pero necesito que las muestre e renglones de 3 o 4 imagenes cada uno. pero no encuentro como generar la tabla para que la lea como lo necesito. ojala me puedan ayudar.

<div id="wrapper">
<div id="header">
<h1><img name="" src="logo.png" width="200" height="75" alt="" /></h1>
</div>
<div id="column"><span class="content">


<table width="200" border="0" cellspacing="20" cellpadding="0">
<form>
<?php
$cuantos =0;
do {
if ($cuantos == 0) {
?>
<tr>
<?php
}
$cuantos ++;
?>
<td>
<?php

?>

<?php
//folder Name
$myfolder = 'jpg';
$mydir='pdf';

//echo $myfolder;

//open folder and read content
if (is_dir($myfolder)) {
if ($read = opendir($myfolder)) {
while ($myfile = readdir($read)) {
$longitud=strlen($myfile);
$longitud= $longitud-4;
$nombre=substr($myfile,0,$longitud);
/*echo 'carpeta'.$myfile;
$cadena = substr($myfile,-3);
echo $cadena;
*/
//verify filetype before of show
if ((strpos($myfile, ".zip") > 1) || (strpos($myfile, ".pdf" ) > 1) || (strpos($myfile, ".jpg" ) > 1) )

{

if(strpos($myfile,".zip")){
$present ='<img src="zip_icon.jpg" alt="zip" /><br />'.$myfile.'';
}


elseif (strpos($myfile, ".pdf")){
/*$longitud=strlen($myfile);
$longitud= $longitud-4;
$imagen=substr($myfile,0,$longitud);*/
//echo $nombre;

}


//elseif (strpos($myfile, ".jpg")){$present ='<img src="'.$myfolder.'/'.$myfile.'" width="40" height="40" alt="image" /><br />'.$myfile.'';

elseif (strpos($myfile, ".jpg")){ $present ='<img src="'.$myfolder.'/'.$nombre.'.jpg" width="143" height="250" alt="image" /><br />';}



echo '<div class="file"><a rel="example_group" id="tip4" href="'.$myfolder.'/'.$nombre.'.jpg">'.$present.'</a>

<br>

<a href="'.$mydir.'/'.$nombre.'" target="_blank"/>Clic para descargar</a>
<td>

</div>';


}

}
//close folder
closedir($read);
}
}

?>
</td>

<?php if($cuantos == 4){
$cuantos = 0;
?>
</tr>
<?php
}
?>
<?php
} while ($row_mP = mysql_fetch_assoc($mP));
?>


</table>


</body>
</html>