묻고답하기

얼마전에 썼던 글인데...재요청 드립니다. ㅜㅜ
 
 
 

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 남기남
채연파파 레이아웃 변경시 layout.html을 수정해도 적용되지 않습니다. [2] 2009.12.21 by 멀루할까
마루7 게시물 별로 읽기 권한을 따로 줄수 있나요? [1] 2009.12.21 by nabul2
채연파파 최근 게시물에 공지를 제일 위로 하고 싶은데요..  
멀루할까 div 레이아웃 파폭 비정상으로떠요 [5] file 2009.12.21 by 멀루할까
Sang403 무슨문제인지 ..fatal error: functio.require-once file  
三乭 게시판의 보기를 누르면 페이지를 생성할 수 없다고 나옵니다.  
snake702 xe.1.3.1.1 메뉴출력기 어디에 있나요?  
psd 아이디에 다른 문자 들어가게 하려면?  
undinekr module config 값을 수정하려면 어떻게 해야 하나요?  
JCJAY FTP 정보 이후 설치가 진행되지 않아요. [1] file 2009.12.21 by 허승철716
흔한남자 윗젯. 아이프레임 질문입니다.  
주알리기 xe_official_v2 레이아웃 질문입니다. file  
ashy 개인홈피에 XE게시판만 가져다 사용할 수 있나요..? [1] 2009.12.21 by mc뷰
라유라 게시판크기 조절하는 방법이 궁금합니다. [1] 2009.12.21 by DuRi
천루냥 회원정보 수정시 에러  
YM플라톤 최근 이미지 위젯프로그램 어디서다운받죠 ??  
오이링 아이디/비번 찾기시 이메일로 아무것도 안옵니다..  
윤정식709 회원가입이 되지 않는데 도움좀 주세요  
FANTA ★ 회원을 일괄로 생성하고 싶습니다. [1] 2009.12.21
소피아7 관리자 로그인이 안됩니다 ㅠ file  
문양호 [목록 수정 삭제] 버튼이 댓글창에 가려져 안 보임 file  
kittun81 롤오버 했을때 DB 값을 반투명하게 출력하는 방법 좀 알려주세요. file  
메디안 헤더부분에 하이퍼 링크를 걸고 싶습니다. file  
채연파파 뭐...플래시 게시판은 아니지만 마땅히 쓸곳이 없어 여기에 씁니다. 글자 흐린 문제 [3] 2009.12.21
YM플라톤 최근이미지 질문이요 [1] 2009.12.21 by 휘즈
불꽃빠 xe_official_v2 메인 화면에 한글 입력은 어떻게 하나요?? [1] 2009.12.21 by 휘즈
박노열 첨부파일 업로드 용량 변경하기 [2] file 2009.12.21 by 때린데 또때려
손경훈267 레이아웃설정에서 미리보기 안되는 이유?  
YM플라톤 최근 이미지 위젯 ㅠ.ㅠ [1] 2009.12.21 by 멀루할까
오진돌 xpressengine 사이트의 로그인을 레이아웃이 아닌 곳에서 사용하기 [1] 2009.12.21 by 멀루할까