1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

fix info for vote topic

This commit is contained in:
Mzhelskiy Maxim 2014-01-30 16:51:14 +07:00
parent 22902e1b08
commit eebcd8a52b

View file

@ -51,7 +51,7 @@ class ActionAjax extends Action {
$this->AddEventPreg('/^vote$/i','/^blog$/','EventVoteBlog');
$this->AddEventPreg('/^vote$/i','/^user$/','EventVoteUser');
$this->AddEventPreg('/^vote$/i','/^question$/','EventVoteQuestion');
$this->AddEventPreg('/^vote$/i','/^get$/','/^info$/','EventVoteGetInfo');
$this->AddEventPreg('/^vote$/i','/^get$/','/^info$/','/^topic$/','EventVoteGetInfoTopic');
$this->AddEventPreg('/^favourite$/i','/^save-tags/','EventFavouriteSaveTags');
$this->AddEventPreg('/^favourite$/i','/^topic$/','EventFavouriteTopic');
@ -412,16 +412,12 @@ class ActionAjax extends Action {
/**
* Получение информации о голосовании за топик
*/
protected function EventVoteGetInfo() {
if ( ! is_string(getRequest('iTopicId')) ) {
protected function EventVoteGetInfoTopic() {
if (!($oTopic = $this->Topic_GetTopicById(getRequestStr('id', null, 'post'))) ) {
return $this->EventErrorDebug();
}
if ( ! ($oTopic = $this->Topic_GetTopicById(getRequestStr('iTopicId', null, 'post'))) ) {
return $this->EventErrorDebug();
}
if ( ! $oTopic->getVote() && ($this->oUserCurrent && $oTopic->getUserId() != $this->oUserCurrent->getId()) && (strtotime($oTopic->getDateAdd()) + Config::Get('acl.vote.topic.limit_time') > time())) {
if (!$oTopic->getVote() && ($this->oUserCurrent && $oTopic->getUserId() != $this->oUserCurrent->getId()) && (strtotime($oTopic->getDateAdd()) + Config::Get('acl.vote.topic.limit_time') > time())) {
return $this->EventErrorDebug();
}