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

썸네일 클릭스 두번째 파일 출력 채택완료

간한이 7년 전 조회 3,404

현재

 

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

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

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

 

도와주세요..!

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

답변 1개

채택된 답변
+20 포인트
베원
7년 전

/lib/thumbnail.php 파일

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

</p>

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

<p>

에서

</p>

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

<p>

 

 

 

 

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

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

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

답변에 대한 댓글 2개

간한이
7년 전
답변감사합니다!

현재 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>

이렇게 되어있습니다!

코드를 어떻게 변경해야할까요?
베원
7년 전
$thumb['src']에는 첫번째 이미지의 주소, $thumb2['src']에는 두번째 이미지의 주소가 들어가겠죠.

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

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

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

로그인