웹마스터 팁

noimg.gif

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

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

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시간 정도 걸렸는데.. 참 어렵네요;;
태그 연관 글
  1. [2010/07/11] 웹마스터 팁 bcastr 이용한 플래쉬 (flash) 최근 이미지 소스 사용 위젯 소개.. by 하얀마법 *1
  2. [2008/09/02] 웹마스터 팁 각 리스트형 위젯에 페이지 기능을 달자. by 라르게덴 *10
  3. [2008/08/01] 묻고답하기 링크한 이미지 지원 위젯에 대하여 문의합니다. by 이미지
제목 글쓴이 날짜
레드햇, 새 리눅스SW 출시 ATpple.com 2003.10.28
호스팅 업체에서 제공하는 에러메세지 표시를 개성적으로 바꾸자! [12] file 이주성 2003.10.25
익스체인지 서버 취약점으로 인한 임의 코드 실행 문제 ATpple.com 2003.10.24
개인서버를만들어보자!(1편 유저생성)(동영상강좌) [8] 타키 2003.10.22
한글이름 그림을 위한 Apache 설정 [2] 김영일 2003.10.23
외부에서 리눅스 텔넷 연결 [4] 화니 2003.10.21
Buffer Overrun in Messenger Service 취약점 [1] ATpple.com 2003.10.20
안전한 FTP, vsftpd 설치와 운영 (한글로그 패치 포함) [1] 좋은진호 2003.10.15
유동아이피로 고정아이피 만들수있는 유틸 [27] 론건맨 2003.10.10
OpenSSL(SSL/TLS)의 ASN.1 라이브러리 다중 취약점 ATpple.com 2003.10.07
IIS6 + Mysql 안돌아 가신다거나 PHP 빨간불 들어오시는님들 읽어주셔요^^* [7] 남정웅 2003.09.26
apache-1.3.28 release [5] 아치™ 2003.09.19
Register_globals 옵션의 개별적용 및 그에관한 tip Dopesoul 2003.09.13
Apache 에서 DoS 공격 막기 (1.3.x, 2.x) 좋은진호 2003.09.08
[강력추천!!] 윈도우에서 아파치,MySql,PHP 돌리기! - apmsetup.com [10] 별빛부셔 2003.09.05
블래스터 웜 바이러스 서버에서 차단하기 [3] 장지현 2003.08.31
[동영상] iis 5.1 + PHP 4.3.2 + MySQL 4.0.13 + 제로보드 4.1 pl4 설치 [48] 비행소년™ 2003.08.25
Windows 2000의 NAT를 이용한 인터넷 공유 서버 구축 [2] 굿스피드 2003.08.20
/home에 있는 계정을 계정별로 따로 백업하는 스크립트 [2] 뽀뽀팅이 2003.08.15
Windows2000 Ad Server 계열쓰시는분들의 보안. [7] 씨파개 2003.08.12