썸네일 관련 질문입니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
썸네일 관련 질문입니다.

QA

썸네일 관련 질문입니다.

본문

다운 받은 스킨을 좀 수정하고 있어서

요즘 이곳에 질문을 많이 올리네요

프로그램을 잘 몰라서 올리니 이해해 주시고 답변 좀 부탁 드리겠습니다.

 

http://www.iesc.co.kr/board/bbs/board.php?bo_table=1

 

첨부파일에 이미지 올리면 썸네일이 잘 추출 되는데

1. 링크1에 유튜브 주소를 삽입하면 썸네일이 나오고

2. 에디터로 이미지를 올리면 썸네일이 나오게 하고 싶습니다.

3. 첨부파일과 유튜브가 동시에 있는 경우에는 첨부파일이 나오기를 원합니다.

 


                    <?php
                    if ($list[$i]['is_notice']) { // 공지사항  ?>
                        <strong style="width:<?php echo $board['bo_gallery_width'] ?>px;height:<?php echo $board['bo_gallery_height'] ?>px">공지</strong>
                    <?php } else {
                        $thumb = get_list_thumbnail2($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], '0');
                        if($thumb['src']) {
                $board['bo_gallery_height'] = $thumb['thumb_height'];
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                        } else {
                            $thumb = get_list_thumbnail2($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], '0');
                        }
                        echo $img_content;
                    }
                     ?>

 

모바일에서 비슷한 질문을 올려서 답변을 받아 해결했는데 이것을 조금만 수정하면 되는데 어렵네요.

pc용 스킨에 적용 할려고 합니다.

아래는 답변 받은 소스입니다.


//첨부파일 확인
$sql = " select bf_file, bf_content from {$g5['board_file_table']}
where bo_table = '$bo_table' 
and wr_id = '$wr_id' 
and bf_type 
between '1' and '3' 
order by bf_no 
limit 0, 1 ";
$row = sql_fetch($sql);
$img_content="";
//첨부파일이 있다면
if($row['bf_file']) {
    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
    if($thumb['src']) {
        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'" class="thumb_img">';
    }
}
첨부파일이 없고 링크가 있다면
if( $img_content=="" && $list[$i]['link'][1]){
    $youtube_key = substr($list[$i]['link'][1],-11,11);
    $img_content = '<img src="'.$youtube_key.'/mqdefault.jpg" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
}
 
//첨부파일도 없고 링크도 없다면
if($img_content==""){
    //에디터 확인
    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
    if($thumb['src']) {
        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'" class="thumb_img">';
    }
}

이 질문에 댓글 쓰기 :

답변 1

첨부파일에 이미지 올리면 썸네일이 잘 추출 되는데 

>> 네 잘 추출되죠

1. 링크1에 유튜브 주소를 삽입하면 썸네일이 나오고

>> 링크1에 유튜브 주소와 썸네일은 관계가 없습니다.

2. 에디터로 이미지를 올리면 썸네일이 나오게 하고 싶습니다.

>> 에디터로 이미지 올려도 목록에 썸네일 추출됩니다.

3. 첨부파일과 유튜브가 동시에 있는 경우에는 첨부파일이 나오기를 원합니다.

>> 유튜브 존재여부와 관계없이 첨부파일이 gif 나 jpg png 이면 썸네일 생성됩니다.

 

목록에 이미지가 유튜브 링크가 존재할때만 보이고 싶다는 건가요?

그렇다면 list.skin.php 에서 if ($list[$i][wr_link1]) { echo "<img src=..."; }  로 감싸주면 되겠죠.

이상 저의 방법론적 답변이었습니다.   https://sir.kr/request 

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

회원로그인

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