TAG Clouds

New Postings

  • 사랑은 시간이 지나가게 만는다. 시간은 사랑이 지나가게 만든다.
    - 프랑스 속담


조회 수 9601 추천 수 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>

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
155 취미 아이유/패닉 - 기다리다 Dreamy 2012.10.18 3629 0
154 취미 사진강좌 노트정리 secret Dreamy 2012.12.23 0 0
153 일반 내 설정파일들 file Dreamy 2013.02.06 2106 0
152 일반 논문 검색 사이트 모음 Dreamy 2013.02.08 2652 0
151 일반 간단 독일어 발음법 Dreamy 2013.02.16 2628 0
150 유틸리티 탐색기 창 한번에 닫기 1 Dreamy 2013.02.18 2967 0
149 일반 저녁에 들으면 좋은 노래 Dreamy 2013.06.11 2418 0
148 일반 미국인이 가장 많이 쓰는 100문장 Dreamy 2013.06.28 2514 0
147 일반 타코와사비 만들기 file Dreamy 2013.08.29 2557 0
146 일반 스와힐리어 - 숫자 Dreamy 2013.08.31 2473 0
145 일반 각종 양념장 Dreamy 2013.09.30 2020 0
144 일반 추석 인사말 모음 Dreamy 2013.09.20 10042 0
143 일반 다이어트 자극글 secret Dreamy 2013.11.06 0 0
142 성당 니케아 신경 PPT file Dreamy 2013.11.30 2591 0
141 일반 오멜라스를 떠나는 사람들 - 어슐라 르 귄(Ursula Le Guin) Dreamy 2014.01.29 1792 0
Board Pagination ‹ Prev 1 2 3 4 5 6 7 8 9 10 11 12 ... 17 Next ›
/ 17

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5