최신글에서 이미지문제 > 그누3질답

그누3질답

최신글에서 이미지문제 정보

그누보드 최신글에서 이미지문제

본문

아래는 envy 님의 news_2 를 쬐금 개조한 것의 latest.skin.php입니다.
이중에서 이미지가 없을 경우에 그 이미지에 해당하는 (<td>이미지</td>)를 아예 뜨지않게 하고 그대신 오른쪽의 (<td>내용</td>) 의 내용을 더 길게 하려면 어떻게 해야하는가요?
** 그림에서 이미지가 없을 경우에는 A가 차지하는 부분을 완전히 없애고 B로 완전히 대체하고 싶다는 뜻입니다.


<?
$image_height = 80; // 높이
$image_width  = 100; // 너비
?>

<table width=100% cellpadding=0 cellspacing=0 border=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i==0) { ?>
<tr>
<td>
<table cellpadding=0 cellspacing=3 border=0>
<tr>
<td width="200" height="50" valign="middle"><p><img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=0 align=left></p></td>
<td width="80%" height="30" valign="top"><span style='font-size:11'><?=$list[$i][date]?></span> <a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=subject><b><?=cut_str($list[$i][subject],50,"...");?></b></span></a> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span> <?=$list[$i][icon_new]?><div align="justify" style="margin-right:1; margin-left:1;"><?=cut_str($list[$i][wr_content],200,"…");?></div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="1" colspan="2">
<table width=100% cellpadding=0 cellspacing=3 border=0>
<tr>
<td width="100%" height="1" background='./<?=$latest_skin?>/line_width.gif'></td>
</tr>
</table>
</td>
</tr>
<!--일반게시물-->
<? } else { ?>
<tr>
<td>
<table cellpadding=0 cellspacing=3 border=0>
<tr>
<td width="200" height="50" valign="middle"><p><img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=0 align=left></p></td>
<td width="80%" height="30" valign="top"><span style='font-size:11'><?=$list[$i][date]?></span> <a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=subject><b><?=cut_str($list[$i][subject],50,"...");?></b></span></a> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span> <?=$list[$i][icon_new]?><div align="justify" style="margin-right:1; margin-left:1;"><?=cut_str($list[$i][wr_content],200,"…");?></div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="1" colspan="2">
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td width="100%" height="1" background='./<?=$latest_skin?>/line_width.gif'></td>
</tr>
</table>
</td>
</tr>
<? } ?>
<? } ?>
<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=25>자료가 없습니다.</td></tr>"; } ?>
<tr>
<td width="100%" height="5" colspan="2"></td>
</tr>
</table>

댓글 전체

이미지 출력하는 부분에 if문을 써서 사용하시면 됩니다...

<? if (!file_exists($list[$i][file_image1])) { ?>
                        <table cellpadding=1 cellspacing=3 border=0>
                                <tr>
                                <td width="80%" height="30" valign="top"> <a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=subject><b><?=cut_str($list[$i][subject],50,"...");?></b></span></a><span style='font-size:10'><?=$list[$i][date]?></span> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span> <?=$list[$i][icon_new]?><div align="justify" style="margin-right:1; margin-left:1;"><?=nl2br(stripslashes(cut_str($list[$i][wr_content], 100, '…' )))?></div></td>
                                </tr>
                        </table>
<? }else{ ?>
                        <table cellpadding=1 cellspacing=3 border=0>
                                <tr>
                                        <td width="200" height="50" valign="middle" bgcolor="#C1C1C1"><p><img src='<?=$list[$i][file_image1]?>' width='<?=$image_width?>' height='<?=$image_height?>' border=0 align=left></p></td>
                                        <td width="80%" height="30" valign="top"> <a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=subject><b><?=cut_str($list[$i][subject],50,"...");?></b></span></a><span style='font-size:10'><?=$list[$i][date]?></span> <span style='font-size:8pt;'><?=$list[$i][commentcnt]?></span> <?=$list[$i][icon_new]?><div align="justify" style="margin-right:1; margin-left:1;"><?=nl2br(stripslashes(cut_str($list[$i][wr_content], 100, '…' )))?></div></td>
                                </tr>
                        </table>
                </td>
        </tr>
<?} ?>

^^ 이해가 되셨는지요?
그럼 건강하세요
전체 9,564
그누3질답 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT