update board move and fix css

This commit is contained in:
Amberstone 2025-11-26 10:17:52 +09:00
parent 6dbc841037
commit 0d5c5d273b
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
9 changed files with 787 additions and 246 deletions

View file

@ -0,0 +1,12 @@
<?php
if (!defined("_G5_ADMIN_")) {
exit;
}
$ext_table = [
"migrate" => G5_TABLE_PREFIX . "migrations"
];
if (!sql_table_exists($ext_table["migrate"])) {
}

View file

@ -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");

View file

@ -121,7 +121,7 @@ $colspan = 11;
<th scope="col" style="width:80px;">글답변</th>
<th scope="col" style="width:80px;">댓글쓰기</th>
<th scope="col" style="width:80px;">버전</th>
<th scope="col" style="width:90px;">관리</th>
<th scope="col" style="width:150px;">관리</th>
</tr>
</thead>
<tbody>
@ -129,6 +129,7 @@ $colspan = 11;
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$one_update = '<a href="./board_form.php?w=u&amp;bo_table=' . $row['bo_table'] . '&amp;' . $qstr . '">수정</a>';
$one_copy = '<a href="./board_copy.php?bo_table=' . $row['bo_table'] . '" class="board_copy" target="win_board_copy">복사</a>';
$s_move = '<a href="./board_move_list.php?bo_table=' . $row['bo_table'] . '">게시물이동</a>';
// 마이그레이션 필요 여부 체크
$need_migration = false;
@ -189,11 +190,14 @@ $colspan = 11;
<?php } ?>
</td>
<td>
<?php echo $one_update ?>
<?php echo $one_copy ?>
<?php if ($need_migration) { ?>
<br><a href="#" class="btn_migrate" data-bo-table="<?php echo $row['bo_table'] ?>">업데이트</a>
<?php } ?>
<div class="manage_buttons">
<?php echo $one_update ?>
<?php echo $one_copy ?>
<?php echo $s_move ?>
<?php if ($need_migration) { ?>
<br><a href="#" class="btn_migrate" data-bo-table="<?php echo $row['bo_table'] ?>">업데이트</a>
<?php } ?>
</div>
</td>
</tr>
<?php
@ -230,7 +234,7 @@ $colspan = 11;
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page='); ?>
<script>
<script>
function fboardlist_submit(f) {
if (!is_checked("chk[]")) {
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");

View file

@ -0,0 +1,48 @@
<?php
include_once "./_common.php";
header('Content-Type: application/json');
$source_board = isset($_POST['source_board']) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['source_board']) : '';
$target_board = isset($_POST['target_board']) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['target_board']) : '';
if (!$source_board || !$target_board) {
echo json_encode(['warning' => false, 'message' => '']);
exit;
}
$source_table = $g5['write_prefix'] . $source_board;
$target_table = $g5['write_prefix'] . $target_board;
$source_exists = sql_query("SHOW TABLES LIKE '{$source_table}'", false);
$target_exists = sql_query("SHOW TABLES LIKE '{$target_table}'", false);
if (!sql_num_rows($source_exists) || !sql_num_rows($target_exists)) {
echo json_encode(['warning' => true, 'message' => '게시판 테이블이 존재하지 않습니다.']);
exit;
}
$source_columns = [];
$result = sql_query("SHOW COLUMNS FROM {$source_table}");
while ($row = sql_fetch_array($result)) {
$source_columns[] = $row['Field'];
}
$target_columns = [];
$result = sql_query("SHOW COLUMNS FROM {$target_table}");
while ($row = sql_fetch_array($result)) {
$target_columns[] = $row['Field'];
}
$missing_columns = array_diff($source_columns, $target_columns);
$exclude_columns = ['wr_id', 'wr_num', 'wr_reply', 'wr_parent'];
$missing_columns = array_diff($missing_columns, $exclude_columns);
if (count($missing_columns) > 0) {
$message = '대상 게시판에 존재하지 않는 필드가 있어 해당 데이터는 복사되지 않습니다: ' . implode(', ', $missing_columns);
echo json_encode(['warning' => true, 'message' => $message]);
} else {
echo json_encode(['warning' => false, 'message' => '']);
}
?>

View file

@ -0,0 +1,295 @@
<?php
include_once "./_common.php";
auth_check($auth[$sub_menu], 'r');
$bo_table = isset($_GET['bo_table']) ? preg_replace('/[^a-z0-9_]/i', '', $_GET['bo_table']) : '';
if (!$bo_table) {
alert('게시판을 선택해주세요.');
}
$board = sql_fetch(" SELECT * FROM {$g5['board_table']} WHERE bo_table = '{$bo_table}' ");
if (!$board) {
alert('존재하지 않는 게시판입니다.');
}
$write_table = $g5['write_prefix'] . $bo_table;
$sfl = isset($_GET['sfl']) ? clean_xss_tags($_GET['sfl']) : '';
$stx = isset($_GET['stx']) ? clean_xss_tags($_GET['stx']) : '';
$sst = isset($_GET['sst']) ? preg_replace('/[^a-z0-9_]/i', '', $_GET['sst']) : 'wr_num';
$sod = isset($_GET['sod']) && in_array($_GET['sod'], ['asc', 'desc']) ? $_GET['sod'] : 'desc';
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$sql_common = " FROM {$write_table} ";
$sql_search = " WHERE (1) ";
if ($stx) {
$sql_search .= " AND ( ";
switch ($sfl) {
case "wr_subject":
case "wr_content":
$sql_search .= " ({$sfl} LIKE '%{$stx}%') ";
break;
case "wr_name":
$sql_search .= " (wr_name LIKE '%{$stx}%') ";
break;
default:
$sql_search .= " (wr_subject LIKE '%{$stx}%' OR wr_content LIKE '%{$stx}%') ";
break;
}
$sql_search .= " ) ";
}
$sql_order = " ORDER BY {$sst} {$sod} ";
$sql = " SELECT COUNT(*) AS cnt {$sql_common} {$sql_search} ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows);
if ($page < 1)
$page = 1;
$from_record = ($page - 1) * $rows;
$sql = " SELECT * {$sql_common} {$sql_search} {$sql_order} LIMIT {$from_record}, {$rows} ";
$result = sql_query($sql);
$board_list = [];
$board_sql = " SELECT bo_table, bo_subject FROM {$g5['board_table']} WHERE bo_table != '{$bo_table}' ORDER BY gr_id, bo_table ";
$board_result = sql_query($board_sql);
while ($row = sql_fetch_array($board_result)) {
$board_list[] = $row;
}
$qstr = 'bo_table=' . $bo_table;
if ($sfl)
$qstr .= '&sfl=' . $sfl;
if ($stx)
$qstr .= '&stx=' . urlencode($stx);
if ($sst)
$qstr .= '&sst=' . $sst;
if ($sod)
$qstr .= '&sod=' . $sod;
if ($page)
$qstr .= '&page=' . $page;
$listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?bo_table=' . $bo_table . '" class="ov_listall">처음</a>';
$g5['title'] = '게시물 이동/복사';
include_once "./admin.head.php";
$colspan = 8;
?>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
<strong><?php echo get_text($board['bo_subject']) ?> (<?php echo $bo_table ?>)</strong>
전체게시물 <?php echo number_format($total_count) ?>
</div>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="wr_subject" <?php echo get_selected($sfl, "wr_subject"); ?>>제목</option>
<option value="wr_content" <?php echo get_selected($sfl, "wr_content"); ?>>내용</option>
<option value="wr_name" <?php echo get_selected($sfl, "wr_name"); ?>>작성자</option>
<option value="wr_subject||wr_content" <?php echo get_selected($sfl, "wr_subject||wr_content"); ?>>제목+내용</option>
</select>
<label for="stx" class="sound_only">검색어</label>
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" class="frm_input">
<input type="submit" value="검색" class="btn_submit">
</form>
<br />
<form name="fwritelist" id="fwritelist" action="./board_move_update.php" onsubmit="return fwritelist_submit(this);"
method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="act_button" value="">
<input type="hidden" name="target_board" id="target_board_hidden" value="">
<div class="tbl_head01 tbl_wrap">
<div class="btn_left">
<label for="target_board_select">대상 게시판 선택:</label>
<select name="target_board_select" id="target_board_select" class="frm_input">
<option value="">선택하세요</option>
<?php foreach ($board_list as $b) { ?>
<option value="<?php echo $b['bo_table'] ?>"><?php echo get_text($b['bo_subject']) ?>
(<?php echo $b['bo_table'] ?>)</option>
<?php } ?>
</select>
<span id="warning_msg" style="color:#ff0000;margin-left:10px;display:none;"></span>
</div>
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<colgroup>
<col style="width:45px;">
<col style="width:80px;">
<col>
<col style="width:120px;">
<col style="width:80px;">
<col style="width:80px;">
<col style="width:120px;">
</colgroup>
<thead>
<tr>
<th scope="col">
<label for="chkall" class="sound_only">전체선택</label>
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
</th>
<th scope="col">번호</th>
<th scope="col">제목</th>
<th scope="col">작성자</th>
<th scope="col">조회</th>
<th scope="col">댓글</th>
<th scope="col">작성일</th>
</tr>
</thead>
<tbody>
<?php
$list = [];
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$list[$i] = get_list($row, $board, $board['bo_subject'], $board['bo_mobile_subject']);
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_chk">
<input type="checkbox" name="chk[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_num"><?php echo $list[$i]['wr_id'] ?></td>
<td class="td_subject">
<?php echo $list[$i]['reply'] ?>
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>&wr_id=<?php echo $list[$i]['wr_id'] ?>"
target="_blank">
<?php echo $list[$i]['subject'] ?>
<?php if ($list[$i]['icon_file'])
echo ' ' . $list[$i]['icon_file']; ?>
<?php if ($list[$i]['icon_new'])
echo ' ' . $list[$i]['icon_new']; ?>
</a>
</td>
<td class="td_name"><?php echo $list[$i]['name'] ?></td>
<td class="td_num"><?php echo $list[$i]['wr_hit'] ?></td>
<td class="td_num"><?php echo $list[$i]['wr_comment'] ?></td>
<td class="td_date"><?php echo $list[$i]['datetime2'] ?></td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<div class="btn_confirm">
<div class="btn ty3">
<span class="material-icons">drive_file_move</span>
<input type="submit" name="act_btn" value="선택이동" title="선택이동" onclick="document.pressed='move'">
</div>
<div class="btn ty3">
<span class="material-icons">content_copy</span>
<input type="submit" name="act_btn" value="선택복사" title="선택복사" onclick="document.pressed='copy'">
</div>
</div>
</form>
<br />
<?php
$pagelist = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&page=');
echo $pagelist;
?>
<div class="local_desc01 local_desc">
<p>
<strong>이동:</strong> 선택한 게시물을 대상 게시판으로 이동합니다. 원본 게시물은 삭제됩니다.<br>
<strong>복사:</strong> 선택한 게시물을 대상 게시판에 복사합니다. 원본 게시물은 유지됩니다.<br>
게시판 테이블 구조가 다른 경우, 존재하는 필드만 복사되며 경고 메시지가 표시됩니다.
</p>
</div>
<script>
var warningShown = false;
function fwritelist_submit(f) {
var targetBoard = document.getElementById('target_board_select').value;
if (!is_checked("chk[]")) {
alert(document.pressed === 'move' ? '이동' : '복사' + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if (!targetBoard) {
alert('대상 게시판을 선택하세요.');
document.getElementById('target_board_select').focus();
return false;
}
f.target_board.value = targetBoard;
f.act_button.value = document.pressed;
var actionText = (document.pressed === 'move') ? '이동' : '복사';
var confirmMsg = '선택한 게시물을 ' + actionText + '하시겠습니까?';
if (document.pressed === 'move') {
confirmMsg += '\n\n원본 게시물은 삭제됩니다.';
}
if (warningShown) {
confirmMsg += '\n\n경고: 일부 필드가 복사되지 않을 수 있습니다.';
}
if (!confirm(confirmMsg)) {
return false;
}
return true;
}
document.getElementById('target_board_select').addEventListener('change', function () {
var targetBoard = this.value;
var sourceBoard = '<?php echo $bo_table ?>';
warningShown = false;
document.getElementById('warning_msg').style.display = 'none';
document.getElementById('warning_msg').innerHTML = '';
if (!targetBoard) {
return;
}
var xhr = new XMLHttpRequest();
xhr.open('POST', './board_move_check.php', true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
if (xhr.status === 200) {
try {
var response = JSON.parse(xhr.responseText);
if (response.warning) {
warningShown = true;
document.getElementById('warning_msg').innerHTML = '⚠ ' + response.message;
document.getElementById('warning_msg').style.display = 'inline';
}
} catch (e) {
console.error('Error parsing response:', e);
}
}
};
xhr.send('source_board=' + sourceBoard + '&target_board=' + targetBoard);
});
</script>
<?php
include_once "./admin.tail.php";
?>

View file

@ -0,0 +1,282 @@
<?php
include_once "./_common.php";
auth_check($auth[$sub_menu], 'w');
$bo_table = isset($_POST['bo_table']) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['bo_table']) : '';
$target_board = isset($_POST['target_board']) ? preg_replace('/[^a-z0-9_]/i', '', $_POST['target_board']) : '';
$act_button = isset($_POST['act_button']) ? $_POST['act_button'] : '';
$chk = isset($_POST['chk']) ? $_POST['chk'] : [];
if (!in_array($act_button, ['move', 'copy'])) {
alert('잘못된 요청입니다.');
}
if (!$bo_table || !$target_board || !$act_button || empty($chk)) {
alert('필수 항목이 누락되었습니다.');
}
if ($bo_table === $target_board) {
alert('같은 게시판으로는 이동/복사할 수 없습니다.');
}
$source_board = sql_fetch("SELECT * FROM {$g5['board_table']} WHERE bo_table = '{$bo_table}'");
$dest_board = sql_fetch("SELECT * FROM {$g5['board_table']} WHERE bo_table = '{$target_board}'");
if (!$source_board || !$dest_board) {
alert('존재하지 않는 게시판입니다.');
}
$source_table = $g5['write_prefix'] . $bo_table;
$target_table = $g5['write_prefix'] . $target_board;
$source_columns = [];
$result = sql_query("SHOW COLUMNS FROM {$source_table}");
while ($row = sql_fetch_array($result)) {
$source_columns[$row['Field']] = $row;
}
$target_columns = [];
$result = sql_query("SHOW COLUMNS FROM {$target_table}");
while ($row = sql_fetch_array($result)) {
$target_columns[$row['Field']] = $row;
}
$exclude_fields = ['wr_id', 'wr_num'];
$common_columns = [];
foreach ($source_columns as $col_name => $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}'");
}
?>

View file

@ -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;

View file

@ -10,16 +10,11 @@ add_stylesheet('<link rel="stylesheet" href="' . $member_skin_url . '/style.admi
<div class="inner">
<h1>
<em>
<strong><?= $config['cf_title'] ?> 관리자</strong> 로그인
<?= $config['cf_title'] ?>
</em>
<span>
AVOCADO EDITION Ver.<?= G5_GNUBOARD_VER ?>
Ver.<?= G5_GNUBOARD_VER ?>
</span>
<sup>
관리자 비번을 잊을 , DB 접속을 통해 직접 변경 하여야 합니다.<br />
최대한 비밀번호를 잊지 않도록 조심해 주시길 바랍니다.<br />
DB 관리툴은 호스팅 업체에 문의해 주시길 바랍니다.
</sup>
</h1>
</div>
</div>

View file

@ -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;
}