외부 이미지 썸네일을 목록에서 보여주고 싶은데 잘 안되네요
아래 소스 좀 봐 주실래요.
외부 썸네일 소스를 추가한 것입니다.
Copy
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';
}
// 외부 이미지 썸네일 만들기 {
} 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.'" >';
// } 외부 이미지 썸네일 만들기
echo $img_content;
}
?>
|
답변 1개
채택된 답변
+20 포인트
6년 전
답변을 작성하려면 로그인이 필요합니다.