최신게시물 날짜별로 정렬이 안되요^^ 도와주세용~~ 정보
최신게시물 날짜별로 정렬이 안되요^^ 도와주세용~~
본문
공지사항 게시물 날짜를 수정했는데... 날짜별로 정렬이 안되요~~~
latestskin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width='432' cellpadding='0' cellspacing='0' border='0'>
<tr><td height='3'></td>
</tr>
</table>
<table width="432" cellspacing="0" cellpadding="0" style='border=0' align='left' style='padding-left:22px;'>
<tr>
<td valign="top" align='left'>
<table width="432" cellpadding=0 cellspacing=0 border=0>
<? for ($i=0; $i<count($list); $i++) {
//$list[$i][href] = "<a onClick=\"javascript:window.open('$g4[bbs_path]/board.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}', 'community', 'left=150, top=50, width=650, height=600, scrollbars=1')\">";
?>
<tr>
<td height=22 style='padding-top:5px;padding-left:0px;cursor:pointer;'><img src='<?=$latest_skin_path?>/img/la_icon.gif'>
<?
$style = "font-family:굴림; font-size:12pt; color:#134F93;";
if ($list[$i][icon_new])
$style = "style='font-family:굴림; font-size:9pt; color:#134F93;' ";
$subject = "<span style='font-size:8pt; color:#134F93;'>".cut_str($list[$i][subject],50)."</span>"; //제목 글자수 자르기 - 꼭 여기서 지정하세요.
echo $list[$i][icon_reply] . " ";
echo " <a href=\"{$list[$i][href]}\">";
if ($list[$i][is_notice])
echo "{$subject}</a>";
else
echo "{$subject}</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:굴림; font-size:9pt; color:#134F93;'>{$list[$i][comment_cnt]}</span></a>";
echo " " . $list[$i][icon_new];
?>
<td align='right' style='padding-top:6px'><font color=#808284><?=substr($list[$i][wr_datetime],0,10)?></font></td>
</td>
</tr>
<tr><td height=1 colspan=2 bgcolor='#E6E7E8'></td></tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td align=center height=100><font color=#D3622B>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td>
</tr>
</table>
latestskin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width='432' cellpadding='0' cellspacing='0' border='0'>
<tr><td height='3'></td>
</tr>
</table>
<table width="432" cellspacing="0" cellpadding="0" style='border=0' align='left' style='padding-left:22px;'>
<tr>
<td valign="top" align='left'>
<table width="432" cellpadding=0 cellspacing=0 border=0>
<? for ($i=0; $i<count($list); $i++) {
//$list[$i][href] = "<a onClick=\"javascript:window.open('$g4[bbs_path]/board.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}', 'community', 'left=150, top=50, width=650, height=600, scrollbars=1')\">";
?>
<tr>
<td height=22 style='padding-top:5px;padding-left:0px;cursor:pointer;'><img src='<?=$latest_skin_path?>/img/la_icon.gif'>
<?
$style = "font-family:굴림; font-size:12pt; color:#134F93;";
if ($list[$i][icon_new])
$style = "style='font-family:굴림; font-size:9pt; color:#134F93;' ";
$subject = "<span style='font-size:8pt; color:#134F93;'>".cut_str($list[$i][subject],50)."</span>"; //제목 글자수 자르기 - 꼭 여기서 지정하세요.
echo $list[$i][icon_reply] . " ";
echo " <a href=\"{$list[$i][href]}\">";
if ($list[$i][is_notice])
echo "{$subject}</a>";
else
echo "{$subject}</a>";
if ($list[$i][comment_cnt])
echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:굴림; font-size:9pt; color:#134F93;'>{$list[$i][comment_cnt]}</span></a>";
echo " " . $list[$i][icon_new];
?>
<td align='right' style='padding-top:6px'><font color=#808284><?=substr($list[$i][wr_datetime],0,10)?></font></td>
</td>
</tr>
<tr><td height=1 colspan=2 bgcolor='#E6E7E8'></td></tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td align=center height=100><font color=#D3622B>게시물이 없습니다.</a></td></tr><? } ?>
</table>
</td>
</tr>
</table>
댓글 전체
추출할때 날짜순으로 정렬해야지 출력하는 위 소스는 아무 소용없습니다
날짜를변경했다고 순서가 바뀌는 것이 아닙니다
출력 순서는 애초에 등록한 순서 그대로여서 변경 되지않기 때문입니다
latest함수에서 oeder by wr_num를 찾아서 order by wr_datetime desc로 수정하면
바뀐 날짜순으로 나옵니다(lib/latest.lib.php)
날짜를변경했다고 순서가 바뀌는 것이 아닙니다
출력 순서는 애초에 등록한 순서 그대로여서 변경 되지않기 때문입니다
latest함수에서 oeder by wr_num를 찾아서 order by wr_datetime desc로 수정하면
바뀐 날짜순으로 나옵니다(lib/latest.lib.php)

잘 됩니다.~~ 감사합니다.^^