From 0d5c5d273bd785eec8826d73be5d704477e0baad Mon Sep 17 00:00:00 2001 From: Arcturus Date: Wed, 26 Nov 2025 10:17:52 +0900 Subject: [PATCH] update board move and fix css --- AvocadoAmber/adm/_admin.mgirate.db.php | 12 + AvocadoAmber/adm/_gnb.002.content.menu.php | 2 + AvocadoAmber/adm/board_list.php | 18 +- AvocadoAmber/adm/board_move_check.php | 48 +++ AvocadoAmber/adm/board_move_list.php | 295 +++++++++++++++++ AvocadoAmber/adm/board_move_update.php | 282 ++++++++++++++++ AvocadoAmber/adm/css/default.css | 63 +++- .../skin/member/basic/login.admin.skin.php | 9 +- .../skin/member/basic/style.admin.css | 304 +++++------------- 9 files changed, 787 insertions(+), 246 deletions(-) create mode 100644 AvocadoAmber/adm/_admin.mgirate.db.php create mode 100644 AvocadoAmber/adm/board_move_check.php create mode 100644 AvocadoAmber/adm/board_move_list.php create mode 100644 AvocadoAmber/adm/board_move_update.php diff --git a/AvocadoAmber/adm/_admin.mgirate.db.php b/AvocadoAmber/adm/_admin.mgirate.db.php new file mode 100644 index 0000000..234235f --- /dev/null +++ b/AvocadoAmber/adm/_admin.mgirate.db.php @@ -0,0 +1,12 @@ + G5_TABLE_PREFIX . "migrations" +]; + +if (!sql_table_exists($ext_table["migrate"])) { + +} diff --git a/AvocadoAmber/adm/_gnb.002.content.menu.php b/AvocadoAmber/adm/_gnb.002.content.menu.php index 64e77e8..5b47006 100644 --- a/AvocadoAmber/adm/_gnb.002.content.menu.php +++ b/AvocadoAmber/adm/_gnb.002.content.menu.php @@ -30,6 +30,8 @@ $menu["content"]->getLastAddedMenu()->addSubFile("/board_form_update.php"); $menu["content"]->getLastAddedMenu()->addSubFile("/board_delete.php"); $menu["content"]->getLastAddedMenu()->addSubFile("/board_copy.php"); $menu["content"]->getLastAddedMenu()->addSubFile("/board_copy_update.php"); +$menu["content"]->getLastAddedMenu()->addSubFile("/board_move_list.php"); +$menu["content"]->getLastAddedMenu()->addSubFile("/board_move_check.php"); $menu["content"]->addChildMenu("content", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 100, "\F2EE", 0); $menu["content"]->getLastAddedMenu()->addSubFile("/boardgroup_list_update.php"); diff --git a/AvocadoAmber/adm/board_list.php b/AvocadoAmber/adm/board_list.php index 5259b74..21568e3 100644 --- a/AvocadoAmber/adm/board_list.php +++ b/AvocadoAmber/adm/board_list.php @@ -121,7 +121,7 @@ $colspan = 11; 글답변 댓글쓰기 버전 - 관리 + 관리 @@ -129,6 +129,7 @@ $colspan = 11; for ($i = 0; $row = sql_fetch_array($result); $i++) { $one_update = '수정'; $one_copy = '복사'; + $s_move = '게시물이동'; // 마이그레이션 필요 여부 체크 $need_migration = false; @@ -189,11 +190,14 @@ $colspan = 11; - - - -
업데이트 - +
+ + + + +
업데이트 + +
- + + diff --git a/AvocadoAmber/adm/board_move_update.php b/AvocadoAmber/adm/board_move_update.php new file mode 100644 index 0000000..6ada99c --- /dev/null +++ b/AvocadoAmber/adm/board_move_update.php @@ -0,0 +1,282 @@ + $col_info) { + if (isset($target_columns[$col_name]) && !in_array($col_name, $exclude_fields)) { + $common_columns[] = $col_name; + } +} + +if (empty($common_columns)) { + alert('복사할 수 있는 공통 컬럼이 없습니다.'); +} + +$success_count = 0; +$fail_count = 0; +$error_messages = []; + +foreach ($chk as $wr_id) { + $wr_id = (int) $wr_id; + + $write = sql_fetch("SELECT * FROM {$source_table} WHERE wr_id = '{$wr_id}'"); + + if (!$write) { + $fail_count++; + $error_messages[] = "게시물 ID {$wr_id}를 찾을 수 없습니다."; + continue; + } + + $is_reply = $write['wr_reply'] ? true : false; + + if ($is_reply && $act_button === 'move') { + $parent_id = $write['wr_parent']; + $parent_check = sql_fetch("SELECT wr_id FROM {$source_table} WHERE wr_id = '{$parent_id}'"); + if (!$parent_check) { + $write['wr_reply'] = ''; + $write['wr_parent'] = 0; + } + } + + try { + $insert_values = []; + $insert_fields = []; + + foreach ($common_columns as $col) { + if ($col === 'wr_num') + continue; + + if ($col === 'wr_reply' || $col === 'wr_parent') { + if ($col === 'wr_reply') { + $insert_fields[] = $col; + $insert_values[] = "''"; + } else if ($col === 'wr_parent') { + $insert_fields[] = $col; + $insert_values[] = "0"; + } + continue; + } + + $insert_fields[] = $col; + $value = $write[$col]; + + if ($col === 'bo_table') { + $insert_values[] = "'{$target_board}'"; + } else { + $insert_values[] = "'" . sql_real_escape_string($value) . "'"; + } + } + + $row = sql_fetch("SELECT MIN(wr_num) AS min_wr_num FROM {$target_table}"); + $wr_num = $row['min_wr_num'] - 1; + + $insert_fields[] = 'wr_num'; + $insert_values[] = "'{$wr_num}'"; + + $sql = "INSERT INTO {$target_table} (" . implode(', ', $insert_fields) . ") + VALUES (" . implode(', ', $insert_values) . ")"; + + sql_query($sql); + $new_wr_id = sql_insert_id(); + + if ($write['wr_file']) { + copy_board_files($bo_table, $wr_id, $target_board, $new_wr_id, $write); + } + + if ($act_button === 'move') { + sql_query("DELETE FROM {$g5['board_new_table']} WHERE bo_table = '{$bo_table}' AND wr_id = '{$wr_id}'"); + sql_query("DELETE FROM {$g5['board_good_table']} WHERE bo_table = '{$bo_table}' AND wr_id = '{$wr_id}'"); + + sql_query("DELETE FROM {$source_table} WHERE wr_id = '{$wr_id}'"); + + move_board_files($bo_table, $wr_id, $target_board, $new_wr_id); + } + + sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write + 1 WHERE bo_table = '{$target_board}'"); + + if ($act_button === 'move') { + sql_query("UPDATE {$g5['board_table']} SET bo_count_write = bo_count_write - 1 WHERE bo_table = '{$bo_table}'"); + } + + $success_count++; + + } catch (Exception $e) { + $fail_count++; + $error_messages[] = "게시물 ID {$wr_id} 처리 중 오류: " . $e->getMessage(); + } +} + +$action_text = ($act_button === 'move') ? '이동' : '복사'; +$message = "{$success_count}개의 게시물이 {$action_text}되었습니다."; + +if ($fail_count > 0) { + $message .= "\\n{$fail_count}개의 게시물 처리 중 오류가 발생했습니다."; + if (!empty($error_messages)) { + $message .= "\\n\\n상세 오류:\\n" . implode("\\n", array_slice($error_messages, 0, 5)); + if (count($error_messages) > 5) { + $message .= "\\n... 외 " . (count($error_messages) - 5) . "건"; + } + } +} + +$qstr = 'bo_table=' . $bo_table; +if (isset($_POST['sod'])) + $qstr .= '&sod=' . $_POST['sod']; +if (isset($_POST['sfl'])) + $qstr .= '&sfl=' . $_POST['sfl']; +if (isset($_POST['stx'])) + $qstr .= '&stx=' . urlencode($_POST['stx']); +if (isset($_POST['page'])) + $qstr .= '&page=' . $_POST['page']; + +goto_url('./board_move_list.php?' . $qstr, false, $message); + +function copy_board_files($source_bo_table, $source_wr_id, $target_bo_table, $target_wr_id, $write_data) +{ + global $g5; + + $source_dir = G5_DATA_PATH . '/file/' . $source_bo_table; + $target_dir = G5_DATA_PATH . '/file/' . $target_bo_table; + + if (!is_dir($target_dir)) { + @mkdir($target_dir, G5_DIR_PERMISSION); + @chmod($target_dir, G5_DIR_PERMISSION); + } + + for ($i = 0; $i < 10; $i++) { + $file_field = 'wr_file' . $i; + $source_field = 'bf_source' . $i; + + if (isset($write_data[$file_field]) && $write_data[$file_field]) { + $source_file = $source_dir . '/' . $write_data[$file_field]; + + if (file_exists($source_file)) { + $new_filename = $target_wr_id . '_' . $i . '_' . time() . substr($write_data[$file_field], strrpos($write_data[$file_field], '.')); + $target_file = $target_dir . '/' . $new_filename; + + if (@copy($source_file, $target_file)) { + @chmod($target_file, G5_FILE_PERMISSION); + + $bf_source = isset($write_data[$source_field]) ? $write_data[$source_field] : basename($write_data[$file_field]); + $bf_filesize = filesize($target_file); + $bf_width = 0; + $bf_height = 0; + $bf_type = 0; + + if (preg_match("/\.(gif|jpg|jpeg|png)$/i", $new_filename)) { + $size = @getimagesize($target_file); + if ($size) { + $bf_width = $size[0]; + $bf_height = $size[1]; + $bf_type = $size[2]; + } + } + + $sql = " INSERT INTO {$g5['board_file_table']} + SET bo_table = '{$target_bo_table}', + wr_id = '{$target_wr_id}', + bf_no = '{$i}', + bf_source = '" . sql_real_escape_string($bf_source) . "', + bf_file = '{$new_filename}', + bf_download = 0, + bf_content = '', + bf_filesize = '{$bf_filesize}', + bf_width = '{$bf_width}', + bf_height = '{$bf_height}', + bf_type = '{$bf_type}', + bf_datetime = '" . G5_TIME_YMDHIS . "' "; + sql_query($sql); + } + } + } + } +} + +function move_board_files($source_bo_table, $source_wr_id, $target_bo_table, $target_wr_id) +{ + global $g5; + + $sql = "SELECT * FROM {$g5['board_file_table']} + WHERE bo_table = '{$source_bo_table}' AND wr_id = '{$source_wr_id}' + ORDER BY bf_no"; + $result = sql_query($sql); + + $source_dir = G5_DATA_PATH . '/file/' . $source_bo_table; + $target_dir = G5_DATA_PATH . '/file/' . $target_bo_table; + + if (!is_dir($target_dir)) { + @mkdir($target_dir, G5_DIR_PERMISSION); + @chmod($target_dir, G5_DIR_PERMISSION); + } + + while ($row = sql_fetch_array($result)) { + $source_file = $source_dir . '/' . $row['bf_file']; + + if (file_exists($source_file)) { + $new_filename = $target_wr_id . '_' . $row['bf_no'] . '_' . time() . substr($row['bf_file'], strrpos($row['bf_file'], '.')); + $target_file = $target_dir . '/' . $new_filename; + + if (@rename($source_file, $target_file)) { + $sql = " INSERT INTO {$g5['board_file_table']} + SET bo_table = '{$target_bo_table}', + wr_id = '{$target_wr_id}', + bf_no = '{$row['bf_no']}', + bf_source = '" . sql_real_escape_string($row['bf_source']) . "', + bf_file = '{$new_filename}', + bf_download = '{$row['bf_download']}', + bf_content = '" . sql_real_escape_string($row['bf_content']) . "', + bf_filesize = '{$row['bf_filesize']}', + bf_width = '{$row['bf_width']}', + bf_height = '{$row['bf_height']}', + bf_type = '{$row['bf_type']}', + bf_datetime = '{$row['bf_datetime']}' "; + sql_query($sql); + } + } + } + + sql_query("DELETE FROM {$g5['board_file_table']} WHERE bo_table = '{$source_bo_table}' AND wr_id = '{$source_wr_id}'"); +} +?> diff --git a/AvocadoAmber/adm/css/default.css b/AvocadoAmber/adm/css/default.css index b14acd0..3be5994 100644 --- a/AvocadoAmber/adm/css/default.css +++ b/AvocadoAmber/adm/css/default.css @@ -1436,15 +1436,53 @@ span.empty { } #gnb { + margin-left: 8px; display: block; position: relative; font-family: 'Noto Sans KR', sans-serif; } +#gnb .gnb_1dli { + position: relative; + overflow: hidden; +} + +#gnb .gnb_1dli>a { + padding: 8px; + line-height: 16px; +} + +#gnb .gnb_1dli>ul { + padding: 0; + margin: 0 0 0 8px; +} + +#gnb .gnb_1dli.on>a { + color: var(--theme-200); +} + +#gnb .gnb_1dli.on>ul { + position: relative; + overflow: hidden; + border-radius: 4px; +} + +#gnb .gnb_1dli.on>ul::before { + content:""; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: .25; + background: var(--theme-sub-900); + display: block; +} + #gnb>ul>li>a { display: block; padding: 8px 16px; - color: #9da4b3; + color: var(--theme-gray-200); font-size: 15px; text-decoration: none; } @@ -1482,10 +1520,22 @@ span.empty { #gnb .gnb_2dli>a:hover { color: #fff; - background: #484c58; + background: var(--theme-sub-700); text-decoration: none; } +#gnb .gnb_2dli>a:hover:before { + color: var(--theme-sub-100); +} + +#gnb .gnb_2dli.on>a:hover { + background: var(--theme-700); +} + +#gnb .gnb_2dli.on>a:hover:before { + color: var(--theme-100); +} + #gnb .gnb_2dul { display: none; } @@ -1803,6 +1853,7 @@ body #container { z-index: 0; } +.btn_confirm .btn>input[type=submit], .btn_confirm .btn>.btn_submit { position: absolute; display: block; @@ -1813,18 +1864,26 @@ body #container { cursor: pointer; } +.manage_buttons { + display: flex; + gap: 8px; + justify-content: space-between; +} + .btn_confirm .btn, .btn_confirm a, .btn_confirm button { background: var(--theme-gray-600); margin-left: 1px; } + .btn_confirm .btn>span, .btn_confirm a>*, .btn_confirm button>* { pointer-events: none; } +.btn_confirm .btn>input[type=submit], .btn_confirm a, .btn_confirm button { box-sizing: border-box; diff --git a/AvocadoAmber/skin/member/basic/login.admin.skin.php b/AvocadoAmber/skin/member/basic/login.admin.skin.php index 2dc2fce..e6ac7f8 100644 --- a/AvocadoAmber/skin/member/basic/login.admin.skin.php +++ b/AvocadoAmber/skin/member/basic/login.admin.skin.php @@ -10,16 +10,11 @@ add_stylesheet('

- 관리자 로그인 + - AVOCADO EDITION Ver. + Ver. - - 관리자 비번을 잊을 시, DB 접속을 통해 직접 변경 하여야 합니다.
- 최대한 비밀번호를 잊지 않도록 조심해 주시길 바랍니다.
- DB 관리툴은 호스팅 업체에 문의해 주시길 바랍니다. -

diff --git a/AvocadoAmber/skin/member/basic/style.admin.css b/AvocadoAmber/skin/member/basic/style.admin.css index 5e8ed41..19a49ec 100644 --- a/AvocadoAmber/skin/member/basic/style.admin.css +++ b/AvocadoAmber/skin/member/basic/style.admin.css @@ -1,265 +1,109 @@ @charset "utf-8"; -@import url(//fonts.googleapis.com/earlyaccess/notosanskr.css); +@import url(../../../adm/css/default.css); -@font-face { - font-family: 'icon'; - src: url('../../../css/fonts/icomoon.eot?y5isk6'); - src: url('../../../css/fonts/icomoon.eot?y5isk6#iefix') format('embedded-opentype'), - url('../../../css/fonts/icomoon.ttf?y5isk6') format('truetype'), - url('../../../css/fonts/icomoon.woff?y5isk6') format('woff'), - url('../../../css/fonts/icomoon.svg?y5isk6#icomoon') format('svg'); - font-weight: normal; - font-style: normal; +/* override */ +html, body { + display: block; + padding: 0; + margin: 0; } -html, body { - position: relative; - height: 100%; - background: #fff; + background: var(--white); } #login_page_box { position: relative; + width: 100%; height: 100%; -} - -#login_page_box:before { - content: ""; - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 50%; - box-sizing: border-box; - border-top: 8px solid #ffbf00; - background: url('./img/bak_admin_login_top_pattern.png'); - z-index: 0; -} - -#login_page_box:after { - content: ""; - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 50%; - - background: rgba(0, 0, 0, 0); - background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.5) 100%); - background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(65%, rgba(0, 0, 0, 0)), color-stop(100%, rgba(0, 0, 0, 0.5))); - background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.5) 100%); - background: -o-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.5) 100%); - background: -ms-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.5) 100%); - background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 65%, rgba(0, 0, 0, 0.5) 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#000000', GradientType=0); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } #login_title { - display: block; - position: relative; - height: 50%; - padding-bottom: 130px; - box-sizing: border-box; - z-index: 3; -} - -#login_title .inner { - position: relative; - width: 100%; - height: 100%; -} - -#login_title h1 { position: absolute; - top: 50%; - left: 50%; - transform: translateX(-50%) translateY(-50%); - font-family: 'Noto Sans KR', sans-serif; - font-size: 35px; - font-weight: 600; -} - -#login_title em { - font-style: normal; - color: #ffbf00; - text-align: center; - line-height: 1.5em; -} - -#login_title em strong { - color: #fff; -} - -#login_title span { - display: block; - font-size: 16px; - font-weight: 400; - color: #999; - text-align: center; -} - -#login_title sup { - display: block; - position: relative; - font-size: 13px; - font-weight: 300; - text-align: center; - padding: 0; - margin-top: 20px; - color: #777; + left: 0; + top: 0; + width: 100%; + height: 50vh; + display: flex; + box-sizing: border-box; + padding: 20px; + justify-content: start; + align-items: center; + flex-direction: column; + background: linear-gradient(to top, rgba(0,0,0,1) 0%, var(--theme-gray-900) 50%, var(--theme-gray-900) 100%); } #mb_login { - position: absolute; - top: 50%; - left: 50%; - width: 500px; - height: 260px; - - border-top: 5px solid #ffbf00; - - transform: translateX(-50%) translateY(-50%); - background: #fff; - - -webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.49); - -moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.49); - box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.49); - - z-index: 5; -} - - -#mb_login:before { - content: ""; - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: -20px; - background: #fff; - z-index: 0; -} - -#mb_login .inner { position: relative; - padding: 30px; - z-index: 1; -} - -#mb_login fieldset.input { - display: block; - position: relative; - margin-bottom: 5px; - margin-right: 130px; -} - -#mb_login fieldset.input input { - display: block; - width: 100%; + padding: 40px; + border-radius: 16px; + background: var(--white); + min-width: 360px; box-sizing: border-box; - - background: #fff !important; - color: #3a3a3b; - height: 45px; - padding: 0 15px 0 45px; - font-size: 15px; - font-family: 'Noto Sans KR', sans-serif; - outline: none; - border: 1px solid #eaeaea; + filter: drop-shadow(0 0 15px #0002); } -#mb_login fieldset.input input:focus { - border: 2px solid #ffbf00; -} - -#mb_login fieldset.input label { - display: block; - position: absolute; - top: 0; - left: 0; - width: 45px; - height: 45px; - line-height: 45px; - overflow: hidden; - text-indent: -999px; - -} - -#mb_login fieldset.input label:before { - display: block; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - text-indent: 0; - text-align: center; - font-family: 'icon'; - font-size: 16px; - color: #ccc; -} - -#mb_login fieldset.input input:focus+label:before { - color: #ffbf00; -} - -#mb_login fieldset.input label.login_id:before { - content: "\e976"; -} - -#mb_login fieldset.input label.login_pw:before { - content: "\e98e"; -} - -#mb_login fieldset.input input:-webkit-autofill { - transition: background-color 50000s ease-in-out 0s; - -webkit-box-shadow: 0 0 0 30px white inset; - -webkit-text-fill-color: #3a3a3b !important; -} - -#mb_login fieldset.check { +#mb_login fieldset { display: block; position: relative; - padding: 5px; - background: #f6f6f6; - border: 1px solid #ebebeb; - color: #3a3a3a; - margin: 5px 130px 5px 0; - font-size: 11px; + padding-top: 1.5em; + margin-bottom: 1em; } -#mb_login fieldset.check label { - cursor: pointer; -} - -#mb_login fieldset.button { +#mb_login fieldset label{ display: block; position: absolute; - top: 30px; - right: 30px; - width: 126px; - height: 128px; + left: 0; + top: 0em; + color: var(--theme-gray-500); } -#mb_login fieldset.button .btn_submit { - display: block; +#mb_login fieldset input:not([type=checkbox]) { width: 100%; - height: 100%; - background: #ffbf00; - font-family: 'Noto Sans KR', sans-serif; - font-size: 18px; - border: none; - cursor: pointer; - color: #fff; + display: block; + box-sizing: border-box; + padding: 4px 8px; + line-height: 2em; + height: auto; + border-radius: 4px; +} + +#mb_login fieldset button.btn_submit { + display: block; + box-sizing: border-box; + border: unset; + width: 100%; + height: auto; + line-height: 3em; + border-radius: 4px; } #copyright { - padding-top: 30px; - font-size: 12px; - color: #aaa; + color: var(--theme-gray-500); text-align: center; + font-size: 11px; + border-top: 1px solid var(--theme-gray-100); + margin-top: 1em; + padding-top: 1em; +} + +#login_title .inner h1 { + color: var(--white); + display: flex; + flex-direction: column; + text-align: center; + line-height: 1.25em; +} + +#login_title .inner h1 span { + font-size: 14px; +} + +#login_title .inner h1 sup { + font-size: 16px; + line-height: 1.25em; }