Example #1
0
 public function __construct($nid)
 {
     parent::__construct();
     $this->nid = (int) $nid;
     $this->titulo = \Rpp\Services\Get\Article::node($nid)['titulo_corto'];
     $this->tipo = \Rpp\Services\Get\Article::node($nid)['tipo'];
     $this->slug_seccion = explode("/", \Rpp\Services\Get\Article::node($nid)['categoria']['slug']);
     $keywords = array();
     $this->keywords = array();
     $this->keywords_slug = array();
     foreach (\Rpp\Services\Get\Article::part($this->nid, 'keywords') as $key => $value) {
         $this->keywords[] = $value['nombre'];
         $this->keywords_slug[] = $value['slug'];
     }
     $this->tags = \Rpp\Services\Get\Article::part($this->nid, 'tags');
     $this->seccion = array();
     foreach (\Rpp\Services\Get\Article::part($this->nid, 'categorias') as $key => $value) {
         if (@$value['primary']) {
             $this->seccion = $value;
             break;
         }
     }
     $this->recomendados = array();
     $this->keywords = implode(",", $this->keywords);
     $this->brandeo = !empty(\Rpp\Services\Get\Article::part($this->nid, 'imagen_branding'));
     $this->especial = !empty(\Rpp\Services\Get\Article::part($this->nid, 'imagen_tag'));
     $this->load_comscore();
     $this->load_epl();
     $this->description = null;
     $this->sugeridas = array();
     \Rpp\Services\Get\UrlTrack::$ns_mchannel = 'articulo.' . $nid;
     $this->description = \Rpp\Services\Get\Article::part($this->nid, 'bajada');
     $this->titulo_social = htmlentities(\Rpp\Services\Get\Article::node($this->nid)['titulo_seo']);
     $this->img_social = \Rpp\Services\Get\Article::node($this->nid)['imagen_portada']['url'];
     $this->url_social = \Rpp\Services\Get\Article::nurl($this->nid);
     $this->fecha_social = \Rpp\Services\Get\Article::node($this->nid)['fecha_publicacion'];
     $this->urlcanonical = $this->url_social;
     $this->id_mam = 1;
     $this->js_app = 'slide|fotogaleria';
 }