TAG Clouds

New Postings

  • 어항 속의 물고기를 스프로 만드는 것은 그다지 어렵지 않다. 문제는 그것을 되돌려 놓는 것이다.
    - 폴란드 속담


조회 수 9753 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
65 게임 일본, The great war of prefecture Dreamy 2009.07.21 10149 0
64 수업 플라톤 '향연'을 읽고 (독후감) 5 file Dreamy 2003.06.22 10197 142
63 교리교안 천주교에 대한 몇가지 질문 file Dreamy 2004.06.06 10237 67
62 교리교안 주님께서 원하시는 것 file Dreamy 2004.06.06 10245 50
61 게임 롤리폴리캐논 2 Dreamy 2009.07.05 10253 0
60 인터넷 HTML 태그 사전 file Dreamy 2006.06.29 10377 48
59 프로그래밍 CxImage Library 5.99 file Dreamy 2005.12.05 10381 23
58 교리교안 나의 소중한 것은 (난파선 게임) file Dreamy 2004.06.06 10439 39
57 인터넷 ietoy 문맥메뉴가 정상작동 하지 않을 경우 대처법 Dreamy 2005.12.19 10460 6
56 프로그래밍 REDIRECTION AND PIPELINE | 유닉스 기초 Dreamy 2005.08.05 10574 7
55 성가대 16배음에 관하여. file Dreamy 2005.08.18 10591 20
54 유틸리티 이미지 프린터 드라이버 ( Virtual Image Printer driver ) 1 file Dreamy 2012.03.28 10667 0
53 성가대 음정이란 file Dreamy 2005.08.15 10685 43
52 수업 사랑의 기술을 읽고 (독후감) file Dreamy 2003.06.22 10715 117
51 성가대 이종철 신부님 말씀(성가대는 꼭 읽어보세요) Dreamy 2009.11.18 10745 0
Board Pagination ‹ Prev 1 ... 7 8 9 10 11 12 13 14 15 16 17 Next ›
/ 17

나눔글꼴 설치 안내


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

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

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5