테스트 사이트 - 개발 중인 베타 버전입니다

하루 게시글 / 댓글 쓰기 포인트 지급 제한

https://sir.kr/qa/549580

 

내용을 토대로 팁으로 작성합니다.

 

사용하시는 게시판 스킨으로 이동 해주세요

 

978180634_1735517829.3977.png

 

스킨 디렉토리를 참조 하시면 됩니다.

 

그리고 해당 스킨 디렉토리 내 write_comment_update.head.skin.php 파일을 생성합니다.

해당 파일이 없다면 생성 해야 하며, 있다면 코드만 추가 해주세요

 

아래 코드를 넣어주시면 됩니다.

[code]

<?php

if (!defined('_GNUBOARD_')) exit;

   

    $comment_cnt = sql_fetch(" select count(*) as cnt from $write_table where wr_is_comment = '1' and mb_id = '{$member['mb_id']}' and substring(`wr_datetime`,1,10) = '". G5_TIME_YMD ."'");

   

    $comment_max = 4; //하루에 포인트를 부여할 댓글쓰기 회수

   

    // 하루에 댓글쓰기 횟수가 최대회수를 넘었다면

    if ($comment_cnt['cnt'] >= $comment_max) {

    $board['bo_comment_point'] = 0; // 댓글쓰기 포인트 지급 0

    }

[/code]

 

만약 해당 파일이 있다면 아래 코드만 넣어주세요

 

[code]

    $comment_cnt = sql_fetch(" select count(*) as cnt from $write_table where wr_is_comment = '1' and mb_id = '{$member['mb_id']}' and substring(`wr_datetime`,1,10) = '". G5_TIME_YMD ."'");

   

    $comment_max = 4; //하루에 포인트를 부여할 댓글쓰기 회수

   

    // 하루에 댓글쓰기 횟수가 최대회수를 넘었다면

    if ($comment_cnt['cnt'] >= $comment_max) {

    $board['bo_comment_point'] = 0; // 댓글쓰기 포인트 지급 0

    }

[/code]

 

이렇게 되면, 하루에 댓글 포인트를 제한 할 수 있습니다.

 

응용)

 

게시글도 함께 제한하기

write_update.head.skin.php 파일 생성 혹은 코드 추가

[code]

<?php

if (!defined('_GNUBOARD_')) exit;

    

   

    // 게시글 수 확인

    $write_cnt = sql_fetch(" select count(*) as cnt from $write_table where wr_is_comment = '0' and mb_id = '{$member['mb_id']}' and substring(`wr_datetime`,1,10) = '". G5_TIME_YMD ."'");

   

    $write_max = 4; //하루에 포인트를 부여할 게시글쓰기 횟수

   

    // 하루에 게시글쓰기 횟수가 최대 횟수를 넘었다면

    if ($write_cnt['cnt'] >= $write_max) {

        $board['bo_write_point'] = 0; // 게시글쓰기 포인트 지급 0

    }

[/code]

 

고맙습니다.

댓글 작성

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

로그인하기

댓글 10개

추천 하였습니다.

@들레아빠 감사합니다!

추천합니다.

@푸른산타 감사합니다!!

@펄스나인 

 

감사합니다 ^^

@민트다이어리 감사합니다 ^^

감사합니다 

추천 하였습니다.

 

게시판 목록

그누보드5 팁자료실

글쓰기
🐛 버그신고