테스트 사이트 - 개발 중인 베타 버전입니다

썸네일 관련 질문입니다. 채택완료

다조아해 7년 전 조회 1,761

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

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

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

 

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

 

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

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

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

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

 

</strong></p>

<p>                    <?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');</p>

<p>                        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');

                        }</p>

<p>                        echo $img_content;

                    }

                     ?></p>

<p><strong>

 

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

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

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

</strong></p>

<p>//첨부파일 확인</p>

<p>$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);</p>

<p>$img_content="";</p>

<p>//첨부파일이 있다면</p>

<p>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">';

    }

}</p>

<p>첨부파일이 없고 링크가 있다면

if( $img_content=="" && $list[$i]['link'][1]){

    $youtube_key = substr($list[$i]['link'][1],-11,11);

    $img_content = '<img src="<a href="<a href="https://img.youtube.com/vi/" target="_blank" rel="noopener noreferrer">https://img.youtube.com/vi/</a>" rel="nofollow noreferrer noopener" target="_blank"><span style="color:#000000"><a href="https://img.youtube.com/vi/" target="_blank" rel="noopener noreferrer">https://img.youtube.com/vi/</a></span></a>'.$youtube_key.'/mqdefault.jpg" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';

}</p>

<p> </p>

<p>//첨부파일도 없고 링크도 없다면</p>

<p>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">';

    }

}</p>

<p><strong>

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

답변 1개

채택된 답변
+20 포인트
해피정
7년 전

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

>> 네 잘 추출되죠

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

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

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

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

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

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

 

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

그렇다면 list.skin.php 에서 if ($list[$i][wr_link1]) { echo "

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

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

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

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

로그인