diff --git a/modules/blog/blog.controller.php b/modules/blog/blog.controller.php index 42a723be4..5f0640962 100644 --- a/modules/blog/blog.controller.php +++ b/modules/blog/blog.controller.php @@ -105,9 +105,6 @@ // comment 모듈의 controller 객체 생성 $oCommentController = &getController('comment'); - // comment_srl이 존재하는지 체크 - $comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager); - // 줄바꾸임나 태그제거등의 작업 $obj->content = nl2br(strip_tags($obj->content)); @@ -144,10 +141,11 @@ if(!$output->toBool()) return $output; - $this->setMessage('success_registed'); $this->add('mid', Context::get('mid')); $this->add('document_srl', $obj->document_srl); - $this->add('comment_srl', $comment_srl); + $this->add('comment_srl', $obj->comment_srl); + + $this->setMessage('success_registed'); } /** diff --git a/modules/blog/skins/default/js/blog.js b/modules/blog/skins/default/js/blog.js index d57637070..8e1abe354 100644 --- a/modules/blog/skins/default/js/blog.js +++ b/modules/blog/skins/default/js/blog.js @@ -51,9 +51,12 @@ function completeReload(ret_obj) { function completeInsertComment(ret_obj) { var error = ret_obj['error']; var message = ret_obj['message']; + var comment_srl = ret_obj['comment_srl']; alert(message); - location.href = current_url.setQuery('comment_srl','').setQuery('act',''); + var url = current_url.setQuery('comment_srl','').setQuery('act','').setQuery('rnd',comment_srl); + if(comment_srl) url += '#comment_'+comment_srl; + location.href = url; } /* 댓글 삭제 */ diff --git a/modules/blog/skins/xe_blog/js/blog.js b/modules/blog/skins/xe_blog/js/blog.js index dba8c67a6..01ef837d7 100644 --- a/modules/blog/skins/xe_blog/js/blog.js +++ b/modules/blog/skins/xe_blog/js/blog.js @@ -57,9 +57,12 @@ function doCommentSubmit() { function completeInsertComment(ret_obj) { var error = ret_obj['error']; var message = ret_obj['message']; + var comment_srl = ret_obj['comment_srl']; alert(message); - location.href = current_url.setQuery('comment_srl','').setQuery('act',''); + var url = current_url.setQuery('comment_srl','').setQuery('act','').setQuery('rnd',comment_srl); + if(comment_srl) url += '#comment_'+comment_srl; + location.href = url; } /* 댓글 삭제 */ diff --git a/modules/blog/tpl/blog_info.html b/modules/blog/tpl/blog_info.html index ff73380b5..598db1048 100644 --- a/modules/blog/tpl/blog_info.html +++ b/modules/blog/tpl/blog_info.html @@ -56,4 +56,4 @@ {$lang->cmd_blog_list} - +