묻고답하기

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

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 남기남
monozoom 에러 메세지창 문구 수정 어디서 해야하나요?  
도토리맘 언어부분 이미지로 집어넣기 [2] 2009.12.19 by 시골어부
타잔출사 firefox에서 파일 첨부 문제인데요 [2] 2009.12.19 by 현우사랑
heyni0809 팝업창 닫을수 있는 방법좀 알려주세요!!  
유병석788 시작모듈이 등록이 되지 않습니다..ㅜㅜ [1] file 2010.06.30 by nabul2
door1986 회원가입과 로그인 모듈 문제...해결방법좀 [1] file 2009.12.19 by 하늘03
kokmjn 쉬운설치 FTP 절대경로 [1] 2009.12.19 by 하늘03
InDesign 게시판을 삭제하면 그 안에 첨부 파일도 삭제되나요? [1] 2009.12.18 by SMaker
june55 Html에서 플래시 연결이 안될때  
짜오끽반 xe 재설치 [1] 2009.12.18 by 우리아기
채연파파 최근 게시물 위젯 사용에 대한 질문 제목 위젯제목 [1] 2009.12.18 by 백성찬
alljoy 하단에 왼쪽에 로고넣는방법 file  
치올 스프링노트 연동 도데체 어떻게 하는건가요 [1] 2009.12.18 by 백성찬
monozoom 회원가입시 일부 사용자에게서만 저장 실패 에러가 나는데요 [1] file 2009.12.18 by 백성찬
demun Code Highlighter 사용하는법을 알려주세요. [1] file 2009.12.18 by 백성찬
technoage 퀵메뉴를 넣으니 오류가 나네요 레이이 오류요  
TiiGer 제목 자동 입력 질문 [1] 2009.12.18 by 박인만
후후훗! 게시판에 글을쓸때 제목이 고정되서 나오게 할순없을까요 ? [1] 2009.12.18 by 박인만
채연파파 최신글 위젯에서 모듈이름나오는 칸이 안 나옵니다. ㅜㅜ [1] file 2009.12.18 by 채연파파
이놀자 XE에서 메타블로그 제작이 가능한지요?  
sellyellow 레이아웃 변경을 어떻게 해야하나요 ㅠㅠ file  
비밀입니다 Cooliris embed wall 위젯 설치 질문입니다. [4] file 2009.12.18 by 비밀입니다
진이☆ 레이아웃 설정시 SETTING에서 도메인을 잘못 수정해서 관리자로그인이 안되요 [1] 2009.12.18 by 백성찬
김학식 모듈 미리보기가 않될때 [1] file 2009.12.18 by 백성찬
김왕균 100M 이상 첨부파일이 올라가지 않아요... [2] file 2009.12.18 by 김왕균
kokmjn XpressEngine Core ver. 1.3.1.1 이게 먼저인가요? [2] 2009.12.18 by 하늘03
우리아기 xe_documents 이 db테이블을 지우면 [1] 2009.12.18 by 하늘03
......욤 비회원이 글쓰기 했을경우 이메일이 표시안되는데요  
S시온스S 파일 첨부가 안되요 ㅠ [1] 2009.12.18 by 찬이
채연파파 1.3.1.1 설치후 모듈을 추가로 OverWrite후 관리화면이 깨집니다. [1] 2009.12.18 by 채연파파