/** * Просмотр списка тредов борды: */ public function viewThreadsAction(Application $application, Template $template) { $board = new Board_BoardModel($_GET['board']); $session = Session::getInstance(); $settings = $board->getSettings(); $key = $session->getKey(); $template->setParameter('title', $settings['title']); $template->setParameter('description', $settings['description']); $template->setParameter('board_id', $board->getId()); $page = @$_GET['page'] ? $_GET['page'] : 0; $this['posts'] = $board->getThreads($page, $pages); $this['form_errors'] = $session->instantGet('board_errors', array()); $this['board_form'] = $session->instantGet('board_form', array()); $this['subscribed'] = Board_BoardModel::subscribedBoard($key, $_GET['board']); $template->setParameter('total_pages', ceil($pages - 1)); $template->setParameter('current_page', $page); $template->setParameter('link_pages', 'http://' . TemplateHelper::getSiteUrl() . '/' . $board->getId() . '/%d/'); $session->instantSet('captcha_board', true); $session->instantSet('captcha_board_comment', true); EventModel::getInstance()->Broadcast('view_board_threads', $_GET['board']); return true; }