갤러리용 최신글에서 한 게시글의 첨부이미지 수를 3개이상 보여줄 수 있나요??
본문
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign="top">
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'></a></td></tr>";
echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%></td>";
}
?>
<? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
답변 1
$image = $list[$i][file][0][file]; //원본
$image2 = $list[$i][file][1][file]; //원본
$image3 = $list[$i][file][2][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$img2=$data_path. "/".$image2; //썸네일이 없을경우 원본출력
$img3=$data_path. "/".$image3; //썸네일이 없을경우 원본출력
만들고
<img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>
<img src='$img2' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>
<img src='$img3' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CECECE; padding:0px'>