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); User_GetUserCurrent(); -if ($oUser and $oUser->getId()==2) { +if (Router::GetIsShowStats() and $oUser and $oUser->getId()==2) { ?>
Статистика выполнения diff --git a/templates/skin/habra/actions/ActionBlog/blog.tpl b/templates/skin/habra/actions/ActionBlog/blog.tpl index 41c70829..3b5963f0 100644 --- a/templates/skin/habra/actions/ActionBlog/blog.tpl +++ b/templates/skin/habra/actions/ActionBlog/blog.tpl @@ -78,6 +78,7 @@ покинуть {/if} + {if $oUserCurrent and $oUserCurrent->getId()==$oBlog->getOwnerId()} {/if} diff --git a/templates/skin/habra/actions/ActionBlog/profile.tpl b/templates/skin/habra/actions/ActionBlog/profile.tpl index 22c2aa1c..5c692303 100644 --- a/templates/skin/habra/actions/ActionBlog/profile.tpl +++ b/templates/skin/habra/actions/ActionBlog/profile.tpl @@ -80,6 +80,7 @@ покинуть {/if} + {if $oUserCurrent and $oUserCurrent->getId()==$oBlog->getOwnerId()} {/if} diff --git a/templates/skin/habra/block.comments.tpl b/templates/skin/habra/block.comments.tpl index b8e0a54e..d8664513 100644 --- a/templates/skin/habra/block.comments.tpl +++ b/templates/skin/habra/block.comments.tpl @@ -13,6 +13,6 @@
- » весь прямой эфир + » весь прямой эфир
diff --git a/templates/skin/habra/header.tpl b/templates/skin/habra/header.tpl index f88d4316..6d852fb9 100644 --- a/templates/skin/habra/header.tpl +++ b/templates/skin/habra/header.tpl @@ -22,7 +22,7 @@ - + {literal} diff --git a/templates/skin/habra/img/rss_small.gif b/templates/skin/habra/img/rss_small.gif new file mode 100644 index 00000000..6ed34f09 Binary files /dev/null and b/templates/skin/habra/img/rss_small.gif differ diff --git a/templates/skin/habra/menu.blog.tpl b/templates/skin/habra/menu.blog.tpl index 8fa123a1..b045a5d0 100644 --- a/templates/skin/habra/menu.blog.tpl +++ b/templates/skin/habra/menu.blog.tpl @@ -59,11 +59,11 @@ - Хорошие + Хорошие - Новые {if ($iCountTopicsNew)>0}+{$iCountTopicsNew}{/if} + Новые {if ($iCountTopicsNew)>0}+{$iCountTopicsNew}{/if} @@ -79,7 +79,7 @@ - Хорошие + Хорошие @@ -104,7 +104,7 @@ - Хорошие + Хорошие diff --git a/templates/skin/habra/menu.profile.tpl b/templates/skin/habra/menu.profile.tpl index 96f0f01a..01675f0a 100644 --- a/templates/skin/habra/menu.profile.tpl +++ b/templates/skin/habra/menu.profile.tpl @@ -138,7 +138,7 @@ - Блог{if $iCountTopicUser} ({$iCountTopicUser}){/if} + Блог{if $iCountTopicUser} ({$iCountTopicUser}){/if} diff --git a/templates/skin/habra/topic.tpl b/templates/skin/habra/topic.tpl index b1b05572..ec792471 100644 --- a/templates/skin/habra/topic.tpl +++ b/templates/skin/habra/topic.tpl @@ -10,6 +10,7 @@ {if $oUserCurrent and $oUserCurrent->getId()==$oTopic->getUserId()} {/if} +
{$oTopic->getText()}