특정게시판에 게시글 하나당 코멘트 하나씩만 달수 있게 하는 방법? 정보
특정게시판에 게시글 하나당 코멘트 하나씩만 달수 있게 하는 방법?
본문
특정게시판에 게시글 하나당 코멘트는 회원이 하나만 달수 있게 하는 방법좀 부탁드립니다.
댓글 전체
bbs/write_comment_update.php파일에서
if ($w == "c" || $w == "cu")
{
if ($member[mb_level] < $board[bo_comment_level])
alert("코멘트를 쓸 권한이 없습니다.");
}
이부분을
if ($w == "c" || $w == "cu")
{
$check = sql_fetch(" select count(*) as cnt from {$g4['write_prefix']}{$bo_table} where wr_is_comment = '1' and mb_id = '$mb_id' ");
if ($check[cnt])
alert("코멘트를 한번이상 쓸수 없습니다.");
if ($member[mb_level] < $board[bo_comment_level])
alert("코멘트를 쓸 권한이 없습니다.");
}
if ($w == "c" || $w == "cu")
{
if ($member[mb_level] < $board[bo_comment_level])
alert("코멘트를 쓸 권한이 없습니다.");
}
이부분을
if ($w == "c" || $w == "cu")
{
$check = sql_fetch(" select count(*) as cnt from {$g4['write_prefix']}{$bo_table} where wr_is_comment = '1' and mb_id = '$mb_id' ");
if ($check[cnt])
alert("코멘트를 한번이상 쓸수 없습니다.");
if ($member[mb_level] < $board[bo_comment_level])
alert("코멘트를 쓸 권한이 없습니다.");
}
이건 잘 안되는거 같아요 ㅠㅠ
곰순이푸님 방법으로 해도 되고
이렇게 해보세요..처음부터 입력박스가 안보이게 하는 방법입니다..쿼리도 줄어들고...
view_comment.skin.php에서
<!-- 코멘트 리스트 -->
<div id="commentContents">
<?
$com_box=1; //추가
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i][wr_id];
if($list[$i][mb_id]==$member[mb_id]) $com_box=0; //추가
?>
if(<?=$com_box?>)
comment_box('', 'c'); // 코멘트 입력폼이 보이도록 처리하기위해서 추가 (root님)
이렇게 해보세요..처음부터 입력박스가 안보이게 하는 방법입니다..쿼리도 줄어들고...
view_comment.skin.php에서
<!-- 코멘트 리스트 -->
<div id="commentContents">
<?
$com_box=1; //추가
for ($i=0; $i<count($list); $i++) {
$comment_id = $list[$i][wr_id];
if($list[$i][mb_id]==$member[mb_id]) $com_box=0; //추가
?>
if(<?=$com_box?>)
comment_box('', 'c'); // 코멘트 입력폼이 보이도록 처리하기위해서 추가 (root님)
와우 감사합니다.^^ 잘되네요 ~^^