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

fix голосования за комментарии и активности

This commit is contained in:
Mzhelskiy Maxim 2014-05-29 13:24:20 +07:00
parent 90db2098af
commit 935bd0ea88
7 changed files with 18 additions and 6 deletions

View file

@ -975,6 +975,12 @@ class ActionAjax extends Action {
if (!($oComment=$this->Comment_GetCommentById(getRequestStr('iTargetId',null,'post')))) {
return $this->EventErrorDebug();
}
/**
* Проверка типа комментария
*/
if (!in_array($oComment->getTargetType(),(array)Config::Get('module.comment.vote_target_allow'))) {
return $this->EventErrorDebug();
}
/**
* Голосует автор комментария?
*/
@ -1028,7 +1034,7 @@ class ActionAjax extends Action {
/**
* Добавляем событие в ленту
*/
$this->Stream_write($oTopicCommentVote->getVoterId(), 'vote_comment', $oComment->getId());
$this->Stream_Write($oTopicCommentVote->getVoterId(), 'vote_comment_'.$oComment->getTargetType(), $oComment->getId());
} else {
return $this->EventErrorDebug();
}

View file

@ -47,7 +47,7 @@ class ModuleStream extends Module {
'add_comment' => array('related' => 'comment','unique'=>true),
'add_blog' => array('related' => 'blog','unique'=>true),
'vote_topic' => array('related' => 'topic'),
'vote_comment' => array('related' => 'comment'),
'vote_comment_topic' => array('related' => 'comment'),
'vote_blog' => array('related' => 'blog'),
'vote_user' => array('related' => 'user'),
'add_friend' => array('related' => 'user','unique_user'=>true),

View file

@ -160,6 +160,7 @@ $config['module']['comment']['nested_per_page'] = 0; // Число коммен
$config['module']['comment']['nested_page_reverse'] = true; // Определяет порядок вывода страниц. true - последние комментарии на первой странице, false - последние комментарии на последней странице
$config['module']['comment']['favourite_target_allow'] = array('topic'); // Список типов комментов, которые разрешено добавлять в избранное
$config['module']['comment']['edit_target_allow'] = array('topic','talk'); // Список типов комментов, которые разрешено редактировать
$config['module']['comment']['vote_target_allow'] = array('topic'); // Список типов комментов, за которые разрешено голосовать
// Модуль Talk
$config['module']['talk']['per_page'] = 30; // Число приватных сообщений на одну страницу
$config['module']['talk']['encrypt'] = 'livestreet'; // Ключ XXTEA шифрования идентификаторов в ссылках

View file

@ -1090,7 +1090,7 @@ return array(
'stream_event_type_add_comment' => 'Добавление комментария',
'stream_event_type_add_blog' => 'Добавление блога',
'stream_event_type_vote_topic' => 'Голосование за топик',
'stream_event_type_vote_comment' => 'Голосование за комментарий',
'stream_event_type_vote_comment_topic' => 'Голосование за комментарий к топику',
'stream_event_type_vote_blog' => 'Голосование за блог',
'stream_event_type_vote_user' => 'Голосование за пользователя',
'stream_event_type_add_friend' => 'Добавление в друзья',

View file

@ -100,7 +100,7 @@
{/if}
<a href="{$oTarget->getUrl()}">{$oTarget->getTitle()|escape:'html'}</a>
{elseif $oStreamEvent->getEventType() == 'vote_comment'}
{elseif $oStreamEvent->getEventType() == 'vote_comment_topic'}
{* Проголосовали за комментарий *}
{if $bUserIsMale}

@ -1 +1 @@
Subproject commit 73b47c15a5c98a0f5b7ac4c0ecdecf5b0f194101
Subproject commit 4e67e5fb845ac689cf1aa79273cd29753569a787

View file

@ -507,4 +507,9 @@ ALTER TABLE `prefix_comment` ADD `comment_text_source` TEXT NOT NULL AFTER `comm
ALTER TABLE `prefix_comment` ADD `comment_date_edit` DATETIME NULL DEFAULT NULL AFTER `comment_date` ,
ADD INDEX ( `comment_date_edit` ) ;
ALTER TABLE `prefix_comment` ADD `comment_count_edit` INT NOT NULL DEFAULT '0' AFTER `comment_count_favourite` ,
ADD INDEX ( `comment_count_edit` ) ;
ADD INDEX ( `comment_count_edit` ) ;
--29.05.2014
UPDATE `prefix_stream_user_type` set `event_type`='vote_comment_topic' WHERE `event_type`='vote_comment';
UPDATE `prefix_stream_event` set `event_type`='vote_comment_topic' WHERE `event_type`='vote_comment';