묻고답하기

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

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 남기남
FANTA ★ 회원을 일괄로 생성하고 싶습니다. [1] 2009.12.21
윤정식709 회원가입이 되지 않는데 도움좀 주세요  
오이링 아이디/비번 찾기시 이메일로 아무것도 안옵니다..  
YM플라톤 최근 이미지 위젯프로그램 어디서다운받죠 ??  
천루냥 회원정보 수정시 에러  
라유라 게시판크기 조절하는 방법이 궁금합니다. [1] 2009.12.21 by DuRi
ashy 개인홈피에 XE게시판만 가져다 사용할 수 있나요..? [1] 2009.12.21 by mc뷰
주알리기 xe_official_v2 레이아웃 질문입니다. file  
흔한남자 윗젯. 아이프레임 질문입니다.  
JCJAY FTP 정보 이후 설치가 진행되지 않아요. [1] file 2009.12.21 by 허승철716
undinekr module config 값을 수정하려면 어떻게 해야 하나요?  
psd 아이디에 다른 문자 들어가게 하려면?  
snake702 xe.1.3.1.1 메뉴출력기 어디에 있나요?  
三乭 게시판의 보기를 누르면 페이지를 생성할 수 없다고 나옵니다.  
Sang403 무슨문제인지 ..fatal error: functio.require-once file  
멀루할까 div 레이아웃 파폭 비정상으로떠요 [5] file 2009.12.21 by 멀루할까
채연파파 최근 게시물에 공지를 제일 위로 하고 싶은데요..  
마루7 게시물 별로 읽기 권한을 따로 줄수 있나요? [1] 2009.12.21 by nabul2
채연파파 레이아웃 변경시 layout.html을 수정해도 적용되지 않습니다. [2] 2009.12.21 by 멀루할까
무키~ XE Official_v2 로 홈페이지를 만들구요~~  
윤지아빠 텍스타일를 생성 백지 화면  
dusskapark Contents 위젯: ''페이지''에서는 섬네일을 읽을 수 없나요? file  
special-m 갑자기 백지가 되고... 완전초기화되고..엉망진창 도와주세요 ㅜㅜ [1] 2009.12.20 by 태림씨야!
마로. 본문의 "이 게시물을..."을 삭제하고 싶을때는?  
촏촏 게시판 글 잘림 현상..  
검은고양이- 게시판 목록 글자크기 [1] 2009.12.20 by 윤지아빠
파란불꽃 xe에서 세이라디오 위젯 사용중 페이지이동시 자꾸 끊기는 문제 해결은?  
현규웅 모바일 버전 XE 접속주소? [1] 2009.12.20 by 백성찬
마로. 에디터 글자색 변경방법은? [1] file 2009.12.20 by 백성찬
이유없는밤샘 mysql 연결 문제