Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/10/2004, 15:36
Beldar
 
Fecha de Ingreso: julio-2002
Mensajes: 40
Antigüedad: 21 años, 9 meses
Puntos: 0
Este es el codigo ke uso para mostrar en columnas:

Código PHP:
<?php
   $link
=Conectarse();
   
$cathegory=$_GET['cathegory'];
   
$start=$_GET['start'];
   
$result=mysql_query("SELECT *
FROM `gal`
WHERE 1 AND `cathegory`
LIKE '$cathegory' limit $start,16"
,$link) or die ("No se encontraron imagenes");
   echo 
"<table align=center width=420>
           <tr>
             <td align=\"left\" colspan=\"4\" height=\"16\" background=\"/img/style/gal/center.jpg\" class=\"txt1\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Imágenes</td>
           </tr>  
           <tr>
             <td align=\"left\" colspan=\"4\">&nbsp;</td>
           </tr>"
;
   
$columnes 4
   for (
$i=1$row mysql_fetch_row ($result); $i++)
   {
      
$resto = ($i $columnes); 
      if (
$resto == 1
      {
         echo 
"<tr>";
      } 
      echo 
"<td align=\"center\" class=\"txt2\"><a href=\"/img/gal/big/$row[2]\" target=\"_blank\"><img src=\"/img/gal/small/$row[3]\" border=\"0\" width=\"100\" alt=\"$row[4]\"></a></td>"
      if (
$resto == 0
      {
         echo 
"</tr>";
      }
   }
   if (
$resto <> 0
   {
      
$ajust $columnes $resto
      for (
$j 0$j $ajust$j++) 
      {
         echo 
"<td>&nbsp;</td>";
      }
         echo 
"</tr>"
      }
   echo 
"<tr>
           <td align=\"right\" colspan=\"4\">&nbsp;</td>
         </tr>    
         <tr>
           <td align=\"right\" colspan=\"4\" class=\"txt2\"><a class=\"txt3\" href=/modules/gal/fullcat.php?cathegory="
;
   echo 
$cathegory;
   echo 
"&&start=";
   
$start=$_GET['start'];
   if (
$start == 0)
   {
      
$a=0;
   }
   else
   {
      
$a=16;
   }
   
$start=$start-$a;
   echo 
"$start";               
   echo 
"><- Anterior</a> | <a class=\"txt3\" href=/modules/gal/fullcat.php?cathegory=";
   echo 
$cathegory;
   echo 
"&&start=";
   
$start=$_GET['start'];
   if (
$ajust 0)
   {
      
$a=0;
   }
   else
   {
      
$a=16;
   }
   
$start=$start+$a;
   echo 
"$start";               
   echo
" >Siguiente -></a></td>
             </tr>              
</table>"
;
mysql_free_result($result);
mysql_close($link);
?>
Fijo ke el paginador se puede mejorar haciendo que en la ultima pagina no salga la opcion siguiente, pero de momento con eso lo soluciono.