최신글에 섬네일이미지가 x박으로 나와요.. 도와주세요.. > 그누4 질문답변

그누4 질문답변

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

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

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

첨부파일

latest.skin.php (2.7K) 2회 다운로드 2008-06-30 02:00:42

본문

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

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;
}
?>
========================

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT