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

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

 

 

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

답변 1개

채택된 답변
+20 포인트

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

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 파일에서 아래 부분에 조건식을 추가해주면 됩니다.

Copy
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

    }

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고