Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public function permalinkAction($nid, $position = false)
 {
     if (empty(\Rpp\Services\Get\Content::part($nid, '_id'))) {
         $this->dispatcher->forward(array('controller' => 'error', 'action' => 'show404'));
     }
     $query_url = explode("?", $_SERVER["REQUEST_URI"]);
     if (isset($query_url[1])) {
         $query_url = "?" . $query_url[1];
     } else {
         $query_url = null;
     }
     if (is_numeric($position)) {
         $query_url = "/" . $position . $query_url;
     }
     return $this->response->redirect($this->view->host . \Rpp\Services\Get\Content::nurl($nid) . $query_url, true, 301);
 }
Ejemplo n.º 4
0
 public function permalinkAction($nid)
 {
     if (empty(\Rpp\Services\Get\Content::part($nid, '_id'))) {
         $this->dispatcher->forward(array('controller' => 'error', 'action' => 'show404'));
     }
     $query_url = explode("?", $_SERVER["REQUEST_URI"]);
     if (isset($query_url[1])) {
         $query_url = "?" . $query_url[1];
     } else {
         $query_url = null;
     }
     header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     header("Location: " . $this->view->host . \Rpp\Services\Get\Content::nurl($nid) . $query_url, TRUE, 301);
     //return $this->response->redirect($this->view->host.\Rpp\Services\Get\Content::nurl($nid).$query_url , false , 301);
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 public function __construct($nid)
 {
     parent::__construct();
     $this->nid = (int) $nid;
     $this->titulo = \Rpp\Services\Get\Content::node($nid)->titulo_corto;
     $this->tipo = \Rpp\Services\Get\Content::node($nid)->tipo;
     $this->slug_seccion = explode("/", \Rpp\Services\Get\Content::node($nid)->categoria['slug']);
     $keywords = array();
     $this->keywords = array();
     $this->keywords_slug = array();
     foreach (\Rpp\Services\Get\Content::part($this->nid, 'keywords') as $key => $value) {
         $this->keywords[] = $value['nombre'];
         $this->keywords_slug[] = $value['slug'];
     }
     $this->tags = \Rpp\Services\Get\Content::part($this->nid, 'tags');
     $this->seccion = array();
     foreach (\Rpp\Services\Get\Content::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\Content::part($this->nid, 'imagen_branding'));
     $this->especial = !empty(\Rpp\Services\Get\Content::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\Content::part($this->nid, 'bajada');
     $this->titulo_social = htmlentities(\Rpp\Services\Get\Content::node($this->nid)->titulo_seo);
     $this->img_social = \Rpp\Services\Get\Content::node($this->nid)->imagen_portada['url'];
     $this->url_social = \Rpp\Services\Get\Content::nurl($this->nid);
     $this->fecha_social = \Rpp\Services\Get\Content::node($this->nid)->fecha_publicacion;
     $this->urlcanonical = $this->url_social;
     $this->id_mam = 1;
     $this->js_app = 'slide|fotogaleria';
     $this->htmlrel = 'rel="nofollow"';
 }
Ejemplo n.º 7
0
              <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>
Ejemplo n.º 8
0
    ?>
        <li>
          <article>
            <figure class="media"><a href="<?php 
    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>
Ejemplo n.º 9
0
    <section class="social-detail">
      <ul>
        <li><a href="<?php 
echo $host;
echo \Rpp\Services\Get\Content::nurl($this->model->nid);
echo \Rpp\Services\Get\UrlTrack::add_params_social('facebook', $position);
?>
" class="facebook"><i class="icon icon-facebook"></i></a></li>
        <li><a href="<?php 
echo $host;
echo \Rpp\Services\Get\Content::nurl($this->model->nid);
echo \Rpp\Services\Get\UrlTrack::add_params_social('twitter', $position);
?>
" class="twitter"><i class="icon icon-twitter"></i></a></li>
        <li><a href="<?php 
echo $host;
echo \Rpp\Services\Get\Content::nurl($this->model->nid);
echo \Rpp\Services\Get\UrlTrack::add_params_social('googleplus', $position);
?>
" class="gplus"><i class="icon icon-google-plus"></i></a></li>
        <li class="li-whatsapp"><a href="<?php 
echo $host;
echo \Rpp\Services\Get\Content::nurl($this->model->nid);
echo \Rpp\Services\Get\UrlTrack::add_params_social('whatsapp', $position);
?>
" class="whatsapp"><i class="icon icon-whatsapp"></i></a></li>
      </ul>
    </section>

Ejemplo n.º 10
0
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>