모바일에서 유튜브 주소 넣으면 썸네일 이미지 나오게 할려면..

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
모바일에서 유튜브 주소 넣으면 썸네일 이미지 나오게 할려면..

QA

모바일에서 유튜브 주소 넣으면 썸네일 이미지 나오게 할려면..

본문

링크1에 유뷰트 주소를 넣으면

모바일에서 썸네일 이미지가 보이게 하고 싶습니다.

 

http://www.iesc.co.kr/board/bbs/board.php?bo_table=1

(위에 주소를 모바일에서 확인하셔야 합니다.)

 

첨부파일에 이미지가 있으면 그 썸네일 이미지를 보여주고

링크1에 유튜드 주소가 있으면 그 썸네일 이미지를 보여주고 싶은데.

만일

둘다 같이 있을때는 첨부파일 이미지를 우선으로 보여주고 싶습니다.

 

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

 

보통은 아래 코드를 입력하는 것으로 알고 있는데 안되서요


                    <?php } else {
      $youtube_key = substr($list[$i]['link'][1],-11,11);
                       
      $img_content = '<img src="https://img.youtube.com/vi/'.$youtube_key.'/mqdefault.jpg" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
                        echo $img_content;
      
                    }
                     ?>

 

아래 소스를 어떻게 수정해야 하는지 좀 알려주시면 감사하겠습니다.


  $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
  if($thumb['src']) {
   $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'" class="thumb_img">';
  } else {
   $img_content = '';
  }

이 질문에 댓글 쓰기 :

답변 1

//첨부파일 확인

$sql = " select bf_file, bf_content from {$g5['board_file_table']}
where bo_table = '$bo_table' 
and wr_id = '$wr_id' 
and bf_type 
between '1' and '3' 
order by bf_no 
limit 0, 1 ";
$row = sql_fetch($sql);

$img_content="";

//첨부파일이 있다면

if($row['bf_file']) {
    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
    if($thumb['src']) {
        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'" class="thumb_img">';
    }
}

첨부파일이 없고 링크가 있다면
if( $img_content=="" && $list[$i]['link'][1]){
    $youtube_key = substr($list[$i]['link'][1],-11,11);
    $img_content = '<img src="https://img.youtube.com/vi/'.$youtube_key.'/mqdefault.jpg" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
}

 

//첨부파일도 없고 링크도 없다면

if($img_content==""){
    //에디터 확인
    $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
    if($thumb['src']) {
        $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'" class="thumb_img">';
    }
}

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

회원로그인

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