Muchas gracias
Código PHP:
<?php
// Paginación
$limite = $_GET['lim'];
if(!$limite Or $limite<0){$limite=0;}//Chequeamos que l es valido, si no a 0
// Buscamos nuevos limites
$l_more = $limite + 9;
$l_less = $limite - 9;
if($l_less<0){$l_less=0;}
// fin paginación
$sql ="SELECT * FROM laken_earth WHERE earth_activ=1 ORDER BY earth_id DESC";
$resultado = bd_consultar($sql, $enlacebd);
if (bd_numero_filas ($resultado) == 0){
}else{
// paginación
$num_filas = bd_numero_filas ($resultado);
$exceso = $num_filas - $l_more;
if($exceso<0){$l_more=$limite;}
$seccion_paginacion .=' <input type="hidden" name="consulta" value="'.$sql.'">';
$seccion_paginacion .= ' <table>';
if($num_filas==($limite+1)){
$seccion_paginacion .= ' <tr> <td width="54%"><h3>Resultados: '.($limite+1).' de '.$num_filas;
}elseif($num_filas<($limite+9)){
$seccion_paginacion .= ' <tr> <td width="54%"><h3>Resultados: '.($limite+1).'-'.$num_filas.' de '.$num_filas;
}else{
$seccion_paginacion .= ' <tr> <td width="54%"><h3>Resultados: '.($limite+1).'-'.($limite+9).' de '.$num_filas;
}
$seccion_paginacion .= ' <a href="?a=list&lim='.$l_less.'"><< Anterior</a> - <a href="?a=list&lim='.$l_more.'">Siguiente >> </a></h3>';
$seccion_paginacion .= '</td></tr>';
$seccion_paginacion .= ' </table>';
// fin paginación
//Sacamos las thumbs
$contador = 0;
while($fila = bd_llenar_array ($resultado)){
if ($contador == 0){$seccion_contenido .= "<tr valign=\"top\">";}
$earth_id = $fila["earth_id"];
$earth_from = $fila["earth_from"];
$earth_email = $fila["earth_email"];
$earth_date = $fila["earth_date"];
$earth_location = $fila["earth_location"];
$earth_image = "$ruta_ima/lakenonearth/".$fila["earth_image"];
$earth_comment = $fila["earth_comment"];
$earth_image = crear_thumb ('ima/lakenonearth/'.$fila["earth_image"],"100",$fila["earth_location"],0,"center");
$seccion_contenido .= "<td width=\"180\"><p><a href=\"javascript:genWin('earth_thumb.php?id=$earth_id','foto',0,0,0,0,0,600,600)\">$earth_image</a><a href=\"javascript:genWin('earth_thumb.php?id=$earth_id','foto',0,0,0,0,0,600,600)\"><img src=\"image/buttons/plus.gif\" width=\"14\" height=\"14\" border=\"0\"></a></p>";
$seccion_contenido .= "<p class=\"bodytxttable\">$earth_text_comment: $earth_comment<br> $earth_text_from: $earth_from<br>$earth_text_location: $earth_location<br>$earth_text_date: $earth_date</p></td>";
$contador++;
if($contador ==3){$contador=0; $seccion_contenido.="</tr>"; }
}
}
bd_liberar_consulta ($resultado);
$seccion_cuerpo= "$ruta_tpl/earth_list.html";
?>