재열람 및 재 다운로드 포인트 차감 문의좀 드려요 채택완료
penstar1
9년 전
조회 4,157
그누보드5 사용중인데요
글읽기 재열람 및 재다운로드시 중복 차감이 안되게 설정이 되어있는것으로 알고 있습니다.
중복 차감 가능하게끔 설정할려고 게시판 글들 찾아보고 해보니 안됩니다.
download.php
54 if (!get_session($ss_name))
67 insert_point($member['mb_id'], $board['bo_download_point'], "{$board['bo_subject']} $wr_id 파일 다운로드", $bo_table, $wr_id, "다운로드");
저부분을 주석 처리를 하라고 해서 해봤는데 역시나 중복 차감은 안됩니다. 중복차감 할수있게 가르쳐 주시면 감사드리겠습니다.
그리구요 읽기 중복 차감도 가능하게끔 가르쳐 주시면 감사하겠습니다.
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
9년 전
lib > common.lib.php 에서 865줄 정도에 해당 부분을 아래와 같이 주석처리 /* */ 해주세요.
// 포인트 부여
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='', $expire=0)
{
global $config;
global $g5;
global $is_admin;
// 포인트 사용을 하지 않는다면 return
if (!$config['cf_use_point']) { return 0; }
// 포인트가 없다면 업데이트 할 필요 없음
if ($point == 0) { return 0; }
// 회원아이디가 없다면 업데이트 할 필요 없음
if ($mb_id == '') { return 0; }
$mb = sql_fetch(" select mb_id from {$g5['member_table']} where mb_id = '$mb_id' ");
if (!$mb['mb_id']) { return 0; }
// 회원포인트
$mb_point = get_point_sum($mb_id);
// 이미 등록된 내역이라면 건너뜀
/*
if ($rel_table || $rel_id || $rel_action)
{
$sql = " select count(*) as cnt from {$g5['point_table']}
where mb_id = '$mb_id'
and po_rel_table = '$rel_table'
and po_rel_id = '$rel_id'
and po_rel_action = '$rel_action' ";
$row = sql_fetch($sql);
if ($row['cnt'])
return -1;
}
*/
// 포인트 건별 생성
$po_expire_date = '9999-12-31';
if($config['cf_point_term'] > 0) {
if($expire > 0)
$po_expire_date = date('Y-m-d', strtotime('+'.($expire - 1).' days', G5_SERVER_TIME));
else
$po_expire_date = date('Y-m-d', strtotime('+'.($config['cf_point_term'] - 1).' days', G5_SERVER_TIME));
}
$po_expired = 0;
if($point < 0) {
$po_expired = 1;
$po_expire_date = G5_TIME_YMD;
}
$po_mb_point = $mb_point + $point;
$sql = " insert into {$g5['point_table']}
set mb_id = '$mb_id',
po_datetime = '".G5_TIME_YMDHIS."',
po_content = '".addslashes($content)."',
po_point = '$point',
po_use_point = '0',
po_mb_point = '$po_mb_point',
po_expired = '$po_expired',
po_expire_date = '$po_expire_date',
po_rel_table = '$rel_table',
po_rel_id = '$rel_id',
po_rel_action = '$rel_action' ";
sql_query($sql);
// 포인트를 사용한 경우 포인트 내역에 사용금액 기록
if($point < 0) {
insert_use_point($mb_id, $point);
}
// 포인트 UPDATE
$sql = " update {$g5['member_table']} set mb_point = '$po_mb_point' where mb_id = '$mb_id' ";
sql_query($sql);
return 1;
}
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인