최신글에서 날자별로 정렬하는 것 좀 알려주세요... > 그누4 질문답변

그누4 질문답변

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

최신글에서 날자별로 정렬하는 것 좀 알려주세요... 정보

최신글에서 날자별로 정렬하는 것 좀 알려주세요...

본문

게시판이 사용자에 의해 날짜를 조작할 수 있도록 했는데

메인 최신글은 날짜가 수정된 순서가 아니라

게시판 입력순서데로 나타나는데 이걸 어떻게 수정해야하나요?

아님 다른 방벙이 있는 것인지 고수님들 부탁드리겠습니다.  ^^;;



최신글  latest.skin.php는 아래와 같습니다.


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width=479 cellpadding=0 cellspacing=0>
<tr>
</tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
    <td align=left><table width="475">
      <tr>
        <td width="379" height="3"><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align="absmiddle" />&nbsp;&nbsp;
            <?
            echo $list[$wr_datatime]['icon_reply'] . " ";
            echo "<a href='{$list[$i]['href']}'>";
            if ($list[$i]['is_notice'])
                echo "<font style='font-family:돋음, 돋움체,굴림, 굴림체; font-size:10pt; color:#333333;'><strong>{$list[$i]['subject']}</strong></font>";
            else
                echo "<font style='font-family:돋음, 돋움체,굴림, 굴림체; font-size:10pt; color:#333333;'>{$list[$i]['subject']}</font>";
            echo "</a>";

            if ($list[$i]['comment_cnt'])
                echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:10pt; 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']}>"; }

            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="84" align="right">[<?=date("20y-m-d", strtotime($list[$i]['wr_datetime']));?>
]</td>
      </tr>
      <tr>
        <td height="1" colspan="2" bgcolor="#ffffff"></td>
      </tr>
    </table></td>
</tr>
<? } ?>

<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
  • 복사

댓글 전체

lib/latest.lib.php에서 latest()함수를 수정해야 합니다
가장 쉬운 방법은 latest함수를 복사해서 latest2 함수를 만들고
order by wr_num 라고 되어있는 부분을 order by wr_datetime desc 로 수정
사용시에는 latest2('스킨','게시판...)
© SIRSOFT
현재 페이지 제일 처음으로