최신글에 섬네일이미지가 x박으로 나와요.. 도와주세요..
전 호스팅에선 됬었는데..
호스팅을 옮기니까 안되네요..
섬네일 주소는
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;
}
?>
========================
호스팅을 옮기니까 안되네요..
섬네일 주소는
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;
}
?>
========================
첨부파일
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 2개
9정도
php 버전마다 틀려요
5.1 이상에서는 100이 아닌 10 이하로 해야 될거에요