Fix #1214 add option to display the first page of comments by default

This commit is contained in:
Kijin Sung 2020-03-23 01:45:25 +09:00
parent 676781a83e
commit b8665d73cb
5 changed files with 26 additions and 1 deletions

View file

@ -491,7 +491,11 @@ class commentModel extends comment
// get a very last page if no page exists
$total_pages = max(1, ceil($document_comment_count / $comment_count));
if(!$page || $page > $total_pages)
if(!$page)
{
$page = (isset($comment_config->default_page) && $comment_config->default_page === 'first') ? 1 : $total_pages;
}
if($page > $total_pages)
{
$page = $total_pages;
}