public function __construct() { $this->epl_kvs = ''; $this->epl_position = '"Top","Peel","VerticalLeft","VerticalRight","Expandible","Middle1","Middle2","RightSmall","Right","Right1","Right2","Right3", "Auspiciado1","Auspiciado2","Auspiciado3","Intersticial"'; //$this->epl_ss = 'ss:"",'; $this->epl_ss = ''; $this->epl_sec = 'Home'; //$this->epl_sec = 'ZonaTest'; $this->urlcanonical = ''; $this->alert = false; $this->no_view_cache_open = false; $this->no_view_cache_central = false; $this->no_view_cache_sidebar = false; $this->no_view_cache_close = false; $this->submenu = "tags"; $this->comscore = 'home.portada'; $this->user = @$_COOKIE[SITESLUG . '_cnu']; $this->user_ga = @$_COOKIE['_ga']; $this->dax_category_img = ''; $this->dax_category_script = ''; $this->dax_theme_img = ''; $this->dax_theme_script = ''; $this->alert = \Rpp\Services\Get\Alert::active(); $this->cabecera = 'general'; $this->scri_bgbanner = ''; $this->js_app = 'slide'; $this->img_social = 'http://s.rpp-noticias.io/images/imgshare.jpg'; $this->hora_planeta = false; $this->s3_raiz = \Rpp\Services\Get\UrlMedia::get_conf()->endpoint->fuente; $this->htmlrel = ''; }
public function seccionAction($seccion_slug) { $this->view->disable(); $result = array(); foreach (\Rpp\Services\Get\Flow::seccion($seccion_slug, 50, 0) as $item) { $article['abstractText'] = \Rpp\Services\Get\Content::node($item->_id)->bajada; $article['date'] = array('published' => date('Y-m-d\\TH:i:sP', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion), 'updated' => date('Y-m-d\\TH:i:sP', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion)); $article['id'] = $item->_id; $image = $audio = $video = array(); $texto_nota = $relacionado = array(); if (\Rpp\Services\Get\Content::part($item->_id, 'tipo') == 'galeria') { $galeria = $gitem = array(); foreach (\Rpp\Services\Get\Content::part($item->_id, 'galeria') as $v => $key) { $gitem[] = array('title' => @\Rpp\Services\Get\Content::part($item->_id, 'contenido')[$key]['alt'], 'author' => @\Rpp\Services\Get\Content::part($item->_id, 'contenido')[$key]['credito'], 'description' => @\Rpp\Services\Get\Content::part($item->_id, 'contenido')[$key]['alt'], 'id' => 0, 'url' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::part($item->_id, 'contenido')[$key]['foto']['hash'], 'medium'), 'thumbnail' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::part($item->_id, 'contenido')[$key]['foto']['hash'], 'small')); \Rpp\Services\Get\Content::unset_part($item->_id, 'contenido', $key); } $galeria[0]['images'] = $gitem; $article['slideshows'] = $galeria; } foreach (\Rpp\Services\Get\Content::part($item->_id, 'contenido') as $contenido) { if ($contenido['tipo'] == 'photo') { $image[] = array('title' => @$contenido['foto']['alt'], 'autor' => @$contenido['credito'], 'description' => @$contenido['foto']['alt'], 'id' => 0, 'url' => \Rpp\Services\Get\UrlMedia::image($contenido['foto']['hash'], 'medium'), 'thumbnail' => \Rpp\Services\Get\UrlMedia::image($contenido['foto']['hash'], 'samll')); } elseif ($contenido['tipo'] == 'video') { $video[] = array('title' => @$contenido['video']['alt'], 'autor' => @$contenido['via'], 'description' => @$contenido['foto']['alt'], 'id' => 0, 'size' => 17791133, 'duration' => 10, 'url' => @$contenido['video']['url'], 'thumbnail' => @$contenido['video']['url_cover']); } elseif ($contenido['tipo'] == 'audio') { $audio[] = array('title' => @$contenido['audio']['alt'], 'autor' => @$contenido['via'], 'description' => @$contenido['audio']['alt'], 'id' => 0, 'size' => 1547822, 'duration' => 10, 'url' => @$contenido['audio']['url'], 'thumbnail' => @$contenido['audio']['url_cover']); } elseif ($contenido['tipo'] == 'text') { $texto_nota[] = strip_tags($contenido['texto']); if (count(@$contenido['relacionado']['items']) > 0) { foreach ($contenido['relacionado']['items'] as $value) { $relacionado[] = array('rel' => 'related', 'href' => \Rpp\Services\Get\Content::nurl($value['nid']), 'mediaType' => 'text/html', 'thumbnail' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::node($value['nid'])->imagen_portada['hash'], 'samll'), 'title' => \Rpp\Services\Get\Content::node($value['nid'])->imagen_portada['alt'], 'author' => 'RPP', 'description' => \Rpp\Services\Get\Content::node($value['nid'])->bajada); } } } } $keywords = array(); foreach (\Rpp\Services\Get\Content::part($item->_id, 'keywords') as $value) { $keywords[] = $value['nombre']; } $article['images'] = $image; $article['videos'] = $video; $article['audio'] = $audio; $article['title'] = \Rpp\Services\Get\Content::node($item->_id)->titulo; $article['subtitle'] = \Rpp\Services\Get\Content::node($item->_id)->titulo_corto; $article['body'] = implode(' ', $texto_nota); $article['keywords'] = $keywords; $article['relatedLinks'] = $relacionado; $result[] = $article; } echo json_encode(array('items' => $result)); }
public function moreAction($init = 1) { $this->view->disable(); $interval = 3; $init = 50 + ($init - 1) * $interval; $response = array(); foreach (\Rpp\Services\Get\Flow::home($interval, $init) as $item) { if (empty($item->_id)) { continue; } $response[] = array('img' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::node($item->_id)->imagen_portada['hash'], 'medium'), 'titulo' => \Rpp\Services\Get\Content::node($item->_id)->titulo, 'bajada' => \Rpp\Services\Get\Content::node($item->_id)->bajada, 'fecha' => date('Y-m-d H:i', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion), 'categoria' => \Rpp\Services\Get\Content::node($item->_id)->categoria['nombre'], 'categoria_url' => str_replace(SITESLUG, '', \Rpp\Services\Get\Content::node($item->_id)->categoria['slug']), 'nota_url' => $this->view->host . \Rpp\Services\Get\Content::nurl($item->_id), 'tipo' => \Rpp\Services\Get\Content::node($item->_id)->tipo); } echo json_encode($response); die; }
public function notaserviceAction($slug = false, $init = 1) { $this->view->disable(); $init = ($init - 1) * 3; $response = array(); $tag_info = \Rpp\Services\Get\Tags::get_tag($slug); if (empty(@$tag_info->_id)) { echo json_encode($response); die; } foreach (\Rpp\Services\Get\LFlow::tag($slug, 3, $init) as $item) { if (empty($item->_id)) { continue; } $response[] = array('img' => \Rpp\Services\Get\UrlMedia::image(\Rpp\Services\Get\Content::node($item->_id)->imagen_portada['hash'], 'medium'), 'titulo' => \Rpp\Services\Get\Content::node($item->_id)->titulo, 'bajada' => \Rpp\Services\Get\Content::node($item->_id)->bajada, 'fecha' => date('Y-m-d H:i', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion), 'categoria' => \Rpp\Services\Get\Content::node($item->_id)->categoria['nombre'], 'categoria_url' => str_replace(SITESLUG, '', \Rpp\Services\Get\Content::node($item->_id)->categoria['slug']), 'nota_url' => $this->view->host . \Rpp\Services\Get\Content::nurl($item->_id), 'tipo' => \Rpp\Services\Get\Content::node($item->_id)->tipo); } echo json_encode($response); die; }
public static function load_incidencias($id_mam) { return json_decode(@file_get_contents(\Rpp\Services\Get\UrlMedia::get_conf()->endpoint->raiz . "mam/{$id_mam}.json")); }