예제 #1
0
 private function getSameAuthorChronicles($nbChroniclesToReturn, $useCache = true)
 {
     // Get same author chronicles and add it to model view
     $authorChronicles = ChronicleSvc::getInstance()->getAuthorChronicles($this->chronicle->getUser()->getId(), $useCache);
     if ($authorChronicles) {
         $authorChronicles = ChronicleHelper::getDifferentChronicles($this->chronicle, $authorChronicles, $nbChroniclesToReturn);
     }
     return $authorChronicles;
 }
예제 #2
0
 private function setViewChronicles()
 {
     // Getting chronicles
     $lastChronicles = ChronicleSvc::getInstance()->getLastAnyType();
     $lastChronicle = array_slice($lastChronicles, 0, 1);
     $lastChronicle = $lastChronicle[0];
     $chronicles = ChronicleSvc::getInstance()->getLastChronicles(13);
     // Init chronicle view model adapter
     $chronicleListAdapter = new ChronicleListAdapter();
     $chronicleView = new PushedChronicle($lastChronicle);
     $this->view->chronicle = $chronicleView->get();
     // Set chronicles from any groups except bloggers and bookstores
     if ($chronicles && count($chronicles) > 0) {
         // We take 12 first chronicles only and different from the last chronicle
         $chronicles = ChronicleHelper::getDifferentChronicles($lastChronicle, $chronicles, 12);
         // Set chronicles view
         $this->view->chronicles = $this->getChronicleView($chronicleListAdapter, $chronicles, __("Dernières <strong>chroniques</strong>", "s1b"), "last-chronicles", $this->view->url(array(), 'chroniclesLastAnyType'), __("Voir d'autres chroniques", "s1b"));
     }
 }