테스트 사이트 - 개발 중인 베타 버전입니다

최신글의 링크 오류 문제 채택완료

 

위와 같이 최신글에 등록된 게시글의 링크가 오류가 나고 있습니다.

아래 최신글 소스에서 어떻게 수정하면 될까요?

 

</p>

<p><?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

include_once(G5_LIB_PATH.'/thumbnail.lib.php');</p>

<p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);

$thumb_width = 480;

$thumb_height = 360;

$list_count = (is_array($list) && $list) ? count($list) : 0;</p>

<p>

/*

 * 유투브 주소에서 Video ID를 추출합니다. 

 */

if ( ! function_exists( 'get_video_id' ) )

{

    function get_video_id( $str )

    {

        if( substr( $str, 0, 4 ) == 'http' )

        {

            if( strpos( $str, 'youtu.be' ) )

            {

                return array_pop( explode( '/', $str ) );

            }

            else if( strpos( $str, '/embed/' ) )

            {

                return array_pop( explode( '/', $str ) );

            }

            else if( strpos( $str, '/v/' ) )

            {

                return array_pop( explode( '/', $str ) );

            }

            else

            {

                $params = explode( '&', array_shift( explode( '#', array_pop( explode( '?', $str ) ) ) ) );

                foreach( $params as $data )

                {

                    $arr = explode( '=', $data );

                    if( $arr[ 0 ] == 'v' )

                    {

                        return $arr[ 1 ];

                    }

                }

            }

        }

        else

        {

            return $str;

        }

 

        return '';

    }

}

 

/*

 * 썸네일 주소를 가져옵니다. 기본값은 default 입니다.

 */

if ( ! function_exists( 'get_yt_thumb' ) )

{

    function get_yt_thumb( $url_or_id, $type )

    {

        switch( $type )

        {

            case '0' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/0.jpg';

                break;

            case '1' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/1.jpg';

                break;

            case '2' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/2.jpg';

                break;

            case '3' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/3.jpg';

                break;

            case 'hq' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/hqdefault.jpg';

                break;

            case 'mq' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/mqdefault.jpg';

                break;

            case 'sd' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/sddefault.jpg';

                break;

            case 'maxres' :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/maxresdefault.jpg';

                break;

            default :

                return '//img.youtube.com/vi/'.get_video_id( $url_or_id ).'/default.jpg';

        }

    }

}</p>

<p>

?></p>

<p><div class="pic_lt">

    <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);</p>

<p>            if($thumb['src']) {

                //$img = $thumb['src'];

                $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" >';

            } else {

                //$img = G5_IMG_URL.'/no_img.png';

                //$thumb['alt'] = '이미지가 없습니다.';

                $v = "";

                $daumpot_limit = "";

                $mov_link = "";

                $img_content = "";

                $mov_link = $list[$i]['wr_10'];

                $youtube_url = parse_url($mov_link);

                parse_str($youtube_url['query']);

                if($v){

                    $img_content = '<img src="'.get_yt_thumb( '<a href="http://youtu.be/'.$v," target="_blank" rel="noopener noreferrer">http://youtu.be/'.$v,</a> 'hq' ).'"class="youtube_thum"'.'">';

                }

            }

        ?>

       

       

       

        <li class="gallery_li"></p>

<p>            <a href="<?php echo $list[$i]['href'] ?>" class="lt_img"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a>

            

            <div class="text">

                <div class="board_title after">

                    <h2 class="lat_title"><?php echo $bo_subject ?></h2>

                    <a href="<?php echo get_pretty_url($bo_table); ?>" class="lt_more"><span class="sound_only"><?php echo $bo_subject ?></span>+</a>

                </div>

                

                <a href="<?php echo $list[$i]['href'] ?>"><?php echo $list[$i]['subject']; ?></a>

                

                <div class="lt_info">

                    <span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>

                </div>

            </div>

            

        </li>

        <?php }  ?>

        <?php if ($list_count == 0) { //게시물이 없을 때  ?>

        <li class="empty_li">게시물이 없습니다.</li>

        <?php }  ?>

    </ul>

    </p>

<p></div>

 </p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

lib/common.lib.php를 보면

    $list['href'] = get_pretty_url($board['bo_table'], $list['wr_id'], $qstr);     $list['comment_href'] = $list['href'];

 

결국 설정문제인 듯합니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

G5_BBS_URL
이런 변수들이 제대로 정의되어 있는지 살펴 보세요.
답변 감사드립니다^^

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인

전체 질문 목록