한번만더도와주세요. 최근게시물 이미지없을때 대처하는이미지좀..
최근게시물에 이미지가없으면 X박스가 자꾸 뜨네요 ㅠ
초보라서 도데체 어디를 수정해야되는지..좀알려주세요.
저번에도 비슷한질문을 올렸는데 서누니님이 답변해주셨는데..비슷한거같은데 제가 하니까 자꾸오류가 나더라구요. 이미지없을때 대처하는이미지를 불러오는걸 설정하고싶은데..꼭좀도와주세요.
소스는
<?
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: #000000;
}
-->
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<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:8.7pt; color:#000000;";
$style = "font-family:돋움; font-size:8.7pt; color:#000000;";
?> <!--이미지 가로와 세로의 크기를 정해주세요 -->
<?
echo "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='$img' width='126' height='66' border='0'></a>";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo " <font style='font-family:돋움; font-size:8.7pt; color:#000000;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo " <font style='font-family:돋움; font-size:8.7pt; color:#000000;'>{$list[$i]['subject']}</font>";
echo "</a>";
?><!--사이즈 width='120' 과 height='120'이 기본설정입니다. 자신에 맞게 수정하세요 --> </div></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</div></td>
<!--가로이미지 숫자를 정해주세요 -->
<? if ($m%5==0){ ?>
<!--가로이미지 숫자와 최신게시물을 부를때 갯수와는 다릅니다. -->
</tr>
<tr>
<td></td>
<?}?>
<? } ?>
<? if (count($list) == 0) { echo "<td height=30 align=center>이미지가 없습니다.</td>"; } ?>
</tr>
</table>
</div></td>
</tr>
</table>
입니다.ㅠ
초보라서 도데체 어디를 수정해야되는지..좀알려주세요.
저번에도 비슷한질문을 올렸는데 서누니님이 답변해주셨는데..비슷한거같은데 제가 하니까 자꾸오류가 나더라구요. 이미지없을때 대처하는이미지를 불러오는걸 설정하고싶은데..꼭좀도와주세요.
소스는
<?
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: #000000;
}
-->
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<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:8.7pt; color:#000000;";
$style = "font-family:돋움; font-size:8.7pt; color:#000000;";
?> <!--이미지 가로와 세로의 크기를 정해주세요 -->
<?
echo "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='$img' width='126' height='66' border='0'></a>";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo " <font style='font-family:돋움; font-size:8.7pt; color:#000000;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo " <font style='font-family:돋움; font-size:8.7pt; color:#000000;'>{$list[$i]['subject']}</font>";
echo "</a>";
?><!--사이즈 width='120' 과 height='120'이 기본설정입니다. 자신에 맞게 수정하세요 --> </div></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
</div></td>
<!--가로이미지 숫자를 정해주세요 -->
<? if ($m%5==0){ ?>
<!--가로이미지 숫자와 최신게시물을 부를때 갯수와는 다릅니다. -->
</tr>
<tr>
<td></td>
<?}?>
<? } ?>
<? if (count($list) == 0) { echo "<td height=30 align=center>이미지가 없습니다.</td>"; } ?>
</tr>
</table>
</div></td>
</tr>
</table>
입니다.ㅠ
댓글 2개
14년 전
if ( file_exists($thumb) )
$img = $thumb; 를 아래와 같이 대체 이미지로 변경하세요.
if (file_exists($img)
$img = "/skin/latest/basic/img/no_image.jpg"
으로 하시면 되는데, $img의 no_image.jpg 파일이 해당 경로에 있어야 겠죠?
이것도 답이 아니라면 유창화로 최근 글을 검색하시면 또 다른 답이 있습니다.
$img = $thumb; 를 아래와 같이 대체 이미지로 변경하세요.
if (file_exists($img)
$img = "/skin/latest/basic/img/no_image.jpg"
으로 하시면 되는데, $img의 no_image.jpg 파일이 해당 경로에 있어야 겠죠?
이것도 답이 아니라면 유창화로 최근 글을 검색하시면 또 다른 답이 있습니다.
열라바보숑
14년 전
좋은답변 감사합니다>_<!
게시판 목록
그누4 질문답변
그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.
기존 게시물은 열람만 가능합니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 66514 | 11년 전 | 2127 | ||
| 66513 | 11년 전 | 4476 | ||
| 66512 | 11년 전 | 4140 | ||
| 66511 | 11년 전 | 2409 | ||
| 66510 | 11년 전 | 3022 | ||
| 66509 |
반갑습니다요
|
11년 전 | 2885 | |
| 66508 |
|
11년 전 | 3474 | |
| 66507 |
자동차방향제
|
11년 전 | 2931 | |
| 66506 |
구라대마왕
|
11년 전 | 2703 | |
| 66505 | 11년 전 | 2780 | ||
| 66504 | 11년 전 | 3110 | ||
| 66503 |
착한아이민이
|
11년 전 | 3296 | |
| 66502 | 11년 전 | 2712 | ||
| 66501 |
착한아이민이
|
11년 전 | 2560 | |
| 66500 |
canth
|
11년 전 | 3289 | |
| 66499 |
한번잘해보자
|
11년 전 | 4226 | |
| 66498 | 11년 전 | 2859 | ||
| 66497 |
xargs
|
11년 전 | 2545 | |
| 66496 |
aisru
|
11년 전 | 2630 | |
| 66495 |
alexseo
|
11년 전 | 2732 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기