Пример #1
0
 /**
  * Просмотр главной страницы раздела (ajax):
  */
 public function indexAjaxAction(Application $application)
 {
     $session = Session::getInstance();
     $filter = $session->persistenceGet('live_filter', true);
     $session->persistenceSet('live_last_visit', time());
     $links = Blog_BlogOnlineModel::GetLinks($filter);
     if (@$_GET['num']) {
         return array_slice($links, 0, (int) $_GET['num']);
     }
     return $links;
 }
Пример #2
0
 /**
  * Процессор:
  */
 public function process($template)
 {
     $session = Session::getInstance();
     $stats = Blog_BlogStatisticsModel::getGlobalStats();
     $links_on = $session->persistenceGet('show_links_panel', true);
     if ($links_on) {
         $filter = $session->persistenceGet('live_filter', true);
         $links = Blog_BlogOnlineModel::GetLinks($filter);
         $template->setParameter('online_links', array_slice($links, 0, 12));
         $template->setParameter('right_panel', $links_on);
     }
     $template->setParameter('global_unique', $stats['unique']);
     $template->setParameter('global_online', $stats['online']);
     $template->setParameter('global_posts', $stats['posts']);
     $template->setParameter('global_unique_posters', $stats['unique_posters']);
     $template->setParameter('global_speed', $stats['speed']);
     if ($session->persistenceGet('global_theme', false)) {
         return $template->render($this->viewParams, $session->persistenceGet('global_theme'));
     }
     parent::process($template);
 }