묻고답하기

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 남기남
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  
kokmjn 쉬운설치 FTP 절대경로 설정이 안됩니다 [1] 2009.12.20 by demun
omni 제어판-관리자 초기 페이지가 빈화면으로 나옵니다.  
주알리기 관리자 모드에 들어가서 세팅을 클릭하면 이런 메세지가 뜹니다. file  
마가린ㅋ 닷홈에 개인홈페이지를만들엇는뎅 게시글을쓰면 글내용이안보여요  
검은고양이- 게시판 글자크기 [1] 2009.12.19 by 윤지아빠