protected function public_core()
 {
     $this->template = 'inme_public/editar_noticia';
     $this->page_description = 'Detalle de la noticia.';
     $this->buscar = '';
     $fsvar = new fs_var();
     $this->analytics = $fsvar->simple_get('inme_analytics');
     $this->modrewrite = $fsvar->simple_get('inme_modrewrite');
     if (isset($_GET['ok_cookies'])) {
         setcookie('ok_cookies', 'TRUE', time() + FS_COOKIES_EXPIRE, '/');
         $fslog = new fs_log();
         $fslog->tipo = 'cookies';
         $fslog->detalle = 'Se han aceptado las cookies';
         $fslog->ip = $_SERVER['REMOTE_ADDR'];
         $fslog->save();
     }
     $this->noticia = FALSE;
     $this->relacionada = FALSE;
     $this->temas = array();
     $noti0 = new inme_noticia_fuente();
     if (isset($_REQUEST['id'])) {
         $this->noticia = $noti0->get($_REQUEST['id']);
     } else {
         if (isset($_REQUEST['permalink'])) {
             $this->noticia = $noti0->get_by_permalink($_REQUEST['permalink']);
         }
     }
     if ($this->noticia) {
         $this->page_title = $this->noticia->titulo;
         $this->page_description = $this->true_text_break($this->noticia->resumen, 140);
         if (!is_null($this->noticia->id_relacionada)) {
             $this->relacionada = $noti0->get($this->noticia->id_relacionada);
         }
         $tema0 = new inme_tema();
         foreach ($this->noticia->keywords() as $key) {
             $tema = $tema0->get($key);
             if ($tema) {
                 if ($tema->activo) {
                     $this->temas[] = $tema;
                     /// si no hay una preview, usamos la de un tema
                     if ($tema->imagen and !$this->noticia->preview) {
                         $this->noticia->preview = $tema->imagen;
                         $this->noticia->save();
                     }
                 }
             } else {
                 $this->new_error_msg('Tema ' . $key . ' no encontrado.');
             }
         }
     } else {
         $this->new_error_msg('Noticia no encontrada.');
     }
 }