게시물의 첨부 파일에 이미지가 포함되어 있지 않으면 최근 이미지 위젯은 아무것도 표시가 되지 않습니다.

그래서 게시판에 글을 작성 했지만 최근 이미지 위젯에 표시가 안되서 직접 게시판을 들어가 보기 전에는 게시물이 있는지 모르게 되죠.
이미지를 첨부 하지 않아도  최근이미지위젯에 표시되는 방법을 공개합니다~~ 빠밤~~

1. /xe/widgets/newest_images/
 queries 폴더 생성  및  getAllDocument.xml 파일 생성
 /xe/widgets/newest_images/queries/getAllDocument.xml

<query id="getAllDocument" action="select">
    <tables>
        <table name="documents" />
    </tables>
    <columns>
        <column name="*"/>
    </columns>
    <conditions>
        <condition operation="in" column="module_srl" var="module_srls" filter="numbers" pipe="and" />
    </conditions>
    <navigation>
        <index var="list_order" default="documents.list_order" order="asc" />
        <list_count var="list_count" default="20" />
    </navigation>
</query>


2. /xe/widgets/newest_images/newest_images.class.php
line 78

            // 정해진 모듈에서 문서별 파일 목록을 구함
            $obj->list_count = $widget_info->rows_list_count*$widget_info->cols_list_count;
            $files_output = executeQueryArray("widgets.newest_images.getAllDocument", $obj);  // 쿼리 파일 변경
            $files_count = count($files_output->data);

3. /xe/widgets/newest_images/skins/xe_official/list.html

 <div class="thumbnail"><a href="{getUrl('','document_srl',$oDocument->document_srl)}"><!--@if($oDocument->getThumbnail($widget_info->thumbnail_width,$widget_info->thumbnail_height,$widget_info->thumbnail_type))-->
                <img src="{$oDocument->getThumbnail($widget_info->thumbnail_width,$widget_info->thumbnail_height,$widget_info->thumbnail_type)}" border="0" alt="" class="thumbnail" />
                <!--@else-->
                <img src="/images/noimg.gif" border="0" alt="" class="thumbnail" />
                <!--@end-->
</a></div>


첨부한 noimg.gif 파일을 저는 /images/ 폴더에 넣었기에 주소를 저렇게 했으며 위치에 맞춰서 수정해 주시면 됩니다.



변경 점을 정리 하자면.
1. 기존에는 첨부 파일이 있는 게시물만 읽어오는 쿼리였는데 이걸 해당 모듈의 전체 게시물을 읽는 쿼리를 생성
2. 1번에 생성한 쿼리를 읽어오도록 대상 수정
3. 이미지가 있으면 이미지를 없으면 noimg 를 표시하도록 if문 추가

입니다.
참 쉽죠~~~ ^^*

// 덧 :  참 쉽죠는 밥 아저씨 패러디구요.. 이거 작업 하느라 1시간 정도 걸렸는데.. 참 어렵네요;;

배포자 개돌
현재평점 10 (평가자 수 : 1)

추천 : 자몽,

profile
여기에서 행복한 시간 되십시오.