자료실에 자료들에 다운로드 할경우 포인트 다중 차감 질문 드립니다. 정보
자료실에 자료들에 다운로드 할경우 포인트 다중 차감 질문 드립니다.본문
안녕하세요 새해 복 많이 받으시고 항상 좋은 일만 가득 하시길 바랍니다.
질문 내용 :
자료실에서 자료를 다운 받을 경우 포인트 차감을 하려 합니다
자료마다 포인트는 다르게 하고 싶은데 어떻게 해야될지 모르겠습니다.
기본 관리자 페이지에서 다운로드 포인트 있는데 100인트 차감되고 150포인트 차감도
되고 200포인트 차감도 되게 할려면 어떻게 해야되는 혹시 스킨이나 자료 있으면 부탁
드립니다.
그리고 한 게시물에 다운로드할 자료가 2가지 이상이면 (예: 외국 영화 같은 경우 영화와
자막 두가지를 한게시물에 올릴경우) 영화는 100포인트 차감 자막은 5포인트 차감 이런
식으로 가능한지요?
마지막으로 24시간동안 그 자료를 반복해서 받아도 차감이 않되게 할수 있는지요?
고수님들 부탁 드립니다.
그럼 새해 복 많이 받으세요
댓글 전체

download.head.skin.php
// 체크
if (!$member[mb_id]) {
alert("로그인 후 이용하세요.", "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id");
}
else if ($member[mb_point] < $write[wr_1]) {
alert("포인트가 부족합니다.", "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id");
}
// 포인트 차감
insert_point($member[mb_id], $write[wr_1], "$board[bo_subject] $wr_id 다운로드", $bo_table, $wr_id, $g4['time_ymd']);
// 체크
if (!$member[mb_id]) {
alert("로그인 후 이용하세요.", "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id");
}
else if ($member[mb_point] < $write[wr_1]) {
alert("포인트가 부족합니다.", "$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id");
}
// 포인트 차감
insert_point($member[mb_id], $write[wr_1], "$board[bo_subject] $wr_id 다운로드", $bo_table, $wr_id, $g4['time_ymd']);

게시물의 여분필드 1에 값에 따라 포인트가 좌우하며...
0시를 기준으로 하루 1회 차감 됩니다.
0시를 기준으로 하루 1회 차감 됩니다.
g4/lib/common.lib.php" line 746
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='')
{
...
...
// 이미 등록된 내역이라면 건너뜀
if ($rel_table || $rel_id || $rel_action)
{
if( $rel_table == '자료실_bo_table')
$sql = " select count(*) as cnt from $g4[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'
and po_datetime > now() - interval 24 hour ";
else
$sql = " select count(*) as cnt from $g4[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;
}
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='')
{
...
...
// 이미 등록된 내역이라면 건너뜀
if ($rel_table || $rel_id || $rel_action)
{
if( $rel_table == '자료실_bo_table')
$sql = " select count(*) as cnt from $g4[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'
and po_datetime > now() - interval 24 hour ";
else
$sql = " select count(*) as cnt from $g4[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;
}