묻고답하기

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 남기남
으렁청청 {$content}에서 쓰이는 {} 이 표시는 무엇을 의미 하는 지요. [1] 2009.12.19 by SMaker
rosebird 닉네임에 마우스 오버시 링크되는 방법좀 알려주세요~~ [1] 2009.12.19 by 윤지아빠
검은토끼 텍스타일 최신글 위젯은 없나요?  
구름공자 팝업창 어떻게 사용하나요?? [1] file 2009.12.19 by 윤지아빠
dusskapark 그림클릭시 팝업창을 띄우고 싶어요... [1] 2009.12.19 by 윤지아빠
라오니 xe제거는 안되나요? 다시설치하려는데 files폴더가 안지워지네요 [1] file 2009.12.19 by 짜오끽반
채연파파 최근 게시물에 공지를 제일 위로 하고 싶은데요..  
kokmjn 쉬운설치 Fatal error 무슨문제인가요? file  
saiph CafeXE만 삭제 가능한가요? [2] 2009.12.19 by JUUN
deepcore 하단과 로그인 레이아웃에 이미지를 추가할려고 합니다. 좀 도와주세요 ㅜ.ㅜ [1] file 2009.12.19 by 태림씨야!
멀루할까 div 적용중 파폭에서 안뜨는것 질문 [1] 2009.12.19 by 태림씨야!
양효주869 rewrite mod 가 안되요!! [1] 2009.12.19 by 태림씨야!
아고라 야후 검색 봇과 XE의 관계는?  
JINJINLI 조회수 0표시하려면.....  
mystic 1.2.6 업데이트후 파일 첨부시 100%에서 사라지는 현상 [2] 2009.12.19 by 쫑아빠™
밧데리 첨부파일 100% 증발 문제............ [3] 2009.12.19 by 쫑아빠™
Kurtcibain 파일첨부에러 [1] file 2009.12.19 by 쫑아빠™
오토다이어리 홈페이지에 광고 파일 붙여주실 분, 약간의 수고비 드립니다.  
주바라기5b2f 홈페이지 여러 가지 게시판  
내귀에켄디 다국어 페이지 설정 관련 [2] 2009.12.19 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 우리아기