댓글 쓰기 권한이 없습니다. 로그인 하시겠습니까?
New Postings
New Comment
일반
2010.03.04 11:25
[ZBXE] 웹진, 갤러리에서 썸네일 클릭 시 원본 이미지 보기
조회 수 9620 추천 수 0 댓글 0
소스 파일을 수정하는 것이므로 반드시 백업을 하시길 권합니다.
게시판의 썸네일 생성 함수를 응용해 원본 이미지를 구하는 함수를 만들어
이를 게시판 썸네일에 링크 시키는 방식입니다.
1. (수정) modules/document/document.item.php 에서 } ?> 위에 다음 함수를 추가합니다.
※ (09.10.24 수정) 함수에 오류가 있어 수정했습니다.
function getThumbSourceFile() {
// 썸네일 원본 파일 출력함수
if($this->get('uploaded_count')) {
$oFileModel = &getModel('file');
$s_file_list = $oFileModel->getFiles($this->document_srl);
$s_source_file = $s_file_list[0]->uploaded_filename;
}
// 첨부된 파일이 없으면 내용중 이미지 파일을 구함
if(!$s_source_file) {
$content = $this->get('content');
$s_target_src = null;
preg_match("/src=(\"|')([^\"' ]*?)(\"|')/is", $content, $s_matches);
$s_target_src = trim($s_matches[2]);
$s_source_file = $s_target_src;
}
return $s_source_file;
}
}
?>
2. 게시판 스킨의 썸네일 링크 부분을 수정합니다. xe_official 게시판 스킨의 웹진 스타일을 예로 들면
modules/board/skins/xe_official/_style.webzine.html 에서 아래 부분을 찾아
<a href="{getUrl("document_srl',$document->document_srl,'listStyle',$listStyle, 'cpage','')}" class="thumb"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" alt="" /></a>
다음과 같이 수정합니다.
<a href="{$document->getThumbSourceFile()}" class="thumb" target='_blank'><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" alt="" /></a>
3. 만약 June Oh님의 HighSlide JS을 사용하고 있다면 아래와 같이 수정합니다.
<span class="thumb"><a href="{$document->getThumbSourceFile()}" class="highslide" onclick="return hs.expand(this)"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" alt="" /></a></span>
4. 갤러리 스타일 역시 썸네일 부분을 찾아 위와 같은 방식으로 수정하면 됩니다.
xe_official 게시판 스킨을 예로 들면 위의 2번 디렉토리에서 _style.gallery.html 파일을 아래와 같은 식으로 수정합니다.
<a href="{$document->getThumbSourceFile()}" target="_blank"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" alt=""/><!--@if($module_info->use_category == "Y" && $document->get('category_srl'))--><strong class="category">{$category_list[$document->get('category_srl')]->title}</strong><!--@end--></a>
역시 June Oh님의 HighSlide JS을 적용하려면 아래와 같이 수정합니다.
<a href="{$document->getThumbSourceFile()}" class="highslide" onclick="return hs.expand(this)"><img src="{$document->getThumbnail($module_info->thumbnail_width, $module_info->thumbnail_height, $module_info->thumbnail_type)}" alt=""/><!--@if($module_info->use_category == "Y" && $document->get('category_srl'))--><strong class="category">{$category_list[$document->get('category_srl')]->title}</strong><!--@end--></a>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 | 추천 수 |
---|---|---|---|---|---|---|
245 | 문서작업 | [HTML iframe]아이프레임(iframe) | Dreamy | 2008.02.26 | 21164 | 42 |
244 | 취미 | 산딸기주 담그는 법 | Dreamy | 2009.06.02 | 20714 | 0 |
243 | 성가대 | 라틴어 발음법 1 | Dreamy | 2008.06.04 | 18203 | 14 |
242 | 취미 | 드리미의 여섯가지 기타 스케일 연습곡 | Dreamy | 2009.07.27 | 17506 | 0 |
241 | 취미 | 시조 모음 | Dreamy | 2005.01.19 | 17434 | 87 |
240 | 취미 | 모과주 담그는 법 | Dreamy | 2004.10.04 | 17426 | 62 |
239 | 성당 | 가톨릭 주요 기도문 | Dreamy | 2009.04.09 | 15869 | 0 |
238 | 취미 | Handel - Lascia ch'io Pianga | Dreamy | 2010.04.09 | 15135 | 0 |
237 | 프로그래밍 | 예제를 통해 Doxygen 주석 다는 방법 최대한 간단히 익히기 | Dreamy | 2007.04.24 | 14666 | 38 |
236 | 취미 | 좋아하는 노래들, 가사와 코드 모음 | Dreamy | 2010.08.06 | 14563 | 0 |
235 | 성가대 | 10월의 어느 멋진날에 | Dreamy | 2010.09.09 | 14485 | 0 |
234 | 일반 | [ZBXE] 게시판(블로그)상단에 글쓰기 버튼이나 링크넣기 1 | Dreamy | 2010.03.04 | 14272 | 0 |
233 | 인터넷 | 도움이 될만한 사이트 모음 (즐겨찾기 하고 자주 가보는사이트) | Dreamy | 2010.02.11 | 14148 | 0 |
232 | 성가대 | 결혼 축가용 '사랑의 서약' 악보 | Dreamy | 2011.01.05 | 14049 | 0 |
231 | 성가대 | 귀도 다레쪼의 계명창법 | Dreamy | 2010.04.23 | 13949 | 0 |
Designed by sketchbooks.co.kr / sketchbook5 board skin
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5