/** * Просмотр треда: */ public function viewThreadAction(Application $application, Template $template) { $board = new Board_BoardModel($_GET['board']); $session = Session::getInstance(); $settings = $board->getSettings(); $template->setParameter('title', $settings['title']); $template->setParameter('description', $settings['description']); $template->setParameter('board_id', $board->getId()); $thread = $board->getThread($_GET['thread_id']); if ($thread === false) { $template->headerNotFound(); } $this['form_errors'] = $session->instantGet('board_post_errors', array()); $this['board_form'] = $session->instantGet('board_post_form', array()); $stats = Board_StatisticsModel::getPostStats($thread['board_id'], $thread['id']); $template->setParameter('total_read', $stats['online']); $template->setParameter('total_write', $stats['writers']); $template->setParameter('total_unique', $stats['unique']); $session->instantSet('captcha_board_comment', true); $this['post'] = $thread; EventModel::getInstance()->Broadcast('view_board_thread', array($_GET['board'], $_GET['thread_id'])); return true; }