묻고답하기

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

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_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 연결 문제  
으렁청청 {$lang_supported[$lang_type]}에서 쓰이는 {} 이 표시는 무엇을 의미 하는 지요. [1] 2009.12.20 by 金东峰
xe좋아염 ㅋ 아이피주소가 바뀌었는데도.. 기존아이피로 연결.. [1] 2009.12.20 by cndl
엄지공쥬 도대체 왜 ㅠㅠ 가운데 정렬이 안되는건가요 도와주세요 [2] file 2009.12.20 by 파파민
대야야 XE Official Ver2 질문합니다. [1] 2009.12.20 by ememo
saiph 글쓰기 할때  
덕본1 자주 싸이트가 백지화면이 됩니다.  
구름공자 확장변수 권한 file