diff --git a/modules/board/skins/cozy_board/comment.html b/modules/board/skins/cozy_board/comment.html index 604487595..25f260288 100644 --- a/modules/board/skins/cozy_board/comment.html +++ b/modules/board/skins/cozy_board/comment.html @@ -1,3 +1,5 @@ + +
{@ $_comment_list = $oDocument->getComments() } @@ -89,15 +91,17 @@
-
- {$lang->first_page} - - - {$page_no} - - {$page_no} + +
+ {$lang->first_page} + + + {$page_no} + + {$page_no} + + {$lang->last_page} +
- {$lang->last_page} -
diff --git a/modules/board/skins/xe_board/comment.html b/modules/board/skins/xe_board/comment.html index cc83bde98..d44ff06d9 100644 --- a/modules/board/skins/xe_board/comment.html +++ b/modules/board/skins/xe_board/comment.html @@ -90,17 +90,19 @@ + + diff --git a/modules/board/skins/xe_guestbook/comment.html b/modules/board/skins/xe_guestbook/comment.html index 6de543bfb..14c2492c5 100644 --- a/modules/board/skins/xe_guestbook/comment.html +++ b/modules/board/skins/xe_guestbook/comment.html @@ -85,17 +85,19 @@ + + diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index afa7040ba..66fcfd6e0 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -158,7 +158,7 @@ /** * @brief document_srl에 해당하는 문서의 댓글 목록을 가져옴 **/ - function getCommentList($document_srl, $page = 1, $is_admin = false) { + function getCommentList($document_srl, $page = 0, $is_admin = false) { // 해당 문서의 모듈에 해당하는 댓글 수를 구함 $oDocumentModel = &getModel('document'); $oDocument = $oDocumentModel->getDocument($document_srl); @@ -175,7 +175,8 @@ $comment_count = $comment_config->comment_count; if(!$comment_count) $comment_count = 50; - if(!$page) !$page = 1; + // 페이지가 없으면 제일 뒤 페이지를 구함 + if(!$page) $page = (int)( ($oDocument->getCommentCount()-1) / $comment_count) + 1; // 정해진 수에 따라 목록을 구해옴 $args->document_srl = $document_srl; diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 0c6854ff3..69cfbe9bf 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -375,13 +375,15 @@ if(!$this->allowComment() || !$this->getCommentCount()) return; if(!$this->isGranted() && $this->isSecret()) return; + // cpage는 댓글페이지의 번호 $cpage = Context::get('cpage'); - if(!$cpage) $cpage = 1; + // 댓글 목록을 구해옴 $oCommentModel = &getModel('comment'); $output = $oCommentModel->getCommentList($this->document_srl, $cpage, $is_admin); if(!$output->toBool() || !count($output->data)) return; + // 구해온 목록을 commentItem 객체로 만듬 $oCommentModel = &getModel('comment'); foreach($output->data as $key => $val) { $oCommentItem = new commentItem(); @@ -389,8 +391,9 @@ $comment_list[$val->comment_srl] = $oCommentItem; } - Context::set('comment_page_navigation', $output->page_navigation); + // 스킨에서 출력하기 위한 변수 설정 Context::set('cpage', $output->page_navigation->cur_page); + if($output->total_page>1) $this->comment_page_navigation = $output->page_navigation; return $comment_list; }