소스 좀 봐주세요.~ 정보
소스 좀 봐주세요.~본문
죄송합니다.
보통은 혼자서 기본 12시간은 삽질 후에 질문드리는데 지금 마감 시간이 너무 촉박해서 모르는 부분을 바로 질문올리는점 사과 드립니다.
아래 소스에서 썸네일이 출력이 안되고 ./data/file///thumb_2/3731417498_610b57ea_img_02_L.gif.thumb 이런식으로 나옵니다.
원인을 알려주시면 정말 감사하겠습니다.
------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_w = "300"; //썸네일 가로
$img_h = "120"; //썸네일 세로
$img_quality = "99"; //압축화질
$data_path = $g4[path]."/data/file/$bo_table/";
$thumb_path = $data_path."/thumb_2";
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width=100% cellpadding=0 cellspacing=0 >
<tr><td height="10"></td></tr>
<? for ($i=0; $i < 1; $i++) { ?>
<?
//썸네일 코드 시작
$image = $list[$i][file][0][file];
$image = $thumb_path . '/' . $list[$i][file][0][file] . '.thumb';
// 섬네일과 새로 올린파일 날짜를 비교하여 셈네일을 갱신하기위해서 지운다.
if ( file_exists($thumb) && (filemtime($thumb) < filemtime($list[$i][file][0][path] .'/'. $list[$i][file][0][file])) ) {
@unlink($thumb);
}
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 = $img_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $img_h)
$dst = imagecreatetruecolor($img_w, $height);
else
$dst = imagecreatetruecolor($img_w, $img_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path . '/' . $list[$i][file][0][file] . '.thumb', $img_quality);
chmod($thumb_path . '/' . $list[$i][file][0][file] . '.thumb', 0606);
}
}
if (file_exists($thumb))
$image = $thumb;
?>
<tr>
<td colspan=4 align=center >
<table width=92% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=48>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$image} {$list[$i]['subject']}</font>";
echo "</a>";
// if ($list[$i]['comment_cnt']) //
// echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
?></td></tr>
</table>
</td>
</tr>
<? for ($i=1; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center >
<table width=92% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=48><img src="<?=$latest_skin_path?>/img/btn_<?=$i ?>.gif" width="60" height="40" align="absmiddle">
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
echo "</a>";
// if ($list[$i]['comment_cnt']) //
// echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
?></td></tr>
</table>
</td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50>게시물이 없습니다.</a></td></tr><? } ?><? } ?>
<tr><td height="2"></td></tr>
<tr><td height="5"></td></tr>
</table>
-----------------------------
보통은 혼자서 기본 12시간은 삽질 후에 질문드리는데 지금 마감 시간이 너무 촉박해서 모르는 부분을 바로 질문올리는점 사과 드립니다.
아래 소스에서 썸네일이 출력이 안되고 ./data/file///thumb_2/3731417498_610b57ea_img_02_L.gif.thumb 이런식으로 나옵니다.
원인을 알려주시면 정말 감사하겠습니다.
------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_w = "300"; //썸네일 가로
$img_h = "120"; //썸네일 세로
$img_quality = "99"; //압축화질
$data_path = $g4[path]."/data/file/$bo_table/";
$thumb_path = $data_path."/thumb_2";
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width=100% cellpadding=0 cellspacing=0 >
<tr><td height="10"></td></tr>
<? for ($i=0; $i < 1; $i++) { ?>
<?
//썸네일 코드 시작
$image = $list[$i][file][0][file];
$image = $thumb_path . '/' . $list[$i][file][0][file] . '.thumb';
// 섬네일과 새로 올린파일 날짜를 비교하여 셈네일을 갱신하기위해서 지운다.
if ( file_exists($thumb) && (filemtime($thumb) < filemtime($list[$i][file][0][path] .'/'. $list[$i][file][0][file])) ) {
@unlink($thumb);
}
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 = $img_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $img_h)
$dst = imagecreatetruecolor($img_w, $height);
else
$dst = imagecreatetruecolor($img_w, $img_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path . '/' . $list[$i][file][0][file] . '.thumb', $img_quality);
chmod($thumb_path . '/' . $list[$i][file][0][file] . '.thumb', 0606);
}
}
if (file_exists($thumb))
$image = $thumb;
?>
<tr>
<td colspan=4 align=center >
<table width=92% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=48>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$image} {$list[$i]['subject']}</font>";
echo "</a>";
// if ($list[$i]['comment_cnt']) //
// echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
?></td></tr>
</table>
</td>
</tr>
<? for ($i=1; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center >
<table width=92% valign=top border=0 cellpadding=0 cellspacing=0>
<tr>
<td height=48><img src="<?=$latest_skin_path?>/img/btn_<?=$i ?>.gif" width="60" height="40" align="absmiddle">
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
echo "</a>";
// if ($list[$i]['comment_cnt']) //
// echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; '>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
?></td></tr>
</table>
</td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50>게시물이 없습니다.</a></td></tr><? } ?><? } ?>
<tr><td height="2"></td></tr>
<tr><td height="5"></td></tr>
</table>
-----------------------------
댓글 전체
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$image} {$list[$i]['subject']}</font>";
echo "</a>";
----------------------------------------------- ↓↓↓↓↓↓↓ 로 수정
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '><img src='{$image}'> {$list[$i]['subject']}</font>";
echo "</a>";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '>{$image} {$list[$i]['subject']}</font>";
echo "</a>";
----------------------------------------------- ↓↓↓↓↓↓↓ 로 수정
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}' target=_parent >";
if ($list[$i]['is_notice'])
echo "<font style='font-family:굴림; font-size:9pt; '>{$list[$i]['subject']}</font>";
else
echo "<font style='font-family:굴림; font-size:9pt; '><img src='{$image}'> {$list[$i]['subject']}</font>";
echo "</a>";
견해님 답변 너무 감사합니다.
제가 급하다보니 그 부분을 놓쳤네요.
지금 정신이 없네요..
정말 감사합니다.
꾸벅
제가 급하다보니 그 부분을 놓쳤네요.
지금 정신이 없네요..
정말 감사합니다.
꾸벅
와. 저도 이거 궁금해하고있었는데 ㅠㅠ 감사합니다.덕분에..