최신글(latest)사용시 가장 최신글이아닌 2번째 글이 불러지게 하는방법 정보
최신글(latest)사용시 가장 최신글이아닌 2번째 글이 불러지게 하는방법본문
제목과 동일하게 최신글 예)
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($i=0; $i<count($list); $i++) {
$list[$i]['content']=eregi_replace(" "," ",$list[$i]['content']);
if($list[$i][file][0][file]) {
$file = "<img src='".$list[$i][file][0][path] .'/'. $list[$i][file][0][file]."' align=absmiddle width=\"150\" height=\"110\" style=\"border:0px solid #eeeeee;\">";
} else {
$file="";
}
?>
<td width="160" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="160" height="120" align="center" valign="top" style="padding-top:3px;" title="<?=$list[$i]['subject']?>"><a href="<?=$list[$i]['href']?>"><?=$file?></a></td>
</table>
</td>
<? if($i!=count($list)-1) { ?>
<td width="5"></td>
<? } ?>
<? } ?>
<? if (count($list) == 0) { ?>
<td height="72" align="center"><font color="#6A6A6A">게시물이 없습니다.</font></td>
<? } ?>
</tr>
</table>
가 있다면 가장 최신의 글이 아닌 2번째 부터 나오게 하는 방법을 가르쳐주세요
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
for ($i=0; $i<count($list); $i++) {
$list[$i]['content']=eregi_replace(" "," ",$list[$i]['content']);
if($list[$i][file][0][file]) {
$file = "<img src='".$list[$i][file][0][path] .'/'. $list[$i][file][0][file]."' align=absmiddle width=\"150\" height=\"110\" style=\"border:0px solid #eeeeee;\">";
} else {
$file="";
}
?>
<td width="160" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="160" height="120" align="center" valign="top" style="padding-top:3px;" title="<?=$list[$i]['subject']?>"><a href="<?=$list[$i]['href']?>"><?=$file?></a></td>
</table>
</td>
<? if($i!=count($list)-1) { ?>
<td width="5"></td>
<? } ?>
<? } ?>
<? if (count($list) == 0) { ?>
<td height="72" align="center"><font color="#6A6A6A">게시물이 없습니다.</font></td>
<? } ?>
</tr>
</table>
가 있다면 가장 최신의 글이 아닌 2번째 부터 나오게 하는 방법을 가르쳐주세요
댓글 전체
ㅌ만약 5개를 표시하려면 $i값 0~4까지 5개를 카운트 합니다.
For문안쪽에보면
$i 가 0부터 카운트시작하잔하요. 이게 첫번째 게시물이거든요
$i를 1부터 카운트하게하면 두번째 게시물부터 나옵니다.
For문안쪽에보면
$i 가 0부터 카운트시작하잔하요. 이게 첫번째 게시물이거든요
$i를 1부터 카운트하게하면 두번째 게시물부터 나옵니다.