다중게시판 최신글에서 답변이 해당글의 밑으로 가게 하려면? > 그누4 질문답변

그누4 질문답변

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

다중게시판 최신글에서 답변이 해당글의 밑으로 가게 하려면? 정보

다중게시판 최신글에서 답변이 해당글의 밑으로 가게 하려면?

본문

다중게시판 최신글에서
답변인 글은 안나오거나, 해당글의 밑으로 내려가게 하고 싶습니다.

쿼리문을 어떻게 손보면 될까요? ㅠㅠ
부탁드립니다.



function latest_multi($skin_dir="", $bo_table1, $bo_table2, $bo_table3, $bo_table4, $bo_table5, $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_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
      and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
      and a.wr_id = a.wr_parent
  order by a.bn_id desc 
limit $rows ";

댓글 전체

$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
      and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
      and a.wr_id = a.wr_parent  and b.wr_parent =b.wr_id
  order by a.bn_id desc 
limit $rows ";

===
and b.wr_parent =b.wr_id
  위 조건식을 추가하시면 답변인글은 안나오게 되겠습니다.~
$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
      and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
      and a.wr_id = a.wr_parent  order by a.bn_id desc 
limit $rows ";

앞에 and a.wr_id = a.wr_parent 조건문이 잇었네요 자세히 못보고 답변드려 죄송합니다

위 조건문은 본글만 나오게 하는 조건이라서 원래 올려주신 소스

$sql = " select * from $g4[board_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
      and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4','$bo_table5')
      and a.wr_id = a.wr_parent
  order by a.bn_id desc 
limit $rows ";

이대로 쓰셔도 답변글은 안나오실꺼 같은데요..

한번 확인해보세요
답변글이 나와서 확인해보니
wr_id 와 wr_parent 이같아요 ㅠㅠ
답글임에도 같네요..

리스트에서 원글을 찾는건 wr_num 을 보고 찾아요..
이럴경우는 어떻게 해야 하는지.. 난감하네요
원글과 답글의 wr_num이 같아요
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT