sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '{$count_write}', bo_count_comment = bo_count_comment - '{$count_comment}' where bo_table = '{$bo_table}' "); } } } else { //-------------------------------------------------------------------- // 코멘트 삭제시 답변 코멘트 까지 삭제되지는 않음 //-------------------------------------------------------------------- //print_r2($write); $comment_id = $wr_id; $len = strlen($write['wr_comment_reply']); if ($len < 0) { $len = 0; } $comment_reply = substr($write['wr_comment_reply'], 0, $len); // 코멘트 삭제 if (!delete_point($write['mb_id'], $bo_table, $comment_id, '코멘트')) { insert_point($write['mb_id'], $board['bo_comment_point'] * -1, "{$board['bo_subject']} {$write[wr_parent]}-{$comment_id} 코멘트삭제"); } // 코멘트 삭제 sql_query(" delete from {$write_table} where wr_id = '{$comment_id}' "); // 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다. $sql = " select max(wr_datetime) as wr_last from {$write_table} where wr_parent = '{$write['wr_parent']}' "; $row = sql_fetch($sql); // 원글의 코멘트 숫자를 감소 sql_query(" update {$write_table} set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' "); // 코멘트 숫자 감소 sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '{$bo_table}' "); // 새글 삭제 sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_id = '{$comment_id}' "); } }
// 원글 포인트 삭제 if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '쓰기')) { insert_point($row[mb_id], $board[bo_write_point] * -1, "{$board['bo_subject']} {$row['wr_id']} 글삭제"); } // 업로드된 파일이 있다면 파일삭제 $sql2 = " select * from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$row['wr_id']}' "; $result2 = sql_query($sql2); while ($row2 = sql_fetch_array($result2)) { @unlink("{$g4['path']}/data/file/{$bo_table}/{$row2['bf_file']}"); } // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$row['wr_id']}' "); $count_write++; } else { // 코멘트 포인트 삭제 if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트')) { insert_point($row[mb_id], $board[bo_comment_point] * -1, "{$board['bo_subject']} {$write[wr_id]}-{$row[wr_id]} 코멘트삭제"); } $count_comment++; } } // 게시글 삭제 sql_query(" delete from {$write_table} where wr_parent = '{$write['wr_id']}' "); // 최근게시물 삭제 sql_query(" delete from {$g4['board_new_table']} where bo_table = '{$bo_table}' and wr_parent = '{$write['wr_id']}' "); // 스크랩 삭제 sql_query(" delete from {$g4['scrap_table']} where bo_table = '{$bo_table}' and wr_id = '{$write['wr_id']}' "); // 공지사항 삭제 $notice_array = explode("\n", trim($board[bo_notice])); $bo_notice = ""; for ($k = 0; $k < count($notice_array); $k++) {
@unlink(G5_DATA_PATH . '/file/' . $bo_table . '/' . $row2['bf_file']); // 썸네일삭제 if (preg_match("/\\.({$config['cf_image_extension']})\$/i", $row2['bf_file'])) { delete_board_thumbnail($bo_table, $row2['bf_file']); } } // 에디터 썸네일 삭제 delete_editor_thumbnail($row['wr_content']); // 에디터 이미지 삭제 apms_editor_image($row['wr_content']); // 파일테이블 행 삭제 sql_query(" delete from {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$row['wr_id']}' "); $count_write++; } else { // 코멘트 포인트 삭제 if (!delete_point($row['mb_id'], $bo_table, $row['wr_id'], '댓글')) { insert_point($row['mb_id'], $board['bo_comment_point'] * -1, "{$board['bo_subject']} {$write['wr_id']}-{$row['wr_id']} 댓글삭제"); } $count_comment++; } // 신고글 sql_query(" delete from {$g5['apms_shingo']} where bo_table = '{$bo_table}' and wr_id = '{$row['wr_id']}' ", false); } // 게시글 삭제 sql_query(" delete from {$write_table} where wr_parent = '{$write['wr_id']}' "); // 최근게시물 삭제 sql_query(" delete from {$g5['board_new_table']} where bo_table = '{$bo_table}' and wr_parent = '{$write['wr_id']}' "); // 스크랩 삭제 sql_query(" delete from {$g5['scrap_table']} where bo_table = '{$bo_table}' and wr_id = '{$write['wr_id']}' "); // 내글반응 삭제 sql_query(" delete from {$g5['apms_response']} where bo_table = '{$bo_table}' and wr_id = '{$write['wr_id']}' ", false);
// 글읽을 조건 if ($mw_basic[cf_read_point] && !$is_admin) { if ($member[mb_point] < $mw_basic[cf_read_point]) { alert("이 게시판은 {$mw_basic['cf_read_point']} 포인트 이상 소지자만 글읽기가 가능합니다."); } } if ($mw_basic[cf_read_register] && !$is_admin) { $gap = ($g4[server_time] - strtotime($member[mb_datetime])) / (60 * 60 * 24); if ($gap < $mw_basic[cf_read_register]) { alert("이 게시판은 가입후 {$mw_basic['cf_read_register']} 일이 지나야 글읽기가 가능합니다."); } } if ($board[bo_read_point] < 0 && $view[mb_id] != $member[mb_id] && !$point && $is_member && !$is_admin && $mw_basic[cf_read_point_message]) { $tmp = sql_fetch(" select * from {$g4['point_table']} where mb_id = '{$member['mb_id']}' and po_rel_table = '{$bo_table}' and po_rel_id = '{$view[wr_id]}' and po_rel_action = '읽기' and po_datetime = '{$g4['time_ymdhis']}'"); if ($tmp) { delete_point($member[mb_id], $bo_table, $view[wr_id], '읽기'); set_session("ss_view_{$bo_table}_{$wr_id}", ''); unset($_SESSION["ss_view_{$bo_table}_{$wr_id}"]); $sign = '&'; if ($mw['config']['cf_seo_url']) { $url = mw_seo_url($bo_table, $wr_id, $qstr); $sign = '?'; } echo <<<HEREDOC <script> if (confirm("글을 읽으시면 {$board['bo_read_point']} 포인트 차감됩니다.\\n\\n현재포인트 : {$member['mb_point']}p\\n\\n")) location.href = '{$_SERVER['REQUEST_URI']}{$sign}point=1'; else history.back(); </script> HEREDOC;
$it_time = G5_TIME_YMDHIS; if ($w == "u") { $row = sql_fetch("select it_time from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' "); $it_time = $row['it_time']; } apms_add_tag($it_id, $pt_tag, $it_time); //파일등록 $file_upload_msg = apms_upload_file('item', $it_id); // 네이버 신디 if ($is_admin == 'super' && $it_use && $pt_syndi) { apms_naver_syndi_ping($it_id); } } // 등록비 기존 삭제 if ($is_regit = "2") { if (!delete_point($member['mb_id'], '@regit', $member['mb_id'], $it_id)) { insert_point($member['mb_id'], $old_upoint * -1, "{$it_id} 등록 취소"); } } // 등록비 신규 등록 if ($is_regit) { insert_point($member['mb_id'], $new_upoint, "{$it_id} 등록", "@regit", $member['mb_id'], $it_id); } $qstr = "{$qstr}&sca={$sca}&page={$page}"; if ($w == "u") { //goto_url("./itemform.php?w=u&it_id=$it_id&$qstr"); goto_url("./?ap=item&w=u&it_id={$it_id}&fn={$fn}&{$qstr}"); } echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">"; ?> <script>
} /* 주문 수정에서 "품절" 선택시 해당 상품 자동 품절 처리하기 else if ($ct_status == '품절') { $stock_use = 1; // 재고에서 뺀다. $sql =" update {$g5['g5_shop_item_table']} set it_stock_qty = 0 where it_id = '{$ct['it_id']}' "; sql_query($sql); } */ } $point_use = $ct['ct_point_use']; // 회원이면서 포인트가 0보다 크면 // 이미 포인트를 부여했다면 뺀다. if ($mb_id && $ct['ct_point'] && $ct['ct_point_use']) { $point_use = 0; //insert_point($mb_id, (-1) * ($ct[ct_point] * $ct[ct_qty]), "주문번호 $od_id ($ct_id) 취소"); delete_point($mb_id, "@delivery", $mb_id, "{$od_id},{$ct_id}"); } // 히스토리에 남김 // 히스토리에 남길때는 작업|아이디|시간|IP|그리고 나머지 자료 $now = G5_TIME_YMDHIS; $ct_history = "\n{$ct_status}|{$member['mb_id']}|{$now}|{$REMOTE_ADDR}"; $sql = " update {$g5['g5_shop_cart_table']}\n set ct_point_use = '{$point_use}',\n ct_stock_use = '{$stock_use}',\n ct_status = '{$ct_status}',\n ct_history = CONCAT(ct_history,'{$ct_history}')\n where od_id = '{$od_id}'\n and ct_id = '{$ct_id}' "; sql_query($sql); // APMS : 가정산 자동반영 - 2014.07.20 apms_account_auto($od_id, $ct_id, $ct_status); // it_id를 배열에 저장 if ($ct_status == '주문' || $ct_status == '취소' || $ct_status == '반품' || $ct_status == '품절' || $ct_status == '완료') { $arr_it_id[] = $ct['it_id']; } } // 상품 판매수량 반영
* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ include_once "_common.php"; include_once "{$board_skin_path}/mw.lib/mw.skin.basic.lib.php"; header("Content-Type: text/html; charset={$g4['charset']}"); if (!($is_admin or $write[mb_id] && $member[mb_id] && $write[mb_id] == $member[mb_id])) { die("권한이 없습니다."); } $vote = sql_fetch("select * from {$mw['vote_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}'"); if (!$vote) { die("설문이 존재하지 않습니다."); } $sql = "select * from {$mw['vote_log_table']} where vt_id = '{$vote['vt_id']}' "; $qry = sql_query($sql); while ($row = sql_fetch_array($qry)) { delete_point($row[mb_id], $bo_table, $wr_id, "설문"); } sql_query("delete from {$mw['vote_log_table']} where vt_id = '{$vote['vt_id']}'"); sql_query("update {$mw['vote_item_table']} set vt_hit = 0 where vt_id = '{$vote['vt_id']}'"); sql_query("update {$mw['vote_table']} set vt_total = 0 where vt_id = '{$vote['vt_id']}'");
$qry = sql_query($sql); } else { $sql = "update {$mw['reward_table']} set {$sql_common}, re_status = '{$re_status}' where bo_table = '{$bo_table}' and wr_id = '{$wr_id}'"; $qry = sql_query($sql); } $write_run_time = mw_time_log($write_run_time, "[write] reward update"); } // 익명 if ($mw_basic[cf_anonymous]) { sql_query(" update {$write_table} set wr_anonymous = '{$wr_anonymous}' where wr_id = '{$wr_id}' "); if ($mw_basic[cf_anonymous_nopoint] && $wr_anonymous) { if ($w == '') { delete_point($member[mb_id], $bo_table, $wr_id, '쓰기'); } else { if ($w == 'r') { delete_point($member[mb_id], $bo_table, $wr_id, '쓰기'); } } } $write_run_time = mw_time_log($write_run_time, "[write] anonymous point"); } // 글읽기 레벨 if ($mw_basic[cf_read_level] && $mw_basic[cf_read_level_own] <= $member[mb_level]) { sql_query(" update {$write_table} set wr_read_level = '{$wr_read_level}' where wr_id = '{$wr_id}' "); $write_run_time = mw_time_log($write_run_time, "[write] update read_level"); } // 모바일 if ($w == '' || $w == 'r') { if (mw_agent_mobile()) { sql_query("update {$write_table} set wr_is_mobile = '1' where wr_id = '{$wr_id}'", false); }
* * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if (!defined("_GNUBOARD_")) { exit; } // 개별 페이지 접근 불가 $sql = "update {$write_table} set wr_option = '{$wr_option}' where wr_id = '{$comment_id}'"; sql_query($sql); // 익명 if ($mw_basic[cf_anonymous]) { sql_query(" update {$write_table} set wr_anonymous = '{$wr_anonymous}' where wr_id = '{$comment_id}' "); if ($mw_basic[cf_anonymous_nopoint] && $wr_anonymous && $w == 'c') { delete_point($member[mb_id], $bo_table, $comment_id, '코멘트'); } } // 모바일 if ($w == 'c') { if (mw_agent_mobile()) { sql_query("update {$write_table} set wr_is_mobile = '1' where wr_id = '{$comment_id}'", false); } } // 비회원 이름 쿠키 저장 if (!$is_member) { set_cookie("mw_cookie_name", $wr_name, -1 * $g4[server_time]); set_cookie("mw_cookie_email", $wr_email, -1 * $g4[server_time]); set_cookie("mw_cookie_homepage", $wr_homepage, -1 * $g4[server_time]); } if ($w == 'c' && mw_is_rate($bo_table, $write['wr_id']) == '' && $wr_rate) {
} // 추천(찬성), 비추천(반대) 카운트 증가 if ($write["wr_{$row[bg_flag]}"] > 0) { sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$row[bg_flag]} = wr_{$row[bg_flag]} - 1 where wr_id = '{$wr_id}' "); } else { sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$row[bg_flag]} = 0 where wr_id = '{$wr_id}' "); } // 내역 삭제 sql_query(" delete from {$g4['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and mb_id = '{$member['mb_id']}' "); sql_query(" delete from {$mw['comment_good_table']} where bo_table = '{$bo_table}' and parent_id = '{$parent_id}' and wr_id = '{$wr_id}' and mb_id = '{$member['mb_id']}' "); if ($row[bg_flag] == "good") { delete_point($write[mb_id], $bo_table, $wr_id, $member[mb_id] . '@good'); delete_point($member[mb_id], $bo_table, $wr_id, $member[mb_id] . '@good_re'); } else { delete_point($write[mb_id], $bo_table, $wr_id, $member[mb_id] . '@nogood'); delete_point($member[mb_id], $bo_table, $wr_id, $member[mb_id] . '@nogood_re'); } $row = sql_fetch(" select wr_{$good} from {$g4[write_prefix]}{$bo_table} where wr_id = '{$wr_id}' "); die("이 코멘트 '{$status}'을 취소 하셨습니다.|" . $row["wr_{$good}"]); } } else { if ($mw_basic[cf_good_days]) { if ($g4[server_time] - strtotime($write[wr_datetime]) > $mw_basic[cf_good_days] * 86400) { die("추천/비추천 할 수 있는 기간이 지났습니다.\n\n글 작성 후 {$mw_basic[cf_good_days]}일 동안만 추천/비추천이 가능합니다. "); } } if ($mw_basic[cf_good_count]) { $sql = " select count(*) as cnt from {$g4['board_good_table']} where bo_table = '{$bo_table}' and mb_id = '{$member['mb_id']}' and bg_datetime like '{$g4['time_ymd']}%' "; $tm1 = sql_fetch($sql); $sql = " select count(*) as cnt from {$mw['comment_good_table']} where bo_table = '{$bo_table}' and mb_id = '{$member['mb_id']}' and bg_datetime like '{$g4['time_ymd']}%' "; $tm2 = sql_fetch($sql);
die("'{$status}'을 취소할 수 있는 기간({$mw_basic['cf_good_cancel_days']}일)이 지났습니다."); } // 추천(찬성), 비추천(반대) 카운트 증가 if ($write["wr_{$row[bg_flag]}"] > 0) { sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$row[bg_flag]} = wr_{$row[bg_flag]} - 1 where wr_id = '{$wr_id}' "); } else { sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$row[bg_flag]} = 0 where wr_id = '{$wr_id}' "); } // 내역 삭제 sql_query(" delete from {$g4['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and mb_id = '{$mb_id}' "); if ($row[bg_flag] == "good") { delete_point($write[mb_id], $bo_table, $wr_id, $mb_id . '@good'); delete_point($mb_id, $bo_table, $wr_id, $mb_id . '@good_re'); } else { delete_point($write[mb_id], $bo_table, $wr_id, $mb_id . '@nogood'); delete_point($mb_id, $bo_table, $wr_id, $mb_id . '@nogood_re'); } die("'{$status}'을 취소 하셨습니다."); } } else { if ($mw_basic[cf_good_days]) { if ($g4[server_time] - strtotime($write[wr_datetime]) > $mw_basic[cf_good_days] * 86400) { die("추천/비추천 할 수 있는 기간이 지났습니다.\n\n글 작성 후 {$mw_basic[cf_good_days]}일 동안만 추천/비추천이 가능합니다. "); } } if ($mw_basic[cf_good_count]) { $sql = " select count(*) as cnt from {$g4['board_good_table']} where bo_table = '{$bo_table}' and mb_id = '{$mb_id}' and bg_datetime like '{$g4['time_ymd']}%' "; $tm1 = sql_fetch($sql); $sql = " select count(*) as cnt from {$mw['comment_good_table']} where bo_table = '{$bo_table}' and mb_id = '{$mb_id}' and bg_datetime like '{$g4['time_ymd']}%' "; $tm2 = sql_fetch($sql); if ($tm1[cnt] + $tm2[cnt] >= $mw_basic[cf_good_count]) {
if ($answer[mb_id] == $write[mb_id] && !$is_admin) { die("자신의 답변은 채택하실 수 없습니다."); } if ($answer[wr_ip] == $write[wr_ip] && !$is_admin) { die("자신의 답변은 채택하실 수 없습니다."); } if ($answer[mb_id] == '@lucky-writing') { $mb = get_member("@lucky-writing", "mb_nick"); die("{$mb[mb_nick]}은 채택하실 수 없습니다."); } $row = sql_fetch("select wr_id from {$write_table} where wr_id = '{$choose_id}' and wr_parent = '{$wr_id}' and wr_is_comment = '1'"); if (!$row) { die("존재하지 않는 게시물입니다."); } sql_query("update {$write_table} set wr_qna_status = '1', wr_qna_id = '{$choose_id}' where wr_id = '{$wr_id}'"); $qna_save_point = round($write[wr_qna_point] * round($mw_basic[cf_qna_save] / 100, 2)); $qna_total_point = $qna_save_point + $mw_basic[cf_qna_point_add]; delete_point($write[mb_id], $bo_table, $wr_id, '@qna-hold'); insert_point($answer[mb_id], $qna_total_point, "답변채택 포인트", $bo_table, $wr_id, '@qna-choose'); if (function_exists('mw_moa_insert')) { $w = 'a'; mw_moa_insert($wr_id, $choose_id, $answer[mb_id], $write[mb_id]); } die("답변이 채택되었습니다.|ok"); } else { // 보류 sql_query("update {$write_table} set wr_qna_status = '2' where wr_id = '{$wr_id}'"); $hold_point = round($write[wr_qna_point] * $mw_basic[cf_qna_hold] / 100, 0); insert_point($write[mb_id], $hold_point, "질문 보류, 포인트 {$mw_basic['cf_qna_hold']}% 환원", $bo_table, $wr_id, '@qna-hold'); die("질문이 보류되었습니다.|ok"); }
} else { if ($member['mb_id']) { if ($member['mb_id'] != $write['mb_id']) { apms_alert('1|자신의 댓글이 아니므로 삭제할 수 없습니다.'); } } else { apms_alert('1|로그인한 회원만 삭제할 수 있습니다.'); //if (sql_password($wr_password) != $write['wr_password']) // apms_alert('1|비밀번호가 틀립니다.'); } } $len = strlen($write['wr_comment_reply']); if ($len < 0) { $len = 0; } $comment_reply = substr($write['wr_comment_reply'], 0, $len); $sql = " select count(*) as cnt from {$comment_table}\n where wr_comment_reply like '{$comment_reply}%'\n and wr_id <> '{$comment_id}'\n and wr_comment = '{$write[wr_comment]}' "; $row = sql_fetch($sql); if ($row['cnt'] && !$is_admin) { apms_alert('1|이 댓글과 관련된 대댓글이 존재하므로 삭제 할 수 없습니다.'); } // 댓글 포인트 삭제 if (!delete_point($write['mb_id'], $it_id, $comment_id, '댓글')) { insert_point($write['mb_id'], $default['pt_comment_point'] * -1, "{$it_id}-{$comment_id} 댓글 삭제"); } // 댓글 삭제 sql_query(" delete from {$comment_table} where wr_id = '{$comment_id}' "); // 상품의 댓글 숫자를 감소 sql_query(" update {$g5['g5_shop_item_table']} set pt_comment = pt_comment - 1 where it_id = '{$it_id}' "); //apms_alert('0|삭제 하셨습니다.'); apms_alert('');