최신글 노이미지 정보
최신글 노이미지본문
최신글스킨입니다.
게시물에 그림이 없을 때 엑박으로 나옵니다.
그런데
이미지 없을 때 단순히 제목과 내용만 나오는게 아니라
디폴트 이미지(noimg.gif)가 나오게 하려면 어떻게 수정해야하나요
알려주세요~
--------------------------------------------------------------------------------------------
<latest.skin.php>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\"><img src='$img' width='$img_w' height='$img_h' border='0'></a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
게시물에 그림이 없을 때 엑박으로 나옵니다.
그런데
이미지 없을 때 단순히 제목과 내용만 나오는게 아니라
디폴트 이미지(noimg.gif)가 나오게 하려면 어떻게 수정해야하나요
알려주세요~
--------------------------------------------------------------------------------------------
<latest.skin.php>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\"><img src='$img' width='$img_w' height='$img_h' border='0'></a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
댓글 전체
최신글스킨 img 폴더에 noimage.gif 추가하고
아래소스 덮어쓰세요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img = "<img src='$latest_skin_path/img/noimage.gif' border=0 width='$img_w' height='$img_h' title='이미지 없음'>"; //노이미지추가
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = "<img src='$thumb' border=0 width='$img_w' height='$img_h'>";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">$img</a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
아래소스 덮어쓰세요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img = "<img src='$latest_skin_path/img/noimage.gif' border=0 width='$img_w' height='$img_h' title='이미지 없음'>"; //노이미지추가
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = "<img src='$thumb' border=0 width='$img_w' height='$img_h'>";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">$img</a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
바야야님 고맙습니다
근데 이미지가 있는 최신글도 노이미지로 뜨네요...
---------------------------------------------------------------------------------------------------------
그리고 어떤 게시글에서 아래처럼 하라고 써 있어서 해봤더니
이미지가 떠야 할 자리에 이미지의 경로가 링크걸린상태로 뜹니다.
---------------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
//$img = "<img src='$latest_skin_path/img/noimg.gif' width='$img_w' height='$img_h' border='0'>"; //섬네일이 없을경우 노이미지출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "$latest_skin_path/img/noimg.gif";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all;line-height:11pt;'>$wr_content</td></tr></table></td></tr></table></td>";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">$img</a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
-------------------------------------------------------------------------------------------------------
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "$latest_skin_path/img/noimg.gif";
그래서 위 부분을 다시 아래처럼 고쳤더니 모든 이미지가 노이미지로만 보여요
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "<img src='$latest_skin_path/img/noimg.gif' width='$img_w' height='$img_h' border='0'>";
근데 이미지가 있는 최신글도 노이미지로 뜨네요...
---------------------------------------------------------------------------------------------------------
그리고 어떤 게시글에서 아래처럼 하라고 써 있어서 해봤더니
이미지가 떠야 할 자리에 이미지의 경로가 링크걸린상태로 뜹니다.
---------------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
//$img = "<img src='$latest_skin_path/img/noimg.gif' width='$img_w' height='$img_h' border='0'>"; //섬네일이 없을경우 노이미지출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "$latest_skin_path/img/noimg.gif";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all;line-height:11pt;'>$wr_content</td></tr></table></td></tr></table></td>";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">$img</a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
-------------------------------------------------------------------------------------------------------
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "$latest_skin_path/img/noimg.gif";
그래서 위 부분을 다시 아래처럼 고쳤더니 모든 이미지가 노이미지로만 보여요
if ( file_exists($thumb) )
$img = $thumb;
else
$img = "<img src='$latest_skin_path/img/noimg.gif' width='$img_w' height='$img_h' border='0'>";
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\"><img src='$img' border=0 width='$img_w' height='$img_h'></a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//my_latest.php파일 extend 에 올림 - 내용의 문장을 이어서 자르기(html 태그제거됨)
// 이미지 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
//224
$img_table = '372';
$td_w1 = '110'; //이미지있는 셀 폭
$td_w2 = '$img_table-$td_w1';
$bg_col = '#Ffffff'; //셀 칼라
$img_w = '130'; // 이미지 가로 세로 사이즈
$img_h = '100';
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width='372' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='8' height='8'><img src='<?=$latest_skin_path?>/img/box_01.gif' width='8' height='8' border='0'></td>
<td width='356' background='<?=$latest_skin_path?>/img/box_02.gif'></td>
<td width='8'><img src='<?=$latest_skin_path?>/img/box_03.gif' width='8' height='8' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/box_04.gif'></td>
<td width='356' align='center' valign='top' bgcolor='#FFFFFF'>
<table width="<?=$img_table?>" border="0" cellspacing="0" cellpadding="3">
<?
for ($i=0; $i<count($list); $i++) {
?>
<tr>
<td height='4' colspan='2'></td></tr>
<?
$image = $list[$i][file][0][file];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
$style_a = "font-family:돋움; font-size:9pt; color:#999999;";
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],25)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
$wr_content = "<span $style_a>".Shorten_String(strip_tags($list[$i][wr_content]), 120, ' ...')."</span>";//내용을 이어서 자르기
$wr_1="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_1]),25,"...")."</span>";
$wr_2="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_2]),25,"...")."</span>";
$wr_3="<span $style_a>".Shorten_String(strip_tags($list[$i][wr_3]),25,"...")."</span>";
echo "<tr><td width='$td_w2' bgcolor='{$bg_col}'>";
echo "<table width='100%' cellpadding=0 cellspacing=0 border=0>";
// 제목
echo "<tr><td style='padding-top:3px;'><b><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></b></td></tr>";
echo "<tr><td><br>{$list[$i][ca_name]}</td></tr><tr><td height=1 bgcolor=#eeeeee></td></tr><tr><td style='padding-top:3px;'><table width=' width='$td_w2'' cellpadding=3 cellspacing=0 border=0><tr><td style='word-break:break-all; line-height: 11pt;'>$wr_content</td></tr></table></td></tr></table></td>
";
//사진
echo "<td width='$td_w1' bgcolor='{$bg_col}'>";
echo "<table cellpadding=2 cellspacing=1 border=0 ><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\"><img src='$img' border=0 width='$img_w' height='$img_h'></a></td></tr></table></td></tr>";
// 날 짜 echo "<tr><td><span style='font-size:8pt; color:#999999;'>{$list[$i][datetime]}</td></tr>";
?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table></td>
<td background='<?=$latest_skin_path?>/img/box_06.gif'></td>
</tr>
<tr>
<td height='8'><img src='<?=$latest_skin_path?>/img/box_07.gif' width='8' height='8' border='0'></td>
<td background='<?=$latest_skin_path?>/img/box_08.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/box_09.gif' width='8' height='8' border='0'></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
추가
현재 사용하는 게시판에서는 썸네일 생성이 안되고있습니다.
따라서 최신글에서 원본을 불러오도록 했습니다.
최신글에서 썸네일 생성을 하시려면 다음스킨을 참고하세요.
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=8336&sca=&sfl=mb_id%2C1&stx=bada&sop=and
현재 사용하는 게시판에서는 썸네일 생성이 안되고있습니다.
따라서 최신글에서 원본을 불러오도록 했습니다.
최신글에서 썸네일 생성을 하시려면 다음스킨을 참고하세요.
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=8336&sca=&sfl=mb_id%2C1&stx=bada&sop=and
바야야님 너무 고맙습니다.^^
제대로 보이네요
제대로 보이네요
찾아해맷었는데!!! ㅠㅠㅠ
$image = $list[$i][file][0][file]; 이부분을
$image = $list[$i][file][0][file];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
이렇게 바꾸니까 되네요!! 감사해요!!
$image = $list[$i][file][0][file]; 이부분을
$image = $list[$i][file][0][file];
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file])
$img = "$latest_skin_path/img/noimage.gif";
이렇게 바꾸니까 되네요!! 감사해요!!