썸네일 문제입니다. 똑같은 소스로 board.php 에서는 생성 최근글 스킨에서는 0k?? > 그누4 질문답변

그누4 질문답변

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

썸네일 문제입니다. 똑같은 소스로 board.php 에서는 생성 최근글 스킨에서는 0k?? 정보

썸네일 문제입니다. 똑같은 소스로 board.php 에서는 생성 최근글 스킨에서는 0k??

본문

<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!$board[bo_1]) alert("게시판 설정 : 여분 필드 1 에 이미지가로길이를 입력하세요.");
if (!$board[bo_2]) alert("게시판 설정 : 여분 필드 2 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (기본값 9)");
if (!$board[bo_3]) alert("게시판 설정 : 여분 필드 3 에 이미지세로길이를 입력하세요.");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$board[bo_1] = "110";
$board[bo_2] = "9";
$board[bo_3] = "80";
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_';
 
 
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
 
list($height, $row_cnt, $cut_len) = explode(",", $options);
$all_cnt = 0;
?>
 
<table width="350" cellpadding="0" cellspacing="0" border="0">
 <tr><td colspan="5" height=5></td></tr>
 <tr><td colspan="5" height=5><img src='<?=$latest_skin_path?>/img/t_top.gif' width="350" height="5" border=0></td></tr>
 <tr>
  <td width="35" height="90"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/t_left.gif' width="35" height="90" border=0></a></td>
  <td width="120" align="center">
   <table width="95%">
    <tr>
    <? for ($i=0; $i<1; $i++) {
     if ($i == 0)
     $title = get_text($list[$all_cnt][wr_subject]);
        $content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
     $img = "<img src='$g4[path]/img/noimage.gif' border=0 width='$board[bo_1]' title='이미지 없음'>";
     $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";       
     $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|bmp)$/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 = $board[bo_1]/ $size[0];
         $height = (int)($size[1] * $rate);
          if ($height < $board[bo_2])
         $dst = imagecreatetruecolor($board[bo_1], $height);
          else
         $dst = imagecreatetruecolor($board[bo_1], $board[bo_2]);
          imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
          imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_3]);
          chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
      }
        echo <<<HEREDOC
        <td width='<?=$subject_len?>' valign='top' align='center'>
            <table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
       <tr>
        <td width='<?=$subject_len?>' height='2' align='center'></td>
       </tr>
             <tr>
                 <td width='<?=$subject_len?>' height='<?=$height?>' align='center'>
        <div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$thumb}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a></div></td>
       </tr>
      </table>
        </td>
HEREDOC;
    $all_cnt++;   
    }
    ?>
    </tr>
    <? if (count($list) == 0) { ?>
    <tr>
     <td colspan=2 align='center' height=25>게시물이 없습니다.</td>
    </tr>
    <? } ?>
   </table>
  </td>
  <td width="3"></td>
  <td width="195" align="left">
   <table width="95%" border="0" cellpadding="0" cellspacing="0" style="TABLE-layout:fixed">
   <? for ($i=0; $i<count($list); $i++) { ?>
   <? if ($i==0) { ?>
   <? } else {?>
     <tr>
    <td width="100%" height="20" style="padding-top: 2px;"><img src='<?=$latest_skin_path?>/img/dot.gif' width="5" height="13" border=0> <a href='<?=$list[$i][href]?>'><?=nl2br(cut_str($list[$i][subject],$cut_len,".."))?></a></td>
     </tr>
   <? } ?>
   <? } ?>
     </table>
    </td>
  <td width="10"><img src='<?=$latest_skin_path?>/img/t_right.gif' width="10" height="90" border=0></td>
 </tr>
 <tr><td colspan="5" valign=top><img src='<?=$latest_skin_path?>/img/t_bt.gif' width="350" height="5" border=0></td></tr>
</table>
 
 
위소스를 사용해서 썸네일을 생성했습니다.
 
썸네일 폴더만 틀리구요.
list는 $bo_table/thumb
메인에서 보여지는 latest 는 $bo_table/thumb_ 입니다.
 
board.php의 리스트 썸네일은 정상적으로 생성되는데요
 
이상하게도 thumb_ 밑의 썸네일은 생성됩니다만 0k입니다.
 
thumb_ 폴더와 그밑의 썸네일 파일을 삭제를 하려고해도 삭제가 되질 않구요.
서버를 정지시켜야 삭제가 됩니다.
 
둘다 퍼미션은 777입니다.
 
정말 하루종일 검색하고 이리저리 다 적용을 해봤는데 다 안됩니다.
 
이거 도대체 뭐가 문제일까요?

댓글 전체

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

회원로그인

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