UTF-8 갤러리 게시판 썸네일이 안되요~ 정보
UTF-8 갤러리 게시판 썸네일이 안되요~본문
제가 UTF-8로 저장해서 쓰고 있는 갤러리입니다.
아래는 리스트에서 썸네일 생성부분이고요.
FTP상에도 썸네일은 생성되어 있어요.
그런데 리스트에서는 정작 이미지가 안떠요....
고수님들 답변 부탁드려요~ ^^;
<?
for ($i=0; $i<count($list); $i++)
{
if ($i && $i%$mod==0)
echo "</tr><tr>";
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 width='$board[bo_1]' title='이미지 없음'>";
$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
continue;
$rate = $board[bo_1] / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $board[bo_2])
$dst = imagecreatetruecolor($board[bo_1], $height);
else
$dst = imagecreatetruecolor($board[bo_1], $board[bo_2]);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_3]);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=0>";
$style = "";
if ($list[$i][icon_new])
$style = " style='font-weight:bold;' ";
$subject = "".cut_str($list[$i][subject],20)."";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><font class=ta8>{$list[$i][comment_cnt]}</font></a>";
echo "<td width='{$td_width}%' valign=top align=center style='word-break:break-all;'>";
echo "<table width=120 cellpadding=0 cellspacing=0>";
echo "<tr><td height=20></td></tr>";
echo "<tr><td height=120 align=center valign=middle style='border-width:1 1 1 1;border-color:D5D5D5;border-style:solid;'><a href='{$list[$i][href]}'>$img</a></td></tr>";
echo "<tr><td style='padding:8 0 0 0;'><a href='{$list[$i][href]}'>$subject";
echo " " . $list[$i][icon_new];
//echo " " . $list[$i][icon_file];
//echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_secret];
echo "</a>{$comment_cnt}</td></tr>";
echo "<tr><td style='padding:3 0 0 0;'><nobr style='overflow:hidden;'><?=$list[$i][name]?></nobr></td></tr>";
if ($is_category) echo "<tr><td><a href='{$list[$i][ca_name_href]}'><font color=#cccccc>[{$list[$i][ca_name]}]</font></a></td></tr>";
if ($is_checkbox) echo "<tr><td><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
echo "<tr><td height=20></td></tr>";
echo "</table></td>\n";
}
// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'> </td>";
?>