view.php에서 이미지가 없으면 noimg로 뜨게 하는방법좀 부탁드립니다. 채택완료
view.php에서 이미지가 없으면 noimg로 뜨게 하는방법좀 부탁드립니다.
아래가 소스입니다. 오른쪽에 작은이미지를 클릭하면 큰이미지에 출력되는건데~
만약에 이미지가 없다면 noimg로 출력되고싶습니다.

이건 노이미지 입니다.
// 파일 출력
$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++){
if($i > 0){
$style= "style=\"display:none\"";
}
echo "
";
//echo nl2br($view[file][$i][content]); // 파일내용 보이게 ,엔터키
$thumimg[$i]="
";
}
?>
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
11년 전
skin/board/gallery/view.skin.php 로 설명드리자면
그러닌까 그누보드5를 받았을 때 따끈 따끈한 gallery스킨으로 설명드려 보죠.
gallery폴더 내에 view.skin.php 파일을 열고 위 처럼 수정한다는 겁니다.
라인이 잘못되었네요.
134,135,136라인입니다. (전혀 수정되지 않은 갤러리스킨)
그리고 이미지가 없을 때 보여 줄 예를 들어 noimage.gif 같은 파일을 img 폴더에 넣었다고 했을 때
</div>
<div><div>// 파일 출력</div>
<div> $v_img_count = count($view['file']);</div>
<div> if($v_img_count) { </div></div>
<div>
이 코드를 아래 처럼 그대로 수정하시라는 말입니다.
</div>
<div><pre style="line-height: normal">// 파일 출력
$v_img_count = count($view['file']);
if(!$v_img_count) { echo "<img src='{$board_skin_url}/img/noimage.gif' />"; }
else{</pre><pre style="line-height: normal">
그대로 바꿔 ftp를 이용해 서버에 올리면 됍니다.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
퇴근후밥상
11년 전
댓글을 작성하려면 로그인이 필요합니다.
11년 전
view.skin.php의 122~123라인
</div>
<div><div>// 파일 출력</div>
<div> $v_img_count = count($view['file']);</div>
<div> if($v_img_count) {</div></div>
<div>
이것을 아래 처럼
</div>
<div><div>// 파일 출력</div>
<div> $v_img_count = count($view['file']);</div>
<div> if(!$v_img_count) { echo "<img src='./img/noimg.jpg' />"; }</div></div>
<div> else{</div>
<div>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
퇴근후밥상
11년 전
소스가 없던데 // 위에있는 부분이 어디에 있는건가요?~~
초보라서 ㅠㅠ 응용하는게 ..ㄷㄷ
<?
// 파일 출력
$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++){
if($i > 0){
$style= "style=\"display:none\"";
}
echo "<img src =$g4[path]/data/file/$bo_table/$row[bf_file] max-width=100
height=325 border=0 id=img$i $style>";
//echo nl2br($view[file][$i][content]); // 파일내용 보이게 ,엔터키
$thumimg[$i]="<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=60 height=40 border=0 id=ThumbImage$i onfocus=\"javascript:ThumbViewer(this)\" onmouseover=\"javascript:ThumbViewer(this)\">";
}
?>
초보라서 ㅠㅠ 응용하는게 ..ㄷㄷ
<?
// 파일 출력
$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++){
if($i > 0){
$style= "style=\"display:none\"";
}
echo "<img src =$g4[path]/data/file/$bo_table/$row[bf_file] max-width=100
height=325 border=0 id=img$i $style>";
//echo nl2br($view[file][$i][content]); // 파일내용 보이게 ,엔터키
$thumimg[$i]="<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=60 height=40 border=0 id=ThumbImage$i onfocus=\"javascript:ThumbViewer(this)\" onmouseover=\"javascript:ThumbViewer(this)\">";
}
?>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
채택
답변대기
답변대기
답변대기
답변대기
채택
채택
답변대기
답변대기
답변대기
채택
else if (ThumbImage4 == ImageObj){
img0.style.display = "none";
img1.style.display = "none";
img2.style.display = "none";
img3.style.display = "none";
img4.style.display = "";
img5.style.display = "none";
img6.style.display = "none";
img7.style.display = "none";
img8.style.display = "none";
img9.style.display = "none";
//ImageResizing(img4);
}
else if (ThumbImage5 == ImageObj){
img0.style.display = "none";
img1.style.display = "none";
img2.style.display = "none";
img3.style.display = "none";
.
.
.
이런식의 소스가 들어가있구요~
이미지부분은 이러한데 위에것을 요기에 어떻게 응용해야할지를 모르겠습니다.ㅠㅠ
<?
// 파일 출력
$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++){
if($i > 0){
$style= "style=\"display:none\"";
}
echo "<img src =$g4[path]/data/file/$bo_table/$row[bf_file] max-width=100
height=325 border=0 id=img$i $style>";
//echo nl2br($view[file][$i][content]); // 파일내용 보이게 ,엔터키
$thumimg[$i]="<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=60 height=40 border=0 id=ThumbImage$i onfocus=\"javascript:ThumbViewer(this)\" onmouseover=\"javascript:ThumbViewer(this)\">";
}
?>