Content 확장 위젯의 경우
추천 순 조회순 인기순 정렬 등 워낙 기능이 많다보니 12년이 지난 지금까지 사용 중에 있습니다.
근데 아무래도 오래되다보니 비밀글이 최신글에 노출된다거나
대기상태의 글이 노출되는 경우도 발생되고 있습니다.
그래서
https://xe1.xpressengine.com/index.php?mid=download&package_id=19088419
이 오래된 자료에
if($args->show_secret == 'Y')
{
$obj->statusList = array('PUBLIC', 'SECRET');
}
else
{
$obj->statusList = array('PUBLIC');
}
이 부분을 추가 해주고 싶습니다.
형식이 완전히 달라 조금 애를 먹고 있는데
// 해당 문서가 비밀글일 경우 권한이 있는지 확인, 없으면 continue
if ($args->view_secret_document == 'use_permission' || $args->view_secret_document == 'not_show') {
if ($args->view_secret_document == 'use_permission' && $oComment->isSecret() && !$oComment->isGranted()) continue;
else if ($args->view_secret_document == 'not_show' && $oComment->isSecret()) continue;
if ($args->comment_document_secret == 'Y') {
$doobj = null;
$doobj->document_srl = $oComment->get('document_srl');
$output = executeQuery('widgets.contentextended.getDocument', $doobj);
$oDocument = new documentItem();
$oDocument->setAttribute($output->data, false);
if ($oDocument->isSecret()) continue;
}
}
여기 어디 추가하면 좋을것 같은데 관련하여 도움 부탁드립니다.
감사합니다.
인용하신 소스는 왠지 비밀글일 때 댓글 수집을 제어하는 것 같은데요.
정확한 판독인지는 모르겠지만, 위젯에서 비밀 댓글을 보여주는 것으로 설정했더라도 문서가 비밀글이면 그냥 통과하는 거 아닌가요?
getNewestDocuments 쿼리 자체를 손봐야 할 것 같아요.
getNewestDocuments.xml을 보면 문서의 status(PUBLIC, SECRET, EMBARGO 등등) 구분 없이 다 수집하는 것 같거든요.