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개 / 댓글 4개
채택된 답변
+20 포인트
회원에게는 안보이고 관리자에게는 보이는 거면 아래와 같이 진행해보세요.
Copy
<?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
}
?>
$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) { 이거 아닌가요?
마르스컴퍼니
2023-12-04 (월) 19:37:28
and wr_parent='$view[wr_id]'
삭제
답변에 대한 댓글 4개
어느날우연이
2023-12-04 (월) 20:04:43
답변을 작성하려면 로그인이 필요합니다.
근데 관리자한테도 적용되던데, 관리자는 적용되지 않게 하려면 어떻게해야할까요???