mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-17 08:18:18 +03:00
появились функции администратора: редактировать все топики, редактировать все блоги, удалять комментарии
This commit is contained in:
parent
5ff2f135a7
commit
5d3e734ff0
|
@ -207,7 +207,7 @@ class ActionBlog extends Action {
|
|||
/**
|
||||
* Явлется ли авторизованный пользователь хозяином блога
|
||||
*/
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
$this->Viewer_AddHtmlTitle($oBlog->getTitle());
|
||||
|
|
|
@ -124,7 +124,7 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* проверяем кто владелец топика
|
||||
*/
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId()) {
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
/**
|
||||
|
@ -133,15 +133,21 @@ class ActionLink extends Action {
|
|||
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
|
||||
/**
|
||||
* Получаем данные для отображения формы
|
||||
* Если админ то делаем доступными все блоги
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -199,13 +205,18 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* Получаем данные для отображения формы
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -243,7 +254,7 @@ class ActionLink extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($this->oUserCurrent->getId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -257,7 +268,7 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* Проверка состоит ли юзер в блоге в который постит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
|
@ -266,7 +277,7 @@ class ActionLink extends Action {
|
|||
/**
|
||||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog)) {
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
@ -341,7 +352,7 @@ class ActionLink extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($oTopic->getUserId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -356,9 +367,9 @@ class ActionLink extends Action {
|
|||
* Проверка состоит ли юзер в блоге в который постит
|
||||
* Если нужно разрешить редактировать топик в блоге в котором юзер уже не стоит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не сотоите в этом блоге!','Ошибка');
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -366,7 +377,7 @@ class ActionLink extends Action {
|
|||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
* Условие $oBlog->getId()!=$oTopic->getBlogId() для того чтоб разрешить отредактировать топик в блоге в который сейчас юзер не имеет права на постинг, но раньше успел в него запостить этот топик
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and $oBlog->getId()!=$oTopic->getBlogId()) {
|
||||
if (!$this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) and $oBlog->getId()!=$oTopic->getBlogId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* проверяем кто владелец топика
|
||||
*/
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId()) {
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
/**
|
||||
|
@ -102,14 +102,19 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Получаем данные для отображения формы
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -166,13 +171,18 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Получаем данные для отображения формы
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -211,7 +221,7 @@ class ActionQuestion extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($this->oUserCurrent->getId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -225,7 +235,7 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Проверка состоит ли юзер в блоге в который постит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
|
@ -234,7 +244,7 @@ class ActionQuestion extends Action {
|
|||
/**
|
||||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog)) {
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
@ -315,7 +325,7 @@ class ActionQuestion extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($oTopic->getUserId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -330,9 +340,9 @@ class ActionQuestion extends Action {
|
|||
* Проверка состоит ли юзер в блоге в который постит
|
||||
* Если нужно разрешить редактировать топик в блоге в котором юзер уже не стоит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не сотоите в этом блоге!','Ошибка');
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -340,7 +350,7 @@ class ActionQuestion extends Action {
|
|||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
* Условие $oBlog->getId()!=$oTopic->getBlogId() для того чтоб разрешить отредактировать топик в блоге в который сейчас юзер не имеет права на постинг, но раньше успел в него запостить этот топик
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and $oBlog->getId()!=$oTopic->getBlogId()) {
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and $oBlog->getId()!=$oTopic->getBlogId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* проверяем кто владелец топика
|
||||
*/
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId()) {
|
||||
if ($oTopic->getUserId()!=$this->oUserCurrent->getId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
return parent::EventNotFound();
|
||||
}
|
||||
/**
|
||||
|
@ -103,17 +103,24 @@ class ActionTopic extends Action {
|
|||
$this->Viewer_AddBlocksRight(array('block.blogInfo.tpl'));
|
||||
/**
|
||||
* Получаем данные для отображения формы
|
||||
* Если админ то делаем доступными все блоги
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
// делаем через "or" чтоб дать возможность юзеру отредактировать свой топик в блоге в котором он уже не может постить, т.е. для тех топиков что были запощены раньше и был доступ в блог
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) or $oTopic->getBlogId()==$oBlog->getId()) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
|
@ -161,13 +168,18 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Получаем данные для отображения формы
|
||||
*/
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
$aAllowBlogsUser=array();
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
$aBlogsOwner=array();
|
||||
if ($this->oUserCurrent->isAdministrator()) {
|
||||
$aBlogsOwner=$this->Blog_GetBlogs();
|
||||
} else {
|
||||
$aBlogsOwner=$this->Blog_GetBlogsByOwnerId($this->oUserCurrent->getId());
|
||||
$aBlogsUser=$this->Blog_GetRelationBlogUsersByUserId($this->oUserCurrent->getId());
|
||||
foreach ($aBlogsUser as $oBlogUser) {
|
||||
$oBlog=$this->Blog_GetBlogById($oBlogUser->getBlogId());
|
||||
if ($this->ACL_CanAddTopic($this->oUserCurrent,$oBlog)) {
|
||||
$aAllowBlogsUser[]=$oBlogUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -272,7 +284,7 @@ class ActionTopic extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($this->oUserCurrent->getId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -286,7 +298,7 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Проверка состоит ли юзер в блоге в который постит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
|
@ -295,7 +307,7 @@ class ActionTopic extends Action {
|
|||
/**
|
||||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog)) {
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
@ -382,7 +394,7 @@ class ActionTopic extends Action {
|
|||
*/
|
||||
$iBlogId=getRequest('blog_id');
|
||||
if ($iBlogId==0) {
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUser($this->oUserCurrent);
|
||||
$oBlog=$this->Blog_GetPersonalBlogByUserId($oTopic->getUserId());
|
||||
} else {
|
||||
$oBlog=$this->Blog_GetBlogById($iBlogId);
|
||||
}
|
||||
|
@ -397,9 +409,9 @@ class ActionTopic extends Action {
|
|||
* Проверка состоит ли юзер в блоге в который постит
|
||||
* Если нужно разрешить редактировать топик в блоге в котором юзер уже не стоит
|
||||
*/
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId())) {
|
||||
if (!$this->Blog_GetRelationBlogUserByBlogIdAndUserId($oBlog->getId(),$this->oUserCurrent->getId()) and !$this->oUserCurrent->isAdministrator()) {
|
||||
if ($oBlog->getOwnerId()!=$this->oUserCurrent->getId()) {
|
||||
$this->Message_AddErrorSingle('Вы не сотоите в этом блоге!','Ошибка');
|
||||
$this->Message_AddErrorSingle('Вы не состоите в этом блоге!','Ошибка');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -407,7 +419,7 @@ class ActionTopic extends Action {
|
|||
* Проверяем есть ли права на постинг топика в этот блог
|
||||
* Условие $oBlog->getId()!=$oTopic->getBlogId() для того чтоб разрешить отредактировать топик в блоге в который сейчас юзер не имеет права на постинг, но раньше успел в него запостить этот топик
|
||||
*/
|
||||
if (!$this->ACL_CanAddTopic($this->User_GetUserCurrent(),$oBlog) and $oBlog->getId()!=$oTopic->getBlogId()) {
|
||||
if (!$this->ACL_CanAddTopic($this->oUserCurrent,$oBlog) and $oBlog->getId()!=$oTopic->getBlogId() and !$this->oUserCurrent->isAdministrator()) {
|
||||
$this->Message_AddErrorSingle('Вы еще не достаточно окрепли чтобы постить в этот блог','Ошибка');
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ class Blog extends Module {
|
|||
* @param Entity_User $oUser
|
||||
* @return unknown
|
||||
*/
|
||||
public function GetPersonalBlogByUser(UserEntity_User $oUser) {
|
||||
return $this->oMapperBlog->GetPersonalBlogByUser($oUser);
|
||||
public function GetPersonalBlogByUserId($sUserId) {
|
||||
return $this->oMapperBlog->GetPersonalBlogByUserId($sUserId);
|
||||
}
|
||||
/**
|
||||
* Получить блог по айдишнику(номеру)
|
||||
|
@ -166,6 +166,14 @@ class Blog extends Module {
|
|||
public function GetBlogsByOwnerId($sUserId) {
|
||||
return $this->oMapperBlog->GetBlogsByOwnerId($sUserId);
|
||||
}
|
||||
/**
|
||||
* Получает список всех НЕ персональных блогов
|
||||
*
|
||||
* @return unknown
|
||||
*/
|
||||
public function GetBlogs() {
|
||||
return $this->oMapperBlog->GetBlogs();
|
||||
}
|
||||
/**
|
||||
* Получает список отновшений блога к юзеру(пользователей блога)
|
||||
*
|
||||
|
|
|
@ -134,9 +134,9 @@ class Mapper_Blog extends Mapper {
|
|||
}
|
||||
|
||||
|
||||
public function GetPersonalBlogByUser(UserEntity_User $oUser) {
|
||||
public function GetPersonalBlogByUserId($sUserId) {
|
||||
$sql = "SELECT * FROM ".DB_TABLE_BLOG." WHERE user_owner_id = ?d and blog_type='personal'";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$oUser->getId())) {
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sUserId)) {
|
||||
return new BlogEntity_Blog($aRow);
|
||||
}
|
||||
return null;
|
||||
|
@ -216,7 +216,22 @@ class Mapper_Blog extends Mapper {
|
|||
return $aBlogs;
|
||||
}
|
||||
|
||||
|
||||
public function GetBlogs() {
|
||||
$sql = "SELECT
|
||||
b.*
|
||||
FROM
|
||||
".DB_TABLE_BLOG." as b
|
||||
WHERE
|
||||
b.blog_type<>'personal'
|
||||
";
|
||||
$aBlogs=array();
|
||||
if ($aRows=$this->oDb->select($sql)) {
|
||||
foreach ($aRows as $aBlog) {
|
||||
$aBlogs[]=new BlogEntity_Blog($aBlog);
|
||||
}
|
||||
}
|
||||
return $aBlogs;
|
||||
}
|
||||
|
||||
public function AddBlogVote(BlogEntity_BlogVote $oBlogVote) {
|
||||
$sql = "INSERT INTO ".DB_TABLE_BLOG_VOTE."
|
||||
|
|
|
@ -44,6 +44,9 @@ class CommentEntity_TopicComment extends Entity
|
|||
public function getCountVote() {
|
||||
return $this->_aData['comment_count_vote'];
|
||||
}
|
||||
public function getDelete() {
|
||||
return $this->_aData['comment_delete'];
|
||||
}
|
||||
|
||||
public function getUserLogin() {
|
||||
return $this->_aData['user_login'];
|
||||
|
@ -139,6 +142,9 @@ class CommentEntity_TopicComment extends Entity
|
|||
public function setCountVote($data) {
|
||||
$this->_aData['comment_count_vote']=$data;
|
||||
}
|
||||
public function setDelete($data) {
|
||||
$this->_aData['comment_delete']=$data;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
|
@ -72,7 +72,9 @@ class Mapper_TopicComment extends Mapper {
|
|||
WHERE
|
||||
c.comment_rating >= 0
|
||||
AND
|
||||
c.comment_date >= ?
|
||||
c.comment_date >= ?
|
||||
AND
|
||||
c.comment_delete = 0
|
||||
ORDER by c.comment_rating desc, c.comment_date desc
|
||||
LIMIT 0, ?d
|
||||
) as c_fast
|
||||
|
@ -155,7 +157,9 @@ class Mapper_TopicComment extends Mapper {
|
|||
FROM
|
||||
".DB_TABLE_TOPIC_COMMENT." as c,
|
||||
".DB_TABLE_TOPIC." as t
|
||||
WHERE
|
||||
WHERE
|
||||
c.comment_delete = 0
|
||||
AND
|
||||
c.topic_id=t.topic_id
|
||||
AND
|
||||
t.topic_publish = 1
|
||||
|
@ -185,7 +189,9 @@ class Mapper_TopicComment extends Mapper {
|
|||
FROM
|
||||
".DB_TABLE_TOPIC_COMMENT." as c,
|
||||
".DB_TABLE_TOPIC." as t
|
||||
WHERE
|
||||
WHERE
|
||||
c.comment_delete = 0
|
||||
AND
|
||||
c.topic_id=t.topic_id
|
||||
AND
|
||||
t.topic_publish = 1
|
||||
|
@ -220,6 +226,8 @@ class Mapper_TopicComment extends Mapper {
|
|||
".DB_TABLE_USER." as u_owner
|
||||
WHERE
|
||||
c.comment_id=(SELECT comment_id FROM ".DB_TABLE_TOPIC_COMMENT." WHERE topic_id=t.topic_id AND t.topic_publish=1 ORDER BY comment_date DESC LIMIT 0,1)
|
||||
AND
|
||||
c.comment_delete = 0
|
||||
AND
|
||||
c.topic_id=t.topic_id
|
||||
AND
|
||||
|
@ -271,7 +279,7 @@ class Mapper_TopicComment extends Mapper {
|
|||
".DB_TABLE_USER." as u
|
||||
WHERE
|
||||
c.topic_id = ?d
|
||||
AND
|
||||
AND
|
||||
c.user_id=u.user_id
|
||||
ORDER by c.comment_id asc;
|
||||
";
|
||||
|
@ -302,6 +310,8 @@ class Mapper_TopicComment extends Mapper {
|
|||
WHERE
|
||||
c.user_id = ?d
|
||||
AND
|
||||
c.comment_delete = 0
|
||||
AND
|
||||
c.topic_id=t.topic_id
|
||||
AND
|
||||
t.topic_publish = 1
|
||||
|
@ -333,6 +343,8 @@ class Mapper_TopicComment extends Mapper {
|
|||
WHERE
|
||||
c.user_id = ?d
|
||||
AND
|
||||
c.comment_delete = 0
|
||||
AND
|
||||
c.topic_id=t.topic_id
|
||||
AND
|
||||
t.topic_publish = 1 ;
|
||||
|
@ -389,11 +401,12 @@ class Mapper_TopicComment extends Mapper {
|
|||
SET
|
||||
comment_text= ?,
|
||||
comment_rating= ?f,
|
||||
comment_count_vote= ?d
|
||||
comment_count_vote= ?d,
|
||||
comment_delete = ?d
|
||||
WHERE
|
||||
comment_id = ?d
|
||||
";
|
||||
if ($this->oDb->query($sql,$oTopicComment->getText(),$oTopicComment->getRating(),$oTopicComment->getCountVote(),$oTopicComment->getId())) {
|
||||
if ($this->oDb->query($sql,$oTopicComment->getText(),$oTopicComment->getRating(),$oTopicComment->getCountVote(),$oTopicComment->getDelete(),$oTopicComment->getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ class User extends Module {
|
|||
$this->oUserCurrent=$oUser;
|
||||
}
|
||||
/**
|
||||
* Запускаем атозалогинивание
|
||||
* Запускаем автозалогинивание
|
||||
* В куках стоит время на сколько запоминать юзера
|
||||
*/
|
||||
$this->AutoLogin();
|
||||
|
|
|
@ -124,7 +124,9 @@ class UserEntity_User extends Entity {
|
|||
public function getUserIsFrend() {
|
||||
return $this->_aData['user_is_frend'];
|
||||
}
|
||||
|
||||
public function isAdministrator() {
|
||||
return $this->_aData['user_is_administrator'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,14 @@ class Mapper_User extends Mapper {
|
|||
}
|
||||
|
||||
public function GetUserById($sKey) {
|
||||
$sql = "SELECT * FROM ".DB_TABLE_USER." WHERE user_id = ? ";
|
||||
$sql = "SELECT
|
||||
u.*,
|
||||
IF(ua.user_id IS NULL,0,1) as user_is_administrator
|
||||
FROM
|
||||
".DB_TABLE_USER." as u
|
||||
LEFT JOIN ".DB_TABLE_USER_ADMINISTRATOR." AS ua ON u.user_id=ua.user_id
|
||||
WHERE
|
||||
u.user_id = ? ";
|
||||
if ($aRow=$this->oDb->selectRow($sql,$sKey)) {
|
||||
return new UserEntity_User($aRow);
|
||||
}
|
||||
|
|
|
@ -39,4 +39,5 @@ define('DB_TABLE_TALK_COMMENT',DB_PREFIX_TABLE.'talk_comment');
|
|||
define('DB_TABLE_FREND',DB_PREFIX_TABLE.'frend');
|
||||
define('DB_TABLE_TOPIC_CONTENT',DB_PREFIX_TABLE.'topic_content');
|
||||
define('DB_TABLE_TOPIC_QUESTION_VOTE',DB_PREFIX_TABLE.'topic_question_vote');
|
||||
define('DB_TABLE_USER_ADMINISTRATOR',DB_PREFIX_TABLE.'user_administrator');
|
||||
?>
|
68
include/ajax/commentDelete.php
Normal file
68
include/ajax/commentDelete.php
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?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
|
||||
*
|
||||
---------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Удаление комментария админом
|
||||
*/
|
||||
|
||||
set_include_path(get_include_path().PATH_SEPARATOR.dirname(dirname(dirname(__FILE__))));
|
||||
chdir(dirname(dirname(dirname(__FILE__))));
|
||||
require_once("./config/config.ajax.php");
|
||||
|
||||
$idComment=@$_REQUEST['idComment'];
|
||||
$bStateError=true;
|
||||
$sMsg='';
|
||||
$sMsgTitle='';
|
||||
if ($oEngine->User_IsAuthorization()) {
|
||||
$oUserCurrent=$oEngine->User_GetUserCurrent();
|
||||
if ($oUserCurrent->isAdministrator()) {
|
||||
if ($oComment=$oEngine->Comment_GetCommentById($idComment)) {
|
||||
$oComment->setDelete(1);
|
||||
if ($oEngine->Comment_UpdateTopicComment($oComment)) {
|
||||
$bStateError=false;
|
||||
$sMsgTitle='Отлично!';
|
||||
$sMsg='Комментарий удален';
|
||||
} else {
|
||||
$sMsgTitle='Ошибка!';
|
||||
$sMsg='Возникли проблемы при удалении!';
|
||||
}
|
||||
} else {
|
||||
$sMsgTitle='Ошибка!';
|
||||
$sMsg='Комментарий не найден!';
|
||||
}
|
||||
} else {
|
||||
$sMsgTitle='Ошибка!';
|
||||
$sMsg='Нет доступа!';
|
||||
}
|
||||
} else {
|
||||
$sMsgTitle='Ошибка!';
|
||||
$sMsg='Необходимо авторизоваться!';
|
||||
}
|
||||
|
||||
|
||||
$GLOBALS['_RESULT'] = array(
|
||||
"bStateError" => $bStateError,
|
||||
"sMsgTitle" => $sMsgTitle,
|
||||
"sMsg" => $sMsg,
|
||||
);
|
||||
|
||||
?>
|
||||
<pre>
|
||||
<b>Request method:</b> <?=$_SERVER['REQUEST_METHOD'] . "\n"?>
|
||||
<b>Loader used:</b> <?=$JsHttpRequest->LOADER . "\n"?>
|
||||
<b>_REQUEST:</b> <?=print_r($_REQUEST, 1)?>
|
||||
</pre>
|
|
@ -45,15 +45,16 @@ ALTER TABLE `prefix_topic_question_vote`
|
|||
ADD CONSTRAINT `prefix_topic_question_vote_fk` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Меняем индекс в таблице комментов
|
||||
ALTER TABLE `prefix_topic_comment` DROP INDEX `comment_date_rating` ;
|
||||
ALTER TABLE `prefix_topic_comment` ADD INDEX `rating_date_id` ( `comment_rating` , `comment_date` , `comment_id` ) ;
|
||||
ALTER TABLE `prefix_topic_comment` ADD INDEX ( `comment_date` ) ;
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER TABLE `prefix_topic_comment` ADD `comment_delete` TINYINT NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `prefix_topic_comment` ADD INDEX ( `comment_delete` ) ;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
</span>
|
||||
{/if}
|
||||
<a href="{$DIR_WEB_ROOT}/rss/blog/{$oBlog->getUrl()}/" title="RSS лента"><IMG height=12 src="{$DIR_STATIC_SKIN}/img/rss_small.gif" width=12></a>
|
||||
{if $oUserCurrent and $oUserCurrent->getId()==$oBlog->getOwnerId()}
|
||||
{if $oUserCurrent and ($oUserCurrent->getId()==$oBlog->getOwnerId() or $oUserCurrent->isAdministrator() )}
|
||||
<a href="{$DIR_WEB_ROOT}/blog/edit/{$oBlog->getId()}/" title="отредактировать блог"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать блог"></a>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -68,8 +68,12 @@ function showCommentForm(reply) {
|
|||
<a href="{$DIR_WEB_ROOT}/profile/{$oComment->getUserLogin()}/" class="comments_nickname">{$oComment->getUserLogin()}</a>
|
||||
<span class="comments_date">{date_format date=$oComment->getDate()}</span>
|
||||
<a href="#comment{$oComment->getId()}" class="small" title=" ссылка ">#</a>
|
||||
{if !$oComment->getDelete()}
|
||||
<span id="comment_delete_{$oComment->getId()}"> <a href="#" title="удалить комментарий" onclick="ajaxCommentDelete({$oComment->getId()}); return false;"><img src="{$DIR_STATIC_SKIN}/img/comment_del.gif" border="0" alt="удалить"></a></span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="rating_comment_holder" id="voter{$oComment->getId()}">
|
||||
{if !$oComment->getDelete()}
|
||||
<span class="comments_rating_off" style="color: {if $oComment->getRating()<0}#d00000{else}#008000{/if};" id="comment_rating_{$oComment->getId()}">{$oComment->getRating()}</span>
|
||||
|
||||
<span id="comment_vote_self_{$oComment->getId()}" style="display: none;">
|
||||
|
@ -110,9 +114,12 @@ function showCommentForm(reply) {
|
|||
{else}
|
||||
<script>showCommentVote('comment_vote_anonim',{$oComment->getId()});</script>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
<div class="comment_text">
|
||||
<div class="comment_text" id="comment_content_{$oComment->getId()}">
|
||||
{if $oComment->getDelete()}
|
||||
<font color="#c5c5c5">комментарий был удален</font>
|
||||
{else}
|
||||
{if $oComment->isBad()}
|
||||
<div style="display: none;" id="comment_text_{$oComment->getId()}">
|
||||
{$oComment->getText()}
|
||||
|
@ -121,8 +128,9 @@ function showCommentForm(reply) {
|
|||
{else}
|
||||
{$oComment->getText()}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
{if $oUserCurrent}
|
||||
{if $oUserCurrent and !$oComment->getDelete()}
|
||||
<div class="comments_reply">
|
||||
<div class="reply_word_holder">(<a href="javascript:showCommentForm({$oComment->getId()});">ответить</a>)</div>
|
||||
<div style="display: none;" id="reply_{$oComment->getId()}"></div>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
</span>
|
||||
{/if}
|
||||
<a href="{$DIR_WEB_ROOT}/rss/blog/{$oBlog->getUrl()}/" title="RSS лента"><IMG height=12 src="{$DIR_STATIC_SKIN}/img/rss_small.gif" width=12></a>
|
||||
{if $oUserCurrent and $oUserCurrent->getId()==$oBlog->getOwnerId()}
|
||||
{if $oUserCurrent and ($oUserCurrent->getId()==$oBlog->getOwnerId() or $oUserCurrent->isAdministrator() )}
|
||||
<a href="{$DIR_WEB_ROOT}/blog/edit/{$oBlog->getId()}/" title="отредактировать блог"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать блог"></a>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Autocompleter.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Autocompleter.Request.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_WEB_ROOT}/classes/lib/external/MooTools_1.2/plugs/Autocompleter/Observer.js"></script>
|
||||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/main.js?v=10"></script>
|
||||
<script type="text/javascript" src="{$DIR_STATIC_SKIN}/js/main.js?v=11"></script>
|
||||
<BODY>
|
||||
|
||||
{literal}
|
||||
|
|
BIN
templates/skin/habra/img/comment_del.gif
Normal file
BIN
templates/skin/habra/img/comment_del.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 559 B |
|
@ -204,6 +204,30 @@ function ajaxQuestionVote(idTopic,idAnswer) {
|
|||
req.send( { idTopic: idTopic, idAnswer: idAnswer } );
|
||||
}
|
||||
|
||||
function ajaxCommentDelete(idComment) {
|
||||
var req = new JsHttpRequest();
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4) {
|
||||
document.getElementById('debug').innerHTML = req.responseText;
|
||||
closeWindowStatus();
|
||||
if (req.responseJS.bStateError) {
|
||||
msgErrorBox.alert(req.responseJS.sMsgTitle,req.responseJS.sMsg);
|
||||
} else {
|
||||
msgNoticeBox.alert(req.responseJS.sMsgTitle,req.responseJS.sMsg);
|
||||
if (document.getElementById('comment_content_'+idComment)) {
|
||||
document.getElementById('comment_content_'+idComment).innerHTML='<font color="#c5c5c5">комментарий был удален</font>';
|
||||
}
|
||||
if (document.getElementById('comment_delete_'+idComment)) {
|
||||
document.getElementById('comment_delete_'+idComment).style.display='none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
showWindowStatus('Удаление комментария...');
|
||||
req.open(null, DIR_WEB_ROOT+'/include/ajax/commentDelete.php', true);
|
||||
req.send( { idComment: idComment } );
|
||||
}
|
||||
|
||||
|
||||
function ajaxVoteUser(idUser,value) {
|
||||
var req = new JsHttpRequest();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<img src="{$DIR_STATIC_SKIN}/img/topic_unpublish.gif" border="0" title="топик находится в черновиках">
|
||||
{/if}
|
||||
{$oTopic->getTitle()|escape:'html'}
|
||||
{if $oUserCurrent and $oUserCurrent->getId()==$oTopic->getUserId()}
|
||||
{if $oUserCurrent and ( $oUserCurrent->getId()==$oTopic->getUserId() or $oUserCurrent->isAdministrator() )}
|
||||
<a href="{$DIR_WEB_ROOT}/{$oTopic->getType()}/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
|
||||
{/if}
|
||||
<a href="{$DIR_WEB_ROOT}/rss/comments/{$oTopic->getId()}/" title="RSS лента"><IMG height=12 src="{$DIR_STATIC_SKIN}/img/rss_small.gif" width=12></a>
|
||||
|
|
|
@ -13,9 +13,11 @@
|
|||
<img src="{$DIR_STATIC_SKIN}/img/topic_unpublish.gif" border="0" title="топик находится в черновиках">
|
||||
{/if}
|
||||
<a href="{if $oTopic->getType()=='link'}{$DIR_WEB_ROOT}/link/go/{$oTopic->getId()}/{else}{$oTopic->getUrl()}{/if}" class="headline_l">{$oTopic->getTitle()|escape:'html'}</a>
|
||||
{if $oUserCurrent and $oUserCurrent->getId()==$oTopic->getUserId()}
|
||||
|
||||
{if $oUserCurrent and ($oUserCurrent->getId()==$oTopic->getUserId() or $oUserCurrent->isAdministrator())}
|
||||
<a href="{$DIR_WEB_ROOT}/{$oTopic->getType()}/edit/{$oTopic->getId()}/" title="отредактировать топик"><img src="{$DIR_STATIC_SKIN}/img/blog_edit.gif" border="0" title="отредактировать топик"></a>
|
||||
{/if}
|
||||
|
||||
</h1>
|
||||
<div class="groups_topic_text">
|
||||
|
||||
|
|
Loading…
Reference in a new issue