리스트 페이지 '노이미지' 표시에 관한 질문입니다. 정보
리스트 페이지 '노이미지' 표시에 관한 질문입니다.본문
우선 멋진 스킨 올려주신 유아원님께 감사드립니다.
제가 유아원님의 농원 제품소개 게시판을 설치했는데요.. 리스트페이지에서
이미지가 없을때 'No image'도 안뜨고 엑박도 전혀 안뜹니다.
그리고 원래 이미지 뜰 테이블도 좌측으로 완전히 밀려납니다.
몇시간동안 이래저래 해봐도 안되네요^^;
list_skin.php 부분입니다. 어느부분이 잘못된건지 모르겠네요..
조언 부탁드리겠습니다. (__)
<? for ($i=0; $i<count($list); $i++) {
if ($L_Type == '1') {
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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;
if ($L_Type == '1') {
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (!is_dir($thumb))
$img = "<img src='$thumb' border=0>";
$img = "<img src='$thumb' border=0>";
$subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
}
else if ($L_Type == '2') {
if ($i && $i%$mod==0)
echo "</tr><tr>";
}
else if ($L_Type == '2') {
if ($i && $i%$mod==0)
echo "</tr><tr>";
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>";
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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;
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (!is_dir($thumb))
$img = "<img src='$thumb' border=0>";
$img = "<img src='$thumb' border=0>";
$subject = "<span $style>".cut_str($list[$i][subject],$L_Type_2_S)."</span>";
} else {
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>?;
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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;
} else {
$img = "<img src='$board_skin_path/img/no_img.gif' border=0 title='이미지 없음'>?;
$filename = $list[$i]['file'][0]['file'];
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!is_dir($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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
$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.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (!is_dir($thumb))
$img = "<img src='$thumb' border=0>";
$subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
}
$style = "";
if ($list[$i][icon_new])
$style = ""; // 읽지 않은 글?? style='font-weight:bold;' 추가
$img = "<img src='$thumb' border=0>";
$subject = "<span $style>".cut_str($list[$i][subject],1000)."</span>";
}
$style = "";
if ($list[$i][icon_new])
$style = ""; // 읽지 않은 글?? style='font-weight:bold;' 추가
$wr_content = "<span $style>".cut_str(get_text($list[$i][wr_content]),$list_content)."</span>";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <span class='L_comment_cnt'>{$list[$i][comment_cnt]}</span>";
if ($list[$i][comment_cnt])
$comment_cnt = " <span class='L_comment_cnt'>{$list[$i][comment_cnt]}</span>";
$cehckbox = "";
if ($is_checkbox)
$cehckbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
if ($is_checkbox)
$cehckbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
$category = "";
if ($is_category)
$category = "<span class=L_line>┃</span><span class=L_category>{$list[$i][ca_name]}</span>";
?>
if ($is_category)
$category = "<span class=L_line>┃</span><span class=L_category>{$list[$i][ca_name]}</span>";
?>
댓글 전체
위 코드에는 없고요.
아래처럼 된 부분이 있어요. 잘 찾아서 제거? 해주세요.
<? if (file_exists($thumb)) { ?>
이미지 테이블~~~~~
<? } ?>
아래처럼 된 부분이 있어요. 잘 찾아서 제거? 해주세요.
<? if (file_exists($thumb)) { ?>
이미지 테이블~~~~~
<? } ?>
그 부분을 삭제하니 엑박이 보이더라구요..
그래도.. no image파일이 안떠서 원본파일을 다시 덮어쓰고
앙마님께서 조언해주신 그 부분을 수정하니 뜨더군요
아마도 제가 수정작업하면서 먼가 잘못 건드린듯해요 ㅎㅎ;
아무튼 감사드립니다.
--------------------------------------------------------------------------------------------------------------------------------------------------
혹시 유아원님 보신다면 아래 소스에서 노이미지 띄우는것좀 도와주세요..
검색해보니 유아원님은 해결하신듯한데.. 부탁드립니다. (__)
<?
// 파일 출력
for ($i=0; $i < 1; $i++) {
//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbView';
$view_w = 250; //썸네일 가로사이즈
$view_h = 180; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $view[file][$i][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 = $view_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $view_h)
$dst = imagecreatetruecolor($view_w, $height);
else
$dst = imagecreatetruecolor($view_w, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
echo "<img src='$thumb' style='border:1px solid #E2E2E2;'>";
}
}
?>
그래도.. no image파일이 안떠서 원본파일을 다시 덮어쓰고
앙마님께서 조언해주신 그 부분을 수정하니 뜨더군요
아마도 제가 수정작업하면서 먼가 잘못 건드린듯해요 ㅎㅎ;
아무튼 감사드립니다.
--------------------------------------------------------------------------------------------------------------------------------------------------
혹시 유아원님 보신다면 아래 소스에서 노이미지 띄우는것좀 도와주세요..
검색해보니 유아원님은 해결하신듯한데.. 부탁드립니다. (__)
<?
// 파일 출력
for ($i=0; $i < 1; $i++) {
//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbView';
$view_w = 250; //썸네일 가로사이즈
$view_h = 180; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $view[file][$i][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 = $view_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $view_h)
$dst = imagecreatetruecolor($view_w, $height);
else
$dst = imagecreatetruecolor($view_w, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
echo "<img src='$thumb' style='border:1px solid #E2E2E2;'>";
}
}
?>
// if (file_exists($thumb) && $filename) {
echo "<img src='$thumb' style='border:1px solid #E2E2E2;'>";
//}
echo "<img src='$thumb' style='border:1px solid #E2E2E2;'>";
//}
엑박만 뜨네요.. ㅠ_ㅠ
no_image 가 선언이 되지 않았기 때문에 당연한 결과 입니다.
그냥 blank이미지 넣어서 하시면...