public function __construct($nid, $position) { parent::__construct(); $this->nid = (int) $nid; $this->position = $position; $this->slug_seccion = explode("/", \Rpp\Services\Get\Content::node($nid)->categoria['slug']); $this->brandeo = !empty(\Rpp\Services\Get\Content::part($this->nid, 'imagen_branding')); $seccion_epl = str_replace('-', '_', $this->slug_seccion[1]); $categoria_epl = str_replace('-', '_', @$this->slug_seccion[2]); $eplsec = array($seccion_epl, 'Tag'); $this->epl_sec = $eplsec[$this->brandeo]; $eplss['nota'] = array($categoria_epl . '_Nota', 'Auspiciado_Nota'); $eplss['galeria'] = array($categoria_epl . '_Galeria', 'Auspiciado_Galeria'); if (\Rpp\Services\Get\Content::node($this->nid)->tipo == 'galeria') { $this->epl_ss = 'ss:"' . $eplss['galeria'][$this->brandeo] . '",'; $this->slug_categoria = $eplss['galeria'][$this->brandeo]; } else { $this->epl_ss = 'ss:"' . $eplss['nota'][$this->brandeo] . '",'; $this->slug_categoria = $eplss['nota'][$this->brandeo]; } $this->preroll = ""; $this->epl_position = '"Interna1" , "Interna2" , "Interna3" , "Interna4" , "Interna5" , "Interna6" , "Interna7" , "Interna8" , "Interna9" , "Interna10"'; $this->epl_kvs = ""; $this->scri_bgbanner = '1'; }
public function notacacheAction() { $this->mqconf = new \Phalcon\Config\Adapter\Ini(CONFIG_PATH . DIRS . "ini/mq.ini"); $connection = new AMQPConnection($this->mqconf->host, $this->mqconf->port, $this->mqconf->user, $this->mqconf->pasw); $channel = $connection->channel(); $channel->queue_declare(SITESLUG . '_nota_cache_invalid', false, true, false, false); echo ' [*] Servicio listener para la publicacion , CTRL+C para cancelar', "\n"; $callback = function ($msg) { $node = json_decode($msg->body); var_dump($node); foreach ($node as $nota) { try { if (\Rpp\Services\Get\Content::node($nota->nid)->tipo == 'galeria') { foreach (\Rpp\Services\Get\Content::part($nota->nid, 'galeria') as $v => $e) { $this->viewCache->delete("nota.header.geleria." . $nota->nid . "." . $v); } } $this->viewCache->delete("nota.wrap.group." . $nota->nid); var_dump("cache reload..."); } catch (\Exception $e) { var_dump($e->getMessage()); } } die; }; $channel->basic_consume(SITESLUG . '_nota_cache_invalid', '', false, true, false, false, $callback); while (count($channel->callbacks)) { $channel->wait(); } }
public function homeAction() { //var_dump(\Rpp\Services\Get\Flow::home(50)); foreach (\Rpp\Services\Get\Flow::home(50) as $key => $value) { var_dump($value, \Rpp\Services\Get\Content::node($value->_id)); } }
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; }
echo \Rpp\Services\Get\Content::node($nid)->imagen_portada['url']; ?> " alt="<?php echo \Rpp\Services\Get\Content::node($nid)->imagen_portada['alt']; ?> " width="259" height="146"></a></figure> <h3 class="tag-title"><?php echo \Rpp\Services\Get\Content::node($nid)->categoria['nombre']; ?> </h3> <h2><span><a href="<?php echo \Rpp\Services\Get\Content::nurl($nid); echo \Rpp\Services\Get\UrlTrack::add_params($i); ?> "><?php echo \Rpp\Services\Get\Content::node($nid)->titulo_corto; ?> </a></span></h2> </div> </li> <?php if ($i >= 2) { break; } ?> <?php } ?> </ul> </section> <?php
<?php $e = 0; ?> <?php foreach (\Rpp\Services\Get\Flow::home(20) as $item) { ?> <?php echo $this->partial('partials/portada/flujo/box/' . \Rpp\Services\Get\Content::node($item->_id)->tipo, array('nid' => $item->_id, 'position' => $e + 1)); ?> <?php $e++; ?> <?php if (($e + \Rpp\Services\Get\Destacados::$size['home'] - 1) % 5 == 0) { ?> <?php echo $this->partial('partials/portada/flujo/box/ads'); ?> <?php } ?> <?php } ?>
public function builder() { $this->nota = \Rpp\Services\Get\Content::nota($this->nid); \Rpp\Services\Get\Content::node($this->nid); \Rpp\Services\Get\Flow::home(); $this->reload_categoria($this->nota->categoria_slug); $this->reload_tag($this->nota->tags); //---flujo galerias----// if ($this->nota->tipo == 'galeria') { \Rpp\Services\Get\Gallery::home(); } elseif ($this->nota->tipo == 'blog') { \Rpp\Services\Get\Flow::autor(); \Rpp\Services\Get\Flow::autor($this->nota->autor['slug']); } elseif ($this->nota->tipo == 'brandcontent') { \Rpp\Services\Get\Flow::brandcontent(); } ##########instant article##################################### if (@$this->nota->instant_article) { \Rpp\Services\Get\Instantarticle::flow(); \Rpp\Services\Get\Instantarticle::flowupd(); } elseif (@$this->last->instant_article) { \Rpp\Services\Get\Instantarticle::flow(); \Rpp\Services\Get\Instantarticle::flowupd(); } ############################################################## if (@$this->last->categoria) { $this->reload_categoria($this->last->categoria); } if (@$this->last->tags) { $this->last->tags = json_decode(json_encode($this->last->tags), true); if ($this->last->tags != $this->nota->tags) { $this->reload_tag($this->last->tags); } } if (@$this->last->tipo) { if ($this->last->tipo == 'galeria') { galeria\Rpp\Services\Get\Gallery::home(); } if ($this->last->tipo == 'blog') { \Rpp\Services\Get\Flow::autor(); } } $this->viewCache->delete("portada.bodyopen.home"); $this->viewCache->delete("portada.bodycentral.home"); $this->viewCache->delete("portada.bodyclose.home"); ###remaquetado########## $this->viewCache->delete("portada.body.open.home"); $this->viewCache->delete("portada.body.central.home"); $this->viewCache->delete("portada.body.close.home"); if ($this->nota->tipo == 'galeria') { foreach ($this->nota->galeria as $v => $e) { $this->viewCache->delete("nota.header.geleria." . $this->nid . "." . $v); ###remaquetado########## $this->viewCache->delete("nota.header.galeria." . $this->nid . "." . $v); } } $this->viewCache->delete("nota.wrap.group." . $this->nid); ###remaquetado########## $this->viewCache->delete("nota.article.body." . $this->nid); var_dump("terminate......."); }
<?php echo $this->partial('partials/breadcrum/index', array('elements' => array(\Rpp\Services\Get\Content::node($this->model->nid)->categoria['nombre'])));
public function load_epl() { $seccion_epl = str_replace('-', '_', $this->slug_seccion[1]); $categoria_epl = str_replace('-', '_', @$this->slug_seccion[2]); $eplsec = array($seccion_epl, 'Tag'); $this->epl_sec = $eplsec[$this->brandeo]; $eplss['nota'] = array($categoria_epl . '_Nota', 'Auspiciado_Nota'); $eplss['galeria'] = array($categoria_epl . '_Galeria', 'Auspiciado_Galeria'); if (\Rpp\Services\Get\Content::node($this->nid)->tipo == 'galeria') { $this->epl_ss = 'ss:"' . $eplss['galeria'][$this->brandeo] . '",'; $this->slug_categoria = $eplss['galeria'][$this->brandeo]; } else { $this->epl_ss = 'ss:"' . $eplss['nota'][$this->brandeo] . '",'; $this->slug_categoria = $eplss['nota'][$this->brandeo]; } // $this->preroll = "http://ads.us.e-planning.net/eb/4/17632/".$seccion_epl."/".$this->slug_categoria."/Preroll?o=v&ma=1&vv=3&kw_ctxt=rpp|".implode('|',$this->keywords_slug); $this->preroll = "https://pubads.g.doubleclick.net/gampad/ads?sz=400x300&iu=/1028310/RPP_Video&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]"; $this->epl_position = '"Top","Peel", "Interna1" , "Interna2" , "Interna3" , "Interna4" , "Interna5" , "Interna6" , "Interna7" , "Interna8" , "Interna9" , "Interna10" , "Intersticial", "VerticalLeft","VerticalRight","Expandible","Middle1","Middle2","RightSmall","Right","Right1","Right2","Right3"'; $this->epl_kvs = implode('|', $this->keywords_slug); $this->scri_bgbanner = '1'; }
echo \Rpp\Services\Get\Content::nurl($item->_id); echo \Rpp\Services\Get\UrlTrack::add_params($position + 1); ?> "><img src="<?php echo \Rpp\Services\Get\Content::node($item->_id)->imagen_portada['url']; ?> " alt="<?php echo \Rpp\Services\Get\Content::node($item->_id)->imagen_portada['alt']; ?> " width="86" height="70"></a></figure> <h2><a href="<?php echo \Rpp\Services\Get\Content::nurl($item->_id); echo \Rpp\Services\Get\UrlTrack::add_params($position + 1); ?> "><?php echo \Rpp\Services\Get\Content::node($item->_id)->titulo; ?> </a></h2> </article> </li> <?php } ?> </ul> </div> </section>
foreach (\Rpp\Services\Get\Visitas::ranking($slug, 5) as $position => $item) { ?> <li> <article> <figure class="media"><a href="<?php echo \Rpp\Services\Get\Content::nurl($item['nid']); echo \Rpp\Services\Get\UrlTrack::add_params($position + 1); ?> "><img src="<?php echo \Rpp\Services\Get\Content::node($item['nid'])->imagen_portada['url']; ?> " height="86" width="70" alt="<?php echo \Rpp\Services\Get\Content::node($item['nid'])->imagen_portada['alt']; ?> "></a></figure> <h2><a href="<?php echo \Rpp\Services\Get\Content::nurl($item['nid']); echo \Rpp\Services\Get\UrlTrack::add_params($position + 1); ?> "><?php echo \Rpp\Services\Get\Content::node($item['nid'])->titulo; ?> </a></h2> </article> </li> <?php } ?> </ul> </div> </section>
break; ?> <?php } ?> <?php } ?> <div class="prominent-txt"> <p> <?php echo \Rpp\Services\Get\Content::node($item->_id)->bajada; ?> </p> <div class="time-related">Publicado el <time datetime="<?php echo date('Y-m-d H:i', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion); ?> "> <?php echo date('d/m/y', \Rpp\Services\Get\Content::node($item->_id)->fecha_publicacion); ?> </time> </div> </div> </div> <?php break; } ?> </article>
<?php echo $this->partial('partials/nota/detalle/open/nota/' . \Rpp\Services\Get\Content::node($this->model->nid)->tipo); ?>
<header> <?php echo $this->partial('partials/nota/header/pubtime', array('fecha_publicacion' => \Rpp\Services\Get\Content::node($this->model->nid)->fecha_publicacion)); ?> <?php echo $this->partial('partials/nota/header/antetitulo', array('antetitulo' => \Rpp\Services\Get\Content::part($this->model->nid, 'volada'))); ?> <?php echo $this->partial('partials/nota/header/titulo', array('titulo' => \Rpp\Services\Get\Content::node($this->model->nid)->titulo)); ?> <?php echo $this->partial('partials/nota/header/bajada', array('bajada' => \Rpp\Services\Get\Content::node($this->model->nid)->bajada)); ?> </header>
<h1><a href="<?php echo \Rpp\Services\Get\Content::nurl($nid); echo \Rpp\Services\Get\UrlTrack::add_params($position); ?> "> <?php echo \Rpp\Services\Get\Content::node($nid)->titulo_corto; ?> </a></h1> <p><?php echo \Rpp\Services\Get\Content::node($nid)->bajada; ?> </p> </header> </div> <figure class="media"> <a href="<?php echo \Rpp\Services\Get\Content::nurl($nid); echo \Rpp\Services\Get\UrlTrack::add_params($position); ?> "><img src="<?php echo \Rpp\Services\Get\Content::node($nid)->imagen_portada['url']; ?> " alt="<?php echo \Rpp\Services\Get\Content::node($nid)->imagen_portada['alt']; ?> "></a> </figure> </article> </div>
echo $contenido['cita']['titulo']; ?> </h4> <h2><a href="#"><?php echo $contenido['cita']['desarrollo']; ?> </a></h2> </li> </ul> </section> <?php } elseif ($contenido['tipo'] == 'photo') { ?> <?php if (\Rpp\Services\Get\Content::node($this->model->nid)->tipo == 'galeria') { ?> <?php continue; ?> <?php } ?> <figure class="media full"> <p> <?php echo $contenido['subtitulo']; ?> </p> <?php echo $this->partial('partials/nota/contenido/bloque/' . $this->model->package . 'imagen', $contenido); ?>