웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
게시물의 첨부 파일에 이미지가 포함되어 있지 않으면 최근 이미지 위젯은 아무것도 표시가 되지 않습니다.
그래서 게시판에 글을 작성 했지만 최근 이미지 위젯에 표시가 안되서 직접 게시판을 들어가 보기 전에는 게시물이 있는지 모르게 되죠.
이미지를 첨부 하지 않아도 최근이미지위젯에 표시되는 방법을 공개합니다~~ 빠밤~~
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시간 정도 걸렸는데.. 참 어렵네요;;
최근 이미지 위젯 noimage 표시..
2009.04.10 09:55
![noimg.gif](https://xe1.xpressengine.com/files/attach/images/121/261/920/017/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시간 정도 걸렸는데.. 참 어렵네요;;
태그 연관 글
- [2010/07/11] 웹마스터 팁 bcastr 이용한 플래쉬 (flash) 최근 이미지 소스 사용 위젯 소개.. *1
- [2008/09/02] 웹마스터 팁 각 리스트형 위젯에 페이지 기능을 달자. *10
- [2008/08/01] 묻고답하기 링크한 이미지 지원 위젯에 대하여 문의합니다.
댓글 6
제목 | 글쓴이 | 날짜 |
---|---|---|
스킨에서 조건/반복문 여러줄 사용하기 [1] | 엘카 | 2011.06.10 |
[배경음악] 첫곡은 랜덤, 그 이후로는 순차재생 [20] | 이주경 | 2003.05.06 |
cafe24 호스팅시 XE 쉬운설치가 안될때 해결방법 ^^(ftp 설정 item) [2] | 연금술사™ | 2011.04.19 |
게시판에 회원확장변수정보 받아서 표시하기 [3] | burster | 2011.03.26 |
다음view(다음뷰) 애드온 사용시 댓글창의 뷰아이콘 지우기 [1] | 하늘종 | 2011.05.31 |
레이아웃 100% 일때 이미지리사이즈 Addon 넓이값 고정하기 | 고수군 | 2011.06.08 |
XE core 1.4.5.7 코드 오류,(상자 위젯 배경 안될때) [2] | 홍성빈닌 | 2011.05.17 |
최근 이미지 위젯 noimage 표시..
[6]
![]() | 개돌 | 2009.04.10 |
확장변수 - 주소입력 받을 시 안내문구 출력 [2] | 반디소리 | 2011.02.24 |
공지사항 정렬 문제 해결법 [4] | 희망일기 | 2010.08.20 |
유닉스에서 디스크 용량 체크 후 호출 해주는 프로그램 | 길버트전 | 2011.05.24 |
관리자페이지 회원목록을 일반페이지에서 사용하기
[5]
![]() | 늘푸른이 | 2010.08.07 |
맞춤형 검색창 만들기 [9] | thejeon | 2009.05.19 |
[PHP 동영상강의] 30. 테이블에 값을 추가해보자 [17] | 서기 | 2006.01.04 |
[PHP 기초] 연산자1 | 난다날아 | 2011.05.19 |
XE 프로젝트 호스팅 SVN 내용을 Google 프로젝트 호스팅으로 이전하기
![]() | 난다날아 | 2011.05.17 |
따른사이트와 내채팅방 연동하기~!<미니온4편>
[7]
![]() | 토끼매니아 | 2011.05.15 |
실시간 날씨를 불러오는 박스 입니다.
[13]
![]() | 범피디 | 2007.12.03 |
'왕' '왕초보'를 위한 ZB4-->XE버전으로 이전시 가장 간단한 순서 [1] | 쭈영 | 2011.05.17 |
th 엘리먼트에 scope 속성 사용
[1] ![]() | 엘카 | 2011.05.14 |