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

최신글에 외부 이미지 썸네일을 나오게 하고 싶은데.. 채택완료

다조아해 5년 전 조회 1,728

최신글에 외부 이미지 썸네일을 나오게 하고 싶은데

프로그램이 막히네요.

 

아래 소스를 어찌 해야 할까요?

 

최신글 소스

 

</strong></p>

<p>            <a href="<?php echo $list[$i]['href'] ?>" class="gall_img">

                <?php

                    $v = "";

                    $mov_link = "";

                    $img_content = "";

                    $mov_link = $list[$i]['wr_10'];

                    $youtube_url = parse_url($mov_link);

                    parse_str($youtube_url['query']);

                    if($v){

                    $img_content = '<img src="'.get_yt_thumb( '<a href="http://youtu.be/'.$v," target="_blank" rel="noopener noreferrer">http://youtu.be/'.$v,</a> 'maxres' ).'" alt="'.$list[$i]['subject'].'" width="'.$thumb_width.'" height="'.$thumb_height.'" />';

                    }

                    

                    if(!$img_content) {

                    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';

                    }                            

                    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);</p>

<p>                    if($thumb['src']) {

                        $img_content = '<span style="width:'.$thumb_width.'px;height:'.$thumb_height.'px"><img src="'.$img.'" alt="'.$thumb['alt'].'" ></span>';

                    }

                        

                    echo $img_content;

                ?>

            </a></p>

<p><strong>

 

아래 소스를 갤러리 게시판에서 제가 외부 이미지 불러오는데 사용했던 소스인데 이 소스를 최신글에 적용 할려고 하는데 막히네요.

 

도움 좀 부탁 드립니다.

 

</strong></p>

<p>                <a href="<?php echo $list[$i]['href'] ?>" class="gall_img">

                    <?php

                            $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);</p>

<p>                           if($thumb['src']) {

                              $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';</p>

<p>                                //    외부 이미지 썸네일 만들기 {

                                } else if($url_img = get_editor_image($list[$i]['wr_content'])){

                                    $img_src = $url_img[1][0];

                                    preg_match("/src=[\'\"]?([^>\'\"]+[^>\'\"]+)/i", $img_src, $m);

                                    $src = htmlspecialchars_decode($m[1]);

                                    preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_src, $m);

                                    $alt = get_text($m[1]);

                                    $filename =  hash("sha256", $src);

                                    $source_path = $target_path = G5_DATA_PATH.'/file/'.$board['bo_table'];

                                    $file_download = $target_path."/".$filename;

                                    if (!file_exists($file_download)) {

                                        copy($src, $file_download);

                                    }

                                    $thumb_src = thumbnail($filename, $source_path, $target_path, $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);

                                    $img_content = '<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.$thumb_src.'" alt="'.$alt.'" >';

                                //    } 외부 이미지 썸네일 만들기</p>

<p>                           } else {

                              $img_content = '';

                            }</p>

<p>                            echo $img_content;

                        }</p>

<p>                        {

                        $v_img_count = count($list[$i]['file']);

                            if($v_img_count && !$img_content) { 

                            if ($list[$i]['file'][0]['view']) {

                            echo strip_tags(get_view_thumbnail($list[$i]['file'][0]['view']), '<img>');

                            }

                        }

                    ?>

                </a></p>

<p><strong>

 

 

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

답변 1개

채택된 답변
+20 포인트
5년 전

능력자님들이 만들어주신 팁이 있으면 모를까

함수를 따로 만들어서 수정하는게 좋지 않을까 싶습니다.

의뢰라고 하기는 좀 그렇지만 글로 설명하는건 .... 

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

답변에 대한 댓글 1개

다조아해
5년 전
외부 썸네일 스킨이네요
https://sir.kr/g5_skin/28685?sfl=wr_subject%7C%7Cwr_content&stx=%EC%99%B8%EB%B6%80

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

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

로그인