최신글에 섬네일이미지가 x박으로 나와요.. 도와주세요..

· 17년 전 · 845 · 2
전 호스팅에선 됬었는데..
호스팅을 옮기니까 안되네요..
섬네일 주소는

data/file/freeboard/thumb_90_60/3

이런식으로 생성되고요..

스킨파일 올립니다..
=============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");

$la_sub = "30"; //제목길이
$la_content = "1000"; //내용길이
$img_w = "90"; //썸네일 가로
$img_h = "60"; //썸네일 세로
$img_q = "100"; //퀼리티

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_'.$img_w.'_'.$img_h;

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>

<style type="text/css">
/*Ver 4 start*/
#la_v17_i<? for ($j=0; $j<count($list); $j++) { echo ", #la_v17_{$j}"; } ?>{float:left}
<?
for ($j=0; $j<count($list); $j++) {
echo "#la_v17_{$j}{width:108px;height:60px;}";
}
?>
#la_v17_img{width:90px;border:1px solid #CCCCCC;padding:3px;}
.la_v17_sub{width:90px;margin-top:3px;word-break:break-all;}
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$img = "<img src='$latest_skin_path/img/no_image.gif' border=0 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 = $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][wr_id], $img_q);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}

if (file_exists($thumb))
$img = "<img src='$thumb' align='absmiddle' border='0'>";

$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
$subject = "<span $style>".cut_str($list[$i][subject],$la_sub)."</span>";
$wr_content = "<span $style>".cut_str(get_text($list[$i][wr_content]),$la_content)."</span>";

echo <<<HEREDOC
<div id="la_v17_{$i}" align="center">
<div id="la_v17_img"><a href='{$list[$i][href]}' onfocus='this.blur()'>{$img}</a></div>
<div class="la_v17_sub"><a href='{$list[$i][href]}'>{$subject}</a></div>
</div>
HEREDOC;
}
?>
========================

첨부파일

latest.skin.php (2.7 KB) 2회 2008-06-30 02:00
|

댓글 2개

이미지 퀄리티를 10이하로 줘보세요
9정도
php 버전마다 틀려요
5.1 이상에서는 100이 아닌 10 이하로 해야 될거에요
10도 안됩니다. 10이하 저는 9로 씁니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
17년 전 조회 910
17년 전 조회 762
17년 전 조회 741
17년 전 조회 689
17년 전 조회 688
17년 전 조회 771
17년 전 조회 711
17년 전 조회 738
17년 전 조회 829
17년 전 조회 846
17년 전 조회 733
17년 전 조회 830
17년 전 조회 712
17년 전 조회 753
17년 전 조회 751
17년 전 조회 772
17년 전 조회 690
17년 전 조회 672
17년 전 조회 690
17년 전 조회 1,509
🐛 버그신고