*/ $sql = "insert {$g5['g5_shop_item_use_table']}\n set it_id = '{$it_id}',\n mb_id = '{$member['mb_id']}',\n is_score = '{$is_score}',\n is_name = '{$is_name}',\n is_password = '******',\n is_subject = '{$is_subject}',\n is_content = '{$is_content}',\n is_time = '" . G5_TIME_YMDHIS . "',\n\t\t\t\t pt_it = '{$it['pt_it']}',\n\t\t\t\t pt_photo = '{$is_photo}',\n\t\t\t\t pt_id = '{$it['pt_id']}',\n is_ip = '{$_SERVER['REMOTE_ADDR']}' "; // APMS - 2014.07.21 if (!$default['de_item_use_use']) { $sql .= ", is_confirm = '1' "; } sql_query($sql); $is_id = sql_insert_id(); if ($default['de_item_use_use']) { $alert_msg = "글은 관리자가 확인한 후에 출력됩니다."; } else { //$alert_msg = "등록 되었습니다."; // 내글반응 등록 $it['pt_id'] = $it['pt_id'] ? $it['pt_id'] : $config['cf_admin']; // 파트너 없으면 최고관리자에게 보냄 apms_response('it', 'use', $it_id, '', $is_id, $is_subject, $it['pt_id'], $member['mb_id'], $is_name); } } else { if ($w == "u") { $sql = " select is_password from {$g5['g5_shop_item_use_table']} where is_id = '{$is_id}' "; $row = sql_fetch($sql); if ($row['is_password'] != $is_password) { alert("비밀번호가 틀리므로 수정하실 수 없습니다."); } $sql = " update {$g5['g5_shop_item_use_table']}\n set is_subject = '{$is_subject}',\n is_content = '{$is_content}',\n is_score = '{$is_score}',\n\t\t\t\t\tpt_photo = '{$is_photo}'\n\t\t\t where is_id = '{$is_id}' "; sql_query($sql); //$alert_msg = "수정 되었습니다."; } else { if ($w == "d") { if (!$is_admin) { $sql = " select count(*) as cnt from {$g5['g5_shop_item_use_table']} where mb_id = '{$member['mb_id']}' and is_id = '{$is_id}' ";
// 원글에 댓글수 증가 & 마지막 시간 반영 sql_query(" update {$write_table} set wr_comment = wr_comment + 1, wr_last = '" . G5_TIME_YMDHIS . "' where wr_id = '{$wr_id}' "); sql_query(" update {$g5['board_new_table']} set as_comment = as_comment + 1 where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ", false); // 새글 INSERT if ($is_new) { sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id, as_lucky, as_re_mb ) values ( '{$bo_table}', '{$comment_id}', '{$wr_id}', '" . G5_TIME_YMDHIS . "', '{$member['mb_id']}', '{$as_lucky}', '{$as_re_mb}') "); } // 댓글 1 증가 sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '{$bo_table}' "); // APMS : 내글반응 등록 if ($is_response) { apms_response('wr', 'comment', '', $bo_table, $wr_id, $wr_subject, $wr['mb_id'], $member['mb_id'], $wr_name, $comment_id); if ($response_flag == 'reply') { //대댓글일 때 $pre_comment = sql_fetch(" select mb_id from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 and wr_comment = '{$tmp_comment}' and wr_comment_reply = '" . substr($tmp_comment_reply, 0, -1) . "' "); apms_response('wr', 'comment_reply', '', $bo_table, $wr_id, $wr_subject, $pre_comment['mb_id'], $member['mb_id'], $wr_name, $comment_id); } } // 포인트 부여 insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 댓글쓰기", $bo_table, $comment_id, '댓글'); // 메일발송 사용 if ($config['cf_email_use'] && $board['bo_use_email']) { // 관리자의 정보를 얻고 $super_admin = get_admin('super'); $group_admin = get_admin('group'); $board_admin = get_admin('board'); $wr_content = nl2br(get_text(stripslashes("원글\n{$wr['wr_subject']}\n\n\n댓글\n{$wr_content}"))); $warr = array('' => '입력', 'u' => '수정', 'r' => '답변', 'c' => '댓글 ', 'cu' => '댓글 수정'); $str = $warr[$w]; $subject = '[' . $config['cf_title'] . '] ' . $board['bo_subject'] . ' 게시판에 ' . $str . '글이 올라왔습니다.'; // 4.00.15 - 메일로 보내는 댓글의 바로가기 링크 수정
if (!$iq_question) { alert("질문을 입력하여 주십시오."); } } if ($w == "") { //APMS : 파트너 정보 등록 - 2014.07.21 $it = apms_it($it_id); $sql = "insert {$g5['g5_shop_item_qa_table']}\n set it_id = '{$it_id}',\n mb_id = '{$member['mb_id']}',\n iq_secret = '{$iq_secret}',\n iq_name = '{$iq_name}',\n iq_email = '{$iq_email}',\n iq_hp = '{$iq_hp}',\n iq_password = '******',\n iq_subject = '{$iq_subject}',\n iq_question = '{$iq_question}',\n iq_time = '" . G5_TIME_YMDHIS . "',\n\t\t\t\t pt_it = '{$it['pt_it']}',\n pt_id = '{$it['pt_id']}',\n\t\t\t\t iq_ip = '{$REMOTE_ADDR}' "; // APMS - 2014.07.21 sql_query($sql); //$alert_msg = '등록 되었습니다.'; $iq_id = sql_insert_id(); // 내글반응 등록 $it['pt_id'] = $it['pt_id'] ? $it['pt_id'] : $config['cf_admin']; // 파트너 없으면 최고관리자에게 보냄 apms_response('it', 'qa', $it_id, '', $iq_id, $iq_subject, $it['pt_id'], $member['mb_id'], $iq_name); } else { if ($w == "u") { if (!$is_admin) { $sql = " select count(*) as cnt from {$g5['g5_shop_item_qa_table']} where mb_id = '{$member['mb_id']}' and iq_id = '{$iq_id}' "; $row = sql_fetch($sql); if (!$row['cnt']) { alert("자신의 글만 수정하실 수 있습니다."); } } $sql = " update {$g5['g5_shop_item_qa_table']}\n set iq_secret = '{$iq_secret}',\n iq_email = '{$iq_email}',\n iq_hp = '{$iq_hp}',\n iq_subject = '{$iq_subject}',\n iq_question = '{$iq_question}'\n where iq_id = '{$iq_id}' "; sql_query($sql); //$alert_msg = '수정 되었습니다.'; } else { if ($w == "d") { if (!$is_admin) {
//럭키포인트 $wr_lucky = $default['pt_lucky'] ? apms_lucky($it_id, '', '') : 0; $sql = " insert into {$comment_table}\n set it_id = '{$it['it_id']}',\n pt_id = '{$it['pt_id']}',\n\t\t\t\t\t wr_option = '{$wr_secret}',\n wr_comment = '{$tmp_comment}',\n wr_comment_reply = '{$tmp_comment_reply}',\n wr_subject = '{$wr_subject}',\n wr_content = '{$wr_content}',\n wr_level = '{$wr_level}',\n\t\t\t\t\t wr_lucky = '{$wr_lucky}',\n mb_id = '{$mb_id}',\n wr_password = '******',\n wr_name = '{$wr_name}',\n wr_email = '{$wr_email}',\n wr_homepage = '{$wr_homepage}',\n wr_re_mb = '{$wr_re_mb}',\n\t\t\t\t\t wr_re_name = '{$wr_re_name}',\n wr_datetime = '" . G5_TIME_YMDHIS . "',\n wr_ip = '{$_SERVER['REMOTE_ADDR']}',\n wr_1 = '{$wr_1}',\n wr_2 = '{$wr_2}',\n wr_3 = '{$wr_3}',\n wr_4 = '{$wr_4}',\n wr_5 = '{$wr_5}' "; sql_query($sql); $comment_id = sql_insert_id(); // 상품에 댓글 반영 sql_query(" update {$g5['g5_shop_item_table']} set pt_comment = pt_comment + 1 where it_id = '{$it_id}' "); // 내글반응 등록 $it['pt_id'] = $it['pt_id'] ? $it['pt_id'] : $config['cf_admin']; // 파트너 없으면 최고관리자에게 보냄 apms_response('it', 'comment', $it_id, '', '', $it['it_name'], $it['pt_id'], $member['mb_id'], $wr_name, $comment_id); if ($response_flag == 'reply' && $wr_re_mb && $wr_re_mb != $it['pt_id']) { //대댓글일 때 - 파트너와 다를 경우 if ($wr_re_mb != $member['mb_id']) { // 대댓글이 글쓴이와 다르다면 보냄 apms_response('it', 'comment_reply', $it_id, '', '', $it['it_name'], $wr_re_mb, $member['mb_id'], $wr_name, $comment_id); } } // 포인트 부여 if ($default['pt_comment_point']) { insert_point($member['mb_id'], $default['pt_comment_point'], "{$it_id}-{$comment_id} 댓글", $it_id, $comment_id, '댓글'); } // 메일발송은 삭제 // SNS 등록 include_once "./itemcommentsend.php"; if ($wr_facebook_user || $wr_twitter_user) { $sql = " update {$comment_table}\n set wr_facebook_user = '******',\n wr_twitter_user = '******'\n where wr_id = '{$comment_id}' "; sql_query($sql); } apms_alert('0|댓글을 등록 하였습니다.'); } else {
alert('이 게시판은 비추천 기능을 사용하지 않습니다.'); } $sql = " select bg_flag from {$g5['board_good_table']}\n where bo_table = '{$bo_table}'\n and wr_id = '{$wr_id}'\n and mb_id = '{$member['mb_id']}'\n and bg_flag in ('good', 'nogood') "; $row = sql_fetch($sql); if ($row['bg_flag']) { if ($row['bg_flag'] == 'good') { $status = $txt_good ? $txt_good : '추천'; } else { $status = $txt_nogood ? $txt_nogood : '비추천'; } alert("이미 {$status} 하셨습니다."); } else { @(include_once $board_skin_path . '/good.skin.php'); // 추천(찬성), 비추천(반대) 카운트 증가 sql_query(" update {$g5['write_prefix']}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' "); sql_query(" update {$g5['board_new_table']} set as_{$good} = as_{$good} + 1 where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ", false); // 내역 생성 sql_query(" insert {$g5['board_good_table']} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member['mb_id']}', bg_flag = '{$good}', bg_datetime = '" . G5_TIME_YMDHIS . "' "); // 내글반응 apms_response('wr', $good, '', $bo_table, $wr_id, $write['wr_subject'], $write['mb_id'], $member['mb_id'], $member['mb_nick']); if ($good == 'good') { $status = $txt_good ? $txt_good : '추천'; } else { $status = $txt_nogood ? $txt_nogood : '비추천'; } $href = './board.php?bo_table=' . $bo_table . '&wr_id=' . $wr_id; @(include_once $board_skin_path . '/good.tail.skin.php'); alert("{$status} 하셨습니다.", '', false); } } }
alert("자신이 등록한 상품의 문의글에 대한 답글만 가능합니다."); } else { alert_close("자신이 등록한 상품의 문의글에 대한 답글만 가능합니다."); } } if (!$iq_answer) { alert("답변을 입력하여 주십시오."); } // 답변등록 $sql = "update {$g5['g5_shop_item_qa_table']} set iq_answer = '{$iq_answer}' where iq_id = '{$iq_id}' "; sql_query($sql); if (!$iq['iq_answer'] && trim($iq_answer)) { $sql = " select a.mb_id, a.iq_email, a.iq_hp, b.it_name\n\t\t\t\tfrom {$g5['g5_shop_item_qa_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )\n\t\t\t\twhere a.iq_id = '{$iq_id}' "; $row = sql_fetch($sql); // 내글반응 등록 apms_response('it', 'reply', $iq['it_id'], '', $iq_id, get_text($iq['iq_subject']), $row['mb_id'], $member['mb_id'], $member['mb_nick']); // SMS 알림 if ($config['cf_sms_use'] == 'icode' && $row['iq_hp']) { include_once G5_LIB_PATH . '/icode.sms.lib.php'; $sms_content = get_text($row['it_name']) . ' 문의에 답변이 등록되었습니다.'; $send_number = preg_replace('/[^0-9]/', '', $default['de_admin_company_tel']); $recv_number = preg_replace('/[^0-9]/', '', $row['iq_hp']); if ($recv_number) { $SMS = new SMS(); // SMS 연결 $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']); $SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), ""); $SMS->Send(); } } // 답변 이메일전송
if (!apms_it_payment($it_id)) { alert('구매가 완료된 회원만 가능합니다.'); } } if ($good == 'good' || $good == 'nogood') { if ($it['pt_id'] == $member['mb_id']) { alert('자신의 자료에는 추천 또는 비추천 하실 수 없습니다.'); } $sql = " select pg_flag from {$g5['apms_good']} where it_id = '{$it_id}' and mb_id = '{$member['mb_id']}' and pg_flag in ('good', 'nogood') "; $row = sql_fetch($sql); if ($row['pg_flag']) { $status = $row['pg_flag'] == 'good' ? '추천' : '비추천'; alert("이미 {$status} 하셨습니다."); } else { // 추천(찬성), 비추천(반대) 카운트 증가 sql_query(" update {$g5['g5_shop_item_table']} set pt_{$good} = pt_{$good} + 1 where it_id = '{$it_id}' "); // 내역 생성 sql_query(" insert {$g5['apms_good']} set it_id = '{$it_id}', mb_id = '{$member['mb_id']}', pg_flag = '{$good}', pg_datetime = '" . G5_TIME_YMDHIS . "' "); // 내글반응 apms_response('it', $good, $it['it_id'], '', '', $it['it_name'], $it['pt_id'], $member['mb_id'], $member['mb_nick']); $status = $good == 'good' ? '추천' : '비추천'; $good_point = (int) $default['pt_good_point']; $good_msg = $it['it_id'] . ' 자료를 ' . $status . ' 했습니다.'; if ($good_point) { insert_point($member['mb_id'], $good_point, $good_msg, $it['it_id'], $it['pt_id'], '@' . $good); } $href = './item.php?it_id=' . $it_id; alert("{$status} 하셨습니다.", '', false); } } }
$mb_tmp = $config['cf_admin'] . ',' . $config['as_admin'] . ',' . $group['gr_admin'] . ',' . $board['bo_admin']; $mb_arr = explode(",", $mb_tmp); $mb_arr = array_unique($mb_arr); for ($i = 0; $i < count($mb_arr); $i++) { if (!$mb_arr[$i] || $member['mb_id'] == $mb_arr[$i]) { continue; } apms_response('wr', 'new', '', $bo_table, $wr_id, $wr_subject, $mb_arr[$i], $member['mb_id'], $wr_name); } } // Push @(include_once './write_update.push.php'); } else { if ($is_response) { // APMS : 내글반응 등록 apms_response('wr', 'reply', '', $bo_table, $wr_id, $wr_subject, $wr['mb_id'], $member['mb_id'], $wr_name); } // 답변은 코멘트 포인트를 부여함 // 답변 포인트가 많은 경우 코멘트 대신 답변을 하는 경우가 많음 insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id} 글답변", $bo_table, $wr_id, '쓰기'); } } else { if ($w == 'u') { if (get_session('ss_bo_table') != $_POST['bo_table'] || get_session('ss_wr_id') != $_POST['wr_id']) { alert('올바른 방법으로 수정하여 주십시오.', G5_BBS_URL . '/board.php?bo_table=' . $bo_table); } $return_url = './board.php?bo_table=' . $bo_table . '&wr_id=' . $wr_id; if ($is_admin == 'super') { // 최고관리자 통과 } else { if ($is_admin == 'group') {
$qa_admin = explode(",", $qa_admin_list); $qa_admin = array_unique($qa_admin); for ($i = 0; $i < count($qa_admin); $i++) { $admin_id = trim($qa_admin[$i]); if (!$admin_id) { continue; } // APMS : 내글반응 등록 apms_response('qa', 'qa', '', '', $qa_id, $qa_subject, $admin_id, $member['mb_id'], $member['mb_nick']); } } if ($w == 'a') { $sql = " update {$g5['qa_content_table']}\n set qa_status = '1'\n where qa_id = '{$write['qa_parent']}' "; sql_query($sql); // APMS : 내글반응 등록 apms_response('qa', 'qa', '', '', $write['qa_parent'], $write['qa_subject'], $write['mb_id'], '', '답변완료'); } } else { if ($w == 'u') { if (!$upload[1]['file'] && !$upload[1]['del_check']) { $upload[1]['file'] = $write['qa_file1']; $upload[1]['source'] = $write['qa_source1']; } if (!$upload[2]['file'] && !$upload[2]['del_check']) { $upload[2]['file'] = $write['qa_file2']; $upload[2]['source'] = $write['qa_source2']; } $sql = " update {$g5['qa_content_table']}\n set qa_email = '{$qa_email}',\n qa_hp = '{$qa_hp}',\n qa_category = '{$qa_category}',\n qa_html = '{$qa_html}',\n qa_subject = '{$qa_subject}',\n qa_content = '{$qa_content}',\n qa_file1 = '{$upload[1]['file']}',\n qa_source1 = '{$upload[1]['source']}',\n qa_file2 = '{$upload[2]['file']}',\n qa_source2 = '{$upload[2]['source']}',\n qa_1 = '{$qa_1}',\n qa_2 = '{$qa_2}',\n qa_3 = '{$qa_3}',\n qa_4 = '{$qa_4}',\n qa_5 = '{$qa_5}' "; if ($qa_sms_recv) { $sql .= ", qa_sms_recv = '{$qa_sms_recv}' "; }
include_once './_common.php'; check_demo(); if ($w == 'd') { auth_check($auth[$sub_menu], "d"); } else { auth_check($auth[$sub_menu], "w"); } check_admin_token(); if ($w == "u") { $sql = "update {$g5['g5_shop_item_qa_table']}\n set iq_subject = '{$iq_subject}',\n iq_question = '{$iq_question}',\n iq_answer = '{$iq_answer}'\n where iq_id = '{$iq_id}' "; sql_query($sql); if (trim($iq_answer)) { $sql = " select a.mb_id, a.iq_email, a.iq_hp, b.it_name\n from {$g5['g5_shop_item_qa_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )\n where a.iq_id = '{$iq_id}' "; $row = sql_fetch($sql); // 내글반응 등록 apms_response('it', 'reply', $it_id, '', '', $iq_subject, $row['mb_id'], $member['mb_id'], $member['mb_nick']); // SMS 알림 if ($config['cf_sms_use'] == 'icode' && $row['iq_hp']) { $sms_content = get_text($row['it_name']) . ' 문의에 답변이 등록되었습니다.'; $send_number = preg_replace('/[^0-9]/', '', $default['de_admin_company_tel']); $recv_number = preg_replace('/[^0-9]/', '', $row['iq_hp']); if ($recv_number) { if ($config['cf_sms_type'] == 'LMS') { include_once G5_LIB_PATH . '/icode.lms.lib.php'; $port_setting = get_icode_port_type($config['cf_icode_id'], $config['cf_icode_pw']); // SMS 모듈 클래스 생성 if ($port_setting !== false) { $SMS = new LMS(); $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $port_setting); $strDest = array(); $strDest[] = $recv_number;