Fix #1190 make comment page count configurable

This commit is contained in:
Kijin Sung 2019-09-13 20:11:32 +09:00
parent 9b64b0f925
commit 73c5b6d84b
5 changed files with 25 additions and 8 deletions

View file

@ -1742,6 +1742,11 @@ class commentController extends comment
{
$comment_config->comment_count = 50;
}
$comment_config->comment_page_count = (int) Context::get('comment_page_count');
if(!$comment_config->comment_page_count)
{
$comment_config->comment_page_count = 10;
}
$comment_config->use_vote_up = Context::get('use_vote_up');
if(!$comment_config->use_vote_up)

View file

@ -481,10 +481,7 @@ class commentModel extends comment
{
$comment_config = $this->getCommentConfig($module_srl);
$comment_count = $comment_config->comment_count;
if(!$comment_count)
{
$comment_count = 50;
}
$comment_page_count = $comment_config->comment_page_count;
}
else
{
@ -501,8 +498,8 @@ class commentModel extends comment
$args = new stdClass();
$args->document_srl = $document_srl;
$args->list_count = $comment_count;
$args->page_count = $comment_page_count;
$args->page = $page;
$args->page_count = 10;
//check if module is using validation system
$oCommentController = getController('comment');
@ -987,10 +984,14 @@ class commentModel extends comment
$comment_config = new stdClass();
}
if(!isset($comment_config->comment_count))
if(!isset($comment_config->comment_count) || !$comment_config->comment_count)
{
$comment_config->comment_count = 50;
}
if(!isset($comment_config->comment_page_count) || $comment_config->comment_page_count)
{
$comment_config->comment_page_count = 10;
}
return $comment_config;
}

View file

@ -5,8 +5,10 @@ $lang->cmd_toggle_checked_comment = 'Invert Selection';
$lang->cmd_delete_checked_comment = 'Delete selected item';
$lang->trash = 'Recycle Bin';
$lang->cmd_trash = 'Move to Recycle Bin';
$lang->comment_count = 'Number of Comments';
$lang->about_comment_count = 'Display comments and if the number of them is over a specified number, move to the comment list.';
$lang->comment_count = 'Number of Comments per Page';
$lang->comment_page_count = 'Number of Pages';
$lang->about_comment_count = 'Set the number of comments to show on each page.';
$lang->about_comment_page_count = 'Set the number of pagination links to show at the bottom.';
$lang->msg_cart_is_null = 'Please select an article to delete.';
$lang->msg_checked_comment_is_deleted = '%d comment(s) is(are) successfully deleted.';
$lang->search_target_list['content'] = 'Content';

View file

@ -6,7 +6,9 @@ $lang->cmd_delete_checked_comment = '선택항목 삭제';
$lang->trash = '휴지통';
$lang->cmd_trash = '휴지통으로 이동';
$lang->comment_count = '댓글 수';
$lang->comment_page_count = '댓글 페이지 수';
$lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고, 그 이상일 경우 페이지 번호를 표시해서 이동할 수 있게 합니다.';
$lang->about_comment_page_count = '하단에 표시할 페이지 링크 수를 설정할 수 있습니다.';
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요.';
$lang->msg_checked_comment_is_deleted = '%d개의 댓글을 삭제했습니다.';
$lang->search_target_list['content'] = '내용';

View file

@ -12,6 +12,13 @@
<p class="x_help-inline">{$lang->about_comment_count}</p>
</div>
</div>
<div class="x_control-group">
<label for="comment_count" class="x_control-label">{$lang->comment_page_count}</label>
<div class="x_controls">
<input type="number" min="1" name="comment_page_count" id="comment_page_count" value="{$comment_config->comment_page_count}" />
<p class="x_help-inline">{$lang->about_comment_page_count}</p>
</div>
</div>
<div class="x_control-group">
<label for="use_vote_up" class="x_control-label">{$lang->cmd_vote}</label>
<div class="x_controls">