슬라이드 배너를 만들고 있는데 도움이 필요합니다.

슬라이드 배너를 만들고 있는데 도움이 필요합니다.

QA

슬라이드 배너를 만들고 있는데 도움이 필요합니다.

본문

안녕하세요. 그누보드를 접한지 얼만 안된 초보입니다. 홈페이지를 만들고 있는데 선생님들의 도움이 필요해서 글을 올리게 되었습니다. 

모바일에서 슬라이드 배너를 만들려고 그누소스님(https://sir.kr/g5_skin/29008)의 글을 일고 업로드 하여 슬라이드는 잘 작동을 하고 있는데, 슬라이드를 클릭하면 해당 글로 이동이 되지 않습니다.  어디를 수정해야 되는지 몰라서 혼자 이것 저것 해보다가 답답함에 도움을 구합니다. 

   

<<모바일 latest.skin.php>>

<?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 = 1920;

//출력배너 높이

$thumb_height = 510;

?>

<style>

    .main_slider_baner{padding: 20px 0; }

    .swiper-slide img{width: 100%;}

</style>

 

<div class="main_slider_baner">

    <link rel="stylesheet" href="<?php echo $latest_skin_url?>/swiper.min.css">

 <!-- Swiper -->

  <div class="swiper-container">

    <div class="swiper-wrapper">

    <?php

    for ($i=0; $i<count($list); $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'].'" >';

    ?>

      <div class="swiper-slide"><a href="http://<?=$list[$i]['wr_link1']?>" target="_blank"><?=$img_content?></a></div>

       

      <?php }  ?>

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

    <?php

$wr_href = ''.$G5_BBS_URL.'bbs/link.php?bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&no=1';

 

if ($list[$i]['icon_secret']){

    $list[$i]['subject'] = "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> " . $list[$i]['subject'];

}

 

if ($list[$i]['is_notice'])

    $list[$i]['subject'] = "<strong>".$list[$i]['subject']."</strong>";

?>

<li class="galley_li post-small-style">

    <div class="img-wrap post-thumb img-hover-scale thumb-overlay" style="padding-bottom:<?php echo $img_height ?>%;">

        <div class="img-item">

            <a href="<?php echo $wr_href; ?>" target="_blank">

                <?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?>

            </a>

            <?php if($is_caption && !$caption && $list[$i]['ca_name']){ ?>

            <div class="post-content-overlay entry-meta meta-0 transition-ease-04">

                <a href="<?php echo $wr_href; ?>" target="_blank"><span class="post-cat <?php echo $bg_red[rand(0, 6)];?>"><?php echo $list[$i]['ca_name'];?></span></a>

            </div>

            <?php } ?>

 

            <?php if($is_caption && $caption) { ?>

            <div class="sidebar-layer">

                <?php if($list[$i]['ca_name']){ ?>

                <div class="entry-meta meta-0 transition-ease-04">

                    <a href="<?php echo $wr_href; ?>" target="_blank"><span class="post-cat <?php echo $bg_red[rand(0, 6)];?>"><?php echo $list[$i]['ca_name'];?></span></a>

                </div>

                <?php } ?>

            </div>

            <?php } ?>

        </div>

    </div>

</li>

    <?}?>

       

    </div>

    <!-- 롤링점 -->

    <div class="swiper-pagination"></div>

      <!-- 좌우버튼 -->

    <div class="swiper-button-next"></div>

    <div class="swiper-button-prev"></div>

  </div>

 

  <!-- Swiper JS -->

  <script src="<?php echo $latest_skin_url?>/swiper.min.js"></script>

 

  <!-- Initialize Swiper -->

  <script>

    var swiper = new Swiper('.swiper-container', {

      pagination: {

        el: '.swiper-pagination',

        dynamicBullets: true,

        },

        navigation: {

        nextEl: '.swiper-button-next',

        prevEl: '.swiper-button-prev',

        },

        loop : true,

        autoplay: {

        delay: 3000, //롤링 시 정지타임

        stopOnLastSlide: false,

        disableOnInteraction: true, //롤링 여부false시 롤링끄기

        },

    });

  </script>

</div>


 

 

 

 

 

혹시 몰라서 <<pc버전 latest.skin.php>>을 같이 올려 드립니다.

<<pc버전 latest.skin.php>>

 

<?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 = 400;

$thumb_height = 130;

 

if($thumb_width && $thumb_height) {

    $img_height = ($thumb_height / $thumb_width) * 100;

} else {

    $img_height = '56.25';

}

 

// 이미지 제목줄

$subject_line = 1;

$subject_height = 22 * $subject_line + 2;

 

// 이미지 글내용 길이

$cut_txt = 80;

 

// 이미지 글내용 출력(true:출력|false:숨김)

$is_content = false;

 

// 배경색상 랜덤

$bg_red = array("bg-red", "bg-orangered", "bg-green", "bg-blue", "bg-purple", "bg-yellow", "bg-navy");

 

// 캡션(0:캡션없음|1:캡션숨김|2:일반캡션|3:호버캡션)

$caption = 0;

$is_caption = ($caption == "1") ? false : true;

 

// 추출개수

$list_count = (is_array($list) && $list) ? count($list) : 0;

 

// 랜덤(true:출력|false:숨김)

$is_rand = false;

if(isset($is_rand) && $is_rand && $list_count)

    shuffle($list);

?>

<style>

 

</style>

<div class="pic_mix_lt5<?php echo ($caption == "3") ? ' is-hover' : ''; // 호버캡션 ?>">

 

    <ul class="">

        <?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'].'" >';

            //vdesign

            //$wr_href = ''.$G5_BBS_URL.'bbs/link.php?bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&no=1" target="'.$list[$i]['wr_1'].'"';

            $wr_href = ''.$G5_BBS_URL.'bbs/link.php?bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&no=1" target="_blank"';

 

            if ($list[$i]['icon_secret']){

                $list[$i]['subject'] = "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> " . $list[$i]['subject'];

            }

 

            if ($list[$i]['is_notice'])

                $list[$i]['subject'] = "<strong>".$list[$i]['subject']."</strong>";

 

        ?>

        <li class="galley_li post-small-style">

            <div class="img-wrap post-thumb img-hover-scale thumb-overlay" style="padding-bottom:<?php echo $img_height ?>%;">

                <div class="img-item">

                    <a href="<?php echo $wr_href; ?>">

                        <?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?>

                    </a>

                    <?php if($is_caption && !$caption && $list[$i]['ca_name']){ ?>

                    <div class="post-content-overlay entry-meta meta-0 transition-ease-04">

                        <a href="<?php echo $wr_href; ?>"><span class="post-cat <?php echo $bg_red[rand(0, 6)];?>"><?php echo $list[$i]['ca_name'];?></span></a>

                    </div>

                    <?php } ?>

 

                    <?php if($is_caption && $caption) { ?>

                    <div class="sidebar-layer">

                        <?php if($list[$i]['ca_name']){ ?>

                        <div class="entry-meta meta-0 transition-ease-04">

                            <a href="<?php echo $wr_href; ?>"><span class="post-cat <?php echo $bg_red[rand(0, 6)];?>"><?php echo $list[$i]['ca_name'];?></span></a>

                        </div>

                        <?php } ?>

                    </div>

                    <?php } ?>

                </div>

            </div>

        </li>

        <?php }  ?>

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

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

        <?php }  ?>

    </ul>

 

</div>

 

이 질문에 댓글 쓰기 :

답변 2

<?=$list[$i]['wr_link1']?> 해당으로 가는데 해당은 따로 게시물 할때 적어주는 링크입니다. 해당을 원하시는 링크로 변경을 하시면 될 거 같습니다. 상세로 가시는거면 다른 게시물 스킨을 참고해서 링크를 변경해주시면 될 거 같습니다.

개발자도구 f12를 열어서 확인해보면

이부분 <a href="http://<?=$list[$i]['wr_link1']?>" target="_blank"> 링크 제대로 나오는지 확인부터 해보세요

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

회원로그인

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