최근 게시물에 이미지도 나오고 유투브 그림도 나오게할려면
본문
현재 이미지를 올리면 최근 올린 페이지에 뜨는데 유투브를 올리면 이미지가 안뜨네요
$imgwidth = 360; //표시할 이미지의 가로사이즈
$imgheight = 200; //표시할 이미지의 세로사이즈
<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->
<div class="scrollpic">
<div id="mybtns">
<a id="left" onclick="leftSlide();"></a>
<a id="right" onclick="rightSlide();"></a>
</div>
<div id="myscroll">
<div id="myscrollbox">
<ul>
<?php for ($i=0; $i<count($list); $i++) {
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);
if($thumb['src']) {
$img = '<img class="" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'" >';
} else {
$img = 'NO IMAGE';
}
?>
<li><a href="<?=$list[$i]['href']?>"><?=$img?><span class="intro"><h5><?=$list[$i]['subject']?></h5><p><?=$list[$i]['content']?></p></span></a></li>
<?php } ?>
<?php if (count($list) == 0) { //게시물이 없을 때 ?>
<li>게시물이 없습니다.</li>
<?php } ?>
</ul>
</div>
</div>
</div>
유투브 자료
<a href="<?php echo $list[$i]['href'] ?>">
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<strong style="width:<?php echo $thumb_width ?>px;height:45px">공지</strong>
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height); // 썸네일 크기를 위에서 선언한 크기사용
// 유튜브, 비메오 썸네일 추출
if(!$thumb){ // 썸네일이 없는 경우
if($list[$i]['wr_1']) { // 유튜브 이미지 출력
$thumb['src'] = "http://img.youtube.com/vi/{$list[$i][wr_1]}/default.jpg";
} elseif ($list[$i]['wr_2']){ // 비메오 이미지 출력
$output=get_vimeo("http://vimeo.com/api/v2/video/".$list[$i]['wr_2'].".php");
$output=unserialize($output);
// echo "<img src='".$output[0][thumbnail_medium]."'>"; //thumbnail_small, thumbnail_medium, thumbnail_large
$thumb['src'] = $output[0][thumbnail_medium];
}
}
// 유튜브, 비메오 썸네일 추출 end
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
}
echo $img_content;
}
?>
</a>
답변 1
"http://img.youtube.com/vi/{$list[$i][wr_1]}/default.jpg"
$list[$i][wr_1]에 정확히 값이 들어있는지 확인해보셔야합니다.
http://img.youtube.com/vi/ZP7CpxNU8ik/default.jpg
이런식으로 해당 동일 주소를 넣어주면 인터넷 창에서도 이미지가 확인됩니다.