최신글스킨에 썸네일이 안나오는데요.. 정보
최신글스킨에 썸네일이 안나오는데요..본문
오류 주소는 http://www.clinicinfo.co.kr/index_test.html 입니당
썸네일이 안뜨는데 어떻게 해야 할까요...
밑에 소스는 latest.skin.php 입니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
// 썸네일 설정
$thumb_width = "100"; // 썸네일 가로
$thumb_height = "85"; // 썸네일 세로
$thumb_quality = "100"; // 썸네일 퀼리티
$thumb_content = "180"; // 내용길이
for ($i=0; $i<count($list); $i++) {
// 썸네일 경로
$data_path = $g4[path]."/data/file/{$bo_table}";
$thumb_path = $data_path.'/thumb_'.$thumb_width.'x'.$thumb_height;
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $list[$i][file][0][file]; // 파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
chmod($thumb_path.'/'.$filename, 0707);
}
}
// 썸네일 파일명 체크
if (file_exists($thumb) && $filename) {
$img = "{$thumb}";
} else {
$img = "";
}
// 링크
$href = "{$g4[path]}/bbs/board.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}";
// 제목
$subject = strip_tags($list[$i]['wr_subject']);
// 코드
if ($i == '0') {
$code = "'{$href}','{$img}','".conv_subject($subject,30,'..')."'";
} else {
$code = ",'{$href}','1','".conv_subject($subject,46,'..')."'";
}
// 이미지
if ($img) {
echo $code;
} else {
echo $code;
}
}
?>
썸네일이 안뜨는데 어떻게 해야 할까요...
밑에 소스는 latest.skin.php 입니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
// 썸네일 설정
$thumb_width = "100"; // 썸네일 가로
$thumb_height = "85"; // 썸네일 세로
$thumb_quality = "100"; // 썸네일 퀼리티
$thumb_content = "180"; // 내용길이
for ($i=0; $i<count($list); $i++) {
// 썸네일 경로
$data_path = $g4[path]."/data/file/{$bo_table}";
$thumb_path = $data_path.'/thumb_'.$thumb_width.'x'.$thumb_height;
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $list[$i][file][0][file]; // 파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
chmod($thumb_path.'/'.$filename, 0707);
}
}
// 썸네일 파일명 체크
if (file_exists($thumb) && $filename) {
$img = "{$thumb}";
} else {
$img = "";
}
// 링크
$href = "{$g4[path]}/bbs/board.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}";
// 제목
$subject = strip_tags($list[$i]['wr_subject']);
// 코드
if ($i == '0') {
$code = "'{$href}','{$img}','".conv_subject($subject,30,'..')."'";
} else {
$code = ",'{$href}','1','".conv_subject($subject,46,'..')."'";
}
// 이미지
if ($img) {
echo $code;
} else {
echo $code;
}
}
?>
댓글 전체

이미지첨부가 아니라 그대로 긁어오신거라서 안나오는게 아닐까요?ㅋ
아래 스킨 한번 써보심이~~;; 고산인님 스킨입니다.
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=70055
==============================================
1. 내용중에 링크 주소가 있으면 링크주소 없으면 본문페이지도 연결한다.
2. 어디선가 html 을 퍼왔다면 그 내용중에 이미지 주소를 찾아서 그림을 출력한다.
3. 그림도 없다면 첫번째 글자를 2배크게 해서 출력한다...
아래 스킨 한번 써보심이~~;; 고산인님 스킨입니다.
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=70055
==============================================
1. 내용중에 링크 주소가 있으면 링크주소 없으면 본문페이지도 연결한다.
2. 어디선가 html 을 퍼왔다면 그 내용중에 이미지 주소를 찾아서 그림을 출력한다.
3. 그림도 없다면 첫번째 글자를 2배크게 해서 출력한다...
글을 퍼왔지만 이미지는 다시 저장해서 올린거라... 그건 아닌듯 합니다용..;;;

썸네일 이미지가 생기지 않은 듯하니다.
실제 경로가서 있는지 확인해 보시고
gd 버젼도 확이해 보세요.
실제 경로가서 있는지 확인해 보시고
gd 버젼도 확이해 보세요.
네 답변 주셔서 감사합니다.
요것이 첨부파일만 썸네일로 불러오네요..$list[$i][file][0][file] 요거 -ㅁ-;;
eregi("<img [^<>]*>", $list[$i]['wr_content'], $regs)
요거 써서 해결 봤습니다..
그럼 좋은 하루 되세용
요것이 첨부파일만 썸네일로 불러오네요..$list[$i][file][0][file] 요거 -ㅁ-;;
eregi("<img [^<>]*>", $list[$i]['wr_content'], $regs)
요거 써서 해결 봤습니다..
그럼 좋은 하루 되세용