미채택 완료
view.php에서 이미지가 없으면 noimg로 뜨게 하는방법좀 부탁드립니다.
view.php에서 이미지가 없으면 noimg로 뜨게 하는방법좀 부탁드립니다.
아래가 소스입니다. 오른쪽에 작은이미지를 클릭하면 큰이미지에 출력되는건데~
만약에 이미지가 없다면 noimg로 출력되고싶습니다.
<img src='$board_skin_path/img/noimage.png'>
이건 노이미지 입니다.
<?
// 파일 출력
$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] width=400 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=70 height=60 border=0 id=ThumbImage$i onfocus=\"javascript:ThumbViewer(this)\" onmouseover=\"javascript:ThumbViewer(this)\">";
}
?>
|
답변 2개 / 댓글 2개
2014-04-17 (목) 16:37:26
skin/board/gallery/view.skin.php 로 설명드리자면
그러닌까 그누보드5를 받았을 때 따끈 따끈한 gallery스킨으로 설명드려 보죠.
gallery폴더 내에 view.skin.php 파일을 열고 위 처럼 수정한다는 겁니다.
라인이 잘못되었네요.
134,135,136라인입니다. (전혀 수정되지 않은 갤러리스킨)
그리고 이미지가 없을 때 보여 줄 예를 들어 noimage.gif 같은 파일을 img 폴더에 넣었다고 했을 때
Copy
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
이 코드를 아래 처럼 그대로 수정하시라는 말입니다.
Copy
// 파일 출력
$v_img_count = count($view['file']);
if(!$v_img_count) { echo "<img src='{$board_skin_url}/img/noimage.gif' />"; }
else{
그대로 바꿔 ftp를 이용해 서버에 올리면 됍니다.
답변에 대한 댓글 1개
퇴근후밥상
2014-04-17 (목) 16:42:24
2014-04-17 (목) 16:18:08
view.skin.php의 122~123라인
Copy
// 파일 출력
$v_img_count = count($view['file']);
if($v_img_count) {
이것을 아래 처럼
Copy
// 파일 출력
$v_img_count = count($view['file']);
if(!$v_img_count) { echo "<img src='./img/noimg.jpg' />"; }
else{
답변에 대한 댓글 1개
퇴근후밥상
2014-04-17 (목) 16:24:58
소스가 없던데 // 위에있는 부분이 어디에 있는건가요?~~
초보라서 ㅠㅠ 응용하는게 ..ㄷㄷ
<?
// 파일 출력
$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)\">";
}
?>