diff --git a/classes/actions/ActionRss.class.php b/classes/actions/ActionRss.class.php index f377c966..b072fccf 100644 --- a/classes/actions/ActionRss.class.php +++ b/classes/actions/ActionRss.class.php @@ -24,6 +24,7 @@ class ActionRss extends Action { public function Init() { $this->SetDefaultEvent('index'); + Router::SetIsShowStats(false); } protected function RegisterEvent() { @@ -91,7 +92,7 @@ class ActionRss extends Action { } protected function RssComments() { - $aResult=$this->Comment_GetCommentsAll(0,1,BLOG_TOPIC_PER_PAGE*2); + $aResult=$this->Comment_GetCommentsAll(0,1,BLOG_COMMENT_PER_PAGE*2); $aComments=$aResult['collection']; $aChannel['title']=SITE_NAME; @@ -119,7 +120,12 @@ class ActionRss extends Action { protected function RssTopicComments() { $sTopicId=$this->GetParam(0); - $aComments=$this->Comment_GetCommentsByTopicId($sTopicId); + + if (!($oTopic=$this->Topic_GetTopicById($sTopicId))) { + return parent::EventNotFound(); + } + + $aComments=$this->Comment_GetCommentsByTopicId($oTopic->getId()); $aChannel['title']=SITE_NAME; $aChannel['link']=DIR_WEB_ROOT; @@ -130,9 +136,9 @@ class ActionRss extends Action { $comments=array(); foreach ($aComments as $oComment){ - $item['title']='коментар до: '.$oComment->getTopicTitle(); - $item['guid']=$oComment->getTopicUrl().'#comment'.$oComment->getId(); - $item['link']=$oComment->getTopicUrl().'#comment'.$oComment->getId(); + $item['title']='коментар до: '.$oTopic->getTitle(); + $item['guid']=$oTopic->getUrl().'#comment'.$oComment->getId(); + $item['link']=$oTopic->getUrl().'#comment'.$oComment->getId(); $item['description']=$oComment->getText(); $item['pubDate']=$oComment->getDate(); $item['author']=$oComment->getUserLogin(); @@ -174,16 +180,16 @@ class ActionRss extends Action { protected function RssColectiveBlog() { $sBlogUrl=$this->GetParam(0); - if (!$sBlogUrl or !($sBlog=$this->Blog_GetBlogByUrl($sBlogUrl))) { - $aResult['collection']=array(); + if (!$sBlogUrl or !($oBlog=$this->Blog_GetBlogByUrl($sBlogUrl))) { + return parent::EventNotFound(); }else{ - $aResult=$this->Topic_GetTopicsByBlogGood($sBlog,0,1,BLOG_TOPIC_PER_PAGE*2); + $aResult=$this->Topic_GetTopicsByBlogGood($oBlog,0,1,BLOG_TOPIC_PER_PAGE*2); } $aTopics=$aResult['collection']; $aChannel['title']=SITE_NAME; $aChannel['link']=DIR_WEB_ROOT; - $aChannel['description']=SITE_NAME.' / RSS channel'; + $aChannel['description']=SITE_NAME.' / '.$oBlog->getTitle().' / RSS channel'; $aChannel['language']='ru'; $aChannel['managingEditor']=RSS_EDITOR_MAIL; $aChannel['generator']=SITE_NAME; @@ -206,16 +212,16 @@ class ActionRss extends Action { protected function RssPersonalBlog() { $this->sUserLogin=$this->GetParam(0); - if (!$this->sUserLogin or !($this->oUserProfile=$this->User_GetUserByLogin($this->sUserLogin))) { - $aResult['collection']=array(); + if (!$this->sUserLogin or !($oUser=$this->User_GetUserByLogin($this->sUserLogin))) { + return parent::EventNotFound(); }else{ - $aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserProfile->getId(),1,0,1,BLOG_TOPIC_PER_PAGE*2); + $aResult=$this->Topic_GetTopicsPersonalByUser($oUser->getId(),1,0,1,BLOG_TOPIC_PER_PAGE*2); } $aTopics=$aResult['collection']; $aChannel['title']=SITE_NAME; $aChannel['link']=DIR_WEB_ROOT; - $aChannel['description']=SITE_NAME.' / RSS channel'; + $aChannel['description']=SITE_NAME.' / '.$oUser->getLogin().' / RSS channel'; $aChannel['language']='ru'; $aChannel['managingEditor']=RSS_EDITOR_MAIL; $aChannel['generator']=SITE_NAME; diff --git a/classes/actions/ActionTopic.class.php b/classes/actions/ActionTopic.class.php index 62701e0c..ef00e98d 100644 --- a/classes/actions/ActionTopic.class.php +++ b/classes/actions/ActionTopic.class.php @@ -474,8 +474,8 @@ class ActionTopic extends Action { /** * Проверяем есть ли содержание топика */ - if (!func_check(getRequest('topic_text'),'text',2,3000)) { - $this->Message_AddError('Текст топика должен быть от 2 до 3000 символов','Ошибка'); + if (!func_check(getRequest('topic_text'),'text',2,15000)) { + $this->Message_AddError('Текст топика должен быть от 2 до 15000 символов','Ошибка'); $bOk=false; } /** diff --git a/classes/engine/Router.class.php b/classes/engine/Router.class.php index f68eac88..9bab8097 100644 --- a/classes/engine/Router.class.php +++ b/classes/engine/Router.class.php @@ -39,7 +39,8 @@ class Router extends Object { static protected $sActionClass=null; static protected $aParams=array(); protected $oAction=null; - protected $oEngine=null; + protected $oEngine=null; + static protected $bShowStats=true; static protected $oInstance=null; @@ -240,6 +241,25 @@ class Router extends Object { self::$aParams[$iOffset]=$value; } + /** + * Показывать или нет статистику выполение скрипта + * Иногда бывает отключить показ, например, при выводе RSS ленты + * + * @param unknown_type $bState + */ + static public function SetIsShowStats($bState) { + self::$bShowStats=$bState; + } + + /** + * Получить статус показывать или нет статистику + * + * @return unknown + */ + static public function GetIsShowStats() { + return self::$bShowStats; + } + /** * Ставим хук на вызов неизвестного метода и считаем что хотели вызвать метод какого либо модуля * diff --git a/index.php b/index.php index 4709b19d..0c5d9bbe 100644 --- a/index.php +++ b/index.php @@ -16,7 +16,7 @@ */ error_reporting(E_ALL); ini_set('display_errors', 1); -define('SYS_HACKER_CONSOLE',true); +define('SYS_HACKER_CONSOLE',false); header('Content-Type: text/html; charset=utf-8'); $t1=microtime(true); @@ -38,7 +38,7 @@ $t2=microtime(true); $oUser=$oRouter->User_GetUserCurrent(); -if ($oUser and $oUser->getId()==2) { +if (Router::GetIsShowStats() and $oUser and $oUser->getId()==2) { ?>