다중 첨부이미지 관련 문의
게시글 등록시 첨부이미지를 여러개 등록을 하고
갤러리 게시판 리스트에서 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\">";
라고 작성해 주었더니 두번째 이미지가 보였습니다.
어디를 어떻게 고쳐야 하는지 알려주시면 너무 너무 감사하겠습니다.
갤러리 게시판 리스트에서 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;
}
?>
이후 출력 형태(모양)에 따른 변경
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;
}
?>
이후 출력 형태(모양)에 따른 변경
게시판 목록
그누5 질답
그누보드5 버전에 대한 질문을 할 수 있습니다.
쪽지나 메일로 해결해 주겠다는 답변은 정상적인 답변으로 보기 어려우므로 신고해 주시기 바랍니다.
쪽지나 메일로 해결해 주겠다는 답변은 정상적인 답변으로 보기 어려우므로 신고해 주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1023 | 11년 전 | 632 | ||
| 1022 | 11년 전 | 1034 | ||
| 1021 |
|
11년 전 | 565 | |
| 1020 |
williamMOON
|
11년 전 | 439 | |
| 1019 | 11년 전 | 793 | ||
| 1018 | 11년 전 | 610 | ||
| 1017 | 11년 전 | 570 | ||
| 1016 | 11년 전 | 1304 | ||
| 1015 | 11년 전 | 697 | ||
| 1014 |
오메가클럽
|
11년 전 | 688 | |
| 1013 | 11년 전 | 891 | ||
| 1012 | 11년 전 | 467 | ||
| 1011 |
개발개발자
|
11년 전 | 450 | |
| 1010 | 11년 전 | 327 | ||
| 1009 | 11년 전 | 434 | ||
| 1008 | 11년 전 | 425 | ||
| 1007 | 11년 전 | 370 | ||
| 1006 | 11년 전 | 465 | ||
| 1005 |
포도주스와
|
11년 전 | 601 | |
| 1004 | 11년 전 | 444 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기