노이미지 나오게 수정좀...부탁해요 정보
노이미지 나오게 수정좀...부탁해요
본문
<?
$g4_path = "../../../";
include_once("$g4_path/common.php");
include_once("$board_skin_path/config.php");
// 파일 출력
$sql = "select * from $g4[board_file_table] where `bo_table`='$bo_table' and `wr_id`='$wr_id'";
$result=mysql_query($sql);
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
?>
<script language="JavaScript">
<!--
function transimg(place) {
if (place==1) dare.src="<?=$img[0]?>";
if (place==2) dare.src="<?=$img[1]?>";
if (place==3) dare.src="<?=$img[2]?>";
if (place==4) dare.src="<?=$img[3]?>";
if (place==5) dare.src="<?=$img[4]?>";
if (place==6) dare.src="<?=$img[5]?>";
if (place==7) dare.src="<?=$img[6]?>";
if (place==8) dare.src="<?=$img[7]?>";
if (place==9) dare.src="<?=$img[8]?>";
if (place==10) dare.src="<?=$img[9]?>";
}
// -->
</script>
<b>[상품 이미지 상세보기]</b>
<table cellpadding="0" cellspacing="0" width="851" height="498">
<tr>
<td width="650" 547">
<table cellpadding="0" cellspacing="0" width="650" height="498">
<tr>
<td width="10" height="10">
</td>
<td width="640" height="10">
</td>
</tr>
<tr>
<td width="10">
<p> </p>
</td>
<td width="640">
<img src="<?=$img[0]?>" width="640" height="480" style='border:1 solid #cccccc;' name=dare>
</td>
</tr>
</table>
</td>
<td width="1"> </td>
<td width="200" height=498 valign=top>
<table cellpadding="0" cellspacing="0" width="200">
<tr>
<td width="9" height="10">
</td>
<td width="191" height="10">
</td>
</tr>
<tr>
<td width="9" height="409">
<p> </p>
</td>
<td width="191" height="409" valign=top>
<table cellpadding="0" cellspacing="0" width="190">
<tr>
<td width="90" height="90"><span style="cursor:hand" onMouseOver="transimg(1)"><img src="<?=$img[0]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
<td width="8" height="90"> </td>
<td width="92" height="90"><span style="cursor:hand" onMouseOver="transimg(2)"><img src="<?=$img[1]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
</tr>
<tr>
<td width="90" height="8"></td>
<td width="8" height="8"></td>
<td width="92" height="8"></td>
</tr>
<tr>
<td width="90" height="90"><span style="cursor:hand" onMouseOver="transimg(3)"><img src="<?=$img[2]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
<td width="8" height="90"> </td>
<td width="92" height="90"><span style="cursor:hand" onMouseOver="transimg(4)"><img src="<?=$img[3]?>" width="90" height="70" style='border:1 solid #cccccc; onerror="this.src=''" >
</span></td>
</tr>
<tr>
<td width="90" height="8"></td>
<td width="8" height="8"></td>
<td width="92" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="850" cellpadding="0" cellspacing="0">
<tr>
<td width="850" valign="middle" align="center" height="30"><a href="javascript:window.close()" onfocus=blur()><img src="<?=$board_skin_path?>/img/close.jpg" border="0"></a></td>
</tr>
</table>
게시판 뷰 페이지에서 첨부이미지 클릭하면 새창으로 이미지 나오는 소스인데요.
노이미지가 설정이 안되서 부탁드립니다....첨부파일에 이미지 1개만 올리면 3개가 엘박으로 나오거든요 무저건4개로 설정이 되어있어요...설정을 올린거만 뜨게해도 좋은데...부탁좀 드립니다.
$g4_path = "../../../";
include_once("$g4_path/common.php");
include_once("$board_skin_path/config.php");
// 파일 출력
$sql = "select * from $g4[board_file_table] where `bo_table`='$bo_table' and `wr_id`='$wr_id'";
$result=mysql_query($sql);
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
?>
<script language="JavaScript">
<!--
function transimg(place) {
if (place==1) dare.src="<?=$img[0]?>";
if (place==2) dare.src="<?=$img[1]?>";
if (place==3) dare.src="<?=$img[2]?>";
if (place==4) dare.src="<?=$img[3]?>";
if (place==5) dare.src="<?=$img[4]?>";
if (place==6) dare.src="<?=$img[5]?>";
if (place==7) dare.src="<?=$img[6]?>";
if (place==8) dare.src="<?=$img[7]?>";
if (place==9) dare.src="<?=$img[8]?>";
if (place==10) dare.src="<?=$img[9]?>";
}
// -->
</script>
<b>[상품 이미지 상세보기]</b>
<table cellpadding="0" cellspacing="0" width="851" height="498">
<tr>
<td width="650" 547">
<table cellpadding="0" cellspacing="0" width="650" height="498">
<tr>
<td width="10" height="10">
</td>
<td width="640" height="10">
</td>
</tr>
<tr>
<td width="10">
<p> </p>
</td>
<td width="640">
<img src="<?=$img[0]?>" width="640" height="480" style='border:1 solid #cccccc;' name=dare>
</td>
</tr>
</table>
</td>
<td width="1"> </td>
<td width="200" height=498 valign=top>
<table cellpadding="0" cellspacing="0" width="200">
<tr>
<td width="9" height="10">
</td>
<td width="191" height="10">
</td>
</tr>
<tr>
<td width="9" height="409">
<p> </p>
</td>
<td width="191" height="409" valign=top>
<table cellpadding="0" cellspacing="0" width="190">
<tr>
<td width="90" height="90"><span style="cursor:hand" onMouseOver="transimg(1)"><img src="<?=$img[0]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
<td width="8" height="90"> </td>
<td width="92" height="90"><span style="cursor:hand" onMouseOver="transimg(2)"><img src="<?=$img[1]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
</tr>
<tr>
<td width="90" height="8"></td>
<td width="8" height="8"></td>
<td width="92" height="8"></td>
</tr>
<tr>
<td width="90" height="90"><span style="cursor:hand" onMouseOver="transimg(3)"><img src="<?=$img[2]?>" width="90" height="70" style='border:1 solid #cccccc;'></span></td>
<td width="8" height="90"> </td>
<td width="92" height="90"><span style="cursor:hand" onMouseOver="transimg(4)"><img src="<?=$img[3]?>" width="90" height="70" style='border:1 solid #cccccc; onerror="this.src=''" >
</span></td>
</tr>
<tr>
<td width="90" height="8"></td>
<td width="8" height="8"></td>
<td width="92" height="8"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="850" cellpadding="0" cellspacing="0">
<tr>
<td width="850" valign="middle" align="center" height="30"><a href="javascript:window.close()" onfocus=blur()><img src="<?=$board_skin_path?>/img/close.jpg" border="0"></a></td>
</tr>
</table>
게시판 뷰 페이지에서 첨부이미지 클릭하면 새창으로 이미지 나오는 소스인데요.
노이미지가 설정이 안되서 부탁드립니다....첨부파일에 이미지 1개만 올리면 3개가 엘박으로 나오거든요 무저건4개로 설정이 되어있어요...설정을 올린거만 뜨게해도 좋은데...부탁좀 드립니다.
댓글 전체
function transimg(place) {
// 추가
if (!place) dare.src="노이미지주소";
if (place==1) dare.src="<?=$img[0]?>";
if (place==2) dare.src="<?=$img[1]?>";
if (place==3) dare.src="<?=$img[2]?>";
if (place==4) dare.src="<?=$img[3]?>";
if (place==5) dare.src="<?=$img[4]?>";
if (place==6) dare.src="<?=$img[5]?>";
if (place==7) dare.src="<?=$img[6]?>";
if (place==8) dare.src="<?=$img[7]?>";
if (place==9) dare.src="<?=$img[8]?>";
if (place==10) dare.src="<?=$img[9]?>";
}
// 추가
if (!place) dare.src="노이미지주소";
if (place==1) dare.src="<?=$img[0]?>";
if (place==2) dare.src="<?=$img[1]?>";
if (place==3) dare.src="<?=$img[2]?>";
if (place==4) dare.src="<?=$img[3]?>";
if (place==5) dare.src="<?=$img[4]?>";
if (place==6) dare.src="<?=$img[5]?>";
if (place==7) dare.src="<?=$img[6]?>";
if (place==8) dare.src="<?=$img[7]?>";
if (place==9) dare.src="<?=$img[8]?>";
if (place==10) dare.src="<?=$img[9]?>";
}

// 추가
if (!place) dare.src="<img src='$board_skin_path/img/noimage.gif' align=absmiddle>";
이렇게 했는데 안되네여...
어떻게 해야될까요.
if (!place) dare.src="<img src='$board_skin_path/img/noimage.gif' align=absmiddle>";
이렇게 했는데 안되네여...
어떻게 해야될까요.
죄송합니다^^; 저때문에 쪽지보내셔서 포인트나 까먹게 만들고 ㅠㅠㅠ
(1) 번의 항목위치에 (2)와 같이 추가해줍니다^^;;
(1) 원본
------------------------------------------------------
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
(2) 변경
------------------------------------------------------
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]=($row[bf_file])?"$g4[path]/data/file/$bo_table/$row[bf_file]":"노이미지주소만";
}
제가 짐작해서 해드리는거라 번거로우시더라도 정상작동되는지 확인하시어서 답글달아주세요 ㅎㅎ
(1) 번의 항목위치에 (2)와 같이 추가해줍니다^^;;
(1) 원본
------------------------------------------------------
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
(2) 변경
------------------------------------------------------
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]=($row[bf_file])?"$g4[path]/data/file/$bo_table/$row[bf_file]":"노이미지주소만";
}
제가 짐작해서 해드리는거라 번거로우시더라도 정상작동되는지 확인하시어서 답글달아주세요 ㅎㅎ

안되네요.ㅎㅎ
으음... 혹시 누가 안되신다면, 원격으로 봐드릴까요^^;;

주소는 이런식으로 했어요...
http://sir.co.kr/skin/board/ggaggungisik/img/btn_choice.gif
http://sir.co.kr/skin/board/ggaggungisik/img/btn_choice.gif

이미지 출력부분에 if 문으로 감싸서 없다면 noimg 출력을 유도하면될것 같네요

for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
for(; $i<4; $i++)
$img[ $i]= '노이미지 경로';
$img[$i]="$g4[path]/data/file/$bo_table/$row[bf_file]";
}
for(; $i<4; $i++)
$img[ $i]= '노이미지 경로';
익스만을 고려한다면 onError를 사용해서도 가능합니다.

답변 정말 고맙습니다~~
엔피씨님이 수정해 주셔서 해결하였습니다. 고맙습니다.
엔피씨님이 수정해 주셔서 해결하였습니다. 고맙습니다.