Extra Form
PHP PHP 7.0
CMS XpressEngine

메인페이지에 특정 게시판의 전체글 갯수와 공지글 갯수를 표시하고 싶습니다.

 

전체글 갯수는

{@
$oDocumentModel = &getModel('document');
$total_count =$oDocumentModel->getDocumentCount($module_srl);
}

<p> {$total_count} </p>

 

위의 방법으로 노출시켰는데...공지글 갯수는 게시판을 아무리 뒤져도 답을 모르겠어요..T T

 

공부는 하고 있는데..아직 개발자가 아니라서...도와주세요!!!

  • profile
    getNoticeList라는 함수가 있으니 거기서 공지글 갯수를 뽑아오거나 카운팅해볼 수 있겠네요.
  • profile
    아마 이런 식으로요...?

    {@
    $oDocumentModel = getModel('document');
    $args = new stdClass();
    $args->module_srl = $module_srl;
    $total_count = $oDocumentModel->getDocumentCount($module_srl);
    $notice_count = count($oDocumentModel->getNoticeList($args));
    }
    <p> {$total_count} </p>
    <p> {$notice_count} </p>
  • profile
    아니면 이렇게 해볼 수도 있겠네요. (본의 아니게 도배를..)
    될는지는 모르겠습니다.

    {@
    $oDocumentModel = getModel('document');
    $args = new stdClass();
    $args->s_is_notice = 'Y';
    $total_count = $oDocumentModel->getDocumentCount($module_srl);
    $notice_count = $oDocumentModel->getDocumentCount($module_srl, $args);
    }
    <p> {$total_count} </p>
    <p> {$notice_count} </p>
  • ?
    • yule
    • 질문기여자
    아!!!!!!!!! 됩니다~~~~~~~~~
    정말 어떻게 감사를 드려야 할지 모르겠네요...정말 감사합니다. 좋은 하루 되세요!!!