최신글을 보여주는 순서에 관한 질문입니다.
최신을 뽑는데
답변한 내용이 질문위에 올라오네요...
즉. 작성한 순서대로 정렬이 됩니다..
게시판에 보이는 순서대로 뽑고 싶은데 어떻게 해야 되는지 알려주세요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=0 align=center>
<table width=99% cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=10 style='padding-top:1px;padding-left:1px;'> <img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:8pt; color:#7D7D7D;'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:8pt; color:#7D7D7D;'>{$list[$i][subject]}</font>";
echo "</a>";
<tr>
<td colspan=0 align=center>
<table width=99% cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=10 style='padding-top:1px;padding-left:1px;'> <img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}'>";
if ($list[$i][is_notice])
echo "<font style='font-family:돋움; font-size:8pt; color:#7D7D7D;'><strong>{$list[$i][subject]}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:8pt; color:#7D7D7D;'>{$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:#9A9A9A;'>{$list[$i][comment_cnt]}</span></a>";
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$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']}>"; }
// 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=63 style='padding-top:1px;'><span style='font-size:8pt; color:#5698C9;'><?=$list[$i][datetime]?></span></td></tr>
<tr><td height=1 colspan=2 background='<?=$latest_skin_path?>/img/dot.gif'></td></tr>
</table></td>
</tr>
<? } ?>
// echo " " . $list[$i][icon_file];
// echo " " . $list[$i][icon_link];
// echo " " . $list[$i][icon_hot];
// echo " " . $list[$i][icon_secret];
?>
</td>
<td width=63 style='padding-top:1px;'><span style='font-size:8pt; color:#5698C9;'><?=$list[$i][datetime]?></span></td></tr>
<tr><td height=1 colspan=2 background='<?=$latest_skin_path?>/img/dot.gif'></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=78><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 2개
거기서도
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
부분이죠.
정렬순서는 order by 뒤에 쓰게되는데 여기서는 wr_id가 기본이죠 이부분을 손대시면 될듯하네요.