Beispiel #1
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;
 }
Beispiel #2
0
       <?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 
}
?>

Beispiel #3
0
 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.......");
 }
Beispiel #4
0
 public function contenidoAction($nid)
 {
     $home = \Rpp\Services\Get\Flow::home();
     var_dump(json_decode(json_encode($home)));
     var_dump(\Rpp\Services\Get\Content::part($nid, 'contenido'));
 }