에디터로 올린 이미지를 먼저 썸네일로 노출하는 방법

에디터로 올린 이미지를 먼저 썸네일로 노출하는 방법

QA

에디터로 올린 이미지를 먼저 썸네일로 노출하는 방법

본문

그누보드 5.4버전 사용 중입니다.

 

첨부파일과 에디터에서 동시에 이미지를 올렸을때 에디터 이미지를 먼저 썸네일로 노출하고, 에디터 이미지 없을 때 첨부파일 이미지를 노출하고 싶은데요.

 

단순하게 


    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 {
        $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
    }

 

이부분을 뒤집으니 에디터 이미지는 썸네일로잘 나오는데 첨부파일 이미지가 모두 노 이미지로 뜨네요.

다른글 찾아봤는데 조금씩 틀려서 다시 질문 드려 봅니다.

감사합니다.

 

그리고 여기서 특정한 게시판만 이부분을 적용 할 수 있을까요?

if ($bo_table != 'free') {
   
}

 

구문을 정확하게 몰라서 잘 적용이 안되네요...

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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