묻고답하기

1) 하고자 하는 일 : 최근 게시물에 공지를 제일 위로 하고 싶습니다.

 

2) 시도했던 방법은...

 

최근게시물 list.html에서

 

두개를 만듭니다.

 

notice_list와 document_list를 받아서

 

공지부터 뿌리고...나중에 일반 게시물을 뿌리는거죠..

 

그럼 notice_list는 어디서 만드냐???

 

newest_document.class.php

 

여기서 만들면 되겠더군요...

 

그래서 만들어 봤습니다.

 

<!--%import("style.css")-->
<div class="latest">
    <ul>
        <!--@foreach($widget_info->notice_list as $oDocument)-->     <== 사실 이부분이죠..
        <li>
          <a href="{$oDocument->getPermanentUrl()}">
          <span class="date">{$oDocument->getRegdate("Y-m-d")}</span>
          <span class="title">
            {$oDocument->getTitle($widget_info->subject_cut_size)}
            <!--@if($oDocument->getCommentCount())-->
              <span class="comment">{$oDocument->getCommentCount()}</span>
            <!--@end-->
          </span>
          {$oDocument->printExtraImages($widget_info->duration_new)}
          </a>
        </li>
        <!--@end-->
        <!--@foreach($widget_info->document_list as $oDocument)-->
        <li>
          <a href="{$oDocument->getPermanentUrl()}">
          <span class="date">{$oDocument->getRegdate("Y-m-d")}</span>
          <span class="title">{$oDocument->getTitle($widget_info->subject_cut_size)}
            <!--@if($oDocument->getCommentCount())-->
              <span class="comment">{$oDocument->getCommentCount()}</span>
            <!--@end-->
          </span>
          {$oDocument->printExtraImages($widget_info->duration_new)}
          </a>
        </li>
        <!--@end-->
    </ul>
</div>

그런데... notice_list는 어떻게 만드냐???

 

흐음..

 

            // 결과가 있으면 각 문서 객체화를 시킴
            $modules = array();
            if(count($output->data)) {
                foreach($output->data as $key => $attribute) {
                    $modules[$attribute->module_srl]->mid = $attribute->mid;
                    $modules[$attribute->module_srl]->site_srl = $attribute->site_srl;

                    $document_srl = $attribute->document_srl;

                    $oDocument = null;
                    $oDocument = new documentItem();
                    $oDocument->setAttribute($attribute, false);
                    $GLOBALS['XE_DOCUMENT_LIST'][$oDocument->document_srl] = $oDocument;

      // Cavin
      if($oDocument->isNotice()) {
                     $notice_list[$key] = $oDocument;
      }

                }
                $oDocumentModel->setToAllDocumentExtraVars();
            } else {
  // Cavin
                $notice_list = array();
            }

            // 결과가 있으면 각 문서 객체화를 시킴
            $modules = array();
            if(count($output->data)) {
                foreach($output->data as $key => $attribute) {
                    $modules[$attribute->module_srl]->mid = $attribute->mid;
                    $modules[$attribute->module_srl]->site_srl = $attribute->site_srl;

                    $document_srl = $attribute->document_srl;

                    $oDocument = null;
                    $oDocument = new documentItem();
                    $oDocument->setAttribute($attribute, false);
                    $GLOBALS['XE_DOCUMENT_LIST'][$oDocument->document_srl] = $oDocument;

      if(!$oDocument->isNotice()) {
                        $document_list[$key] = $oDocument;
                    }
                }
                $oDocumentModel->setToAllDocumentExtraVars();
            } else {
                $document_list = array();
            }

 

이렇게 만들어 봤습니다.. ㄷㄷ

 

근데...잘 작동이 안되는게...

 

일단 그 게시판에 공지가 2개 있는데..

 

공지가 1개 나올때도 있고...2개나올때고 있다는겁니다. ㅠㅠ

 

 

조언 좀 부탁드립니다..

 

그래서..board쪽을 참고하려고 봤더니...

거긴..함수로 따로 만들어서 사용했더라구요...ㄷㄷㄷㄷㄷ 함수까지는 완전 이해하질 못해서...아직은...

 

1) 함수로 알려주시면 정말이지 "고기 잡는법"을 알려주시는 겁니다.

    (다만 시간이 오래 걸리시겠죠?)

 

2) 샘플을 만들어주시면...이리 뜯어보고 저리 뜯어봐서..완전 제껄로 만들겠습니다.

 

3) 그냥 힌트만 주시다고 해도..저야 감지덕지지요.. ^^;;;;;

 

 

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
울리는짱구 제로보드xe 스킨질문이요 [1] 2008.10.06 by 백성찬
SeypPig 설치 완료 후 관리자 로그인이 안되요...ㅜㅜ 고수님들 도와주세요. [3] file 2008.10.06 by 백성찬
루마 1.0.5.에서 1.0.6으로 zbxe 폴더 전체를 덮어씌웠는데 문제가 생겼어요ㅠㅠㅠ [1] 2008.10.06 by 느까끼
김찬희 게시판 리스트에 나오는 날짜를 임의로 수정할 수 있는 방법 [2] 2008.10.06 by hosea085
G.g.G index.php 이름을 변경할경우, [1] 2008.10.06 by 백성찬
제로왕초보 로그인 전/후의 ''기본'' 모듈을 다르게 설정할 수 있는 방법? [5] 2008.10.06 by 제로왕초보
파다 기존에 있던 회원들.. [1] 2008.10.06 by 백성찬
부암영어 스킨 [2] 2008.10.06 by 부암영어
우냠냠 게시판하나가 조회수가 계속 올라가네요 [1] 2008.10.06 by 하하하^^
신비의불 코드생성한 소스를 페이지에 삽입하면 엑박이 뜨는데.. [2] file 2008.10.06 by 신비의불
술먹는하마 가로 스크롤바 길어지는 문제입니다. ㅜㅜ 도와주세요~ file  
김용희 게시판 검색이 작동하지 않습니다. [1] 2008.10.06 by Xeicus
joyfful 익스플로러 8 에서 버그 발생.. [2] file 2008.10.06 by joyfful
가랑바람 개인홈페이지에 로그인 기능을 만들고 싶습니다. [3] 2008.10.06 by 백성찬
사용자 통합검색 기능 [기능이 제대로 동작하지 않는 문제] [1] file 2008.10.06 by 느까끼
울보왕자 홈페이지 제작에 관해서 문의 [1] file 2008.10.06 by 백성찬
풀래누 게시글 마우스오버시 내용 미리보기 [2] 2008.10.06 by 초얼
송인혁 블로그처럼 절대주소를 가질 수는 없을까요?  
연얀 제로보드 사용할때 하단에 파일첨부가 클릭이안되요 [11] 2008.10.06 by 연얀
최대웅591 Forbidden "You don''t have permission to access /zbxe/ on this server" [2] 2008.10.06 by 최대웅591