그누보드 갤러리 스킨에 썸네일 2개 보여주기
본문
여기 저기 찾다 하나 얻긴 얻었는데 첫번째 이미지는 나오고 2번째 이미지가 안나오네요
ㅠ.ㅠ
http://static.se2.naver.com/static/img/bg_b1.png) repeat;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://static.se2.naver.com/static/img/bg_b1.png',sizingMethod='scale');color:#888888;"><?php for ($i=0; $i<count($list); $i++) {
if($i>0 && ($i % $bo_gallery_cols == 0))
$style = 'clear:both;';
else
$style = '';
if ($i == 0) $k = 0;
$k += 1;
if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;";
?>
위부분에서 $i 가 나오는데
http://static.se2.naver.com/static/img/bg_b1.png) repeat;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://static.se2.naver.com/static/img/bg_b1.png',sizingMethod='scale');color:#888888;"><?php {
$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[$i2]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="118" height="90">';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
if($thumb2['src']) {
$img_content2 = ' <img src="'.$thumb2['src'].'" alt="'.$thumb2['alt'].'" width="118" height="90">';
} else {
$img_content2 = ' <span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
echo $img_content;
echo $img_content2;
}
?>
이렇게 해버렸거든요 두번째 이미지가 안나오는 이유가 뭘까요? ㅠ.ㅠ
답변 2
$thumb2 = get_list_thumbnail($board['bo_table'], $list[$i2]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);--------> 변경
$filepath = '../data/file/'.$bo_table;
if($list[$i][file][1][view]) $im_src = $list[$i][file][1][file];
else if($list[$i][file][2][view]) $im_src = $list[$i][file][2][file];
else $im_src = $list[$i][file][3][file];
$thumbk = thumbnail($im_src, $filepath,$filepath, $board['bo_gallery_width'], $board['bo_gallery_height'], false);
if($thumbk ) $thumb2['src']= $filepath.'/'.$thumbk;
4번째 첨부까지 체크해서 이미지 첨부가 있으면 됩니다
음 겔러리에서 2개의 이미지를 뽑으시려면
$fileCnt = $list[$i][file][count];
이녀석과
$fileCnt = count($list[$i][file]);
이녀석둘중에 카운트가 나오는 걸로다가 해서 이미지 수를 뽑아와서 for를 돌려서 하셔도 되고
두개의 이미지가 필요하신거니까
$fileCnt = 2;
이렇게 정하셔도 되고요
다만 이미지의 수가 2보타 크면 모든 이미지를 뿌려줄수가 있으니 제한은 두셔야 겠지요
for($j=0; $j<$fileCnt; $j++)
{
$thisFile = $list[$i][file][$j];
if($thisFile[view])
{
echo get_view_thumbnail($thisFile[view]);
}
}
이런식으로 불러와야 되지 않나 싶은데요