2026, 새로운 도약을 시작합니다.

게시글 댓글 중복 막기 채택완료

그누보드 게시글 내에 같은사람이 한계정으로 1댓글만 달수 있고

그 이상은 댓글을 쓰는걸 막고싶은데 방법 공유 해주실 분 계신가요?

답변 1개

채택된 답변
+20 포인트

view_comment.php 파일 수정해보세요

Copy


$is_comment_write = false;

if ($member['mb_level'] >= $board['bo_comment_level'])

    $is_comment_write = true;

// 코멘트 작성 여부 확인

$sql = " select count(*) from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 and mb_id = '".$member['mb_id']."'";

$row = sql_fetch($sql);

$write_cnt = $row['cnt'];

if($write_cnt)    // 코멘트를 작성 하였다면 댓글 쓰기 차단

    $is_comment_write = false;

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

저 소스를 사용하는 스킨 view_comment.php 파일 최상단에 집어넣으면 되는건가요? php 초보라서요..
[code]
$is_comment_write = false;
if ($member['mb_level'] >= $board['bo_comment_level'])
$is_comment_write = true;

// 상단은 이미 소스가 작성되어 있을 겁니다.
// 하단에 넣어주시면 됩니다.

// 코멘트 작성 여부 확인
$sql = " select count(*) from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 and mb_id = '".$member['mb_id']."'";
$row = sql_fetch($sql);
$write_cnt = $row['cnt'];
if($write_cnt) // 코멘트를 작성 하였다면 댓글 쓰기 차단
$is_comment_write = false;
[/code]

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고