1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 07:54:24 +03:00
ifhub.club/classes/actions/ActionPersonalBlog.class.php
Alexey Kachayev 9be9867ec9 1. Очищены все константы, которые использовались в Config-mapping`e.
2 Адресация в Actions и Entity переопределена через вызов Роутреа. 

3. От констант очищены include файыл и ajax.
2009-08-20 07:43:06 +00:00

129 lines
3.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*-------------------------------------------------------
*
* 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
*
---------------------------------------------------------
*/
/**
* Обработка персональных блогов, т.е. УРла вида /log/
*
*/
class ActionPersonalBlog extends Action {
/**
* Главное меню
*
* @var unknown_type
*/
protected $sMenuHeadItemSelect='blog';
/**
* Меню
*
* @var unknown_type
*/
protected $sMenuItemSelect='log';
/**
* Субменю
*
* @var unknown_type
*/
protected $sMenuSubItemSelect='good';
/**
* Инициализация
*
*/
public function Init() {
$this->SetDefaultEvent('good');
/**
* Добавляем блоки для отображения
*/
$this->Viewer_AddBlocks('right',array('stream','tags'));
}
/**
* Регистрируем необходимые евенты
*
*/
protected function RegisterEvent() {
$this->AddEventPreg('/^good$/i','/^(page(\d+))?$/i','EventTopics');
$this->AddEvent('good','EventTopics');
$this->AddEventPreg('/^bad$/i','/^(page(\d+))?$/i','EventTopics');
$this->AddEventPreg('/^new$/i','/^(page(\d+))?$/i','EventTopics');
}
/**********************************************************************************
************************ РЕАЛИЗАЦИЯ ЭКШЕНА ***************************************
**********************************************************************************
*/
/**
* Показ топиков
*
*/
protected function EventTopics() {
$sShowType=$this->sCurrentEvent;
/**
* Меню
*/
$this->sMenuSubItemSelect=$sShowType;
/**
* Передан ли номер страницы
*/
$iPage=$this->GetParamEventMatch(0,2) ? $this->GetParamEventMatch(0,2) : 1;
/**
* Получаем список топиков
*/
$aResult=$this->Topic_GetTopicsPersonal($iPage,Config::Get('module.topic.per_page'),$sShowType);
$aTopics=$aResult['collection'];
/**
* Формируем постраничность
*/
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('personal_blog').$sShowType);
/**
* Вызов хуков
*/
$this->Hook_Run('personal_show',array('sShowType'=>$sShowType));
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('aTopics',$aTopics);
$this->Viewer_Assign('aPaging',$aPaging);
/**
* Устанавливаем шаблон вывода
*/
$this->SetTemplateAction('index');
}
/**
* При завершении экшена загружаем в шаблон необходимые переменные
*
*/
public function EventShutdown() {
/**
* Подсчитываем новые топики
*/
$iCountTopicsCollectiveNew=$this->Topic_GetCountTopicsCollectiveNew();
$iCountTopicsPersonalNew=$this->Topic_GetCountTopicsPersonalNew();
$iCountTopicsNew=$iCountTopicsCollectiveNew+$iCountTopicsPersonalNew;
/**
* Загружаем переменные в шаблон
*/
$this->Viewer_Assign('sMenuHeadItemSelect',$this->sMenuHeadItemSelect);
$this->Viewer_Assign('sMenuItemSelect',$this->sMenuItemSelect);
$this->Viewer_Assign('sMenuSubItemSelect',$this->sMenuSubItemSelect);
$this->Viewer_Assign('iCountTopicsCollectiveNew',$iCountTopicsCollectiveNew);
$this->Viewer_Assign('iCountTopicsPersonalNew',$iCountTopicsPersonalNew);
$this->Viewer_Assign('iCountTopicsNew',$iCountTopicsNew);
}
}
?>