TAG Clouds

New Postings

  • 당신이 진심으로 성공하고자 한다면, 자기 훈련을 두 번째 사랑으로, 목표설정을 첫 번째 사랑으로 삼아라.
    - 월터 크라이슬러


조회 수 9648 추천 수 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
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
110 취미 장필순 - 나의 외로움이 널 부를때 file Dreamy 2012.01.01 8147 0
109 게임 [배틀 기어] 횡스크롤 2차 세계 대전 Dreamy 2009.01.25 8273 0
108 일반 바오밥나무 발아법(마다가스카 종) Dreamy 2006.08.16 8303 7
107 일반 누구에게 나 슬픈날은 있다. 'The Blueday Book' file Dreamy 2004.10.09 8307 76
106 일반 [역전세란 대응방법]...전세사는 분들만 보세요. (아고라펌) Dreamy 2008.12.04 8396 0
105 수업 J.S. Mill '여성의 예속'을 읽고 (독후감) 2 file Dreamy 2003.06.22 8450 128
104 교리교안 XY기업경영 (프로그램) file Dreamy 2004.06.06 8560 33
103 교리교안 십자가를 찾아서 (프로그램) file Dreamy 2004.06.06 8711 14
102 수업 SIC_XE 어셈블러 2 file ★웅제★ 2003.06.22 8764 177
101 교리교안 그리스도의 상징들 file Dreamy 2004.06.06 8802 16
100 일반 Shift 키의 10가지 기능 1 Dreamy 2010.08.27 8880 0
99 일반 게임이론 길라잡이 file Dreamy 2006.05.01 8899 44
98 프로그래밍 C language FAQ. file Dreamy 2006.07.14 8906 8
97 교리교안 내가 지금 하고싶은 것 file Dreamy 2004.06.06 9004 19
96 일반 영화 씬 시티(sin city) 대본 1 file Dreamy 2006.07.13 9163 61
Board Pagination ‹ Prev 1 ... 4 5 6 7 8 9 10 11 12 13 14 15 ... 17 Next ›
/ 17

나눔글꼴 설치 안내


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

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

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5