Esempio n. 1
0
         }
     }
     $tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char;
     // 원글쓴이
     $as_re_name = $reply_array['wr_name'];
     $as_re_mb = $reply_array['mb_id'];
 } else {
     $sql = " select max(wr_comment) as max_comment from {$write_table}\n                    where wr_parent = '{$wr_id}' and wr_is_comment = 1 ";
     $row = sql_fetch($sql);
     //$row[max_comment] -= 1;
     $row['max_comment'] += 1;
     $tmp_comment = $row['max_comment'];
     $tmp_comment_reply = '';
 }
 //럭키포인트
 $as_lucky = $board['as_lucky'] ? apms_lucky('', $bo_table, $wr_id) : 0;
 $wr_subject = get_text(stripslashes($wr['wr_subject']));
 $sql = " insert into {$write_table}\n                set ca_name = '" . addslashes($wr['ca_name']) . "',\n                     wr_option = '{$wr_secret}',\n                     wr_num = '{$wr['wr_num']}',\n                     wr_reply = '',\n                     wr_parent = '{$wr_id}',\n                     wr_is_comment = 1,\n                     wr_comment = '{$tmp_comment}',\n                     wr_comment_reply = '{$tmp_comment_reply}',\n                     wr_subject = '',\n                     wr_content = '{$wr_content}',\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_datetime = '" . G5_TIME_YMDHIS . "',\n                     wr_last = '',\n                     wr_ip = '{$_SERVER['REMOTE_ADDR']}',\n                     as_level = '{$as_level}',\n\t\t\t\t\t as_lucky = '{$as_lucky}',\n                     as_re_mb = '{$as_re_mb}',\n\t\t\t\t\t as_re_name = '{$as_re_name}',\n\t\t\t\t\t as_icon = '{$as_icon}',\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}',\n                     wr_6 = '{$wr_6}',\n                     wr_7 = '{$wr_7}',\n                     wr_8 = '{$wr_8}',\n                     wr_9 = '{$wr_9}',\n                     wr_10 = '{$wr_10}' ";
 sql_query($sql);
 $comment_id = sql_insert_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) {
Esempio n. 2
0
         }
     }
     $tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char;
     // 원글쓴이
     $wr_re_name = $reply_array['wr_name'];
     $wr_re_mb = $reply_array['mb_id'];
 } else {
     $sql = " select max(wr_comment) as max_comment from {$comment_table}\n                    where it_id = '{$it_id}' ";
     $row = sql_fetch($sql);
     //$row[max_comment] -= 1;
     $row['max_comment'] += 1;
     $tmp_comment = $row['max_comment'];
     $tmp_comment_reply = '';
 }
 //럭키포인트
 $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);
     }