해당 게시판에 댓글 1회만 작성하게 하기
본문
A 게시판에
1번글 - B가 댓글 달았음!
2번글
3번글
이때 A게시판에서 B에게는 다른 글을 포함 모든글에 댓글창을 감췄으면 합니다.
<?php
$result = sql_fetch(" select count(*) as cnt from $write_table where wr_is_comment='1' and wr_parent='$view[wr_id]' and mb_id='$member[mb_id]'");
if($result['cnt']<"1") {
?>
<div>
댓글창
</div>
<?php } ?>
댓글을 단경우 댓글창을 감추는 코드는 위 코드로 적용이 되었는데,
해당글만 적용이 되어서요.
해당 게시판의 모든글에 적용하려면 어떻게 해야할까요?
답변 3
회원에게는 안보이고 관리자에게는 보이는 거면 아래와 같이 진행해보세요.
<?php
$result = sql_fetch(" select count(*) as cnt from {$write_table} where wr_is_comment='1' and mb_id='{$member['mb_id']}'");
if($result['cnt'] < 1) {
?>
댓글창
<?php
}
?>
!-->
and wr_parent='$view[wr_id]'
삭제
$result = sql_fetch(" select count(*) as cnt from {$write_table} where wr_is_comment='1' and wr_parent='{$view['wr_id']}' and mb_id='{$member['mb_id']}'");
if ($result['cnt'] < 1) { 이거 아닌가요?
답변을 작성하시기 전에 로그인 해주세요.