썸네일을 첫번째, 두번째, 세번째등 개별로 뽑아 보기 정보
썸네일을 첫번째, 두번째, 세번째등 개별로 뽑아 보기첨부파일
본문
lib/thumbnail.lib.php
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3', $option=0)
{
global $g5, $config;
$filename = $alt = "";
$edt = false;
$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 $option, 1 ";
$row = sql_fetch($sql);
skin/board/gallery/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'], $board['bo_gallery_width'], $board['bo_gallery_height']);
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 1);
$thumb3 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 2);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
$img_content .= '<br><img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
$img_content .= '<br><img src="'.$thumb3['src'].'" alt="'.$thumb3['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;
}
?>
이렇게 수정해서 사용해 보세요..
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3', $option=0)
{
global $g5, $config;
$filename = $alt = "";
$edt = false;
$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 $option, 1 ";
$row = sql_fetch($sql);
skin/board/gallery/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'], $board['bo_gallery_width'], $board['bo_gallery_height']);
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 1);
$thumb3 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 2);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
$img_content .= '<br><img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
$img_content .= '<br><img src="'.$thumb3['src'].'" alt="'.$thumb3['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;
}
?>
이렇게 수정해서 사용해 보세요..
추천
3
3
댓글 11개
감사합니다 ^^
글 보고 수정해 봣씁니다.
lib 파일과 list스킨 수정햇는데 썸네일 한개가 3개로 나오네요. 어떤 부분이 잘못된 것일까요?
lib 파일과 list스킨 수정햇는데 썸네일 한개가 3개로 나오네요. 어떤 부분이 잘못된 것일까요?
, $option=0)
포인트는 $option 값입니다.
파일넘버를 불러오는 것입니다.
포인트는 $option 값입니다.
파일넘버를 불러오는 것입니다.
그럼 옵션은 어디에 따로 써주는 건가요?
http://gooddirectcar.com/bbs/board.php?bo_table=review&page= 요렇게 나와요~ 어떤 부분 수정하면 가능할까요? 부탁드립니다. 감사합니다.
수정1
$um_value='80/0.5/3', $option=0)
수정2
bf_no limit $option, 1 ";
수정3
$thumb2 = ~~~ '80/0.5/3', 1);
수정4
$thumb3 = ~~~ '80/0.5/3', 2);
모두 정확히해보세요.썸네일 한번지워주시구요
$um_value='80/0.5/3', $option=0)
수정2
bf_no limit $option, 1 ";
수정3
$thumb2 = ~~~ '80/0.5/3', 1);
수정4
$thumb3 = ~~~ '80/0.5/3', 2);
모두 정확히해보세요.썸네일 한번지워주시구요
답변감사드립니다.
제가 잘 볼줄 몰라서 ... 자꾸 답답한 소리하고 있나 봐요...
-----------$crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3', $option=0)
-----------order by bf_no limit $option, 1 ";
list 에다가는
<li class="gall_href">
<a href="<?php echo $list[$i]['href'] ?>">
<?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'], $board['bo_gallery_width'], $board['bo_gallery_height']);
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 1);
$thumb3 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 2);
if($thumb['src']) {
$img_content = '<ul class="list_img"><li><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li>';
$img_content .= '<li><img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li>';
$img_content .= '<li><img src="'.$thumb3['src'].'" alt="'.$thumb3['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li></ul>';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
echo $img_content;
}
?>
</a>
</li>
요렇게 넣어줬는데요.
썸네일 정리하기 버튼 눌러서 정리도 했구요.
그런데 똑같아요... 혹시 제가 수정한 글중에 오타나 그런게 있어서 그럴까요?
제가 잘 볼줄 몰라서 ... 자꾸 답답한 소리하고 있나 봐요...
-----------$crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3', $option=0)
-----------order by bf_no limit $option, 1 ";
list 에다가는
<li class="gall_href">
<a href="<?php echo $list[$i]['href'] ?>">
<?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'], $board['bo_gallery_width'], $board['bo_gallery_height']);
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 1);
$thumb3 = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], 'false', 'true', 'center', 'false', '80/0.5/3', 2);
if($thumb['src']) {
$img_content = '<ul class="list_img"><li><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li>';
$img_content .= '<li><img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li>';
$img_content .= '<li><img src="'.$thumb3['src'].'" alt="'.$thumb3['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'"></li></ul>';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
echo $img_content;
}
?>
</a>
</li>
요렇게 넣어줬는데요.
썸네일 정리하기 버튼 눌러서 정리도 했구요.
그런데 똑같아요... 혹시 제가 수정한 글중에 오타나 그런게 있어서 그럴까요?
갤러리 첨부이미지 순서대로 뽑아오기는 썸네일립 파일에 옵션을 넣어서 뽑아오면 된다~! ^^
감사합니다
좋은 팁 감사합니다. ^^
감사합니다.^^