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

다중 첨부이미지 관련 문의

· 12년 전 · 391 · 1
게시글 등록시 첨부이미지를 여러개 등록을 하고

갤러리 게시판 리스트에서 2개 보여주고 싶습니다. 한 게시물에서 말이죠.

-----------G5 갤러리 게시판에서 썸네일을 보여주는 부분은 아래와 같습니다.

$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);

if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';

} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}

echo $img_content;

여기에서 어디를 수정해야 하는지... 당췌 알수가 없습니다. ㅠㅠ

참고로 G4 버전에서는

$img2 = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][1][file]);
를 삽입하고
echo "<img src=\"{$img2}\" width='{$img_width}' height='{$img_height}' border=\"0\">";
라고 작성해 주었더니 두번째 이미지가 보였습니다.

어디를 어떻게 고쳐야 하는지 알려주시면 너무 너무 감사하겠습니다.

댓글 작성

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

로그인하기

댓글 1개

12년 전
lib/thumbnail.lib.php 별표시 부분 변경

function get_list_thumbnail($bo_table, $wr_id, $bf_current, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
{ // $bf_current 추가 ★
global $g5, $config;
$filename = $alt = "";
$edt = false;
$bf_current = $bf_current-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 $bf_current, 1 "; // 수정 ★
$row = sql_fetch($sql);



갤러리 list.skin.php 수정 및 추가
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<strong style="width:<?php echo $board['bo_gallery_width'] ?>px;height:<?php echo $board['bo_gallery_height'] ?>px">공지</strong>
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], 1, $board['bo_gallery_width'], $board['bo_gallery_height']); // 수정 -> 1은 첫번째 이미지 ★

if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}

echo $img_content;
// 두번째 이미지 출력 추가 ★
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], 2, $board['bo_gallery_width'], $board['bo_gallery_height']); // 2는 두 번째 이미지

if($thumb2['src']) {
$img_content2 = '<img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
} else {
$img_content2 = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}

echo $img_content2;
}
?>


이후 출력 형태(모양)에 따른 변경

게시글 목록

번호 제목
4009
4008
4004
4002
3999
3993
3992
3983
3981
3977
3975
3968
3967
3960
3955
3950
3946
3944
3939
3937