2008-09-21 09:36:57 +03:00
|
|
|
<?
|
|
|
|
/*-------------------------------------------------------
|
|
|
|
*
|
|
|
|
* LiveStreet Engine Social Networking
|
|
|
|
* Copyright © 2008 Mzhelskiy Maxim
|
|
|
|
*
|
|
|
|
*--------------------------------------------------------
|
|
|
|
*
|
|
|
|
* Official site: www.livestreet.ru
|
|
|
|
* Contact e-mail: rus.engine@gmail.com
|
|
|
|
*
|
|
|
|
* GNU General Public License, version 2:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
*
|
|
|
|
---------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Класс обработки УРЛа вида /comments/
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class ActionComments extends Action {
|
|
|
|
|
2009-02-14 13:56:04 +02:00
|
|
|
/**
|
|
|
|
* Главное меню
|
|
|
|
*
|
|
|
|
* @var unknown_type
|
|
|
|
*/
|
|
|
|
protected $sMenuHeadItemSelect='blog';
|
|
|
|
|
2008-09-21 09:36:57 +03:00
|
|
|
public function Init() {
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RegisterEvent() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************************
|
|
|
|
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
|
|
|
|
**********************************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Для любого евента(тобишь любого УРЛа после /comments/) выводим комментарии
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
protected function EventNotFound() {
|
|
|
|
/**
|
|
|
|
* Передан ли номер страницы
|
|
|
|
*/
|
|
|
|
if (preg_match("/^page(\d+)$/i",$this->sCurrentEvent,$aMatch)) {
|
|
|
|
$iPage=$aMatch[1];
|
|
|
|
} else {
|
|
|
|
$iPage=1;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* Получаем список комментов
|
|
|
|
*/
|
|
|
|
$iCount=0;
|
|
|
|
$aResult=$this->Comment_GetCommentsAll($iCount,$iPage,BLOG_COMMENT_PER_PAGE);
|
|
|
|
$aComments=$aResult['collection'];
|
|
|
|
/**
|
|
|
|
* Формируем постраничность
|
|
|
|
*/
|
|
|
|
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_COMMENT_PER_PAGE,4,DIR_WEB_ROOT.'/comments');
|
|
|
|
/**
|
|
|
|
* Загружаем переменные в шаблон
|
|
|
|
*/
|
|
|
|
$this->Viewer_Assign('aPaging',$aPaging);
|
|
|
|
$this->Viewer_Assign("aComments",$aComments);
|
2009-01-10 21:23:36 +02:00
|
|
|
$this->Viewer_AddHtmlTitle($this->Lang_Get('comments'));
|
2008-09-21 09:36:57 +03:00
|
|
|
/**
|
|
|
|
* Устанавливаем шаблон вывода
|
|
|
|
*/
|
|
|
|
$this->SetTemplateAction('index');
|
|
|
|
}
|
2009-02-14 13:56:04 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Выполняется при завершении работы экшена
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function EventShutdown() {
|
|
|
|
/**
|
|
|
|
* Загружаем в шаблон необходимые переменные
|
|
|
|
*/
|
|
|
|
$this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect);
|
|
|
|
}
|
2008-09-21 09:36:57 +03:00
|
|
|
}
|
|
|
|
?>
|