getHandler()->prepare(getQuery("selectAlbumByID")); $stmt->bindParam(1,$IDGaleria); $stmt->execute(); $galeria = $stmt->fetch(PDO::FETCH_ASSOC); /* -------- Fotografías -------- */ $stmt = $dbh->getHandler()->prepare(getQuery("selectFotosByAlbum")); $stmt->bindParam(1,$IDGaleria); $stmt->execute(); $fotos = $stmt->fetchAll(PDO::FETCH_ASSOC); /* ToDo Mandar a notFound cuando venga vacia la consulta */ /* -------- Banners -------- */ $banners = array(); $aParam = array( "0" ); $stmt = $dbh->getHandler()->prepare(getQuery("selectBannersBySeccion")); $stmt->bindParam(1,$aParam[0]); $stmt->execute(); while( $row = $stmt->fetch(PDO::FETCH_ASSOC) ){ $banners[$row["posicion"]]["url"] = $row["url"] ? $row["url"] : "javascript:void(0);"; $banners[$row["posicion"]]["imagen"] = $row["imagen"]; } /* -------- Noticias Recientes -------- */ $stmt = $dbh->getHandler()->prepare(getQuery("selectNoticiasRecientes")); $stmt->execute(); $nRecientes = $stmt->fetchAll(PDO::FETCH_ASSOC); /* -------- Noticias Más Vistas -------- */ $stmt = $dbh->getHandler()->prepare(getQuery("selectNoticiasMasVistas")); $stmt->execute(); $nMasVistas = $stmt->fetchAll(PDO::FETCH_ASSOC); /* -------- Noticias Relacionadas -------- */ $stmt = $dbh->getHandler()->prepare(getQuery("selectNoticiasInID")); $stmt->bindParam(1,$noticia["rel1"]); $stmt->bindParam(2,$noticia["rel2"]); $stmt->bindParam(3,$noticia["rel3"]); $stmt->execute(); $nRelacionadas = $stmt->fetchAll(PDO::FETCH_ASSOC); $dbh->closeConnection(); /* --------------------------------- */ /* Variables */ /* --------------------------------- */ /* -------- Para el contenido -------- */ $fecha = date("YmdHis"); /* -------- Variables globales definidas -------- */ include "rsc/lib/vars.php"; /* -------- Utilidades -------- */ include "rsc/lib/util.php"; /* -------- Configuración del template -------- */ $tpl = array( "titulo" => $galeria["title"]." - Galería" ,"contenido" => "tpl/interior.tpl.php" ,"c.derecha" => "_galeria.html" ,"c.izquierda" => "tpl/brlb.tpl.php" ,"ruta" => "" ,"css" => array( "rsc/css/flexslider-2.2.0.css", "rsc/css/interior.css" ) ,"js-libs" => array( "http://connect.facebook.net/en_US/all.js#appId=127930277291556&xfbml=1" , "rsc/js/jquery-1.10.2.min.js" , "rsc/js/jquery.flexslider-2.2.js" ) ,"js-onload" => "js-c/galeria.onload.js" ); /* --------------------------------- */ /* Template */ /* --------------------------------- */ include "tpl/general.tpl.php"; ?>