mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-19 09:18:18 +03:00
1. Очищены все константы, которые использовались в Config-mapping`e.
2 Адресация в Actions и Entity переопределена через вызов Роутреа. 3. От констант очищены include файыл и ajax.
This commit is contained in:
parent
9bf0793130
commit
9be9867ec9
|
@ -91,7 +91,7 @@ class ActionBlog extends Action {
|
|||
* Устанавливаем евент по дефолту, т.е. будем показывать хорошие топики из коллективных блогов
|
||||
*/
|
||||
$this->SetDefaultEvent('good');
|
||||
$this->sMenuSubBlogUrl=DIR_WEB_ROOT.'/'.Config::Get('router.page.blog').'/';
|
||||
$this->sMenuSubBlogUrl=Router::GetPath('blog');
|
||||
/**
|
||||
* Достаём текущего пользователя
|
||||
*/
|
||||
|
@ -193,9 +193,9 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
if (isset($_FILES['avatar']) and is_uploaded_file($_FILES['avatar']['tmp_name'])) {
|
||||
$sFileTmp=$_FILES['avatar']['tmp_name'];
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_48x48",3000,3000,48,48)) {
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_24x24",3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}",3000,3000);
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_48x48",3000,3000,48,48)) {
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_24x24",3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}",3000,3000);
|
||||
$oBlog->setAvatar(1);
|
||||
$aFileInfo=pathinfo($sFileAvatar);
|
||||
$oBlog->setAvatarType($aFileInfo['extension']);
|
||||
|
@ -292,9 +292,9 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
if (isset($_FILES['avatar']) and is_uploaded_file($_FILES['avatar']['tmp_name'])) {
|
||||
$sFileTmp=$_FILES['avatar']['tmp_name'];
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_48x48",3000,3000,48,48)) {
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_24x24",3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}",3000,3000);
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_48x48",3000,3000,48,48)) {
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}_24x24",3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId(),"avatar_blog_{$oBlog->getUrl()}",3000,3000);
|
||||
$oBlog->setAvatar(1);
|
||||
$aFileInfo=pathinfo($sFileAvatar);
|
||||
$oBlog->setAvatarType($aFileInfo['extension']);
|
||||
|
@ -308,9 +308,9 @@ class ActionBlog extends Action {
|
|||
*/
|
||||
if (isset($_REQUEST['avatar_delete'])) {
|
||||
$oBlog->setAvatar(0);
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}_48x48.".$oBlog->getAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}_24x24.".$oBlog->getAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}.".$oBlog->getAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}_48x48.".$oBlog->getAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}_24x24.".$oBlog->getAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$oBlog->getOwnerId()."/avatar_blog_{$oBlog->getUrl()}.".$oBlog->getAvatarType());
|
||||
$oBlog->setAvatarType(null);
|
||||
}
|
||||
/**
|
||||
|
@ -522,12 +522,12 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsCollective($iPage,BLOG_TOPIC_PER_PAGE,$sShowType);
|
||||
$aResult=$this->Topic_GetTopicsCollective($iPage,Config::Get('module.topic.per_page'),$sShowType);
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.blog').'/'.$sShowType);
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('blog').$sShowType);
|
||||
/**
|
||||
* Вызов хуков
|
||||
*/
|
||||
|
@ -634,7 +634,7 @@ class ActionBlog extends Action {
|
|||
$this->Viewer_Assign('iMaxIdComment',$iMaxIdComment);
|
||||
$this->Viewer_AddHtmlTitle($oTopic->getBlog()->getTitle());
|
||||
$this->Viewer_AddHtmlTitle($oTopic->getTitle());
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/comments/'.$oTopic->getId().'/',$oTopic->getTitle());
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'comments/'.$oTopic->getId().'/',$oTopic->getTitle());
|
||||
/**
|
||||
* Устанавливаем шаблон вывода
|
||||
*/
|
||||
|
@ -662,13 +662,13 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsByBlog($oBlog,$iPage,BLOG_TOPIC_PER_PAGE,$sShowType);
|
||||
$aResult=$this->Topic_GetTopicsByBlog($oBlog,$iPage,Config::Get('module.topic.per_page'),$sShowType);
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$sUrlAdd=$sShowType=='good' ? '' : $sShowType;
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,$oBlog->getUrlFull().$sUrlAdd);
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,$oBlog->getUrlFull().$sUrlAdd);
|
||||
/**
|
||||
* Получаем число новых топиков в текущем блоге
|
||||
*/
|
||||
|
@ -701,7 +701,7 @@ class ActionBlog extends Action {
|
|||
$this->Viewer_Assign('aTopics',$aTopics);
|
||||
$this->Viewer_Assign('oBlog',$oBlog);
|
||||
$this->Viewer_AddHtmlTitle($oBlog->getTitle());
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/blog/'.$oBlog->getUrl().'/',$oBlog->getTitle());
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'blog/'.$oBlog->getUrl().'/',$oBlog->getTitle());
|
||||
/**
|
||||
* Устанавливаем шаблон вывода
|
||||
*/
|
||||
|
|
|
@ -50,12 +50,12 @@ class ActionBlogs extends Action {
|
|||
/**
|
||||
* Получаем список блогов
|
||||
*/
|
||||
$aResult=$this->Blog_GetBlogsRating($iPage,BLOG_BLOGS_PER_PAGE);
|
||||
$aResult=$this->Blog_GetBlogsRating($iPage,Config::Get('module.blog.per_page'));
|
||||
$aBlogs=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_BLOGS_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.blogs'));
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.blog.per_page'),4,Router::GetPath('blogs'));
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -53,19 +53,19 @@ class ActionComments extends Action {
|
|||
/**
|
||||
* Получаем список комментов
|
||||
*/
|
||||
$aResult=$this->Comment_GetCommentsAll('topic',$iPage,BLOG_COMMENT_PER_PAGE);
|
||||
$aResult=$this->Comment_GetCommentsAll('topic',$iPage,Config::Get('module.comment.per_page'));
|
||||
$aComments=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_COMMENT_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.comments'));
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.comment.per_page'),4,Router::GetPath('comments'));
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
$this->Viewer_Assign('aPaging',$aPaging);
|
||||
$this->Viewer_Assign("aComments",$aComments);
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('comments_all'));
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/allcomments/',$this->Lang_Get('comments_all'));
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'allcomments/',$this->Lang_Get('comments_all'));
|
||||
/**
|
||||
* Устанавливаем шаблон вывода
|
||||
*/
|
||||
|
|
|
@ -89,7 +89,7 @@ class ActionIndex extends Action {
|
|||
*
|
||||
*/
|
||||
protected function EventIndex() {
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/index/',SITE_NAME);
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'index/',Config::Get('view.name'));
|
||||
/**
|
||||
* Меню
|
||||
*/
|
||||
|
@ -101,12 +101,12 @@ class ActionIndex extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsGood($iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsGood($iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.index'));
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('index'));
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -65,11 +65,11 @@ class ActionLogin extends Action {
|
|||
*/
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
$sBackUrl=$_SERVER['HTTP_REFERER'];
|
||||
if (strpos($sBackUrl,DIR_WEB_ROOT.'/'.Config::Get('router.page.login'))===false) {
|
||||
if (strpos($sBackUrl,Router::GetPath('login'))===false) {
|
||||
func_header_location($sBackUrl);
|
||||
}
|
||||
}
|
||||
func_header_location(DIR_WEB_ROOT.'/');
|
||||
func_header_location(Config::Get('path.root.web').'/');
|
||||
}
|
||||
}
|
||||
$this->Viewer_Assign('bLoginError',true);
|
||||
|
@ -136,7 +136,7 @@ class ActionLogin extends Action {
|
|||
$oReminder->setUserId($oUser->getId());
|
||||
if ($this->User_AddReminder($oReminder)) {
|
||||
$this->Notify_SendReminderCode($oUser,$oReminder);
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.login').'/reminder/send/');
|
||||
func_header_location(Router::GetPath('login').'reminder/send/');
|
||||
}
|
||||
} else {
|
||||
$this->Message_AddError($this->Lang_Get('password_reminder_bad_email'),$this->Lang_Get('error'));
|
||||
|
|
|
@ -74,12 +74,12 @@ class ActionMy extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserProfile->getId(),1,$iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserProfile->getId(),1,$iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.my').'/'.$this->oUserProfile->getLogin());
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('my').$this->oUserProfile->getLogin());
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -87,7 +87,7 @@ class ActionMy extends Action {
|
|||
$this->Viewer_Assign('aTopics',$aTopics);
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('user_menu_publication').' '.$this->oUserProfile->getLogin());
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('user_menu_publication_blog'));
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/log/'.$this->oUserProfile->getLogin().'/',$this->oUserProfile->getLogin());
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'log/'.$this->oUserProfile->getLogin().'/',$this->oUserProfile->getLogin());
|
||||
/**
|
||||
* Устанавливаем шаблон вывода
|
||||
*/
|
||||
|
@ -116,12 +116,12 @@ class ActionMy extends Action {
|
|||
/**
|
||||
* Получаем список комментов
|
||||
*/
|
||||
$aResult=$this->Comment_GetCommentsByUserId($this->oUserProfile->getId(),'topic',$iPage,BLOG_COMMENT_PER_PAGE);
|
||||
$aResult=$this->Comment_GetCommentsByUserId($this->oUserProfile->getId(),'topic',$iPage,Config::Get('module.comment.per_page'));
|
||||
$aComments=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_COMMENT_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.my').'/'.$this->oUserProfile->getLogin().'/comment');
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.comment.per_page'),4,Router::GetPath('my').$this->oUserProfile->getLogin().'/comment');
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -89,7 +89,7 @@ class ActionNew extends Action {
|
|||
*
|
||||
*/
|
||||
protected function EventNew() {
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/new/',SITE_NAME);
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'new/',Config::Get('view.name'));
|
||||
/**
|
||||
* Меню
|
||||
*/
|
||||
|
@ -101,12 +101,12 @@ class ActionNew extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsNew($iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsNew($iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.new'));
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('new'));
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -76,12 +76,12 @@ class ActionPeople extends Action {
|
|||
/**
|
||||
* Получаем список юзеров
|
||||
*/
|
||||
$aResult=$this->User_GetUsersByCountry($oCountry->getName(),$iPage,USER_PER_PAGE);
|
||||
$aResult=$this->User_GetUsersByCountry($oCountry->getName(),$iPage,Config::Get('module.user.per_page'));
|
||||
$aUsersCountry=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,USER_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.people').'/'.$this->sCurrentEvent.'/'.$oCountry->getName());
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.user.per_page'),4,Router::GetPath('people').$this->sCurrentEvent.'/'.$oCountry->getName());
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -110,12 +110,12 @@ class ActionPeople extends Action {
|
|||
/**
|
||||
* Получаем список юзеров
|
||||
*/
|
||||
$aResult=$this->User_GetUsersByCity($oCity->getName(),$iPage,USER_PER_PAGE);
|
||||
$aResult=$this->User_GetUsersByCity($oCity->getName(),$iPage,Config::Get('module.user.per_page'));
|
||||
$aUsersCity=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,USER_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.people').'/'.$this->sCurrentEvent.'/'.$oCity->getName());
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.user.per_page'),4,Router::GetPath('people').$this->sCurrentEvent.'/'.$oCity->getName());
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -218,12 +218,12 @@ class ActionPeople extends Action {
|
|||
/**
|
||||
* Получаем список юзеров
|
||||
*/
|
||||
$aResult=$this->User_GetUsersRating($sType,$iPage,USER_PER_PAGE);
|
||||
$aResult=$this->User_GetUsersRating($sType,$iPage,Config::Get('module.user.per_page'));
|
||||
$aUsersRating=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,USER_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.people').'/'.$this->sCurrentEvent);
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.user.per_page'),4,Router::GetPath('people').$this->sCurrentEvent);
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -84,12 +84,12 @@ class ActionPersonalBlog extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsPersonal($iPage,BLOG_TOPIC_PER_PAGE,$sShowType);
|
||||
$aResult=$this->Topic_GetTopicsPersonal($iPage,Config::Get('module.topic.per_page'),$sShowType);
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.personal_blog').'/'.$sShowType);
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('personal_blog').$sShowType);
|
||||
/**
|
||||
* Вызов хуков
|
||||
*/
|
||||
|
|
|
@ -69,12 +69,12 @@ class ActionProfile extends Action {
|
|||
/**
|
||||
* Получаем список избранных топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsFavouriteByUserId($this->oUserProfile->getId(),$iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsFavouriteByUserId($this->oUserProfile->getId(),$iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.profile').'/'.$this->oUserProfile->getLogin().'/favourites');
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('profile').$this->oUserProfile->getLogin().'/favourites');
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -111,7 +111,7 @@ class ActionProfile extends Action {
|
|||
*/
|
||||
$aUsersSelfFriend=$this->User_GetUsersSelfFriend($this->oUserProfile->getId());
|
||||
|
||||
if (USER_USE_INVITE) {
|
||||
if (Config::Get('general.reg.invite')) {
|
||||
/**
|
||||
* Получаем список тех кого пригласил юзер
|
||||
*/
|
||||
|
|
|
@ -36,7 +36,7 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Если включены инвайты то перенаправляем на страницу регистрации по инвайтам
|
||||
*/
|
||||
if (!$this->User_IsAuthorization() and USER_USE_INVITE and !in_array(Router::GetActionEvent(),array('invite','activate','confirm')) and !$this->CheckInviteRegister()) {
|
||||
if (!$this->User_IsAuthorization() and Config::Get('general.reg.invite') and !in_array(Router::GetActionEvent(),array('invite','activate','confirm')) and !$this->CheckInviteRegister()) {
|
||||
return Router::Action('registration','invite');
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Если используется активация, то генерим код активации
|
||||
*/
|
||||
if (USER_USE_ACTIVATION) {
|
||||
if (Config::Get('general.reg.activation')) {
|
||||
$oUser->setActivate(0);
|
||||
$oUser->setActivateKey(md5(func_generator().time()));
|
||||
} else {
|
||||
|
@ -159,7 +159,7 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Если юзер зарегистрировался по приглашению то обновляем инвайт
|
||||
*/
|
||||
if (USER_USE_INVITE and $oInvite=$this->User_GetInviteByCode($this->GetInviteRegister())) {
|
||||
if (Config::Get('general.reg.invite') and $oInvite=$this->User_GetInviteByCode($this->GetInviteRegister())) {
|
||||
$oInvite->setUserToId($oUser->getId());
|
||||
$oInvite->setDateUsed(date("Y-m-d H:i:s"));
|
||||
$oInvite->setUsed(1);
|
||||
|
@ -168,12 +168,12 @@ class ActionRegistration extends Action {
|
|||
/**
|
||||
* Если стоит регистрация с активацией то проводим её
|
||||
*/
|
||||
if (USER_USE_ACTIVATION) {
|
||||
if (Config::Get('general.reg.activation')) {
|
||||
/**
|
||||
* Отправляем на мыло письмо о подтверждении регистрации
|
||||
*/
|
||||
$this->Notify_SendRegistrationActivate($oUser,getRequest('password'));
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.registration').'/confirm/');
|
||||
func_header_location(Router::GetPath('registration').'confirm/');
|
||||
} else {
|
||||
$this->Notify_SendRegistration($oUser,getRequest('password'));
|
||||
$this->Viewer_Assign('bRefreshToHome',true);
|
||||
|
@ -246,7 +246,7 @@ class ActionRegistration extends Action {
|
|||
*
|
||||
*/
|
||||
protected function EventInvite() {
|
||||
if (!USER_USE_INVITE) {
|
||||
if (!Config::Get('general.reg.invite')) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ class ActionRegistration extends Action {
|
|||
}
|
||||
|
||||
protected function DropInviteRegister() {
|
||||
if (USER_USE_INVITE) {
|
||||
if (Config::Get('general.reg.invite')) {
|
||||
$this->Session_Drop('invite_code');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,15 +39,15 @@ class ActionRss extends Action {
|
|||
}
|
||||
|
||||
protected function RssGood() {
|
||||
$aResult=$this->Topic_GetTopicsGood(1,BLOG_TOPIC_PER_PAGE*2);
|
||||
$aResult=$this->Topic_GetTopicsGood(1,Config::Get('module.topic.per_page')*2);
|
||||
$aTopics=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / RSS channel';
|
||||
$aChannel['title']=Config::Get('view.name');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('view.name').' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('view.name');
|
||||
|
||||
$topics=array();
|
||||
foreach ($aTopics as $oTopic){
|
||||
|
@ -66,15 +66,15 @@ class ActionRss extends Action {
|
|||
}
|
||||
|
||||
protected function RssNew() {
|
||||
$aResult=$this->Topic_GetTopicsNew(1,BLOG_TOPIC_PER_PAGE*2);
|
||||
$aResult=$this->Topic_GetTopicsNew(1,Config::Get('module.topic.per_page')*2);
|
||||
$aTopics=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$topics = array();
|
||||
foreach ($aTopics as $oTopic){
|
||||
|
@ -93,15 +93,15 @@ class ActionRss extends Action {
|
|||
}
|
||||
|
||||
protected function RssComments() {
|
||||
$aResult=$this->Comment_GetCommentsAll('topic',1,BLOG_COMMENT_PER_PAGE*2);
|
||||
$aResult=$this->Comment_GetCommentsAll('topic',1,Config::Get('module.comment.per_page')*2);
|
||||
$aComments=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$comments=array();
|
||||
foreach ($aComments as $oComment){
|
||||
|
@ -129,12 +129,12 @@ class ActionRss extends Action {
|
|||
$aComments=$this->Comment_GetCommentsByTargetId($oTopic->getId(),'topic');
|
||||
$aComments=$aComments['comments'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$comments=array();
|
||||
foreach ($aComments as $oComment){
|
||||
|
@ -154,15 +154,15 @@ class ActionRss extends Action {
|
|||
|
||||
protected function RssTag() {
|
||||
$sTag=urldecode($this->GetParam(0));
|
||||
$aResult=$this->Topic_GetTopicsByTag($sTag,1,BLOG_TOPIC_PER_PAGE*2);
|
||||
$aResult=$this->Topic_GetTopicsByTag($sTag,1,Config::Get('module.topic.per_page')*2);
|
||||
$aTopics=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$topics=array();
|
||||
foreach ($aTopics as $oTopic){
|
||||
|
@ -185,16 +185,16 @@ class ActionRss extends Action {
|
|||
if (!$sBlogUrl or !($oBlog=$this->Blog_GetBlogByUrl($sBlogUrl))) {
|
||||
return parent::EventNotFound();
|
||||
}else{
|
||||
$aResult=$this->Topic_GetTopicsByBlog($oBlog,1,BLOG_TOPIC_PER_PAGE*2,'good');
|
||||
$aResult=$this->Topic_GetTopicsByBlog($oBlog,1,Config::Get('module.topic.per_page')*2,'good');
|
||||
}
|
||||
$aTopics=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / '.$oBlog->getTitle().' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / '.$oBlog->getTitle().' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$topics=array();
|
||||
foreach ($aTopics as $oTopic){
|
||||
|
@ -217,16 +217,16 @@ class ActionRss extends Action {
|
|||
if (!$this->sUserLogin or !($oUser=$this->User_GetUserByLogin($this->sUserLogin))) {
|
||||
return parent::EventNotFound();
|
||||
}else{
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($oUser->getId(),1,1,BLOG_TOPIC_PER_PAGE*2);
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($oUser->getId(),1,1,Config::Get('module.topic.per_page')*2);
|
||||
}
|
||||
$aTopics=$aResult['collection'];
|
||||
|
||||
$aChannel['title']=SITE_NAME;
|
||||
$aChannel['link']=DIR_WEB_ROOT;
|
||||
$aChannel['description']=SITE_NAME.' / '.$oUser->getLogin().' / RSS channel';
|
||||
$aChannel['title']=Config::Get('path.root.web');
|
||||
$aChannel['link']=Config::Get('path.root.web');
|
||||
$aChannel['description']=Config::Get('path.root.web').' / '.$oUser->getLogin().' / RSS channel';
|
||||
$aChannel['language']='ru';
|
||||
$aChannel['managingEditor']=RSS_EDITOR_MAIL;
|
||||
$aChannel['generator']=SITE_NAME;
|
||||
$aChannel['managingEditor']=Config::Get('general.rss_editor_mail');
|
||||
$aChannel['generator']=Config::Get('path.root.web');
|
||||
|
||||
$topics=array();
|
||||
foreach ($aTopics as $oTopic){
|
||||
|
|
|
@ -33,7 +33,7 @@ class ActionSearch extends Action {
|
|||
* Ищем
|
||||
*/
|
||||
$aReq = $this->PrepareRequest();
|
||||
$aRes = $this->PrepareResults($aReq, BLOG_TOPIC_PER_PAGE);
|
||||
$aRes = $this->PrepareResults($aReq, Config::Get('module.topic.per_page'));
|
||||
if(FALSE === $aRes) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
|
||||
return Router::Action('error');
|
||||
|
@ -76,7 +76,7 @@ class ActionSearch extends Action {
|
|||
* Ищем
|
||||
*/
|
||||
$aReq = $this->PrepareRequest();
|
||||
$aRes = $this->PrepareResults($aReq, BLOG_COMMENT_PER_PAGE);
|
||||
$aRes = $this->PrepareResults($aReq, Config::Get('module.comment.per_page'));
|
||||
if(FALSE === $aRes) {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
|
||||
return Router::Action('error');
|
||||
|
@ -120,7 +120,7 @@ class ActionSearch extends Action {
|
|||
* Если запрос слишком короткий перенаправляем на начальную страницу поиска
|
||||
* Хотя тут лучше показывать юзеру в чем он виноват
|
||||
*/
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.search').'/');
|
||||
func_header_location(Router::GetPath('search'));
|
||||
}
|
||||
$aReq['sType'] = strtolower(Router::GetActionEvent());
|
||||
/**
|
||||
|
@ -158,7 +158,7 @@ class ActionSearch extends Action {
|
|||
*/
|
||||
foreach(array_keys($this->sTypesEnabled) as $sType){
|
||||
if($aRes['aCounts'][$sType])
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.search').'/'.$sType.'/?q='.$aReq['q']);
|
||||
func_header_location(Router::GetPath('search').$sType.'/?q='.$aReq['q']);
|
||||
}
|
||||
} elseif(($aReq['iPage']-1)*$iLimit <= $aRes['aCounts'][$aReq['sType']]) {
|
||||
/**
|
||||
|
@ -187,7 +187,7 @@ class ActionSearch extends Action {
|
|||
$aReq['iPage'],
|
||||
$iLimit,
|
||||
4,
|
||||
DIR_WEB_ROOT.'/'.Config::Get('router.page.search').'/'.$aReq['sType'],
|
||||
Router::GetPath('search').$aReq['sType'],
|
||||
array(
|
||||
'q' => $aReq['q']
|
||||
)
|
||||
|
|
|
@ -100,7 +100,7 @@ class ActionSettings extends Action {
|
|||
* @return unknown
|
||||
*/
|
||||
protected function EventInvite() {
|
||||
if (!USER_USE_INVITE) {
|
||||
if (!Config::Get('general.reg.invite')) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
|
||||
|
@ -268,11 +268,11 @@ class ActionSettings extends Action {
|
|||
*/
|
||||
if (isset($_FILES['avatar']) and is_uploaded_file($_FILES['avatar']['tmp_name'])) {
|
||||
$sFileTmp=$_FILES['avatar']['tmp_name'];
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId(),'avatar_100x100',3000,3000,100,100)) {
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId(),'avatar_64x64',3000,3000,64,64);
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId(),'avatar_48x48',3000,3000,48,48);
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId(),'avatar_24x24',3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId(),'avatar',3000,3000);
|
||||
if ($sFileAvatar=func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId(),'avatar_100x100',3000,3000,100,100)) {
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId(),'avatar_64x64',3000,3000,64,64);
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId(),'avatar_48x48',3000,3000,48,48);
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId(),'avatar_24x24',3000,3000,24,24);
|
||||
func_img_resize($sFileTmp,Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId(),'avatar',3000,3000);
|
||||
$this->oUserCurrent->setProfileAvatar(1);
|
||||
$aFileInfo=pathinfo($sFileAvatar);
|
||||
$this->oUserCurrent->setProfileAvatarType($aFileInfo['extension']);
|
||||
|
@ -286,17 +286,17 @@ class ActionSettings extends Action {
|
|||
*/
|
||||
if (isset($_REQUEST['avatar_delete'])) {
|
||||
$this->oUserCurrent->setProfileAvatar(0);
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId().'/avatar_100x100.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId().'/avatar_64x64.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId().'/avatar_48x48.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId().'/avatar_24x24.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(DIR_SERVER_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->oUserCurrent->getId().'/avatar.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId().'/avatar_100x100.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId().'/avatar_64x64.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId().'/avatar_48x48.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId().'/avatar_24x24.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
@unlink(Config::Get('path.root.server').Config::Get('path.uploads.images').'/'.$this->oUserCurrent->getId().'/avatar.'.$this->oUserCurrent->getProfileAvatarType());
|
||||
}
|
||||
/**
|
||||
* Загрузка фото, делаем ресайзы
|
||||
*/
|
||||
if (isset($_FILES['foto']) and is_uploaded_file($_FILES['foto']['tmp_name'])) {
|
||||
$sDirUpload=DIR_UPLOADS_IMAGES.'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.$this->oUserCurrent->getId();
|
||||
$sDirUpload=Config::Get('path.uploads.images').'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.$this->oUserCurrent->getId();
|
||||
$sFileTmp=$_FILES['foto']['tmp_name'];
|
||||
if ($sFileFoto=func_img_resize($sFileTmp,$sDirUpload,func_generator(6),3000,3000,250)) {
|
||||
$this->oUserCurrent->setProfileFoto($sDirUpload.'/'.$sFileFoto);
|
||||
|
@ -309,7 +309,7 @@ class ActionSettings extends Action {
|
|||
* Удалить фото
|
||||
*/
|
||||
if (isset($_REQUEST['foto_delete'])) {
|
||||
@unlink(DIR_SERVER_ROOT.$this->oUserCurrent->getProfileFoto());
|
||||
@unlink(Config::Get('path.root.server').$this->oUserCurrent->getProfileFoto());
|
||||
$this->oUserCurrent->setProfileFoto(null);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -63,12 +63,12 @@ class ActionTag extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsByTag($sTag,$iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsByTag($sTag,$iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.tag').'/'.htmlspecialchars($sTag));
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('tag').htmlspecialchars($sTag));
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ class ActionTag extends Action {
|
|||
$this->Viewer_Assign('sTag',$sTag);
|
||||
$this->Viewer_AddHtmlTitle($this->Lang_Get('tag_title'));
|
||||
$this->Viewer_AddHtmlTitle($sTag);
|
||||
$this->Viewer_SetHtmlRssAlternate(DIR_WEB_ROOT.'/'.Config::Get('router.page.rss').'/tag/'.$sTag.'/',$sTag);
|
||||
$this->Viewer_SetHtmlRssAlternate(Router::GetPath('rss').'tag/'.$sTag.'/',$sTag);
|
||||
/**
|
||||
* Устанавливаем шаблон вывода
|
||||
*/
|
||||
|
|
|
@ -85,7 +85,7 @@ class ActionTalk extends Action {
|
|||
* Обработка удаления сообщения
|
||||
*/
|
||||
$this->Talk_DeleteTalkUserByArray($sTalkId,$this->oUserCurrent->getId());
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.talk').'/');
|
||||
func_header_location(Router::GetPath('talk'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ class ActionTalk extends Action {
|
|||
}
|
||||
|
||||
if ($oTalk=$this->Talk_SendTalk($this->Text_Parser(getRequest('talk_title')),$this->Text_Parser(getRequest('talk_text')),$this->oUserCurrent,$this->aUsersId)) {
|
||||
func_header_location(DIR_WEB_ROOT.'/'.Config::Get('router.page.talk').'/read/'.$oTalk->getId().'/');
|
||||
func_header_location(Router::GetPath('talk').'read/'.$oTalk->getId().'/');
|
||||
} else {
|
||||
$this->Message_AddErrorSingle($this->Lang_Get('system_error'));
|
||||
return Router::Action('error');
|
||||
|
|
|
@ -215,12 +215,12 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Получаем список топиков
|
||||
*/
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserCurrent->getId(),$this->sCurrentEvent=='published' ? 1 : 0,$iPage,BLOG_TOPIC_PER_PAGE);
|
||||
$aResult=$this->Topic_GetTopicsPersonalByUser($this->oUserCurrent->getId(),$this->sCurrentEvent=='published' ? 1 : 0,$iPage,Config::Get('module.topic.per_page'));
|
||||
$aTopics=$aResult['collection'];
|
||||
/**
|
||||
* Формируем постраничность
|
||||
*/
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,BLOG_TOPIC_PER_PAGE,4,DIR_WEB_ROOT.'/'.Config::Get('router.page.topic').'/'.$this->sCurrentEvent);
|
||||
$aPaging=$this->Viewer_MakePaging($aResult['count'],$iPage,Config::Get('module.topic.per_page'),4,Router::GetPath('topic').$this->sCurrentEvent);
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
|
|
@ -56,7 +56,7 @@ class Init {
|
|||
*
|
||||
*/
|
||||
public function InitAction() {
|
||||
if (!$this->oUserCurrent and SITE_CLOSE_MODE and Router::GetAction()!='registration' and Router::GetAction()!='login') {
|
||||
if (!$this->oUserCurrent and Config::Get('general.close') and Router::GetAction()!='registration' and Router::GetAction()!='login') {
|
||||
Router::Action('login');
|
||||
}
|
||||
$this->Hook_Run('init_action');
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
class BlockBlogs extends Block {
|
||||
public function Exec() {
|
||||
if ($aResult=$this->Blog_GetBlogsRating(1,BLOCK_BLOGS_COUNT_ROW)) {
|
||||
if ($aResult=$this->Blog_GetBlogsRating(1,Config::Get('block.blogs.row'))) {
|
||||
$aBlogs=$aResult['collection'];
|
||||
$this->Viewer_Assign('aBlogs',$aBlogs);
|
||||
$sTextResult=$this->Viewer_Fetch("block.blogs_top.tpl");
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
class BlockStream extends Block {
|
||||
public function Exec() {
|
||||
if ($aComments=$this->Comment_GetCommentsOnline('topic',BLOCK_STREAM_COUNT_ROW)) {
|
||||
if ($aComments=$this->Comment_GetCommentsOnline('topic',Config::Get('block.stream.row'))) {
|
||||
$this->Viewer_Assign('aComments',$aComments);
|
||||
$sTextResult=$this->Viewer_Fetch("block.stream_comment.tpl");
|
||||
$this->Viewer_Assign('sStreamComments',$sTextResult);
|
||||
|
|
|
@ -73,7 +73,7 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanPostComment(UserEntity_User $oUser) {
|
||||
if ($oUser->getRating()>=ACL_CAN_POST_COMMENT) {
|
||||
if ($oUser->getRating()>=Config::Get('acl.create.comment.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -86,9 +86,9 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanPostCommentTime(UserEntity_User $oUser) {
|
||||
if (ACL_CAN_POST_COMMENT_TIME>0 and $oUser->getDateCommentLast()) {
|
||||
if (Config::Get('acl.create.comment.limit_time')>0 and $oUser->getDateCommentLast()) {
|
||||
$sDateCommentLast=strtotime($oUser->getDateCommentLast());
|
||||
if ($oUser->getRating()<ACL_CAN_POST_COMMENT_TIME_RATING and ((time()-$sDateCommentLast)<ACL_CAN_POST_COMMENT_TIME)) {
|
||||
if ($oUser->getRating()<Config::Get('acl.create.comment.limit_time_rating') and ((time()-$sDateCommentLast)<Config::Get('acl.create.comment.limit_time'))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanVoteComment(UserEntity_User $oUser, CommentEntity_Comment $oComment) {
|
||||
if ($oUser->getRating()>=ACL_CAN_VOTE_COMMENT) {
|
||||
if ($oUser->getRating()>=Config::Get('acl.vote.comment.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -127,7 +127,7 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanVoteBlog(UserEntity_User $oUser, BlogEntity_Blog $oBlog) {
|
||||
if ($oUser->getRating()>=ACL_CAN_VOTE_BLOG) {
|
||||
if ($oUser->getRating()>=Config::Get('acl.vote.blog.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -141,7 +141,7 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanVoteTopic(UserEntity_User $oUser, TopicEntity_Topic $oTopic) {
|
||||
if ($oUser->getRating()>=ACL_CAN_VOTE_TOPIC) {
|
||||
if ($oUser->getRating()>=Config::Get('acl.vote.topic.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -155,7 +155,7 @@ class LsACL extends Module {
|
|||
* @return bool
|
||||
*/
|
||||
public function CanVoteUser(UserEntity_User $oUser, UserEntity_User $oUserTarget) {
|
||||
if ($oUser->getRating()>=ACL_CAN_VOTE_USER) {
|
||||
if ($oUser->getRating()>=Config::Get('acl.vote.user.rating')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -70,9 +70,9 @@ class BlogEntity_Blog extends Entity
|
|||
}
|
||||
public function getAvatarPath($iSize=48) {
|
||||
if ($this->getAvatar()) {
|
||||
return DIR_WEB_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->getOwnerId()."/avatar_blog_{$this->getUrl()}_".$iSize.'x'.$iSize.'.'.$this->getAvatarType();
|
||||
return Config::Get('path.root.web').Config::Get('path.uploads.images').'/'.$this->getOwnerId()."/avatar_blog_{$this->getUrl()}_".$iSize.'x'.$iSize.'.'.$this->getAvatarType();
|
||||
} else {
|
||||
return DIR_STATIC_SKIN.'/images/avatar_blog_'.$iSize.'x'.$iSize.'.gif';
|
||||
return Config::Get('path.static.skin').'/images/avatar_blog_'.$iSize.'x'.$iSize.'.gif';
|
||||
}
|
||||
}
|
||||
public function getUserIsJoin() {
|
||||
|
@ -86,9 +86,9 @@ class BlogEntity_Blog extends Entity
|
|||
}
|
||||
public function getUrlFull() {
|
||||
if ($this->getType()=='personal') {
|
||||
return DIR_WEB_ROOT.'/'.Config::Get('router.page.my').'/'.$this->getOwner()->getLogin().'/';
|
||||
return Router::GetPath('my').$this->getOwner()->getLogin().'/';
|
||||
} else {
|
||||
return DIR_WEB_ROOT.'/'.Config::Get('router.page.blog').'/'.$this->getUrl().'/';
|
||||
return Router::GetPath('blog').$this->getUrl().'/';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ class LsComment extends Module {
|
|||
$iMaxIdComment=max($aComments);
|
||||
$aCmts=$this->GetCommentsAdditionalData($aComments);
|
||||
if (!class_exists('LsViewer')) {
|
||||
require_once(DIR_SERVER_ENGINE."/modules/viewer/Viewer.class.php");
|
||||
require_once(Config::Get('path.root.engine')."/modules/viewer/Viewer.class.php");
|
||||
}
|
||||
$oViewerLocal=new LsViewer(Engine::getInstance());
|
||||
$oViewerLocal->Init();
|
||||
|
|
|
@ -62,7 +62,7 @@ class CommentEntity_Comment extends Entity
|
|||
return $this->_aData['level'];
|
||||
}
|
||||
public function isBad() {
|
||||
if ($this->getRating()<=BLOG_COMMENT_BAD) {
|
||||
if ($this->getRating()<=Config::Get('module.comment.bad')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -29,7 +29,7 @@ class LsNotify extends Module {
|
|||
*/
|
||||
public function Init() {
|
||||
if (!class_exists('LsViewer')) {
|
||||
require_once(DIR_SERVER_ENGINE."/modules/sys_viewer/Viewer.class.php");
|
||||
require_once(Config::Get('path.root.engine')."/modules/sys_viewer/Viewer.class.php");
|
||||
}
|
||||
$this->oViewerLocal=new LsViewer(Engine::getInstance());
|
||||
$this->oViewerLocal->Init();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
require_once(DIR_SERVER_ENGINE.'/lib/external/Sphinx/sphinxapi.php');
|
||||
require_once(Config::Get('path.root.engine').'/lib/external/Sphinx/sphinxapi.php');
|
||||
|
||||
/**
|
||||
* Модуль для работы с машиной полнотекстового поиска Sphinx
|
||||
|
@ -17,7 +17,7 @@ class LsSphinx extends Module {
|
|||
* Получаем объект Сфинкса(из Сфинкс АПИ)
|
||||
*/
|
||||
$this->oSphinx = new SphinxClient();
|
||||
$this->oSphinx->SetServer(SEARCH_SPHINX_HOST, intval(SEARCH_SPHINX_PORT));
|
||||
$this->oSphinx->SetServer(Config::Get('module.search.sphinx.host'), intval(Config::Get('module.search.sphinx.port')));
|
||||
/**
|
||||
* Устанавливаем тип сортировки
|
||||
*/
|
||||
|
@ -53,7 +53,7 @@ class LsSphinx extends Module {
|
|||
/**
|
||||
* используем кеширование при поиске
|
||||
*/
|
||||
$cacheKey = SEARCH_ENTITY_PREFIX."searchResult_{$sObjType}_{$sTerms}_{$iOffset}_{$iLimit}";
|
||||
$cacheKey = Config::Get('module.search.entity_prefix')."searchResult_{$sObjType}_{$sTerms}_{$iOffset}_{$iLimit}";
|
||||
if (false === ($data = $this->Cache_Get($cacheKey))) {
|
||||
/**
|
||||
* Параметры поиска
|
||||
|
@ -74,7 +74,7 @@ class LsSphinx extends Module {
|
|||
/**
|
||||
* Ищем
|
||||
*/
|
||||
if(!is_array($data = $this->oSphinx->Query($sTerms, SEARCH_ENTITY_PREFIX.$sObjType.'Index'))) {
|
||||
if(!is_array($data = $this->oSphinx->Query($sTerms, Config::Get('module.search.entity_prefix').$sObjType.'Index'))) {
|
||||
return FALSE; // Скорее всего недоступен демон searchd
|
||||
}
|
||||
/**
|
||||
|
@ -106,7 +106,7 @@ class LsSphinx extends Module {
|
|||
* @return unknown
|
||||
*/
|
||||
public function GetSnippet($sText, $sIndex, $sTerms, $before_match, $after_match){
|
||||
$aReturn = $this->oSphinx->BuildExcerpts(array($sText), SEARCH_ENTITY_PREFIX.$sIndex.'Index', $sTerms, array(
|
||||
$aReturn = $this->oSphinx->BuildExcerpts(array($sText), Config::Get('module.search.entity_prefix').$sIndex.'Index', $sTerms, array(
|
||||
'before_match' => $before_match,
|
||||
'after_match' => $after_match,
|
||||
)
|
||||
|
|
|
@ -94,7 +94,7 @@ class Mapper_Talk extends Mapper {
|
|||
u.user_login as user_login
|
||||
FROM
|
||||
".DB_TABLE_TALK." as t,
|
||||
".DB_TABLE_USER." as u
|
||||
".Config::Get('db.table.user')." as u
|
||||
WHERE
|
||||
t.talk_id = ?d
|
||||
AND
|
||||
|
|
|
@ -406,7 +406,7 @@ class LsTopic extends Module {
|
|||
),
|
||||
'topic_publish' => 1,
|
||||
'topic_rating' => array(
|
||||
'value' => BLOG_INDEX_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.index_good'),
|
||||
'type' => 'top',
|
||||
'publish_index' => 1,
|
||||
),
|
||||
|
@ -421,7 +421,7 @@ class LsTopic extends Module {
|
|||
* @return unknown
|
||||
*/
|
||||
public function GetTopicsNew($iPage,$iPerPage) {
|
||||
$sDate=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$sDate=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
$aFilter=array(
|
||||
'blog_type' => array(
|
||||
'personal',
|
||||
|
@ -470,18 +470,18 @@ class LsTopic extends Module {
|
|||
switch ($sShowType) {
|
||||
case 'good':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_PERSONAL_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.personal_good'),
|
||||
'type' => 'top',
|
||||
);
|
||||
break;
|
||||
case 'bad':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_PERSONAL_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.personal_good'),
|
||||
'type' => 'down',
|
||||
);
|
||||
break;
|
||||
case 'new':
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -494,7 +494,7 @@ class LsTopic extends Module {
|
|||
* @return unknown
|
||||
*/
|
||||
public function GetCountTopicsPersonalNew() {
|
||||
$sDate=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$sDate=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
$aFilter=array(
|
||||
'blog_type' => array(
|
||||
'personal',
|
||||
|
@ -557,18 +557,18 @@ class LsTopic extends Module {
|
|||
switch ($sShowType) {
|
||||
case 'good':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_COLLECTIVE_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.collective_good'),
|
||||
'type' => 'top',
|
||||
);
|
||||
break;
|
||||
case 'bad':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_COLLECTIVE_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.collective_good'),
|
||||
'type' => 'down',
|
||||
);
|
||||
break;
|
||||
case 'new':
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -581,7 +581,7 @@ class LsTopic extends Module {
|
|||
* @return unknown
|
||||
*/
|
||||
public function GetCountTopicsCollectiveNew() {
|
||||
$sDate=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$sDate=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
$aFilter=array(
|
||||
'blog_type' => array(
|
||||
'open',
|
||||
|
@ -626,18 +626,18 @@ class LsTopic extends Module {
|
|||
switch ($sShowType) {
|
||||
case 'good':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_COLLECTIVE_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.collective_good'),
|
||||
'type' => 'top',
|
||||
);
|
||||
break;
|
||||
case 'bad':
|
||||
$aFilter['topic_rating']=array(
|
||||
'value' => BLOG_COLLECTIVE_LIMIT_GOOD,
|
||||
'value' => Config::Get('module.blog.collective_good'),
|
||||
'type' => 'down',
|
||||
);
|
||||
break;
|
||||
case 'new':
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$aFilter['topic_new']=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -652,7 +652,7 @@ class LsTopic extends Module {
|
|||
* @return unknown
|
||||
*/
|
||||
public function GetCountTopicsByBlogNew($oBlog) {
|
||||
$sDate=date("Y-m-d H:00:00",time()-BLOG_TOPIC_NEW_TIME);
|
||||
$sDate=date("Y-m-d H:00:00",time()-Config::Get('module.topic.new_time'));
|
||||
$aFilter=array(
|
||||
'blog_type' => array(
|
||||
'open',
|
||||
|
|
|
@ -116,9 +116,9 @@ class TopicEntity_Topic extends Entity
|
|||
|
||||
public function getUrl() {
|
||||
if ($this->getBlog()->getType()=='personal') {
|
||||
return DIR_WEB_ROOT.'/'.Config::Get('router.page.blog').'/'.$this->getId().'.html';
|
||||
return Router::GetPath('blog').$this->getId().'.html';
|
||||
} else {
|
||||
return DIR_WEB_ROOT.'/'.Config::Get('router.page.blog').'/'.$this->getBlog()->getUrl().'/'.$this->getId().'.html';
|
||||
return Router::GetPath('blog').$this->getBlog()->getUrl().'/'.$this->getId().'.html';
|
||||
}
|
||||
}
|
||||
public function getVote() {
|
||||
|
|
|
@ -487,7 +487,7 @@ class LsUser extends Module {
|
|||
} else {
|
||||
$data['session']=$this->oSession;
|
||||
}
|
||||
if (!SYS_CACHE_USE or $data['time']<time()-60*10) {
|
||||
if (!Config::Get('sys.cache.use') or $data['time']<time()-60*10) {
|
||||
$data['time']=time();
|
||||
$this->oMapper->UpdateSession($this->oSession);
|
||||
$this->Cache_Clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG,array('user_session_update'));
|
||||
|
|
|
@ -126,9 +126,9 @@ class UserEntity_User extends Entity {
|
|||
}
|
||||
public function getProfileAvatarPath($iSize=100) {
|
||||
if ($this->getProfileAvatar()) {
|
||||
return DIR_WEB_ROOT.DIR_UPLOADS_IMAGES.'/'.$this->getId().'/avatar_'.$iSize.'x'.$iSize.'.'.$this->getProfileAvatarType();
|
||||
return Config::Get('path.root.web').Config::Get('path.uploads.images').'/'.$this->getId().'/avatar_'.$iSize.'x'.$iSize.'.'.$this->getProfileAvatarType();
|
||||
} else {
|
||||
return DIR_STATIC_SKIN.'/images/avatar_'.$iSize.'x'.$iSize.'.jpg';
|
||||
return Config::Get('path.static.skin').'/images/avatar_'.$iSize.'x'.$iSize.'.jpg';
|
||||
}
|
||||
}
|
||||
public function getVote() {
|
||||
|
@ -141,7 +141,7 @@ class UserEntity_User extends Entity {
|
|||
return $this->_aData['user_is_administrator'];
|
||||
}
|
||||
public function getUserWebPath() {
|
||||
return DIR_WEB_ROOT.'/'.Config::Get('router.page.profile').'/'.$this->getLogin().'/';
|
||||
return Router::GetPath('profile').$this->getLogin().'/';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function Add(UserEntity_User $oUser) {
|
||||
$sql = "INSERT INTO ".DB_TABLE_USER."
|
||||
$sql = "INSERT INTO ".Config::Get('db.table.user')."
|
||||
(user_login,
|
||||
user_password,
|
||||
user_mail,
|
||||
|
@ -41,7 +41,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function Update(UserEntity_User $oUser) {
|
||||
$sql = "UPDATE ".DB_TABLE_USER."
|
||||
$sql = "UPDATE ".Config::Get('db.table.user')."
|
||||
SET
|
||||
user_password = ? ,
|
||||
user_mail = ? ,
|
||||
|
@ -172,7 +172,7 @@ class Mapper_User extends Mapper {
|
|||
u.* ,
|
||||
IF(ua.user_id IS NULL,0,1) as user_is_administrator
|
||||
FROM
|
||||
".DB_TABLE_USER." as u
|
||||
".Config::Get('db.table.user')." as u
|
||||
LEFT JOIN ".DB_TABLE_USER_ADMINISTRATOR." AS ua ON u.user_id=ua.user_id
|
||||
WHERE
|
||||
u.user_id IN(?a)
|
||||
|
@ -190,7 +190,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
u.user_id
|
||||
FROM
|
||||
".DB_TABLE_USER." as u
|
||||
".Config::Get('db.table.user')." as u
|
||||
WHERE u.user_activate_key = ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sKey)) {
|
||||
return $aRow['user_id'];
|
||||
|
@ -203,7 +203,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
u.user_id
|
||||
FROM
|
||||
".DB_TABLE_USER." as u
|
||||
".Config::Get('db.table.user')." as u
|
||||
WHERE u.user_mail = ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sMail)) {
|
||||
return $aRow['user_id'];
|
||||
|
@ -215,7 +215,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
u.user_id
|
||||
FROM
|
||||
".DB_TABLE_USER." as u
|
||||
".Config::Get('db.table.user')." as u
|
||||
WHERE
|
||||
u.user_login = ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sLogin)) {
|
||||
|
@ -247,7 +247,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
user_id
|
||||
FROM
|
||||
".DB_TABLE_USER."
|
||||
".Config::Get('db.table.user')."
|
||||
WHERE
|
||||
user_activate = 1
|
||||
ORDER BY
|
||||
|
@ -267,7 +267,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
user_id
|
||||
FROM
|
||||
".DB_TABLE_USER."
|
||||
".Config::Get('db.table.user')."
|
||||
WHERE
|
||||
user_rating ".($sType=='good' ? '>=0' : '<0')." and user_activate = 1
|
||||
ORDER BY
|
||||
|
@ -285,7 +285,7 @@ class Mapper_User extends Mapper {
|
|||
|
||||
|
||||
public function GetCountUsers() {
|
||||
$sql = "SELECT count(user_id) as count FROM ".DB_TABLE_USER." WHERE user_activate = 1";
|
||||
$sql = "SELECT count(user_id) as count FROM ".Config::Get('db.table.user')." WHERE user_activate = 1";
|
||||
$result=$this->oDb->selectRow($sql);
|
||||
return $result['count'];
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ class Mapper_User extends Mapper {
|
|||
|
||||
|
||||
public function GetCountUsersSex() {
|
||||
$sql = "SELECT user_profile_sex AS ARRAY_KEY, count(user_id) as count FROM ".DB_TABLE_USER." WHERE user_activate = 1 GROUP BY user_profile_sex ";
|
||||
$sql = "SELECT user_profile_sex AS ARRAY_KEY, count(user_id) as count FROM ".Config::Get('db.table.user')." WHERE user_activate = 1 GROUP BY user_profile_sex ";
|
||||
$result=$this->oDb->select($sql);
|
||||
return $result;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ class Mapper_User extends Mapper {
|
|||
count(user_id) as count,
|
||||
country_id
|
||||
FROM
|
||||
".DB_TABLE_COUNTRY_USER."
|
||||
".Config::Get('db.table.country_user')."
|
||||
GROUP BY country_id LIMIT 0, ?d
|
||||
) as cu
|
||||
JOIN ".DB_TABLE_COUNTRY." as c on cu.country_id=c.country_id
|
||||
|
@ -347,7 +347,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
user_id
|
||||
FROM
|
||||
".DB_TABLE_USER."
|
||||
".Config::Get('db.table.user')."
|
||||
WHERE
|
||||
user_activate = 1
|
||||
and
|
||||
|
@ -365,7 +365,7 @@ class Mapper_User extends Mapper {
|
|||
|
||||
|
||||
public function AddFriend(UserEntity_Friend $oFriend) {
|
||||
$sql = "INSERT INTO ".DB_TABLE_FRIEND."
|
||||
$sql = "INSERT INTO ".Config::Get('db.table.friend')."
|
||||
(user_id,
|
||||
user_friend_id
|
||||
)
|
||||
|
@ -379,7 +379,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function DeleteFriend(UserEntity_Friend $oFriend) {
|
||||
$sql = "DELETE FROM ".DB_TABLE_FRIEND."
|
||||
$sql = "DELETE FROM ".Config::Get('db.table.friend')."
|
||||
WHERE
|
||||
user_id = ?d
|
||||
AND
|
||||
|
@ -402,7 +402,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
*
|
||||
FROM
|
||||
".DB_TABLE_FRIEND."
|
||||
".Config::Get('db.table.friend')."
|
||||
WHERE
|
||||
user_id = ?
|
||||
AND
|
||||
|
@ -420,7 +420,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
uf.user_friend_id
|
||||
FROM
|
||||
".DB_TABLE_FRIEND." as uf
|
||||
".Config::Get('db.table.friend')." as uf
|
||||
WHERE
|
||||
uf.user_id = ?d ;
|
||||
";
|
||||
|
@ -437,7 +437,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
user_id
|
||||
FROM
|
||||
".DB_TABLE_FRIEND."
|
||||
".Config::Get('db.table.friend')."
|
||||
WHERE
|
||||
user_friend_id = ?d ";
|
||||
$aUsers=array();
|
||||
|
@ -450,7 +450,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetInviteByCode($sCode,$iUsed=0) {
|
||||
$sql = "SELECT * FROM ".DB_TABLE_INVITE." WHERE invite_code = ? and invite_used = ?d ";
|
||||
$sql = "SELECT * FROM ".Config::Get('db.table.invite')." WHERE invite_code = ? and invite_used = ?d ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sCode,$iUsed)) {
|
||||
return new UserEntity_Invite($aRow);
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function AddInvite(UserEntity_Invite $oInvite) {
|
||||
$sql = "INSERT INTO ".DB_TABLE_INVITE."
|
||||
$sql = "INSERT INTO ".Config::Get('db.table.invite')."
|
||||
(invite_code,
|
||||
user_from_id,
|
||||
invite_date_add
|
||||
|
@ -472,7 +472,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function UpdateInvite(UserEntity_Invite $oInvite) {
|
||||
$sql = "UPDATE ".DB_TABLE_INVITE."
|
||||
$sql = "UPDATE ".Config::Get('db.table.invite')."
|
||||
SET
|
||||
user_to_id = ? ,
|
||||
invite_date_used = ? ,
|
||||
|
@ -486,7 +486,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetCountInviteUsedByDate($sUserIdFrom,$sDate) {
|
||||
$sql = "SELECT count(invite_id) as count FROM ".DB_TABLE_INVITE." WHERE user_from_id = ?d and invite_date_add >= ? ";
|
||||
$sql = "SELECT count(invite_id) as count FROM ".Config::Get('db.table.invite')." WHERE user_from_id = ?d and invite_date_add >= ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sUserIdFrom,$sDate)) {
|
||||
return $aRow['count'];
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetCountInviteUsed($sUserIdFrom) {
|
||||
$sql = "SELECT count(invite_id) as count FROM ".DB_TABLE_INVITE." WHERE user_from_id = ?d";
|
||||
$sql = "SELECT count(invite_id) as count FROM ".Config::Get('db.table.invite')." WHERE user_from_id = ?d";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sUserIdFrom)) {
|
||||
return $aRow['count'];
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
i.user_to_id
|
||||
FROM
|
||||
".DB_TABLE_INVITE." as i
|
||||
".Config::Get('db.table.invite')." as i
|
||||
WHERE
|
||||
i.user_from_id = ?d ";
|
||||
$aUsers=array();
|
||||
|
@ -521,7 +521,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
i.user_from_id
|
||||
FROM
|
||||
".DB_TABLE_INVITE." as i
|
||||
".Config::Get('db.table.invite')." as i
|
||||
WHERE
|
||||
i.user_to_id = ?d
|
||||
LIMIT 0,1;
|
||||
|
@ -533,7 +533,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function SetCountryUser($sCountryId,$sUserId) {
|
||||
$sql = "REPLACE ".DB_TABLE_COUNTRY_USER."
|
||||
$sql = "REPLACE ".Config::Get('db.table.country_user')."
|
||||
SET
|
||||
country_id = ? ,
|
||||
user_id = ?
|
||||
|
@ -542,7 +542,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetCountryByName($sName) {
|
||||
$sql = "SELECT * FROM ".DB_TABLE_COUNTRY." WHERE country_name = ? ";
|
||||
$sql = "SELECT * FROM ".Config::Get('db.table.country')." WHERE country_name = ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sName)) {
|
||||
return new UserEntity_Country($aRow);
|
||||
}
|
||||
|
@ -553,8 +553,8 @@ class Mapper_User extends Mapper {
|
|||
$sql = "
|
||||
SELECT cu.user_id
|
||||
FROM
|
||||
".DB_TABLE_COUNTRY." as c,
|
||||
".DB_TABLE_COUNTRY_USER." as cu
|
||||
".Config::Get('db.table.country')." as c,
|
||||
".Config::Get('db.table.country_user')." as cu
|
||||
WHERE
|
||||
c.country_name = ?
|
||||
AND
|
||||
|
@ -592,7 +592,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function AddCountry(UserEntity_Country $oCountry) {
|
||||
$sql = "INSERT INTO ".DB_TABLE_COUNTRY."
|
||||
$sql = "INSERT INTO ".Config::Get('db.table.country')."
|
||||
(country_name)
|
||||
VALUES(?)
|
||||
";
|
||||
|
@ -653,7 +653,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
*
|
||||
FROM
|
||||
".DB_TABLE_COUNTRY."
|
||||
".Config::Get('db.table.country')."
|
||||
WHERE
|
||||
country_name LIKE ?
|
||||
LIMIT 0, ?d
|
||||
|
@ -668,7 +668,7 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function AddReminder(UserEntity_Reminder $oReminder) {
|
||||
$sql = "REPLACE ".DB_TABLE_REMINDER."
|
||||
$sql = "REPLACE ".Config::Get('db.table.reminder')."
|
||||
SET
|
||||
reminder_code = ? ,
|
||||
user_id = ? ,
|
||||
|
@ -688,7 +688,7 @@ class Mapper_User extends Mapper {
|
|||
$sql = "SELECT
|
||||
*
|
||||
FROM
|
||||
".DB_TABLE_REMINDER."
|
||||
".Config::Get('db.table.reminder')."
|
||||
WHERE
|
||||
reminder_code = ?";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sCode)) {
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
//error_reporting(E_ALL);
|
||||
define('SYS_HACKER_CONSOLE',false);
|
||||
require_once("loader.php");
|
||||
require_once(DIR_SERVER_ENGINE."/classes/Engine.class.php");
|
||||
require_once(DIR_SERVER_ENGINE."/lib/external/JsHttpRequest/JsHttpRequest.php");
|
||||
require_once(Config::Get('path.root.engine')."/classes/Engine.class.php");
|
||||
require_once(Config::Get('path.root.engine')."/lib/external/JsHttpRequest/JsHttpRequest.php");
|
||||
$JsHttpRequest = new JsHttpRequest("UTF-8");
|
||||
ProfilerSimple::getInstance(DIR_SERVER_ROOT.'/logs/profiler.log',false);
|
||||
ProfilerSimple::getInstance(Config::Get('path.root.server').'/logs/profiler.log',false);
|
||||
$oEngine=Engine::getInstance();
|
||||
$oEngine->Init();
|
||||
$oEngine->Security_ValidateSendForm();
|
||||
|
|
|
@ -239,8 +239,8 @@ function func_img_resize($sFileSrc,$sDirDest,$sFileDest,$iWidthMax,$iHeightMax,$
|
|||
$iHeightNew=$aSize[1];
|
||||
}
|
||||
|
||||
$sFileFullPath=DIR_SERVER_ROOT.'/'.$sDirDest.'/'.$sFileDest;
|
||||
@func_mkdir(DIR_SERVER_ROOT,$sDirDest);
|
||||
$sFileFullPath=Config::Get('path.root.server').'/'.$sDirDest.'/'.$sFileDest;
|
||||
@func_mkdir(Config::Get('path.root.server'),$sDirDest);
|
||||
if ($iWidthDest and $iWidthDest!=$aSize[0]) {
|
||||
$img_dest=imagecreatetruecolor($iWidthNew,$iHeightNew);
|
||||
imagesavealpha($img_dest,true);
|
||||
|
|
|
@ -32,58 +32,57 @@ class Config {
|
|||
* @var array
|
||||
*/
|
||||
static protected $aMapper = array(
|
||||
'sys.mail.include_comment' => 'SYS_MAIL_INCLUDE_COMMENT_TEXT',
|
||||
'sys.mail.include_talk' => 'SYS_MAIL_INCLUDE_TALK_TEXT',
|
||||
'path.root.web' => 'DIR_WEB_ROOT',
|
||||
'path.root.server' => 'DIR_SERVER_ROOT',
|
||||
'path.root.engine' => 'DIR_SERVER_ENGINE',
|
||||
'path.root.engine_lib' => 'DIR_WEB_ENGINE_LIB',
|
||||
'path.static.root' => 'DIR_STATIC_ROOT',
|
||||
'path.static.skin' => 'DIR_STATIC_SKIN',
|
||||
'path.uploads.root' => 'DIR_UPLOADS',
|
||||
'path.uploads.images' => 'DIR_UPLOADS_IMAGES',
|
||||
'path.offset_request_url' => 'SYS_OFFSET_REQUEST_URL',
|
||||
'path.smarty.template' => 'DIR_SMARTY_TEMPLATE',
|
||||
'path.smarty.compiled' => 'DIR_SMARTY_COMPILED',
|
||||
'path.smarty.cache' => 'DIR_SMARTY_CACHE',
|
||||
'path.smarty.plug' => 'DIR_SMARTY_PLUG',
|
||||
'acl.create.blog.rating' => 'ACL_CAN_BLOG_CREATE',
|
||||
'acl.create.comment.rating' => 'ACL_CAN_POST_COMMENT',
|
||||
'acl.create.comment.limit_time' => 'ACL_CAN_POST_COMMENT_TIME',
|
||||
'acl.create.comment.limit_time_rating' => 'ACL_CAN_POST_COMMENT_TIME_RATING',
|
||||
'acl.vote.blog.rating' => 'ACL_CAN_VOTE_BLOG',
|
||||
'acl.vote.comment.rating' => 'ACL_CAN_VOTE_COMMENT',
|
||||
'acl.vote.topic.rating' => 'ACL_CAN_VOTE_TOPIC',
|
||||
'acl.vote.user.rating' => 'ACL_CAN_VOTE_USER',
|
||||
'acl.vote.topic.limit_time' => 'VOTE_LIMIT_TIME_TOPIC',
|
||||
'acl.vote.comment.limit_time' => 'VOTE_LIMIT_TIME_COMMENT',
|
||||
'view.skin' => 'SITE_SKIN',
|
||||
'view.name' => 'SITE_NAME',
|
||||
'view.keywords' => 'SITE_KEYWORDS',
|
||||
'view.description' => 'SITE_DESCRIPTION',
|
||||
'view.noindex' => 'BLOG_URL_NO_INDEX',
|
||||
'view.tinymce' => 'BLOG_USE_TINYMCE',
|
||||
'view.img_resize_width' => 'BLOG_IMG_RESIZE_WIDTH',
|
||||
'general.close' => 'SITE_CLOSE_MODE',
|
||||
'general.rss_editor_mail' => 'RSS_EDITOR_MAIL',
|
||||
'general.reg.invite' => 'USER_USE_INVITE',
|
||||
'general.reg.activation' => 'USER_USE_ACTIVATION',
|
||||
'module.user.per_page' => 'USER_PER_PAGE',
|
||||
'module.topic.new_time' => 'BLOG_TOPIC_NEW_TIME',
|
||||
'module.topic.per_page' => 'BLOG_TOPIC_PER_PAGE',
|
||||
'module.comment.per_page' => 'BLOG_COMMENT_PER_PAGE',
|
||||
'module.comment.bad' => 'BLOG_COMMENT_BAD',
|
||||
'module.comment.max_tree' => 'BLOG_COMMENT_MAX_TREE_LEVEL',
|
||||
'module.blog.personal_good' => 'BLOG_PERSONAL_LIMIT_GOOD',
|
||||
'module.blog.collective_good' => 'BLOG_COLLECTIVE_LIMIT_GOOD',
|
||||
'module.blog.index_good' => 'BLOG_INDEX_LIMIT_GOOD',
|
||||
'module.blog.per_page' => 'BLOG_BLOGS_PER_PAGE',
|
||||
'block.stream.row' => 'BLOCK_STREAM_COUNT_ROW',
|
||||
'block.blogs.row' => 'BLOCK_BLOGS_COUNT_ROW',
|
||||
'db.table.prefix' => 'DB_PREFIX_TABLE',
|
||||
'module.search.entity_prefix' => 'SEARCH_ENTITY_PREFIX',
|
||||
'module.search.sphinx.host' => 'SEARCH_SPHINX_HOST',
|
||||
'module.search.sphinx.port' => 'SEARCH_SPHINX_PORT'
|
||||
//'sys.mail.include_comment' => 'SYS_MAIL_INCLUDE_COMMENT_TEXT',
|
||||
//'sys.mail.include_talk' => 'SYS_MAIL_INCLUDE_TALK_TEXT',
|
||||
//'path.root.server' => 'DIR_SERVER_ROOT',
|
||||
//'path.root.engine' => 'DIR_SERVER_ENGINE',
|
||||
//'path.root.engine_lib' => 'DIR_WEB_ENGINE_LIB',
|
||||
//'path.static.root' => 'DIR_STATIC_ROOT',
|
||||
//'path.static.skin' => 'DIR_STATIC_SKIN',
|
||||
//'path.uploads.root' => 'DIR_UPLOADS',
|
||||
//'path.uploads.images' => 'DIR_UPLOADS_IMAGES',
|
||||
//'path.offset_request_url' => 'SYS_OFFSET_REQUEST_URL',
|
||||
//'path.smarty.template' => 'DIR_SMARTY_TEMPLATE',
|
||||
//'path.smarty.compiled' => 'DIR_SMARTY_COMPILED',
|
||||
//'path.smarty.cache' => 'DIR_SMARTY_CACHE',
|
||||
//'path.smarty.plug' => 'DIR_SMARTY_PLUG',
|
||||
//'acl.create.blog.rating' => 'ACL_CAN_BLOG_CREATE',
|
||||
//'acl.create.comment.rating' => 'ACL_CAN_POST_COMMENT',
|
||||
//'acl.create.comment.limit_time' => 'ACL_CAN_POST_COMMENT_TIME',
|
||||
//'acl.create.comment.limit_time_rating' => 'ACL_CAN_POST_COMMENT_TIME_RATING',
|
||||
//'acl.vote.blog.rating' => 'ACL_CAN_VOTE_BLOG',
|
||||
//'acl.vote.comment.rating' => 'ACL_CAN_VOTE_COMMENT',
|
||||
//'acl.vote.topic.rating' => 'ACL_CAN_VOTE_TOPIC',
|
||||
//'acl.vote.user.rating' => 'ACL_CAN_VOTE_USER',
|
||||
//'acl.vote.topic.limit_time' => 'VOTE_LIMIT_TIME_TOPIC',
|
||||
//'acl.vote.comment.limit_time' => 'VOTE_LIMIT_TIME_COMMENT',
|
||||
//'view.skin' => 'SITE_SKIN',
|
||||
//'view.name' => 'SITE_NAME',
|
||||
//'view.keywords' => 'SITE_KEYWORDS',
|
||||
//'view.description' => 'SITE_DESCRIPTION',
|
||||
//'view.noindex' => 'BLOG_URL_NO_INDEX',
|
||||
//'view.tinymce' => 'BLOG_USE_TINYMCE',
|
||||
//'view.img_resize_width' => 'BLOG_IMG_RESIZE_WIDTH',
|
||||
//'general.close' => 'SITE_CLOSE_MODE',
|
||||
//'general.rss_editor_mail' => 'RSS_EDITOR_MAIL',
|
||||
//'general.reg.invite' => 'USER_USE_INVITE',
|
||||
//'general.reg.activation' => 'USER_USE_ACTIVATION',
|
||||
//'module.user.per_page' => 'USER_PER_PAGE',
|
||||
//'module.topic.new_time' => 'BLOG_TOPIC_NEW_TIME',
|
||||
//'module.topic.per_page' => 'BLOG_TOPIC_PER_PAGE',
|
||||
//'module.comment.per_page' => 'BLOG_COMMENT_PER_PAGE',
|
||||
//'module.comment.bad' => 'BLOG_COMMENT_BAD',
|
||||
//'module.comment.max_tree' => 'BLOG_COMMENT_MAX_TREE_LEVEL',
|
||||
//'module.blog.personal_good' => 'BLOG_PERSONAL_LIMIT_GOOD',
|
||||
//'module.blog.collective_good' => 'BLOG_COLLECTIVE_LIMIT_GOOD',
|
||||
//'module.blog.index_good' => 'BLOG_INDEX_LIMIT_GOOD',
|
||||
//'module.blog.per_page' => 'BLOG_BLOGS_PER_PAGE',
|
||||
//'block.stream.row' => 'BLOCK_STREAM_COUNT_ROW',
|
||||
//'block.blogs.row' => 'BLOCK_BLOGS_COUNT_ROW',
|
||||
//'db.table.prefix' => 'DB_PREFIX_TABLE',
|
||||
//'module.search.entity_prefix' => 'SEARCH_ENTITY_PREFIX',
|
||||
//'module.search.sphinx.host' => 'SEARCH_SPHINX_HOST',
|
||||
//'module.search.sphinx.port' => 'SEARCH_SPHINX_PORT'
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ $sMsg='';
|
|||
|
||||
if ($oEngine->User_IsAuthorization()) {
|
||||
$oUserCurrent=$oEngine->User_GetUserCurrent();
|
||||
if ($aBlogs=$oEngine->Blog_GetBlogsRatingJoin($oUserCurrent->getId(),BLOCK_BLOGS_COUNT_ROW)) {
|
||||
if ($aBlogs=$oEngine->Blog_GetBlogsRatingJoin($oUserCurrent->getId(),Config::Get('block.blogs.row'))) {
|
||||
$bStateError=false;
|
||||
$oEngine->Viewer_VarAssign();
|
||||
$oEngine->Viewer_Assign('aBlogs',$aBlogs);
|
||||
|
|
|
@ -30,7 +30,7 @@ $sMsg='';
|
|||
|
||||
if ($oEngine->User_IsAuthorization()) {
|
||||
$oUserCurrent=$oEngine->User_GetUserCurrent();
|
||||
if ($aBlogs=$oEngine->Blog_GetBlogsRatingSelf($oUserCurrent->getId(),BLOCK_BLOGS_COUNT_ROW)) {
|
||||
if ($aBlogs=$oEngine->Blog_GetBlogsRatingSelf($oUserCurrent->getId(),Config::Get('block.blogs.row'))) {
|
||||
$bStateError=false;
|
||||
$oEngine->Viewer_VarAssign();
|
||||
$oEngine->Viewer_Assign('aBlogs',$aBlogs);
|
||||
|
|
|
@ -29,7 +29,7 @@ $sMsgTitle='';
|
|||
$sMsg='';
|
||||
|
||||
|
||||
if ($aResult=$oEngine->Blog_GetBlogsRating(1,BLOCK_BLOGS_COUNT_ROW)) {
|
||||
if ($aResult=$oEngine->Blog_GetBlogsRating(1,Config::Get('block.blogs.row'))) {
|
||||
$aBlogs=$aResult['collection'];
|
||||
$bStateError=false;
|
||||
$oEngine->Viewer_VarAssign();
|
||||
|
|
|
@ -29,7 +29,7 @@ $sMsgTitle='';
|
|||
$sMsg='';
|
||||
|
||||
|
||||
if ($aComments=$oEngine->Comment_GetCommentsOnline('topic',BLOCK_STREAM_COUNT_ROW)) {
|
||||
if ($aComments=$oEngine->Comment_GetCommentsOnline('topic',Config::Get('block.stream.row'))) {
|
||||
$bStateError=false;
|
||||
$oEngine->Viewer_VarAssign();
|
||||
$oEngine->Viewer_Assign('aComments',$aComments);
|
||||
|
|
|
@ -29,7 +29,7 @@ $sMsgTitle='';
|
|||
$sMsg='';
|
||||
|
||||
|
||||
if ($oTopics=$oEngine->Topic_GetTopicsLast(BLOCK_STREAM_COUNT_ROW)) {
|
||||
if ($oTopics=$oEngine->Topic_GetTopicsLast(Config::Get('block.stream.row'))) {
|
||||
$bStateError=false;
|
||||
$oEngine->Viewer_VarAssign();
|
||||
$oEngine->Viewer_Assign('oTopics',$oTopics);
|
||||
|
|
|
@ -34,7 +34,7 @@ if ($oEngine->User_IsAuthorization()) {
|
|||
if (is_uploaded_file($_FILES['img_file']['tmp_name'])) {
|
||||
$sFileTmp=$_FILES['img_file']['tmp_name'];
|
||||
$sDirSave=DIR_UPLOADS_IMAGES.'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.$oUserCurrent->getId();
|
||||
if ($sFileImg=func_img_resize($sFileTmp,$sDirSave,func_generator(),3000,3000,BLOG_IMG_RESIZE_WIDTH,null,false)) {
|
||||
if ($sFileImg=func_img_resize($sFileTmp,$sDirSave,func_generator(),3000,3000,Config::Get('view.img_resize_width'),null,false)) {
|
||||
$sFile=$sDirSave.'/'.$sFileImg;
|
||||
} else {
|
||||
$sMsgTitle=$oEngine->Lang_Get('error');
|
||||
|
@ -63,7 +63,7 @@ if ($oEngine->User_IsAuthorization()) {
|
|||
fwrite($fp,$sContent);
|
||||
fclose($fp);
|
||||
$sDirSave=DIR_UPLOADS_IMAGES.'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.func_generator(1).'/'.$oUserCurrent->getId();
|
||||
if ($sFileImg=func_img_resize($sFileTmp,$sDirSave,func_generator(),3000,3000,BLOG_IMG_RESIZE_WIDTH,null,false)) {
|
||||
if ($sFileImg=func_img_resize($sFileTmp,$sDirSave,func_generator(),3000,3000,Config::Get('view.img_resize_width'),null,false)) {
|
||||
$sFile=$sDirSave.'/'.$sFileImg;
|
||||
} else {
|
||||
$sMsgTitle=$oEngine->Lang_Get('error');
|
||||
|
@ -88,7 +88,7 @@ if ($oEngine->User_IsAuthorization()) {
|
|||
$bStateError=false;
|
||||
$sMsgTitle='';
|
||||
$sMsg='';
|
||||
$sText='<img src="'.DIR_WEB_ROOT.$sFile.'" ';
|
||||
$sText='<img src="'.Config::Get('path.root.web').$sFile.'" ';
|
||||
if (isset($_REQUEST['title']) and $_REQUEST['title']!='') {
|
||||
$sText.=' title="'.htmlspecialchars($_REQUEST['title']).'" ';
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ chdir(dirname(__FILE__));
|
|||
|
||||
// Получаем объект конфигурации
|
||||
require_once("./config/loader.php");
|
||||
require_once(DIR_SERVER_ENGINE."/classes/Engine.class.php");
|
||||
require_once(Config::Get('path.root.engine')."/classes/Engine.class.php");
|
||||
|
||||
$oProfiler=ProfilerSimple::getInstance(DIR_SERVER_ROOT.'/logs/profiler.log',false);
|
||||
$oProfiler=ProfilerSimple::getInstance(Config::Get('path.server.root').'/logs/profiler.log',false);
|
||||
$iTimeId=$oProfiler->Start('full_time');
|
||||
|
||||
$oRouter=Router::getInstance();
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<a href="{router page='blog'}">{$aLang.blog_menu_collective}</a> {if $iCountTopicsCollectiveNew>0}+{$iCountTopicsCollectiveNew}{/if}
|
||||
{if $sMenuItemSelect=='blog'}
|
||||
<ul class="sub-menu" >
|
||||
<li {if $sMenuSubItemSelect=='good'}class="active"{/if}><div><a href="{$sMenuSubBlogUrl}">{$aLang.blog_menu_collective_good}</a></div></li>
|
||||
{if $iCountTopicsBlogNew>0}<li {if $sMenuSubItemSelect=='new'}class="active"{/if}><div><a href="{$sMenuSubBlogUrl}new/">{$aLang.blog_menu_collective_new}</a> +{$iCountTopicsBlogNew}</div></li>{/if}
|
||||
<li {if $sMenuSubItemSelect=='bad'}class="active"{/if}><div><a href="{$sMenuSubBlogUrl}bad/">{$aLang.blog_menu_collective_bad}</a></div></li>
|
||||
<li {if $sMenuSubItemSelect=='good'}class="active"{/if}><div><a href="{router page='blog'}">{$aLang.blog_menu_collective_good}</a></div></li>
|
||||
{if $iCountTopicsBlogNew>0}<li {if $sMenuSubItemSelect=='new'}class="active"{/if}><div><a href="{router page='blog'}new/">{$aLang.blog_menu_collective_new}</a> +{$iCountTopicsBlogNew}</div></li>{/if}
|
||||
<li {if $sMenuSubItemSelect=='bad'}class="active"{/if}><div><a href="{router page='blog'}bad/">{$aLang.blog_menu_collective_bad}</a></div></li>
|
||||
</ul>
|
||||
{/if}
|
||||
</li>
|
||||
|
|
Loading…
Reference in a new issue