include_once('conexao.mysql.php'); if (is_numeric($_GET["id"])){ // Projeto Atual $sql = "select * from galeria where status = 1 and id_galeria = " . $_GET["id"]; $res = mysql_query($sql); if ( mysql_num_rows($res) == 0) die('ERRO!'); $gal = mysql_fetch_assoc($res); //echo "\n " .$sql; $css = ( $gal["tipo"] == 0 ) ? "image-post-clipping" : "image-post"; //Anterior //$sql = "select id_galeria from galeria where tipo = " . $gal["tipo"] . " and status = 1 and (ordem <= " . $gal["ordem"] . " and id_galeria < " . $_GET["id"] . ") order by ordem desc, id_galeria desc limit 1" ; $sql = "select id_galeria from galeria where tipo = " . $gal["tipo"] . " and status = 1 and ordem <= " . $gal["ordem"] . " and id_galeria <> " . $_GET["id"] . " order by ordem desc, id_galeria desc limit 1" ; $res = mysql_query($sql); $ant = mysql_fetch_assoc($res); //echo "\n" .$sql; //Próximo //$sql = "select id_galeria from galeria where tipo = " . $gal["tipo"] . " and status = 1 and (ordem >= " . $gal["ordem"] . " and id_galeria > " . $_GET["id"] . ") order by ordem, id_galeria limit 1" ; $sql = "select id_galeria from galeria where tipo = " . $gal["tipo"] . " and status = 1 and ordem >= " . $gal["ordem"] . " and id_galeria <> " . $_GET["id"] . " order by ordem, id_galeria limit 1" ; $res = mysql_query($sql); $prox = mysql_fetch_assoc($res); //echo "\n" .$sql; $sql = "select * from fotos where id_galeria = " . $_GET["id"] . " order by ordem, id_foto"; $fot = mysql_query($sql); }else{ die('ERRO!'); } ?>