하루동안 획득 가능한 포인트 제한하기
[code]
/*
* 그누보드/extend/user.config.php에 삽입
*/
function chk_point($mb_id, $insert_point) {
global $g5;
$limit_point = "100";//포인트 제한.
$sql = "select SUM(po_point) as point FROM `{$g5['point_table']}` WHERE mb_id ='{$mb_id}' and TO_DAYS(po_datetime) = TO_DAYS('" . G5_TIME_YMDHIS . "')";
$today_point = sql_fetch($sql);
//100미만인 대상만 포인트 적립
if ($today_point['point'] < $limit_point) {
$point = $insert_point;
} else {
$point = 1;
}
return $point;
}
[/code]
[code]
//한번에 적용 - 원본 미수정.
//user.config.php 에 chk_point 함수 아래에 추가
$board['bo_read_point']= chk_point($member['mb_id'], $board['bo_read_point']);//읽기포인트
$board['bo_write_point']= chk_point($member['mb_id'], $board['bo_write_point']);//쓰기포인트
$board['bo_comment_point']= chk_point($member['mb_id'], $board['bo_comment_point']);//답변 및 댓글포인트
$board['bo_download_point']= chk_point($member['mb_id'], $board['bo_download_point']);//다운로드포인트
[/code]
/*
* 그누보드/extend/user.config.php에 삽입
*/
function chk_point($mb_id, $insert_point) {
global $g5;
$limit_point = "100";//포인트 제한.
$sql = "select SUM(po_point) as point FROM `{$g5['point_table']}` WHERE mb_id ='{$mb_id}' and TO_DAYS(po_datetime) = TO_DAYS('" . G5_TIME_YMDHIS . "')";
$today_point = sql_fetch($sql);
//100미만인 대상만 포인트 적립
if ($today_point['point'] < $limit_point) {
$point = $insert_point;
} else {
$point = 1;
}
return $point;
}
[/code]
[code]
//한번에 적용 - 원본 미수정.
//user.config.php 에 chk_point 함수 아래에 추가
$board['bo_read_point']= chk_point($member['mb_id'], $board['bo_read_point']);//읽기포인트
$board['bo_write_point']= chk_point($member['mb_id'], $board['bo_write_point']);//쓰기포인트
$board['bo_comment_point']= chk_point($member['mb_id'], $board['bo_comment_point']);//답변 및 댓글포인트
$board['bo_download_point']= chk_point($member['mb_id'], $board['bo_download_point']);//다운로드포인트
[/code]
댓글 6개
9년 전
오바되면 1 포인트가 적립되는 것인가요?
user.config.php 에 말고, 별도 파일로 만들어서 extend 폴더에 넣어버리면 될 것 같습니다.
저같은 경우는 user.config.php 도 그누보드 원소스으로 보고, 가능하면 건드리지 않습니다. ^^
user.config.php 에 말고, 별도 파일로 만들어서 extend 폴더에 넣어버리면 될 것 같습니다.
저같은 경우는 user.config.php 도 그누보드 원소스으로 보고, 가능하면 건드리지 않습니다. ^^
7년 전
^^
sinbi
7년 전
진서기 님, 사랑합니다.
welcome
5년 전
댓글에 한해서 제한하고 싶은데 어떻게 하면 될까요?
1년 전
메모메모..
알엠마이너스에프
9개월 전
잘보고 갑니다
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4400 | ||
| 54 | 12년 전 | 7043 | ||
| 53 |
senseme
|
12년 전 | 9510 | |
| 52 | 12년 전 | 8959 | ||
| 51 |
takumi22
|
12년 전 | 8601 | |
| 50 |
마스보드포럼
|
12년 전 | 6832 | |
| 49 | 12년 전 | 5881 | ||
| 48 | 12년 전 | 7551 | ||
| 47 | 12년 전 | 7650 | ||
| 46 |
젬스브라운
|
12년 전 | 4814 | |
| 45 | 12년 전 | 6868 | ||
| 44 | 12년 전 | 8411 | ||
| 43 | 12년 전 | 6242 | ||
| 42 |
While
|
12년 전 | 9594 | |
| 41 | 12년 전 | 5354 | ||
| 40 |
푸른하늘3
|
12년 전 | 9664 | |
| 39 |
|
12년 전 | 6634 | |
| 38 | 12년 전 | 8987 | ||
| 37 |
|
12년 전 | 7579 | |
| 36 | 12년 전 | 5208 | ||
| 35 |
21세기소년
|
12년 전 | 6116 | |
| 34 |
rumi717
|
12년 전 | 6804 | |
| 33 |
|
12년 전 | 9732 | |
| 32 | 12년 전 | 9138 | ||
| 31 |
|
12년 전 | 8851 | |
| 30 | 12년 전 | 4845 | ||
| 29 |
|
12년 전 | 7365 | |
| 28 | 12년 전 | 7170 | ||
| 27 | 12년 전 | 6892 | ||
| 26 | 12년 전 | 6659 | ||
| 25 |
|
12년 전 | 5925 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기