Beispiel #1
0
 public function procesar_portada()
 {
     $this->mostrar = 'portada';
     if (isset($_GET['mostrar'])) {
         $this->mostrar = $_GET['mostrar'];
     }
     $this->buscar = '';
     if (isset($_REQUEST['buscar'])) {
         $this->buscar = $_REQUEST['buscar'];
     }
     $this->codfuente = '';
     if (isset($_GET['codfuente'])) {
         $this->codfuente = $_GET['codfuente'];
     }
     $this->keyword = '';
     if (isset($_GET['keyword'])) {
         $this->keyword = $_GET['keyword'];
     }
     $this->offset = 0;
     if (isset($_GET['offset'])) {
         $this->offset = intval($_GET['offset']);
     }
     $this->preview = new inme_noticia_preview();
     $noti = new inme_noticia_fuente();
     if ($this->buscar != '') {
         $this->noticias = $noti->search($this->buscar, $this->offset);
     } else {
         if ($this->codfuente != '') {
             $this->noticias = $noti->all_from_fuente($this->codfuente, $this->offset);
         } else {
             if ($this->keyword != '') {
                 $this->noticias = $noti->all_from_keyword($this->keyword, $this->offset);
             } else {
                 if ($this->mostrar == 'portada') {
                     if ($this->offset > 0) {
                         $this->noticias = $noti->all($this->offset, 'publicada DESC');
                     } else {
                         $this->noticias = $this->cache->get('inme_portada');
                         if (!$this->noticias) {
                             $this->noticias = $noti->all($this->offset, 'publicada DESC');
                             $this->cache->set('inme_portada', $this->noticias, 300);
                         }
                     }
                 } else {
                     if ($this->mostrar == 'populares') {
                         $this->noticias = $noti->all($this->offset, 'popularidad DESC');
                     } else {
                         $this->noticias = $noti->all($this->offset);
                     }
                 }
             }
         }
     }
     $tema = new inme_tema();
     $this->mostrar_tema = FALSE;
     if (isset($_GET['keyword'])) {
         $this->mostrar_tema = $tema->get($_GET['keyword']);
     }
     $this->temas_populares = $this->cache->get('inme_temas_populares');
     if (!$this->temas_populares) {
         $this->temas_populares = $tema->populares();
         $this->cache->set('inme_temas_populares', $this->temas_populares, 300);
     }
 }
Beispiel #2
0
 protected function public_core()
 {
     $this->template = 'inme_public/portada';
     $this->mostrar = 'portada';
     if (isset($_GET['mostrar'])) {
         $this->mostrar = $_GET['mostrar'];
     }
     $this->buscar = '';
     if (isset($_REQUEST['buscar'])) {
         $this->buscar = $_REQUEST['buscar'];
     }
     $this->codfuente = '';
     if (isset($_GET['codfuente'])) {
         $this->codfuente = $_GET['codfuente'];
     }
     $this->offset = 0;
     if (isset($_GET['offset'])) {
         $this->offset = intval($_GET['offset']);
     }
     $this->preview = new inme_noticia_preview();
     $noti = new inme_noticia_fuente();
     if ($this->buscar != '') {
         $this->noticias = $noti->search($this->buscar, $this->offset);
     } else {
         if ($this->codfuente != '') {
             $this->noticias = $noti->all_from_fuente($this->codfuente, $this->offset);
         } else {
             if ($this->mostrar == 'portada') {
                 $this->noticias = $noti->all($this->offset, 'publicada DESC');
             } else {
                 if ($this->mostrar == 'populares') {
                     $this->noticias = $noti->all($this->offset, 'popularidad DESC');
                 } else {
                     $this->noticias = $noti->all($this->offset);
                 }
             }
         }
     }
 }