N

최근갤러리 FOR 문을좀 수정할려 합니다.

Untitled-2.gif
총 3개의 이미지를 뽑아올때

첫번째 이미지는 빈칸이고 두번째는 우측상단 세번째는 좌측하단 네번째는 우측하단

이렇게 뽑아볼려고 합니다.


아래의 소스에서 어떻게 수정을 하면 좋을지.. 부탁드립니다.

<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 align="center" valign='top' style='padding-left:3px;'>
<?
$img = "이미지 없음";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;

$rate = $thum_width / $size[0];
$height = (int)($size[1] * $rate);

$dst = imagecreatetruecolor($thum_width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thum_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $image_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}

if (file_exists($thumb))
$img = "<img src='$thumb' alt='{$list[$i][subject]}' border='0'>";
// $img = "<img src='$thumb' alt='{$list[$i][subject]}' width='90' height='60' border='0' style='border:1 solid #C6C6C6;'>"; // 썸네일 가로 세로 고정시 사용

echo $list[$i][icon_reply] . " ";
echo "<table cellpadding=0 cellspacing=1 border=0><tr>";
echo "<td><div style='width:88px; height:73px;border:1 solid #C6C6C6; position: relative; overflow:hidden;' align=center valign=center><a href={$list[$i]['href']} onfocus=\"this.blur()\">$img</a></div></td>";
//echo "</tr><tr align=center><td height=20 valign=bottom>{$list[$i]['subject']}</td>";
echo "</tr></table>";
?>
</td>
<? } ?>

<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td></td>";
}
?>

<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>

첨부파일

Untitled-2.gif (23.7 KB)
0회 2008-04-11 09:49
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 1,085
17년 전 조회 1,253
17년 전 조회 1,523
17년 전 조회 971
17년 전 조회 1,611
17년 전 조회 1,514
17년 전 조회 1,673
17년 전 조회 849
17년 전 조회 876
17년 전 조회 774
17년 전 조회 1,252
17년 전 조회 1,564
17년 전 조회 1,248
17년 전 조회 941
17년 전 조회 979
17년 전 조회 946
17년 전 조회 1,540
17년 전 조회 983
17년 전 조회 946
17년 전 조회 1,316