mb_point2 라는 필드를 추가하였습니당 정보
mb_point2 라는 필드를 추가하였습니당본문
포인트를 2가지를 사용하려고 합니다..
그래서 mb_point2 필드를 추가해서 새로운포인트를 만들었구...
회원관리창에 mb_point2 도 불러오도록 설정하였습니다..
po_point2 도 추가하였구요..
db 에서 임의로 수정해주면 변경이 되긴합니다만...
mb_point 처럼 웹에서 지급하는것이안되더군요..
insert_point 함수를 고치거나 insert_point2 로 추가를 해줘야 할거같은데..
방법을 모르겟습니다 -ㅁ-;;
방법을 아시는분은 설명부탁드리겠습니다 ㅠ;ㅠ
/////////////////////////////////////////////
요약
/////////////////////////////////////////////
아래 함수를 이용하여... mb_point2 에 포인트지급하기 ㅠㅠ
// 포인트 부여
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='')
{
global $config;
global $g4;
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 $g4[member_table] where mb_id = '$mb_id' ");
if (!$mb[mb_id]) { return 0; }
// 이미 등록된 내역이라면 건너뜀
if ($rel_table || $rel_id || $rel_action)
{
$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;
}
// 포인트 건별 생성
$sql = " insert into $g4[point_table]
set mb_id = '$mb_id',
po_datetime = '$g4[time_ymdhis]',
po_content = '".addslashes($content)."',
po_point = '$point',
po_rel_table = '$rel_table',
po_rel_id = '$rel_id',
po_rel_action = '$rel_action' ";
sql_query($sql);
// 포인트 내역의 합을 구하고
$sql = " select sum(po_point) as sum_po_point from $g4[point_table] where mb_id = '$mb_id' ";
$row = sql_fetch($sql);
$sum_point = $row[sum_po_point];
// 포인트 UPDATE
$sql = " update $g4[member_table] set mb_point = '$sum_point' where mb_id = '$mb_id' ";
sql_query($sql);
return 1;
}
-p.s 이전에 올린 2개의 질문글은 지웠습니다.. 죄송합니다..
질문을 너무 이상하게 한거같아서요
그래서 mb_point2 필드를 추가해서 새로운포인트를 만들었구...
회원관리창에 mb_point2 도 불러오도록 설정하였습니다..
po_point2 도 추가하였구요..
db 에서 임의로 수정해주면 변경이 되긴합니다만...
mb_point 처럼 웹에서 지급하는것이안되더군요..
insert_point 함수를 고치거나 insert_point2 로 추가를 해줘야 할거같은데..
방법을 모르겟습니다 -ㅁ-;;
방법을 아시는분은 설명부탁드리겠습니다 ㅠ;ㅠ
/////////////////////////////////////////////
요약
/////////////////////////////////////////////
아래 함수를 이용하여... mb_point2 에 포인트지급하기 ㅠㅠ
// 포인트 부여
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='')
{
global $config;
global $g4;
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 $g4[member_table] where mb_id = '$mb_id' ");
if (!$mb[mb_id]) { return 0; }
// 이미 등록된 내역이라면 건너뜀
if ($rel_table || $rel_id || $rel_action)
{
$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;
}
// 포인트 건별 생성
$sql = " insert into $g4[point_table]
set mb_id = '$mb_id',
po_datetime = '$g4[time_ymdhis]',
po_content = '".addslashes($content)."',
po_point = '$point',
po_rel_table = '$rel_table',
po_rel_id = '$rel_id',
po_rel_action = '$rel_action' ";
sql_query($sql);
// 포인트 내역의 합을 구하고
$sql = " select sum(po_point) as sum_po_point from $g4[point_table] where mb_id = '$mb_id' ";
$row = sql_fetch($sql);
$sum_point = $row[sum_po_point];
// 포인트 UPDATE
$sql = " update $g4[member_table] set mb_point = '$sum_point' where mb_id = '$mb_id' ";
sql_query($sql);
return 1;
}
-p.s 이전에 올린 2개의 질문글은 지웠습니다.. 죄송합니다..
질문을 너무 이상하게 한거같아서요
댓글 전체
쩝 혼자서... 해결했습니다