댓글 포인트 관련 질문드립니다. 정보
댓글 포인트 관련 질문드립니다.
본문
1시간 이내 도배방지를 위해 소스를 추가했습니다.
생각한대로 돌아가긴 하는데 연속적으로 댓글을 입력 할 경우 포인트지급이 무시되어버립니다.
횟수만 제한두고 시간은 제한두지 않으려고 하는데 다른파일에서 봐야될 부분이 있는지 알려주시면 감사하겠습니다.
/bbs/write_comment_update.php
if ($w == "c") // 코멘트 입력
{
if ($member[mb_point] + $board[bo_comment_point] < 0 && !$is_admin)
alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 코멘트쓰기(".number_format($board[bo_comment_point]).")가 불가합니다.\\n\\n포인트를 적립하신 후 다시 코멘트를 써 주십시오.");
$count_comment_write = "select count(*) as cnt from $write_table where wr_parent = '$wr_id' AND wr_id != wr_parent";
$check_count_comment = sql_fetch($count_comment_write);
$count_comment_write2 = "select count(*) as cnt from g4_point where po_rel_action = '코멘트' AND mb_id = '$mb_id' AND po_datetime > DATE_SUB(now(), INTERVAL 1 hour)";
$check_count_comment2 = sql_fetch($count_comment_write2);
// echo $check_count_comment2[cnt];
switch($check_count_comment2[cnt]){
case 0:
case 1:
case 2:
if(0 == $check_count_comment[cnt]) insert_point($member[mb_id], ceil($board[bo_comment_point]*1.5), "$board[bo_subject] {$wr_id}-{$comment_id} 1등 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트'); insert_point($member[mb_id], $board[bo_comment_point], "$board[bo_subject] {$wr_id}-{$comment_id} 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트');
// echo '012';
break;
case 3:
case 4:
if(0 == $check_count_comment[cnt]) {insert_point($member[mb_id], ceil($board[bo_comment_point]*1.5), "$board[bo_subject] {$wr_id}-{$comment_id} 1등 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트'); }else
insert_point($member[mb_id], ceil($board[bo_comment_point]*0.3), "$board[bo_subject] {$wr_id}-{$comment_id} 연속 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트');
// echo '34';
break;
default:
insert_point($member[mb_id], 1, "$board[bo_subject] {$wr_id}-{$comment_id} | {$check_count_comment2[cnt]} 번째 코멘트", $bo_table, $wr_id, '코멘트');
// echo '0';
break;
}
생각한대로 돌아가긴 하는데 연속적으로 댓글을 입력 할 경우 포인트지급이 무시되어버립니다.
횟수만 제한두고 시간은 제한두지 않으려고 하는데 다른파일에서 봐야될 부분이 있는지 알려주시면 감사하겠습니다.
/bbs/write_comment_update.php
if ($w == "c") // 코멘트 입력
{
if ($member[mb_point] + $board[bo_comment_point] < 0 && !$is_admin)
alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 코멘트쓰기(".number_format($board[bo_comment_point]).")가 불가합니다.\\n\\n포인트를 적립하신 후 다시 코멘트를 써 주십시오.");
$count_comment_write = "select count(*) as cnt from $write_table where wr_parent = '$wr_id' AND wr_id != wr_parent";
$check_count_comment = sql_fetch($count_comment_write);
$count_comment_write2 = "select count(*) as cnt from g4_point where po_rel_action = '코멘트' AND mb_id = '$mb_id' AND po_datetime > DATE_SUB(now(), INTERVAL 1 hour)";
$check_count_comment2 = sql_fetch($count_comment_write2);
// echo $check_count_comment2[cnt];
switch($check_count_comment2[cnt]){
case 0:
case 1:
case 2:
if(0 == $check_count_comment[cnt]) insert_point($member[mb_id], ceil($board[bo_comment_point]*1.5), "$board[bo_subject] {$wr_id}-{$comment_id} 1등 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트'); insert_point($member[mb_id], $board[bo_comment_point], "$board[bo_subject] {$wr_id}-{$comment_id} 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트');
// echo '012';
break;
case 3:
case 4:
if(0 == $check_count_comment[cnt]) {insert_point($member[mb_id], ceil($board[bo_comment_point]*1.5), "$board[bo_subject] {$wr_id}-{$comment_id} 1등 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트'); }else
insert_point($member[mb_id], ceil($board[bo_comment_point]*0.3), "$board[bo_subject] {$wr_id}-{$comment_id} 연속 코멘트 {$check_count_comment2[cnt]}", $bo_table, $wr_id, '코멘트');
// echo '34';
break;
default:
insert_point($member[mb_id], 1, "$board[bo_subject] {$wr_id}-{$comment_id} | {$check_count_comment2[cnt]} 번째 코멘트", $bo_table, $wr_id, '코멘트');
// echo '0';
break;
}
댓글 전체