썸네일 관련 이미지 없을때 노이미 뜨게 하는 방법? > 그누4 질문답변

그누4 질문답변

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

썸네일 관련 이미지 없을때 노이미 뜨게 하는 방법? 정보

썸네일 관련 이미지 없을때 노이미 뜨게 하는 방법?

본문

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

$cols  = 4; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=145; //표시할 이미지의 가로사이즈
$imgheight=93; //표시할 이미지의 세로사이즈
$image_h  = 5; // 이미지 상하 간격

$col_width = (int)(99 / $cols);

$data_path = $g4[path]."/data/file/$bo_table";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="E1E1E1">
    <tr>
        <td height="89">
            <table width="100%" border="0" cellpadding="0" cellspacing="4" bgcolor="FFFFFF">
                <tr>
                    <td align=center valign="top" bgcolor="FFFFFF" style="padding:0px" height="71">
    <table width="97%" border="0" cellspacing="0" cellpadding="0">
    <tr bgcolor=#FFFFFF>
        <td height="22"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><strong><?=$board[bo_subject]?></strong></a></td>
        <td align="right">&nbsp;&nbsp;<a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></span></a></td>
    </tr>
    <tr><td colspan=2 height="1" bgcolor=EEEEEE></td></tr>
    <tr><td colspan=2 height="3"></td></tr>
    </table>
<!-- 최신글 제목 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>

<? for ($i=0; $i<count($list); $i++) {
  if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>

<td width="<?=$col_width?>%" align="center" valign='top'>

<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력

    echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' style='width:{$imgwidth}px;height:{$imgheight}px;border:0px solid #CCCCCC; padding:0px'></a></td></tr>";
echo "<tr><td align='center' height='21'><a href='{$list[$i]['href']}'><span style='font-size:8pt;'>{$list[$i]['subject']}</span></a></td></tr></table>";
?>
</td>
<? } ?>

<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
    echo "<td width=$col_width%>&nbsp;</td>";
}
?>

  <? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>
  </tr>
  <tr>
                                <td width="1%" height="1" align="center" valign="top">
                                    <tr>
                                        </td></tr>
</table>

</td></tr>
</table>
</td></tr>
</table>

위에 latest.skin.php 을 쓰고 있습니다.
다만 첨부파일이 없는경우 노출될때 이미지가 없다면
노이미지 파일로 뜨게 하는 방법 ? 어디에 어느 태그를 삽입 해야하는지요?
그리고 만약 본문에 링크로된 이미지가 있따면 그거 라도 가져오게하는건 ?
어려울까요 ^^;;

일단 첨부파일없으면 노이미지 뜨는거만이라도 구현 하고 싶오요~~

도와 주세욤
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로