diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 84ac81c11..06b6077ff 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -1523,6 +1523,12 @@ class BoardView extends Board throw new Rhymix\Framework\Exception('msg_not_target'); } + $features = Rhymix\Modules\Board\Models\Features::fromModuleInfo($this->module_info); + if (!$features->{$target}->vote_log) + { + throw new Rhymix\Framework\Exceptions\FeatureDisabled; + } + $output = executeQueryArray($queryId, $args); if(!$output->toBool()) { @@ -1537,7 +1543,11 @@ class BoardView extends Board { if($log->point > 0) { - if($log->member_srl == $vote_member_infos[$log->member_srl]->member_srl) + if (isset($vote_member_infos[$log->member_srl])) + { + continue; + } + if (!$features->{$target}->vote_up_log) { continue; } @@ -1545,7 +1555,11 @@ class BoardView extends Board } else { - if($log->member_srl == $blame_member_infos[$log->member_srl]->member_srl) + if (isset($blame_member_infos[$log->member_srl])) + { + continue; + } + if (!$features->{$target}->vote_down_log) { continue; } @@ -1553,6 +1567,8 @@ class BoardView extends Board } } } + + Context::set('board_features', $features); Context::set('vote_member_info', $vote_member_infos); Context::set('blame_member_info', $blame_member_infos); $this->setTemplateFile('vote_log'); diff --git a/modules/board/models/Features.php b/modules/board/models/Features.php index 6bbc567ec..5f815be70 100644 --- a/modules/board/models/Features.php +++ b/modules/board/models/Features.php @@ -61,8 +61,10 @@ class Features // Document features $features->document->vote_up = ($document_config->use_vote_up ?? 'Y') !== 'N'; + $features->document->vote_up_log = ($document_config->use_vote_up ?? 'Y') === 'S'; $features->document->vote_down = ($document_config->use_vote_down ?? 'Y') !== 'N'; - $features->document->vote_log = ($document_config->use_vote_up ?? 'Y') === 'S' || ($document_config->use_vote_down ?? 'Y') === 'S'; + $features->document->vote_down_log = ($document_config->use_vote_down ?? 'Y') === 'S'; + $features->document->vote_log = $features->document->vote_up_log || $features->document->vote_down_log; if (isset($document_config->allow_vote_cancel)) { $features->document->cancel_vote = $document_config->allow_vote_cancel === 'Y'; @@ -92,8 +94,10 @@ class Features // Comment features $features->comment->vote_up = ($comment_config->use_vote_up ?? 'Y') !== 'N'; + $features->comment->vote_up_log = ($comment_config->use_vote_up ?? 'Y') === 'S'; $features->comment->vote_down = ($comment_config->use_vote_down ?? 'Y') !== 'N'; - $features->comment->vote_log = ($comment_config->use_vote_up ?? 'Y') === 'S' || ($comment_config->use_vote_down ?? 'Y') === 'S'; + $features->comment->vote_down_log = ($comment_config->use_vote_down ?? 'Y') === 'S'; + $features->comment->vote_log = $features->comment->vote_up_log || $features->comment->vote_down_log; if (isset($comment_config->allow_vote_cancel)) { $features->comment->cancel_vote = $comment_config->allow_vote_cancel === 'Y';