![sonrisota](http://static.forosdelweb.com/fdwtheme/images/smilies/xD.png)
![Pensando](http://static.forosdelweb.com/fdwtheme/images/smilies/scratchchin.gif)
espero que me alla explicado bien, aqui les dejo el codigo
Código PHP:
<?php
if (isset($_GET["gallery_pag"])) {
$_gallery_pag_actual=$_GET["gallery_pag"];
}else {
$_gallery_pag_actual=1;
}
$_gallery_id_1=mysql_query("SELECT id FROM galerias_img WHERE id_cat = '".$_GET["cat"]."'",$conexion) or die (mysql_error());
$_gallery_total_result=mysql_num_rows($_gallery_id_1);
$_gallery_nav = "";
$_gallery_pag= array();
while ($row_nav = mysql_fetch_assoc($_gallery_id_1)) {
$_gallery_pag[]=$row_nav["id"];
}
$_gallery_ant=$_gallery_pag_actual - 1;
$_gallery_sig=$_gallery_pag_actual + 1;
if ($_gallery_pag_actual == $_gallery_pag[$_gallery_pag_actual]) {
$_gallery_nav .= " Anterior ";
}else {
$_gallery_nav .= "<a href = 'ver_imagen.php?id=".$_GET["id"]."&cat=".$_GET["cat"]."&gallery_pag=".$_gallery_ant."'>Anterior</a> ";
}
for ($num=1; $num <= $_gallery_total_result; $num++) {
if ($num == $_gallery_pag[$_gallery_pag_actual-1]) {
$_gallery_nav .=" <strong>".$num."</strong> ";
}else {
$_gallery_nav .=" <a href = 'ver_imagen.php?id=".$_gallery_pag[$num-1]."&cat=".$_GET["cat"]."&gallery_pag=".$num."'>".$num."</a> ";
}
}
if ($_gallery_pag_actual == $_gallery_total_result) {
$_gallery_nav .=" Siguiente";
}else {
$_gallery_nav .=" <a href = 'ver_imagen.php?id=".$_GET["id"]."&cat=".$_GET["cat"]."&gallery_pag=".$_gallery_sig."'>Siguiente</a>";
}
mysql_free_result($_gallery_id_1);
$_gallery_result = mysql_query("SELECT url FROM galerias_img WHERE id = '".$_gallery_pag[$_gallery_pag_actual]."'",$conexion) or die (mysql_error());
$_gallery_info = "";
$_gallery_info .="Imagen <strong>".$_gallery_pag_actual."</strong> de <strong>".$_gallery_total_result."</strong>";
?>