세번째 질문입니다.포인트 관련 정보
세번째 질문입니다.포인트 관련본문
제가 잘 몰라서 세번째 질문을 드립니다.
글쓰기 할때 뿐 만이 아니라 본인 글을 본인이 수정할때도 글쓰기와 같은 포인트가 차감되게 하고 싶습니다.
물론 전체게시판이 아니라 특정 스킨에만요.
스킨에서 포인트를 관여하는 페이지 같아서 소스 올립니다.
어느부분을 손 봐야 할지 고수님들 알려 주시면 감사하겠습니다.
---소스---
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($w != "u") {
insert_point($member[mb_id], "-$wr_6", "$board[bo_subject] $wr_id 등록", $bo_table, $wr_id, '등록');
echo "<script>alert('등록되었습니다');opener.location.reload();close();</script>";
}else{
$sql = mysql_query(" update $g4[point_table] set po_point = '-$wr_6' where po_rel_table = '$bo_table' and po_rel_id = '$wr_id' and po_rel_action = '등록' and mb_id = '$write_mb_id' ");
// 포인트 내역의 합을 구하고
$sql = " select sum(po_point) as sum_po_point from $g4[point_table] where mb_id = '$write_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 = '$write_mb_id' ";
sql_query($sql);
echo "<script>alert('수정되었습니다');</script>";
}
?>
-------여기까지---------------------------------------------
글쓰기 할때 뿐 만이 아니라 본인 글을 본인이 수정할때도 글쓰기와 같은 포인트가 차감되게 하고 싶습니다.
물론 전체게시판이 아니라 특정 스킨에만요.
스킨에서 포인트를 관여하는 페이지 같아서 소스 올립니다.
어느부분을 손 봐야 할지 고수님들 알려 주시면 감사하겠습니다.
---소스---
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($w != "u") {
insert_point($member[mb_id], "-$wr_6", "$board[bo_subject] $wr_id 등록", $bo_table, $wr_id, '등록');
echo "<script>alert('등록되었습니다');opener.location.reload();close();</script>";
}else{
$sql = mysql_query(" update $g4[point_table] set po_point = '-$wr_6' where po_rel_table = '$bo_table' and po_rel_id = '$wr_id' and po_rel_action = '등록' and mb_id = '$write_mb_id' ");
// 포인트 내역의 합을 구하고
$sql = " select sum(po_point) as sum_po_point from $g4[point_table] where mb_id = '$write_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 = '$write_mb_id' ";
sql_query($sql);
echo "<script>alert('수정되었습니다');</script>";
}
?>
-------여기까지---------------------------------------------
댓글 전체
if($w == "u") { // 수정일때
}
if($w == "") { // 등록일때
}
}
if($w == "") { // 등록일때
}