썸네일 클릭스 두번째 파일 출력

썸네일 클릭스 두번째 파일 출력

QA

썸네일 클릭스 두번째 파일 출력

본문

현재

 

https://sir.kr/g5_skin/16792?sca=%EA%B0%A4%EB%9F%AC%EB%A6%AC 스킨을 사용중입니다.

썸네일 클릭시 같은 이미지가 나오는데 이거를

두번째 파일로 출력하고 싶습니다!

 

도와주세요..!

이 질문에 댓글 쓰기 :

답변 1

/lib/thumbnail.php 파일

- get_list_thumbnail 함수를 그대로 복사해서 get_list_thumbnail_2 함수를 만듦
- get_list_thumbnail_2 함수의 쿼리문을 다음과 같이 변경


$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 ";

에서


$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 1, 1 ";

 

 

 

 

사용하실 스킨 list.skin.php 파일

- get_list_thumbnail 함수를 사용하는 부분을 get_list_thumbnail_2 함수로 바꿈

답변감사합니다!

현재 list.ski.php 소스가

  <li class="gall_href <?php echo ($is_admin ? '' : 'popup-gallery'); ?>">

                    <?php
                    $image_org = '';
                    if ($list[$i]['is_notice']) { // 공지사항
                        $img_content = '<strong style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">공지</strong>';
                    } else {
                        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
                        $thumb2 = get_list_thumbnail_2($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

                        $image_org = $thumb['ori'];
                        if($thumb['src']) {
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="ga-img">';
                        } else {
                            $img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px" class="ga-img">no image</span>';
                        }
                       
                    }
                    ?>
                    <a href="<?php echo ($is_admin ? $list[$i]['href'] : $image_org); ?>" class="<?php echo ($is_admin ? '' : 'image-popup-vertical-fit');?>" title="<?php echo $list[$i]['subject'] ?>" writer="<?php echo $list[$i]['wr_name'] ?>" date="<?php echo $list[$i]['datetime2'] ?>">
                    <?php echo $img_content;?></a>
                    <!-- <img src="<?php echo G5_IMG_URL ?>/over.png" class="over"> -->
                </li>

<script type="text/javascript">
<!--
$(document).ready(function() {

$('.popup-gallery').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
titleSrc: function(item) {

}
}
});

});
//-->
</script>

이렇게 되어있습니다!

코드를 어떻게 변경해야할까요?

$thumb['src']에는 첫번째 이미지의 주소, $thumb2['src']에는 두번째 이미지의 주소가 들어가겠죠.

클릭했을 때 나오는 이미지 태그의 src를 $thumb2['src']로 수정하시면 됩니다.

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

회원로그인

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