최신글에 외부 이미지 썸네일을 나오게 하고 싶은데
프로그램이 막히네요.
아래 소스를 어찌 해야 할까요?
최신글 소스
Copy
<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( 'http://youtu.be/'.$v, '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);
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>
아래 소스를 갤러리 게시판에서 제가 외부 이미지 불러오는데 사용했던 소스인데 이 소스를 최신글에 적용 할려고 하는데 막히네요.
도움 좀 부탁 드립니다.
Copy
<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']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
// 외부 이미지 썸네일 만들기 {
} 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.'" >';
// } 외부 이미지 썸네일 만들기
} else {
$img_content = '';
}
echo $img_content;
}
{
$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>
|
답변 1개 / 댓글 1개
채택된 답변
+20 포인트
2020-04-09 (목) 11:02:42
능력자님들이 만들어주신 팁이 있으면 모를까
함수를 따로 만들어서 수정하는게 좋지 않을까 싶습니다.
의뢰라고 하기는 좀 그렇지만 글로 설명하는건 ....
답변에 대한 댓글 1개
2020-04-09 (목) 11:06:18
답변을 작성하려면 로그인이 필요합니다.
https://sir.kr/g5_skin/28685?sfl=wr_subject%7C%7Cwr_content&stx=%EC%99%B8%EB%B6%80