[고수분들 질문드려요ㅠㅠ] 갤러리 게시판 사용시 첫 이미지 썸네일 적용 기능

[고수분들 질문드려요ㅠㅠ] 갤러리 게시판 사용시 첫 이미지 썸네일 적용 기능

QA

[고수분들 질문드려요ㅠㅠ] 갤러리 게시판 사용시 첫 이미지 썸네일 적용 기능

본문

아래 그림처럼 갤러리 게시판 사용시 첫 이미지 썸네일 적용기능을 적용해 체크하면 게시글에서는 첫이미지가 노출안되고 썸네일로만 사용되도록 하는 기능을 그누보드에 추가할 수 있는 방법 아실까요? 

 

 

%EC%84%AC%EB%84%A4%EC%9D%BC2_20.06.png

이 질문에 댓글 쓰기 :

답변 1

갤러리 게시판 목록에서 썸네일 경우

skin\board\gallery\list.skin.php 파일을 예로 들면,

$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

이 부분이 썸네일 가녀오는 부분인데..

 

lib\thumbnail.lib.php 파일에서 아래 부분에 조건식을 추가해주면 됩니다.


    if(isset($row['bf_file']) && $row['bf_file']) {
        $filename = $row['bf_file'];
        $filepath = G5_DATA_PATH.'/file/'.$bo_table;
        $alt = get_text($row['bf_content']);
    } else if(조건식) {
        $write = get_thumbnail_find_cache($bo_table, $wr_id, 'content');
        $edt = true;
       
        if( $matches = get_editor_image($write['wr_content'], false) ){
            for($i=0; $i<count($matches[1]); $i++)
            {
                // 이미지 path 구함
                $p = parse_url($matches[1][$i]);
                if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
                    $data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);
                else
                    $data_path = $p['path'];
 
                $srcfile = G5_PATH.$data_path;
 
                if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) {
                    $size = @getimagesize($srcfile);
                    if(empty($size))
                        continue;
 
                    $filename = basename($srcfile);
                    $filepath = dirname($srcfile);
 
                    preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $matches[0][$i], $malt);
                    $alt = isset($malt[1]) ? get_text($malt[1]) : '';
 
                    break;
                }
 
                $filename = run_replace('get_editor_filename', $filename, $p);
            }   //end for
        }   //end if
    }

 

답변을 작성하시기 전에 로그인 해주세요.
전체 467
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT