From 49561f32e5f09531e04b5385f39dd1015c2b6b1f Mon Sep 17 00:00:00 2001 From: Arcturus Date: Wed, 30 Oct 2024 08:25:04 +0900 Subject: [PATCH] add editorconfig, fix syntax error only --- .editorconfig | 23 ++++ .vscode/settings.json | 3 + AvocadoEdition/bbs/new_delete.php | 4 +- AvocadoEdition/bbs/write_update_file.php | 8 +- .../skin/board/qna/write_comment_update.php | 124 +++++++++--------- 5 files changed, 94 insertions(+), 68 deletions(-) create mode 100644 .editorconfig create mode 100644 .vscode/settings.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..aedf1e7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.js] +indent_style = space +indent_size = 2 + +[**.css] +indent_style = tab +indent_size = 2 + +[**.php] +indent_style = space +indent_size = 4 + +[**.html] +indent_style = tab +indent_size = 2 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3922dc3 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "php.version": "5.3" +} diff --git a/AvocadoEdition/bbs/new_delete.php b/AvocadoEdition/bbs/new_delete.php index 4a9c3fa..7191e78 100644 --- a/AvocadoEdition/bbs/new_delete.php +++ b/AvocadoEdition/bbs/new_delete.php @@ -128,7 +128,7 @@ for($i=0;$i$value) { } goto_url("new.php?sfl=$sfl&stx=$stx&page=$page"); -?> \ No newline at end of file +?> diff --git a/AvocadoEdition/bbs/write_update_file.php b/AvocadoEdition/bbs/write_update_file.php index 7cc6a86..c00208e 100644 --- a/AvocadoEdition/bbs/write_update_file.php +++ b/AvocadoEdition/bbs/write_update_file.php @@ -260,10 +260,10 @@ if ($w == '' || $w == 'r') { wr_last = '".G5_TIME_YMDHIS."', wr_ip = '{$_SERVER['REMOTE_ADDR']}', - ch_id = '$character['ch_id']', - ch_side = '$character['ch_side']', - ch_class = '$character['ch_class']', - ti_id = '$character['ch_title']', + ch_id = '{$character['ch_id']}', + ch_side = '{$character['ch_side']}', + ch_class = '{$character['ch_class']}', + ti_id = '{$character['ch_title']}', wr_width = '$wr_width', wr_height = '$wr_height', wr_url = '$wr_url', diff --git a/AvocadoEdition/skin/board/qna/write_comment_update.php b/AvocadoEdition/skin/board/qna/write_comment_update.php index c31673c..321e605 100644 --- a/AvocadoEdition/skin/board/qna/write_comment_update.php +++ b/AvocadoEdition/skin/board/qna/write_comment_update.php @@ -22,17 +22,17 @@ if (!$is_member) alert("이름은 필히 입력하셔야 합니다."); } -if ($w == "c" || $w == "cu") +if ($w == "c" || $w == "cu") { - if ($member['mb_level'] < $board['bo_comment_level']) + if ($member['mb_level'] < $board['bo_comment_level']) alert("코멘트를 쓸 권한이 없습니다."); -} +} else - alert("w 값이 제대로 넘어오지 않았습니다."); + alert("w 값이 제대로 넘어오지 않았습니다."); // 세션의 시간 검사 // 4.00.15 - 코멘트 수정시 연속 게시물 등록 메시지로 인한 오류 수정 -if ($w == "c" && $_SESSION["ss_datetime"] >= ($g5['server_time'] - $config['cf_delay_sec']) && !$is_admin) +if ($w == "c" && $_SESSION["ss_datetime"] >= ($g5['server_time'] - $config['cf_delay_sec']) && !$is_admin) alert("너무 빠른 시간내에 게시물을 연속해서 올릴 수 없습니다."); set_session("ss_datetime", $g5['server_time']); @@ -50,8 +50,8 @@ if ($row['prev_md5'] == $curr_md5 && $w != 'cu' && !$is_admin) alert("동일한 내용을 연속해서 등록할 수 없습니다."); $wr = get_write($write_table, $wr_id); -if (!$wr['wr_id']) - alert("글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동하였을 수 있습니다."); +if (!$wr['wr_id']) + alert("글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동하였을 수 있습니다."); // 자동등록방지 검사 //include_once ("./norobot_check.inc.php"); @@ -71,7 +71,7 @@ if (!$is_member) { // 이 옵션을 사용 안 함으로 설정할 경우 어떤 스크립트도 실행 되지 않습니다. //if (!trim($_POST["wr_content"])) die ("내용을 입력하여 주십시오."); -if ($member['mb_id']) +if ($member['mb_id']) { $mb_id = $member['mb_id']; // 4.00.13 - 실명 사용일때 코멘트에 별명으로 입력되던 오류를 수정 @@ -79,8 +79,8 @@ if ($member['mb_id']) $wr_password = $member['mb_password']; $wr_email = $member['mb_email']; $wr_homepage = $member['mb_homepage']; -} -else +} +else { $mb_id = ""; $wr_password = sql_password($wr_password); @@ -98,9 +98,9 @@ if ($w == "c") // 코멘트 입력 alert("보유하신 포인트(".number_format($member['mb_point']).")가 없거나 모자라서 코멘트쓰기(".number_format($board['bo_comment_point']).")가 불가합니다.\\n\\n포인트를 적립하신 후 다시 코멘트를 써 주십시오."); // 코멘트 답변 - if ($comment_id) + if ($comment_id) { - $sql = " select wr_id, wr_comment, wr_comment_reply from $write_table + $sql = " select wr_id, wr_comment, wr_comment_reply from $write_table where wr_id = '$comment_id' "; $reply_array = sql_fetch($sql); if (!$reply_array['wr_id']) @@ -116,25 +116,25 @@ if ($w == "c") // 코멘트 입력 $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' + $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 + } + 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' + $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']%' "; + if ($reply_array['wr_comment_reply']) + $sql .= " and wr_comment_reply like '{$reply_array['wr_comment_reply']}%' "; $row = sql_fetch($sql); if (!$row['reply']) @@ -146,9 +146,9 @@ if ($w == "c") // 코멘트 입력 $tmp_comment_reply = $reply_array['wr_comment_reply'] . $reply_char; } - else + else { - $sql = " select max(wr_comment) as max_comment from $write_table + $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; @@ -158,9 +158,9 @@ if ($w == "c") // 코멘트 입력 } $sql = " insert into $write_table - set ca_name = '$wr['ca_name']', + set ca_name = '{$wr['ca_name']}', wr_option = '$wr_secret', - wr_num = '$wr['wr_num']', + wr_num = '{$wr['wr_num']}', wr_reply = '', wr_parent = '$wr_id', wr_is_comment = '1', @@ -173,7 +173,7 @@ if ($w == "c") // 코멘트 입력 wr_name = '$wr_name', wr_email = '$wr_email', wr_homepage = '$wr_homepage', - wr_datetime = '$g5['time_ymdhis']', + wr_datetime = '{$g5['time_ymdhis']}', wr_last = '', wr_ip = '$_SERVER[REMOTE_ADDR]', wr_1 = '$wr_1', @@ -191,14 +191,14 @@ if ($w == "c") // 코멘트 입력 $comment_id = mysql_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 $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 ) values ( '$bo_table', '$comment_id', '$wr_id', '$g5['time_ymdhis']' ) "); - 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']' ) "); + 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' "); + 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, '코멘트'); @@ -212,7 +212,7 @@ if ($w == "c") // 코멘트 입력 $board_admin = get_admin("board"); $wr_subject = get_text(stripslashes($wr['wr_subject'])); - $wr_content = nl2br(get_text(stripslashes("----- 원글 -----\n\n$wr['wr_subject']\n\n\n----- 코멘트 -----\n\n$wr_content"))); + $wr_content = nl2br(get_text(stripslashes("----- 원글 -----\n\n{$wr['wr_subject']}\n\n\n----- 코멘트 -----\n\n$wr_content"))); $warr = array( ""=>"입력", "u"=>"수정", "r"=>"답변", "c"=>"코멘트", "cu"=>"코멘트 수정" ); $str = $warr[$w]; @@ -244,7 +244,7 @@ if ($w == "c") // 코멘트 입력 // 코멘트 쓴 모든이에게 메일 발송이 되어 있다면 (자신에게는 발송하지 않는다) 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']', '' ) + 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)) @@ -258,49 +258,49 @@ if ($w == "c") // 코멘트 입력 mailer($wr_name, $wr_email, $unique_email[$i], $subject, $content, 1); } } -} +} else if ($w == "cu") // 코멘트 수정 -{ - $sql = " select mb_id, wr_comment, wr_comment_reply from $write_table +{ + $sql = " select mb_id, 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; + 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("자신의 글이 아니므로 수정할 수 없습니다."); - } + 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("자신의 글이 아니므로 수정할 수 없습니다."); + } $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_comment = '$tmp_comment' and wr_is_comment = 1 "; $row = sql_fetch($sql); if ($row['cnt'] && !$is_admin) @@ -338,5 +338,5 @@ else if ($w == "cu") // 코멘트 수정 @include_once("$board_skin_path/write_comment_update.skin.php"); @include_once("$board_skin_path/write_comment_update.tail.skin.php"); -goto_url("./board.php?bo_table=$bo_table&wr_id=$wr['wr_parent']&page=$page" . $qstr . "&cwin=$cwin#c_{$comment_id}"); +goto_url("./board.php?bo_table=$bo_table&wr_id={$wr['wr_parent']}&page=$page" . $qstr . "&cwin=$cwin#c_{$comment_id}"); ?>