그룹별 최신글에서 노 이미지 깨집니다. > 그누4 질문답변

그누4 질문답변

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

그룹별 최신글에서 노 이미지 깨집니다. 정보

그룹별 최신글에서 노 이미지 깨집니다.

본문

Warning: imagejpeg() [function.imagejpeg]: Unable to open './skin/latest/cunic_group/img/no_image.gifThumb' for writing in /web/home/ulsanall/html/skin/latest/cunic_group/latest.skin.php on line 50
아래소스는 그룹별 최신글(이미지포함) 에서 소스입니다
그림 파일이 있을때는 문제가 없습니다만
이미지가 없을 시는  노이이지가 나와야 되는데 깨지네요
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$latest_img = "$g4[path]/img/latest/";
?>
<table width="380" cellpadding=0 cellspacing=0>
<table width="380" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($k=0; $k<count($list); $k++)
{
    if ($k > 0)
    $title =  cut_str(get_text($list[$k][wr_subject]),22);
    $content = cut_str(get_text($list[$k][wr_content]), 80);
    $img = "$g4[path]/data/file/{$list[$k][bo_table]}/".urlencode($list[$k][file][0][file]);
    if (!file_exists($img) || !$list[$k][file][0][file])
    $img = "<?=$latest_skin_path?>/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
    $thumbx=100;
    $thumby=52;
    $thumbyy = $thumby+6;
    $destfile =$img.'Thumb';
   
    $size = @getimagesize($img);
    if(is_array($size) && !is_file($destfile)) {
     switch($size[2]) {
      case(1) :
       if(function_exists('ImageCreateFromGif')) $im = ImageCreateFromGif($img);
       break;
      case(2) :
       if(function_exists('ImageCreateFromJpeg')) $im = ImageCreateFromJpeg($img);
       break;
      case(3) :
       if(function_exists('ImageCreateFromPng')) $im = ImageCreateFromPng($img);
       break;
     }
     $fixsize = mando_image_size($size[0], $size[1], $thumbx, $thumby);
     if($im) {
      if($k==0) @exec("rm ".dirname($_SERVER[SCRIPT_FILENAME])."/data/file/$bo_table/*Thumb-rf");
      if(function_exists('ImageCreateTrueColor')) $newim = ImageCreateTrueColor($fixsize[x],$fixsize[y]);
      else $newim = ImageCreate($fixsize[x],$fixsize[y]);
      if(function_exists('ImageCopyResampled')) ImageCopyResampled($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      else ImageCopyResized($newim,$im,0,0,0,0,$fixsize[x],$fixsize[y],$size[0],$size[1]);
      ImageDestroy($im);
      ImageJpeg($newim, $destfile, 100);
      ImageDestroy($newim);
      unset($im, $newim);
     }
     $list[$k][img][x] = $fixsize[x];
     $list[$k][img][y] = $fixsize[y];
    } else {
     if(is_file($destfile)) {
      $size = @getimagesize($destfile);
      $list[$k][img][x] = $size[0];
      $list[$k][img][y] = $size[1];
     } else {
      $img = "";
      $size = @getimagesize($img);
      $list[$k][img][x] = $thumbx;
      $list[$k][img][y] = $thumby;
     }
    }
    if(is_file($destfile))$img = $destfile;
 if($k==0){   
    echo <<<HEREDOC
<td align="center" width="10">
<td align="center" valign="top"  width="80">
<table width=100 cellpadding="0" cellspacing="0" border="0" style="padding:0px;">
<tr align=center>
<td width=100 align="center" style='padding-top:0px;'>
<div align=center>
<table width=100 align="center"  bgcolor='#fafafa' cellpadding="3" cellspacing="0" border="0">
<tr><td align="center" valign="middle" style='border:1px solid #cfcfcf'>
<a href="{$list[$k][href]}">
<img src=" {$destfile}" width="{$list[$k][img][x]}" height="{$list[$k][img][y]}" border="0" alt="$content"></a>
</td>
</tr>
</table></div>
</td>
</tr>
<!--
<tr>
<td height=14 align="center" valign="middle" style='padding-top:3px;padding-bottom:3px;border:0px solid #777777'>
<a href="{$list[$k][href]}" style='font-family:돋움;font-size:11px;color:#336666'>{$list[$k][wr_subject]}</a>
</td>
</tr>
-->
</table>
</td>

<td width=10 ></td>
<td align="center" valign="top" >
<table width="100%" height=68 cellpadding="0" cellspacing="0" border="0" style="padding:0px;" >
HEREDOC;
 }else{
  echo <<<HEREDOC
<tr>
<td height=12 align="left" valign="middle">
<img src="$latest_skin_path/img/board_icon.gif" width="9" height="12">
<a href="{$list[$k][href]}">[{$list[$k][bo_subject]}]  $title</a>
</td>
</tr>
HEREDOC;
if($i<(count($list)-1)){echo "<tr><td colspan='9' height='0' ></td></tr>";}
  }
}
?>
 
</table>
</td>
</tr>
</table
 
  혹시 이거 해결해서 사용중이신분이시거나 아시는분  조언좀 부탁 드립니다.

댓글 전체

skin/latest/cunic_group/img/no_image.gif 파일이 있는지 확인하시구요..
21라인 부근에서 $destfile =$img; 로 수정후 테스트 해보세요..
하나씩 의심가는 부분을 찾는방법밖에는....
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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