코멘트 제한 방법 정보
코멘트 제한 방법본문
안녕하세요
게시물에 코멘트 제한하는 방법을 찾아보니깐 자신의 코멘트 개수를 제한하는 건 있는데요..
예를 들어 게시물에 50개의 코멘트가 달렸다면 그 게시물에 더이상 코멘트를 작성하지 못하도록 하는 방법이 없을까요? 링크도 같이 클릭안되게 되면 좋겠구요..
부탁드릴께요..
게시물에 코멘트 제한하는 방법을 찾아보니깐 자신의 코멘트 개수를 제한하는 건 있는데요..
예를 들어 게시물에 50개의 코멘트가 달렸다면 그 게시물에 더이상 코멘트를 작성하지 못하도록 하는 방법이 없을까요? 링크도 같이 클릭안되게 되면 좋겠구요..
부탁드릴께요..
댓글 전체
if($view[comment_cnt] > 50 {
코멘트
} else {
<a>코멘트</a>
}
와 같이 하면 될 듯 합니다...
코멘트
} else {
<a>코멘트</a>
}
와 같이 하면 될 듯 합니다...
view_comment.php 파일의
$is_comment_write = false;
if ($member[mb_level] >= $board[bo_comment_level])
$is_comment_write = true;
-- 이부분 다음에 추가 --
$sql = "select count(*) as cnt from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$commentcnt = sql_fetch($sql);
if ($commentcnt[cnt] > 50)
$is_comment_write = false;
추가 하면 총 50개이상일경우 쓰기 란이 안보입니다.
$is_comment_write = false;
if ($member[mb_level] >= $board[bo_comment_level])
$is_comment_write = true;
-- 이부분 다음에 추가 --
$sql = "select count(*) as cnt from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_comment desc, wr_comment_reply ";
$commentcnt = sql_fetch($sql);
if ($commentcnt[cnt] > 50)
$is_comment_write = false;
추가 하면 총 50개이상일경우 쓰기 란이 안보입니다.
위에 한건 쿼리를 다시 날리는거네요 .
if ($view[wr_comment] > 50)
$is_comment_write = false;
로 하시면 해결될거 같네요
if ($view[wr_comment] > 50)
$is_comment_write = false;
로 하시면 해결될거 같네요
view.skin.php 를 수정하면 간단할거같습니다.
<?
// 코멘트 입출력
if($view[wr_comment] < 50) {
include_once("./view_comment.php");
} else {
echo "코맨트 횟수가 초과 되었습니다....";
}
?>
<?
// 코멘트 입출력
if($view[wr_comment] < 50) {
include_once("./view_comment.php");
} else {
echo "코맨트 횟수가 초과 되었습니다....";
}
?>