최근 게시물에 이미지도 나오고 유투브 그림도 나오게할려면

최근 게시물에 이미지도 나오고 유투브 그림도 나오게할려면

QA

최근 게시물에 이미지도 나오고 유투브 그림도 나오게할려면

본문

현재 이미지를 올리면 최근 올린 페이지에 뜨는데 유투브를 올리면 이미지가 안뜨네요

$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 

이런식으로 해당 동일 주소를 넣어주면 인터넷 창에서도 이미지가 확인됩니다.

이건 최근글에 뜨거든요

<li class="col-sm-4 col-xs-6<?=$wr_id == $list[$i]['wr_id'] ? " active" : ''?>">

<a href='<?php echo $list[$i]['href'];?>' class="fz_gallery_li_wrap">
<span class="fz_gallery_thumb"><?php echo $img_content;?></span>
<span class="fz_gallery_title">
<?php
echo $list[$i]['icon_reply'];
echo $list[$i]['article_type'];
if ($is_category && $list[$i]['ca_name']) {echo "<span class=\"bo_cate_link\">[{$list[$i]['ca_name']}]</span>";}
echo $list[$i]['subject'];
echo $list[$i]['icon_pack'];
?>
</span>
<?php if($board['bo_use_list_content']){?>
<span class="fz_gallery_content"><?=cut_str(str_replace("&nbsp;", "", trim(strip_tags($list[$i]['wr_content']))), 80)?></span>
<?php }?>
<span class="fz_gallery_etc">
<span class="fz_gallery_etc_info"><i class="fa fa-eye"></i> <?php echo $list[$i]['wr_hit'] ?></span>
<span class="fz_gallery_etc_info"><i class="fa fa-comments"></i> <?php echo $list[$i]['comment_cnt'] ? $list[$i]['comment_cnt'] : '0';?></span>
<?php if ($is_good) { ?><span class="fz_gallery_etc_info"><i class="fa fa-thumbs-o-up"></i> <?php echo $list[$i]['wr_good'] ?></span><?php }?>
<?php if ($is_nogood) { ?><span class="fz_gallery_etc_info"><i class="fa fa-thumbs-o-down"></i> <?php echo $list[$i]['wr_nogood'] ?></span><?php }?>
<span class="fz_gallery_date"><i class="fa fa-calendar-check-o"></i> <?php echo $list[$i]['datetime2'] ?></span>
</span>
</a>
<span class="fz_gallery_user">
<i class="fa fa-user"></i><?php echo $list[$i]['name'] ?>
<?php if ($is_checkbox) { ?>
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>" class="fz_admin_chk">
<?php } ?>
</span>
</li>

답변을 작성하시기 전에 로그인 해주세요.
전체 136
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT