최근게시물에서 답글이 원본글 아래로 오는 방법에 대하여 > 그누4 질문답변

그누4 질문답변

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

최근게시물에서 답글이 원본글 아래로 오는 방법에 대하여 정보

최근게시물에서 답글이 원본글 아래로 오는 방법에 대하여

본문

최근게시물은 글써진 시간을 토대로 작업 결과물을 보여줍니다.

이것을 답글인 경우 원본글 밑에 답변글이 그 아래로 놓여지도록 하는 것이 필요한데요

이것에 대한 좋은 의견 부탁드립니다.


  • 복사

댓글 전체

최근 라이브러리를 고치시면 될듯한데..음...

답글 기준이 어디였더라..wr_reply였던가.. 그건 또확인해봐야 알겠군요.
입으로 글작성 답변후 디비테이블 비교해보심 답이 금방 나올것입니다.

$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";

-->

$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_reply, wr_id desc limit 0, $rows ";

우선권을 살짝 바꾸시면 됩니다. 고유값 wr_id를 우선으로 하나 첫째적으로 정렬의 규칙을 리플일 경우 wr_id를 무시하고 정렬하라는 것입니다.

게시판의 필드 정렬을 자세히 보는것도 하나의 방법인듯합니다.

아..그리고 최근 라이브러리를 하나더 추가하시고 하심 좋을듯하네요.

function latest_reply($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
~~~ 기존의 내용에서 정렬부분 정정 한내용 ~~
}
그누보드 / lib / latest.lib.php 파일에 아래와 같이 했더니
원본글만 보이고 답글이 안보이네요..  ^^;;

function latest_reply($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
    global $g4;

    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";

    $list = array();

    $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
    $board = sql_fetch($sql);

    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//  $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_reply, wr_id desc limit 0, $rows ";

    //explain($sql);
    $result = sql_query($sql);
    for ($i=0; $row = sql_fetch_array($result); $i++)
        $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
   
    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}
답도 못드린건데 체택되었네요.. 감사합니다.. 이런...제작의뢰[아깝..ㅡㅡ;; 사람참간사하죠..쩝.]를 하셨군요... 오늘에야 확인되서.. 확인해볼라구 했더니... 거기다..공개까지.. 대단한 그누정신이시네요..^^*
© SIRSOFT
현재 페이지 제일 처음으로