글이 두개째 부터 나옵니다... > 그누4 질문답변

그누4 질문답변

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

글이 두개째 부터 나옵니다... 정보

글이 두개째 부터 나옵니다...

본문

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
$image_height = 120; // 높이
$image_width  = 120; // 너비
?>

<table width="576" border="0" cellspacing="0" cellpadding="0">
<tr>
<Td height="3" bgcolor="#FFFFFF"></Td>
</tr>
  <tr>
    <td height="28"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td heigt="24"><img src="<?=$latest_skin_path?>/img/event_navi.gif"></td>


</tr>
      </table></td>
  </tr>
  <tr>
<Td height="1" bgcolor="#CCCCCC"></Td>
</tr>
</table>

<table width=576 cellpadding=0 cellspacing=1 border=0 style="table-layout: fixed;">
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i==0){?>
<tr>
<td width="22%" rowspan=5> <!--리스크 개수 !-->
<?               
echo "<a href='{$list[$i][href]}'>";
            $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
            if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
        echo "<img src='$g4[path]/data/file/$bo_table/$image' width='$image_width' height='$image_height'  border=3 style='border-color:EFEFEF;' align=left>"; // 이미지크기
            } else
        echo "<img src='$latest_skin_path/img/noimage.gif' width='$image_width' height='$image_height' border=3 style='border-color:EFEFEF;' align=left>";
echo "</a>";
?>
</td>

<? }else{?>
    <td width="63%" style="border-bottom-width:1;border-bottom-color:#dddddd;border-bottom-style:dotted;">
<?
            echo $list[$i][icon_reply] . " ";
            echo "<a href='{$list[$i][href]}'>";
            if ($list[$i][is_notice])
                echo "<font style='font-family:돋움; font-size:9pt; color:#281900;'>{$list[$i][subject]}</font>";
            else
echo "<font style='font-family:돋움; font-size:9pt; color:#281900;'>[{$list[$i][ca_name]}] </font>";
                echo "<font style='font-family:돋움; font-size:9pt; color:#281900;'>{$list[$i][subject]}</font>";
            echo "</a>";

            if ($list[$i][comment_cnt])
                echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#281900;'>{$list[$i][comment_cnt]}</span></a>";

            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

            echo " " . $list[$i][icon_new];
            echo " " . $list[$i][icon_file];
            echo " " . $list[$i][icon_link];
            echo " " . $list[$i][icon_hot];
            echo " " . $list[$i][icon_secret];
            ?>
</td>
    <td width="15%" align="center" style="border-bottom-width:1;border-bottom-color:#dddddd;border-bottom-style:dotted;"><span style='font-family:돋움; font-size:8pt; color:#281900;'>[<?=$list[$i][datetime2]?>]</span></td>
  </tr>
<? } ?>
<? } ?>

</table>



최신글이고요....게시판에 글이 하나 있으면 안나오고 두개 이상있어야 나옵니다

왜 이럴까요...

고수님들의 많은 조언 부탁드립니다
  • 복사

댓글 전체

<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i==0){?>
여기서 <? if ($i==0){?>
 일때는 먼저 다른걸 실행되는거같은데...
0일때만 즉 1번째글일때만 이프문안에꺼 실행되고
1(두번째글) 부터는 제대로 출력... 저거 지워보세욤~
© SIRSOFT
현재 페이지 제일 처음으로