묻고답하기

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 남기남
엄지공쥬 도대체 왜 ㅠㅠ 가운데 정렬이 안되는건가요 도와주세요 [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 윤지아빠
김찬회425 확장변수 라디오 버튼에 이미지 달을려면요? file  
dusskapark 썸네일을 클릭 안되게 하고 싶어요.  
bonui faceoff 사용시 메뉴바가 보이지 않아요  
마로. 본문 이미지 리사이즈 문제 [1] 2009.12.19 by DuRi
채연파파 layout.html를 수정하면 레이아웃이 변경되나요? [1] 2009.12.19 by DuRi
매콤한라면 cafeXE등에서 도메인 접속 설정?  
유서영895 cafe24 호스팅 쓸만한가요? XE 랑 궁합이 어떤지요? [1] 2009.12.19 by 채연파파
chromebooster 본문 글씨기를 결정하는방법이..?  
Tinno zb4의 아이콘 방명록 관련 질문입니다.(파폭지원여부..)  
kokmjn 이 홈페이지 에 사용된 메인 위젯이 무엇인가요? [1] 2009.12.19 by nabul2
후니0308 게시판이 이상해요~~ ㅜㅜ file  
멀루할까 div 레이아웃 파폭 비정상으로떠요 file  
으렁청청 {$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