답글이 달렸는지 체크하기
글마다 '답변완료' '대기중'하는 표시가 뜨는 스킨을 만드려 합니다.
공지와 답변글에는 상태표시가 없고
답변이 달리지 않은 글에는 '대기중'
답글이 달리면 원글에 '답변완료'라는 글자가 뜨게 하려고 해서
if (($list[$i][is_notice])||($list[$i][reply]))
echo "<img src='$board_skin_path/img/noimage.gif'>";
else if (???????????????????????)
echo "<img src='$board_skin_path/img/icon_select.gif'>";
else
echo "<img src='$board_skin_path/img/icon_standby.gif'>";
일단 이렇게 짰는데요
중간부분 답글이 달린 원글인지 여부를 어떻게 판단해야 할지 모르겠습니다
검색해보니 쿼리문으로 wr_parent값을 0보다 크게하고 wr_is_comment=0하라는 댓글이 있길래
" select count(*) as cnt from $write_table
where wr_reply like '$reply%'
and wr_parent > 0
and wr_is_comment = 0 ";"
하고 돌렸는데 무조건 답변완료 상태로 체크가 됩니다ㅠㅠ
어떻게 해야하는지 알려주시면 감사하겠습니다
공지와 답변글에는 상태표시가 없고
답변이 달리지 않은 글에는 '대기중'
답글이 달리면 원글에 '답변완료'라는 글자가 뜨게 하려고 해서
if (($list[$i][is_notice])||($list[$i][reply]))
echo "<img src='$board_skin_path/img/noimage.gif'>";
else if (???????????????????????)
echo "<img src='$board_skin_path/img/icon_select.gif'>";
else
echo "<img src='$board_skin_path/img/icon_standby.gif'>";
일단 이렇게 짰는데요
중간부분 답글이 달린 원글인지 여부를 어떻게 판단해야 할지 모르겠습니다
검색해보니 쿼리문으로 wr_parent값을 0보다 크게하고 wr_is_comment=0하라는 댓글이 있길래
" select count(*) as cnt from $write_table
where wr_reply like '$reply%'
and wr_parent > 0
and wr_is_comment = 0 ";"
하고 돌렸는데 무조건 답변완료 상태로 체크가 됩니다ㅠㅠ
어떻게 해야하는지 알려주시면 감사하겠습니다
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 2개
변수 j를 넣어서
<?
$j=$i+1;
if (($list[$i][is_notice])||($list[$i][reply]))
echo "<img src='$board_skin_path/img/noimage.gif'>";
else if ($list[$j][reply])
echo "<img src='$board_skin_path/img/icon_select.gif'>";
else
echo "<img src='$board_skin_path/img/icon_standby.gif'>";
?>
그누보드5에서도 잘 되네요.
진짜 필요한 소스였는데..
감사합니다.^^