웹마스터 팁
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
게시물의 첨부 파일에 이미지가 포함되어 있지 않으면 최근 이미지 위젯은 아무것도 표시가 되지 않습니다.
그래서 게시판에 글을 작성 했지만 최근 이미지 위젯에 표시가 안되서 직접 게시판을 들어가 보기 전에는 게시물이 있는지 모르게 되죠.
이미지를 첨부 하지 않아도 최근이미지위젯에 표시되는 방법을 공개합니다~~ 빠밤~~
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
-
헐..
2009.04.10 19:20
-
박토치
2009.04.11 02:25
너무 감사한 팁인되요. 제가 이 글을 보면서도 잘 따라하지 못하는건지 잘 안되네요.엑박으로뜨고..물론 이미지화일도 제대로 업로드했고요.
혹시 실례되지 않는다면 수정된 파일을 좀 올려주실 수 있을까요?
그리고 이걸보면서 생각한게 혹시 게시판 썸네일도 이렇게 변경할 수있나요? (갤러리형식,웹진형식)
할수있다면 좀 알려주시면 너무 감사합니다. -
개돌
2009.04.14 09:22
엑박으로 뜨는 이미지 파일을 오른클릭하셔서 경로를 다시 한번 확인해보세요. 엑박으로 뜬다는건 게시물은 정상적으로 불러왓다는 뜻이 아닐까 싶네요.
그리고 갤러리형식에서는 line 101 의
<!--@if($document->thumbnailExists($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type))-->
<a href="{getUrl('document_srl',$document->document_srl,'listStyle',$listStyle, 'cpage','')}"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" border="0" alt="" class="thumb"/></a>
<!--@else-->
<img src="./images/common/blank.gif" border="0" alt="" class="thumb" width="{$module_info->thumbnail_width}" height="{$module_info->thumbnail_height}" />
<!--@end-->
위의 표시 부분의 이미지 경로를 바꿔주시면 될것 같네요
웹진형의 경우 line 100 에
<!--@if($document->thumbnailExists($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type))-->
<td rowspan="2" class="thumb"><a href="{getUrl('document_srl',$document->document_srl,'listStyle',$listStyle, 'cpage','')}"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" border="0" alt="" /></a></td>
<td class="webzineTitle">
<!--@else-->
<td class="webzineTitle" colspan="2">
<!--@end-->
위 표시된 부분을
<td rowspan="2" class="thumb"><a href="{getUrl('document_srl',$document->document_srl,'listStyle',$listStyle, 'cpage','')}"><img src="이미지경로" border="0" alt="" /></a></td>
<td class="webzineTitle">
이렇게 바꾸고 이미지 경로를 바꿔주시면 될 것 같고요 ^^
각각의 파일 경로는 /xe/modules/board/skins/xe_board/style.gallery.html ,/xe/modules/board/skins/xe_board/style.webzine.html
입니다. -
이성진336
2009.04.13 04:30
비슷한 문제로 며칠을 고생했는데 ㅜㅡ
저는 첨부파일은 없지만 본문에 이미지가 삽입되어 있는 경우
최근이미지 목록에 읽어오질 않는겁니다.(첨부파일이 있는 문서만 읽어오므로)
그래서 위에서 설명하신 모든 문서를 읽어오는 쿼리만 수정하니 바로 해결되는군요
정말 감사합니다^_^)=b -
글쓴이
2009.07.03 11:27
저도 고생많이 했는데 정말 감사합니다.
-
polipoli
2011.05.30 11:08
정말 고맙습니다.. ㅠ
저 혼자서는 몇날 며칠이 걸려도 절대 해결 못했을 거에요.. ㅠㅜ
제목 | 글쓴이 | 날짜 |
---|---|---|
포인트 사용시에도 그룹이 안 떨어지도록 하는 방법 [4] | sejin7940 | 2013.10.18 |
추천인 표시 [11] | socialskyo | 2013.10.17 |
모바일 이미지 업로드시 세로사진 자동 회전하기 [8] | Xiso | 2013.10.17 |
XE 로만든 앱 + 푸쉬기능 구현하기 (안드로이드) [53] | Xiso | 2013.10.16 |
게시판 하단 검색대상의 순서,노출항목 들 제어하는 방법 [1] | sejin7940 | 2013.10.15 |
페이북 좋아요 버튼 애드온 [2] | 똑디 | 2013.10.11 |
게시판에 다른 테이블 값 직접 가져오기 [1] | 똑디 | 2013.10.11 |
javascript template parser for xe (난이도 중급) [1] | 엘카 | 2013.10.09 |
제이쿼리 최신 버전 사용하기 [8] | Lansi | 2013.10.08 |
제이쿼리 datepicker 옵션 변경 | Lansi | 2013.10.07 |
1.7 이상 기본레이아웃, ie9에서 1차메뉴 깨짐 현상... [3] | uoou | 2013.10.07 |
XE 1.7 에서 닉네임 클릭시 홈페이지나 블로그 등이 새창으로 안 뜨는 버그 수정법 [1] | sejin7940 | 2013.10.07 |
[유저용O, 개발자용x]포인트 레벨 아이콘이나 스킨에 사용할 소스가 부족하세요? [1] | socialskyo | 2013.10.05 |
썸네일 생성시 crop 이 상단 기준으로 생성되게 하는 방법 [5] | sejin7940 | 2013.10.04 |
New FAQ Skin 사용 시 DB 에러 수정하기 | 퍼니엑스이 | 2013.10.02 |
htaccess 수정 주소이동하기 [펌] [2] | 오락실주인 | 2013.10.02 |
phpmyadmin [ 일괄변경,부분수정 ] | 오락실주인 | 2013.10.02 |
[주옥시리즈]최신글,인기글 위젯에 댓글수 표기하기 [1] | socialskyo | 2013.10.01 |
레이아웃 동적 변경하기 | Lansi | 2013.09.27 |
XML 쿼리 사용시 null 값일 경우 업데이트가 안 될 때 [1] | Lansi | 2013.09.27 |
이런건 기본으로 들어가야 할 상황인데 말이죠