메인화면에서 유튜브영상 출력되는 비디오스킨 없을까요?

메인화면에서 유튜브영상 출력되는 비디오스킨 없을까요?

QA

메인화면에서 유튜브영상 출력되는 비디오스킨 없을까요?

본문

몇시간째 '비디오스킨' 검색 찾아서 적용해보는데 잘 안되네요ㅠ

갤러리 스킨(theme/pic_block)처럼 메인에 출력되면 되는데...

 

동영상은 출력이 스킨이 없어서 안되서요...

아니면 갤러리 스킨에서 동영상출력이 가능하도록 수정할 소스 좀 알려주심 감사하겠습니다.

 

기본 소스 입니다.

-------------------

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 210;
$thumb_height = 150;
$list_count = (is_array($list) && $list) ? count($list) : 0;
?>

<div class="pic_lt">
    <h2 class="lat_title"><a href="<?php echo get_pretty_url($bo_table); ?>"><?php echo $bo_subject ?></a></h2>
    <ul>
    <?php
    for ($i=0; $i<$list_count; $i++) {
    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);

    if($thumb['src']) {
        $img = $thumb['src'];
    } else {
        $img = G5_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
    $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']);
    ?>
        <li class="galley_li">
            <a href="<?php echo $wr_href; ?>" class="lt_img"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a>
            <?php
            if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";

            echo "<a href=\"".$wr_href."\"> ";
            if ($list[$i]['is_notice'])
                echo "<strong>".$list[$i]['subject']."</strong>";
            else
                echo $list[$i]['subject'];
            echo "</a>";
            
            if ($list[$i]['icon_new']) echo "<span class=\"new_icon\">N<span class=\"sound_only\">새글</span></span>";
            if ($list[$i]['icon_hot']) echo "<span class=\"hot_icon\">H<span class=\"sound_only\">인기글</span></span>";

            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

            // echo $list[$i]['icon_reply']." ";
            // if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;
            // if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;

            if ($list[$i]['comment_cnt'])  echo "
            <span class=\"lt_cmt\">".$list[$i]['wr_comment']."</span>";

            ?>

            <div class="lt_info">
                <span class="lt_nick"><?php echo $list[$i]['name'] ?></span>
                <span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>              
            </div>
        </li>
    <?php }  ?>
    <?php if ($list_count == 0) { //게시물이 없을 때  ?>
    <li class="empty_li">게시물이 없습니다.</li>
    <?php }  ?>
    </ul>
    <a href="<?php echo get_pretty_url($bo_table); ?>" class="lt_more"><span class="sound_only"><?php echo $bo_subject ?></span>더보기</a>

</div>


 

이 질문에 댓글 쓰기 :

답변 2


    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
    if($thumb['src']) {
        $img = $thumb['src'];
    } else {
        $img = G5_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';

위의 부분을 아래와 같이 변경해 보세요...

 


    $img_content = '<img width="345" height="200"  src="https://img.youtube.com/vi/'.$list[$i]["wr_10"].'/mqdefault.jpg" border="0">';

 

유투브 이미지는 이런식으로 불러오면 됩니다.

wr_10 에는 유튜브 ?v=adsfadgad7788  이 부분을 대입하면 됩니다.
전체 링크를 넣어서 저 부분만 가져 올 수도 있게 할 수도 있을 것입니다.

 

동영상 자체를 이곳에서 바로 플레이 하게 하면 속도가 너무 느려져서 해당 영상의 이미지만 불러와서 보여주고 클릭하면 팝업으로 띄워서 플레이 하거나 하면 될것입니다.

답변 감사합니다.

적용해 봤는데 아무런 변화가 없네요ㅠ 무엇이 문제일까요?

인터넷 설정에서 쿠키 삭제하고 새로고침 열심히 해봐도 아무런 변화가 없네요...

 

그리고...

이부분을 
$img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
이렇게 변경하란 말씀인가요?
$img_content = '<img width="345" height="200"  src="https://img.youtube.com/vi/'.$list[$i]["wr_10"].'/mqdefault.jpg" border="0">';

 


아니면 이부분을
    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
    if($thumb['src']) {
        $img = $thumb['src'];
    } else {
        $img = G5_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';

이렇게 변경하란 말씀인가요?

    $img_content = '<img width="345" height="200"  src="https://img.youtube.com/vi/'.$list[$i]["wr_10"].'/mqdefault.jpg" border="0">';
 

 

아무튼 두가지 모두 적용해 봤는데 아무런 변화가 없습니다ㅠㅜ

 

 

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

회원로그인

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