썸네일이 없을 경우 노이미지 좀 나오게 부탁드려요 정보
썸네일이 없을 경우 노이미지 좀 나오게 부탁드려요본문
안녕하세요.
최근글에 썸네일이 없을경우 노이미지가 나오게 하고 싶은데..
프로그램을 몰라서 쩔쩔 매고 있습니다.
썸네일이 없을 경우 노이미지 좀 나오게 부탁드려요
$no_img = $latest_skin_path."/img/no_image.jpg";
위처럼 ...저런부분을 추가해서 넣고 싶어요
────────────────────────────────────────────────
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $file) && file_exists($file)) {
$thumb = thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "", $filter, $noimg); //첨부파일 언샾마스크추가
} else { //에디터에서 삽입한 이미지
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor
$file = $g4[path].'/' . $tmp[0]; // 파일명
$thumb=thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "", $filter, $noimg); //언샾마스크추가
}
}
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {
echo "<a href='{$list[$i]['href']}'>";
echo "<img src='$thumb' border='0' align='absmiddle'>";
echo "</a>";
}
?>
────────────────────────────────────────────────
최근글에 썸네일이 없을경우 노이미지가 나오게 하고 싶은데..
프로그램을 몰라서 쩔쩔 매고 있습니다.
썸네일이 없을 경우 노이미지 좀 나오게 부탁드려요
$no_img = $latest_skin_path."/img/no_image.jpg";
위처럼 ...저런부분을 추가해서 넣고 싶어요
────────────────────────────────────────────────
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $file) && file_exists($file)) {
$thumb = thumbnail($file, $img_width, $img_height, 0, 1, 90, 0, "", $filter, $noimg); //첨부파일 언샾마스크추가
} else { //에디터에서 삽입한 이미지
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor
$file = $g4[path].'/' . $tmp[0]; // 파일명
$thumb=thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "", $filter, $noimg); //언샾마스크추가
}
}
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {
echo "<a href='{$list[$i]['href']}'>";
echo "<img src='$thumb' border='0' align='absmiddle'>";
echo "</a>";
}
?>
────────────────────────────────────────────────
댓글 전체
추가
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$no_img = $latest_skin_path."/img/no_img.gif";
?>
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {
echo "<a href='{$list[$i]['href']}'>";
echo "<img src='$thumb' border='0' align='absmiddle'>";
echo "</a>";
}
노 이미지 부분 추가
else if (!file_exists($list[$i][file_image0])){ // no img
echo "<a href='{$list[$i]['href']}'><img src='$no_img' border='0' align='absmiddle'></a>";
}
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$no_img = $latest_skin_path."/img/no_img.gif";
?>
if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {
echo "<a href='{$list[$i]['href']}'>";
echo "<img src='$thumb' border='0' align='absmiddle'>";
echo "</a>";
}
노 이미지 부분 추가
else if (!file_exists($list[$i][file_image0])){ // no img
echo "<a href='{$list[$i]['href']}'><img src='$no_img' border='0' align='absmiddle'></a>";
}
알려주셔서 너무 감사드립니다 ^^//