테스트 사이트 - 개발 중인 베타 버전입니다

첨부파일이 없으면 이미지 안나오고 내용만 나오게 가능한가요..?? 채택완료

비움과채움 11년 전 조회 4,109

 ";         $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                     break;                 $rate = $img_width / $size[0];                 $height = (int)($size[1] * $rate);

                // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면                 if ($height < $img_height)                 // 계산된 이미지 높이로 복사본 이미지 생성                     $dst = imagecreatetruecolor($img_width, $height);                 else                 // 설정된 이미지 높이로 복사본 이미지 생성                     $dst = imagecreatetruecolor($img_width, $img_height);                 imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);                 imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);                 chmod($thumb_path.'/'.$list[$i][wr_id], 0606);             }         }

        if (file_exists($thumb))             $img = "";       else             if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))             { $img = ""; }  ?> ​

 

위 소스 에서 첨부를 하지 않으면 내용만 리스트에 뿌려주고 첨부파일이 있으면 이미지나오고 리스트에 내용나오게 가능한가요..??

 

아시분 있으면 알려주세요....정말 모르겠네요...ㅜㅜ

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

그누보드는 기본적으로 첨부 이미지가 없으면, 내용만 나오게 되어 있습니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인