diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index d4a942969..65321a2df 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -387,7 +387,8 @@ class commentModel extends comment { $args->module_srl = $obj->module_srl; } - + + $args->is_secret = $obj->is_secret; $args->document_srl = $obj->document_srl; $args->list_count = $obj->list_count; diff --git a/modules/comment/queries/getNewestCommentList.xml b/modules/comment/queries/getNewestCommentList.xml index a8cdd39c1..90f74da8f 100644 --- a/modules/comment/queries/getNewestCommentList.xml +++ b/modules/comment/queries/getNewestCommentList.xml @@ -7,6 +7,7 @@ + diff --git a/widgets/content/content.class.php b/widgets/content/content.class.php index 5687df931..91323425f 100644 --- a/widgets/content/content.class.php +++ b/widgets/content/content.class.php @@ -191,6 +191,12 @@ class content extends WidgetHandler $obj->module_srl = $args->module_srl; $obj->sort_index = $args->order_target; $obj->list_count = $args->list_count * $args->page_count; + + if($args->show_secret != 'Y') + { + $obj->is_secret = 'N'; + } + // Get model object of the comment module and execute getCommentList() method $oCommentModel = getModel('comment'); $output = $oCommentModel->getNewestCommentList($obj); @@ -201,6 +207,12 @@ class content extends WidgetHandler foreach($output as $key => $oComment) { + $oDocument = getModel('document')->getDocument($oComment->get('document_srl'), false, false); + if(!$oDocument->isExists() || $oDocument->isSecret() && $args->show_secret != 'Y') + { + continue; + } + $attribute = $oComment->getObjectVars(); $title = $oComment->getSummary($args->content_cut_size); $thumbnail = $oComment->getThumbnail($args->thumbnail_width,$args->thumbnail_height,$args->thumbnail_type);