최근 갤러리에서 엑박 방지법은?

토탈나라님의 멋진 갤러리 최근게시물 스킨을 적용했습니다
근데 그림을 직접 올리지 않고 링크를 거신 몇몇 분이 계셔서 흉하게 엑박이 뜨네요..
이미지가 없을 때 대신 보여주는 그림파일 적용법을 알고 싶습니다.
다음은 latest.skin.php입니다


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<style type="text/css">
<!--
.style1 {
color: #000000;
font-weight: bold;
}
-->
</style>


<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='5' height='5'><img src='<?=$latest_skin_path?

>/img/1.gif' width='5' height='5' border='0'></td>
<td background='<?=$latest_skin_path?>/img/2.gif'></td>
<td width='5'><img src='<?=$latest_skin_path?>/img/3.gif'

width='5' height='5' border='0'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/4.gif'></td>
<td align='center' valign='top' bgcolor='#FFFFFF'><table

width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0"

cellpadding="0">
<tr>
<td>  <font color="#003366"><strong>
<?=$board[bo_subject]?>
</strong></font></td>
<td><div align="right"><a href='<?=$g4[bbs_path]?

>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?

>/img/more.gif" width="32" height="9" border="0"></a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" bgcolor="#2d8cda"></td>
</tr>
<tr>
<td height="2"></td>
</tr>
<tr>
<td><div align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<? for($i=0; $i<count($list); $i++) {$m++;?>
<td width="65" valign="top"><div align="center">
<table width="55" border="0" cellspacing="0">
<tr>
<td><div align="center">
<?
$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:8pt; color:#999999;";

$style = "font-family:돋움; font-size:8pt; color:#636363;";
?>

<!--이미지 가로와 세로의 크기를 정해주세요 -->
<? echo "<a href='{$list[$i][href]}' onfocus='this.blur()'><img

src='$img' width='80' height='80' border='0'></a>"; ?>
<!--사이즈 width='80' 과 height='80'이 기본설정입니다. 자신에 맞게 수

정하세요 --> </div></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</div></td>
<!--가로이미지 숫자를 정해주세요 -->
<? if ($m%7==0){ ?>
<!--가로이미지 숫자와 최신게시물을 부를때 갯수와는 다릅니다. -->
</tr>
<tr>
<?}?>
<? } ?>
<? if (count($list) == 0) { echo "<td height=30

align=center>no image.</td>"; } ?>
</tr>
</table>
</div></td>
</tr>
</table></td>
<td background='<?=$latest_skin_path?>/img/5.gif'></td>
</tr>
<tr>
<td height='5'><img src='<?=$latest_skin_path?>/img/6.gif'

width='5' height='5' border='0'></td>
<td background='<?=$latest_skin_path?>/img/7.gif'></td>
<td><img src='<?=$latest_skin_path?>/img/8.gif' width='5'

height='5' border='0'></td>
</tr>
</table>
|

댓글 7개

date 폴더에 게시판아이디 폴더 thumb 폴더가 있는지 확인하시구요 없으면 만들어주세요 그리고 권한설정하시구요 707로 그러시면 됩니다.
무슨말인지 전혀 모르겠어요. ㅠㅠ
두가지 방법을 제시해 드릴께요.

첫번째는 이미지 파일이 없는지 체크해서 없으면 대신 쓸 이미지 경로를 적어주면 되구요. 예로 $img= $thurmb; 다음 줄에 if (!file_exists($img)) { $img="<!--원하는 이미지 경로를 넣어주세요-->"}를 적어줍니다.

여기 '<!--원하는 이미지 경로를 넣어주세요-->'문구에다 원하는 이미지 경로를 적어야 합니다. 그대로 쓰면 안되구요...

두번째로는 의심스런 이미지 img 태그안에 onerror="this.src='<!--원하는 이미지 경로를 넣어주세요-->'"를 넣도록 소스를 수정해 보세요.

예를 들면 위에서 <img src='$img' width='80' height='80' border='0'>를 <img src='$img' width='80' height='80' border='0' onerror=\"this.src='<!--원하는 이미지의 경로-->'\" />로 하면 되지 않을까 싶네요.

둘중 하나를 하시면 될 것 같네요.
두가지 다 안되네요. 첫번째 방법은 에러 메시지가 뜨고요.. 두번째 방법은 변화가 없습니다..
스킨 게시판을 보시면 이미지 없을때 noimage.gif 가 뜨도록 제작된 것이 있습니다.
참고> http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=75593
적용하기가 힘들 것 같군요;;;
답변 주신 분들께 감사드립니다^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 800
17년 전 조회 814
17년 전 조회 970
17년 전 조회 971
17년 전 조회 823
17년 전 조회 1,217
17년 전 조회 758
17년 전 조회 845
17년 전 조회 1,994
17년 전 조회 1,541
17년 전 조회 1,339
17년 전 조회 865
17년 전 조회 711
17년 전 조회 698
17년 전 조회 710
17년 전 조회 860
17년 전 조회 808
17년 전 조회 747
17년 전 조회 782
17년 전 조회 957