This commit is contained in:
Amberstone 2025-12-07 01:55:12 +09:00
parent adf8c56665
commit a82695bb4e
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
52 changed files with 4016 additions and 991 deletions

3
.gitignore vendored
View file

@ -62,3 +62,6 @@
error.log error.log
access.log access.log
build.log build.log
net.json # for traffic
/net.json
[Aa]vocado[Aa]mber/net.json

3
AvocadoAmber/.htaccess Normal file
View file

@ -0,0 +1,3 @@
RewriteEngine On
RewriteRule ^(\.git|\.ht|\.travis|codeception\.|composer\.|Gruntfile\.js|package\.json|CONTRIBUTING|COPYRIGHT|LICENSE|README) - [L,F]

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_delete.php");
$menu["content"]->getLastAddedMenu()->addSubFile("/board_copy.php"); $menu["content"]->getLastAddedMenu()->addSubFile("/board_copy.php");
$menu["content"]->getLastAddedMenu()->addSubFile("/board_copy_update.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"]->addChildMenu("content", "게시판그룹관리", G5_ADMIN_URL . "/boardgroup_list.php", true, 100, "\F2EE", 0);
$menu["content"]->getLastAddedMenu()->addSubFile("/boardgroup_list_update.php"); $menu["content"]->getLastAddedMenu()->addSubFile("/boardgroup_list_update.php");

View file

@ -31,15 +31,15 @@ include_once G5_PATH . '/head.sub.php';
<header id="header"> <header id="header">
<div id="admin_prof"> <div id="admin_prof">
<h1> <h1>
<a href="<?php echo G5_ADMIN_URL ?>"><img src="<?= G5_ADMIN_URL ?>/img/logo.png" alt="Avocado Edition" /></a> <a href="<?php echo G5_ADMIN_URL ?>"><img src="<?= G5_ADMIN_URL ?>/img/logo.png" alt="Avocado Edition: Amber" /></a>
</h1> </h1>
</div>
<p> <p>
<a href="<?php echo G5_ADMIN_URL ?>/member_form.php?w=u&amp;mb_id=<?php echo $member['mb_id'] ?>" class="name"> <a href="<?php echo G5_ADMIN_URL ?>/member_form.php?w=u&amp;mb_id=<?php echo $member['mb_id'] ?>" class="name">
<?= $member['mb_name'] ?> <?= $member['mb_name'] ?>
</a> </a>
<a href="<?php echo G5_BBS_URL ?>/logout.php" class="logout">로그아웃</a> <a href="<?php echo G5_BBS_URL ?>/logout.php" class="logout">로그아웃</a>
</p> </p>
</div>
<nav id="gnb"> <nav id="gnb">
<ul> <ul>
<li style="border-bottom:1px solid #444;"> <li style="border-bottom:1px solid #444;">
@ -65,6 +65,7 @@ include_once G5_PATH . '/head.sub.php';
</nav> </nav>
</header> </header>
<section id="wrapper"> <section id="wrapper">
<div class="admin-content">
<aside id="page_top"> <aside id="page_top">
<h2><?php echo $g5['title'] ?></h2> <h2><?php echo $g5['title'] ?></h2>
</aside> </aside>

View file

@ -2,6 +2,7 @@
if (!defined('_GNUBOARD_')) if (!defined('_GNUBOARD_'))
exit; exit;
?> ?>
</div>
<div class="footer-copyright"> <div class="footer-copyright">
<a href="https://amberst.one/amber/AvocadoAmber" target="_blank"> Avocado Amber v<?= G5_GNUBOARD_VER ?> </a> <a href="https://amberst.one/amber/AvocadoAmber" target="_blank"> Avocado Amber v<?= G5_GNUBOARD_VER ?> </a>
</div> </div>
@ -11,6 +12,17 @@ if (!defined('_GNUBOARD_'))
<script src="<?php echo G5_ADMIN_URL ?>/js/admin.js?ver=<?php echo G5_JS_VER; ?>"></script> <script src="<?php echo G5_ADMIN_URL ?>/js/admin.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script src="<?php echo G5_ADMIN_URL ?>/js/admin.ajax.js?ver=<?php echo G5_JS_VER; ?>"></script> <script src="<?php echo G5_ADMIN_URL ?>/js/admin.ajax.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script> <script>
// give section active class
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('section[id^=anc_]').forEach((section) => {
let section_id = section.getAttribute('id');
if (section_id) {
let anc = section.querySelector(`a[href='#${section_id}']`);
anc.classList.add('active');
}
});
});
$(function () { $(function () {
var hide_menu = false; var hide_menu = false;
var mouse_event = false; var mouse_event = false;

View file

@ -9,7 +9,8 @@ CREATE TABLE `__TABLE_NAME__` (
`ca_name` varchar(255) NOT NULL, `ca_name` varchar(255) NOT NULL,
`wr_option` set('html1','html2','secret','mail') NOT NULL, `wr_option` set('html1','html2','secret','mail') NOT NULL,
`wr_subject` varchar(255) NOT NULL, `wr_subject` varchar(255) NOT NULL,
`wr_content` text NOT NULL, `wr_content` mediumtext NOT NULL,
`wr_extra_vars` text NOT NULL,
`wr_link1` text NOT NULL, `wr_link1` text NOT NULL,
`wr_link2` text NOT NULL, `wr_link2` text NOT NULL,
`wr_link1_hit` int(11) NOT NULL DEFAULT '0', `wr_link1_hit` int(11) NOT NULL DEFAULT '0',
@ -19,6 +20,7 @@ CREATE TABLE `__TABLE_NAME__` (
`wr_nogood` int(11) NOT NULL DEFAULT '0', `wr_nogood` int(11) NOT NULL DEFAULT '0',
`mb_id` varchar(20) NOT NULL, `mb_id` varchar(20) NOT NULL,
`wr_password` varchar(255) NOT NULL, `wr_password` varchar(255) NOT NULL,
`wr_extrapassword` varchar(255) NOT NULL,
`wr_name` varchar(255) NOT NULL, `wr_name` varchar(255) NOT NULL,
`wr_email` varchar(255) NOT NULL, `wr_email` varchar(255) NOT NULL,
`wr_homepage` varchar(255) NOT NULL, `wr_homepage` varchar(255) NOT NULL,

View file

@ -99,8 +99,10 @@
* @var string|int $bo_8 * @var string|int $bo_8
* @var string|int $bo_9 * @var string|int $bo_9
* @var string|int $bo_10 * @var string|int $bo_10
* @var string $bo_version
*/ */
include_once "./_common.php"; include_once "./_common.php";
include_once "./board_migration.inc.php";
if ($w == 'u') if ($w == 'u')
check_demo(); check_demo();
@ -263,7 +265,8 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
bo_7 = '{$_POST['bo_7']}', bo_7 = '{$_POST['bo_7']}',
bo_8 = '{$_POST['bo_8']}', bo_8 = '{$_POST['bo_8']}',
bo_9 = '{$_POST['bo_9']}', bo_9 = '{$_POST['bo_9']}',
bo_10 = '{$_POST['bo_10']}' "; bo_10 = '{$_POST['bo_10']}',
bo_version = '". BOARD_MIGRATION_VERSION . "'";
if ($w == '') { if ($w == '') {
@ -317,12 +320,6 @@ if ($w == '') {
$sql = "SELECT a.wr_id, (count(b.wr_parent) - 1) AS cnt FROM {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b WHERE a.wr_id=b.wr_parent AND a.wr_is_comment=0 GROUP BY a.wr_id "; $sql = "SELECT a.wr_id, (count(b.wr_parent) - 1) AS cnt FROM {$g5['write_prefix']}{$bo_table} a, {$g5['write_prefix']}{$bo_table} b WHERE a.wr_id=b.wr_parent AND a.wr_is_comment=0 GROUP BY a.wr_id ";
$result = sql_query($sql); $result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
/*
// 코멘트수를 얻습니다.
$sql2 = "SELECT count(*) as cnt FROM {$g5['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);
*/
sql_query("UPDATE {$g5['write_prefix']}{$bo_table} SET wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' "); sql_query("UPDATE {$g5['write_prefix']}{$bo_table} SET wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' ");
} }
} }
@ -352,7 +349,6 @@ if ($w == '') {
} }
// 같은 그룹내 게시판 동일 옵션 적용 // 같은 그룹내 게시판 동일 옵션 적용
$grp_fields = ''; $grp_fields = '';
if (is_checked('chk_grp_device')) if (is_checked('chk_grp_device'))

View file

@ -1,8 +1,12 @@
<?php <?php
include_once "./_common.php"; include_once "./_common.php";
include_once "./board_migration.inc.php";
auth_check($auth[$sub_menu], 'r'); auth_check($auth[$sub_menu], 'r');
// 마이그레이션 체크
$boards_need_update = check_all_boards_migration();
$sql_common = " from {$g5['board_table']} a "; $sql_common = " from {$g5['board_table']} a ";
$sql_search = " where (1) "; $sql_search = " where (1) ";
@ -66,6 +70,11 @@ $colspan = 11;
<div class="local_ov01 local_ov"> <div class="local_ov01 local_ov">
<?php echo $listall ?> <?php echo $listall ?>
생성된 게시판수 <?php echo number_format($total_count) ?> 생성된 게시판수 <?php echo number_format($total_count) ?>
<?php if (count($boards_need_update) > 0) { ?>
<span style="font-weight: bold; margin-left: 20px;">
업데이트 필요: <?php echo count($boards_need_update) ?>
</span>
<?php } ?>
</div> </div>
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get"> <form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
@ -111,7 +120,8 @@ $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:80px;">글답변</th>
<th scope="col" style="width:80px;">댓글쓰기</th> <th scope="col" style="width:80px;">댓글쓰기</th>
<th scope="col" style="width:60px;">관리</th> <th scope="col" style="width:80px;">버전</th>
<th scope="col" style="width:150px;">관리</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -119,6 +129,16 @@ $colspan = 11;
for ($i = 0; $row = sql_fetch_array($result); $i++) { 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_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>'; $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;
foreach ($boards_need_update as $board_update) {
if ($board_update['bo_table'] == $row['bo_table']) {
$need_migration = true;
break;
}
}
$bg = 'bg' . ($i % 2); $bg = 'bg' . ($i % 2);
?> ?>
@ -163,14 +183,27 @@ $colspan = 11;
<?php echo get_member_level_select('bo_comment_level[' . $i . ']', 1, 10, $row['bo_comment_level']) ?> <?php echo get_member_level_select('bo_comment_level[' . $i . ']', 1, 10, $row['bo_comment_level']) ?>
</td> </td>
<td> <td>
<?php if ($need_migration) { ?>
<span style="color: #ff6b6b; font-weight: bold;">업데이트 필요</span>
<?php } else { ?>
<span><?php echo htmlspecialchars($row['bo_version']); ?></span>
<?php } ?>
</td>
<td>
<div class="manage_buttons">
<?php echo $one_update ?> <?php echo $one_update ?>
<?php echo $one_copy ?> <?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> </td>
</tr> </tr>
<?php <?php
} }
if ($i == 0) if ($i == 0)
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>'; echo '<tr><td colspan="' . ($colspan + 1) . '" class="empty_table">자료가 없습니다.</td></tr>';
?> ?>
</tbody> </tbody>
</table> </table>
@ -186,6 +219,12 @@ $colspan = 11;
<span class="material-icons">delete</span> <span class="material-icons">delete</span>
<input type="submit" name="act_button" value="선택삭제" title="선택삭제" onclick="document.pressed=this.value"> <input type="submit" name="act_button" value="선택삭제" title="선택삭제" onclick="document.pressed=this.value">
</div> </div>
<?php if (count($boards_need_update) > 0) { ?>
<div class="btn ty4">
<span class="material-icons">update</span>
<input type="submit" name="act_button" value="선택마이그레이션" title="선택마이그레이션" onclick="document.pressed=this.value">
</div>
<?php } ?>
<?php if ($is_admin == 'super') { ?> <?php if ($is_admin == 'super') { ?>
<a href="./board_form.php" title="게시판 추가" class="btn"><span class="material-icons">add</span></a> <a href="./board_form.php" title="게시판 추가" class="btn"><span class="material-icons">add</span></a>
<?php } ?> <?php } ?>
@ -208,6 +247,12 @@ $colspan = 11;
} }
} }
if (document.pressed == "선택마이그레이션") {
if (!confirm("선택한 게시판을 마이그레이션 하시겠습니까?")) {
return false;
}
}
return true; return true;
} }
@ -216,6 +261,36 @@ $colspan = 11;
window.open(this.href, "win_board_copy", "left=100,top=100,width=550,height=450"); window.open(this.href, "win_board_copy", "left=100,top=100,width=550,height=450");
return false; return false;
}); });
$(".btn_migrate").click(function (e) {
e.preventDefault();
var bo_table = $(this).data('bo-table');
if (!confirm(bo_table + ' 게시판을 업데이트 하시겠습니까?')) {
return false;
}
$.ajax({
url: './board_list_update.php',
type: 'POST',
data: {
act_button: '단일마이그레이션',
bo_table: bo_table,
token: '<?php echo $token ?>'
},
dataType: 'json',
success: function (response) {
if (response.success) {
location.reload();
} else {
alert('오류: ' + response.message);
}
},
error: function () {
alert('마이그레이션 중 오류가 발생했습니다.');
}
});
});
}); });
</script> </script>

View file

@ -1,13 +1,63 @@
<?php <?php
include_once "./_common.php"; include_once "./_common.php";
include_once "./board_migration.inc.php";
check_demo(); check_demo();
// 단일 마이그레이션 처리 (AJAX)
if ($_POST['act_button'] == "단일마이그레이션") {
header('Content-Type: application/json');
auth_check($auth[$sub_menu], 'w');
$bo_table = sql_real_escape_string(strip_tags($_POST['bo_table']));
if (empty($bo_table)) {
echo json_encode(['success' => false, 'message' => '게시판 테이블명이 없습니다.']);
exit;
}
$result = migrate_board_table($bo_table);
echo json_encode($result);
exit;
}
// 선택 마이그레이션 처리
if (!count($_POST['chk'])) { if (!count($_POST['chk'])) {
alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요."); alert($_POST['act_button'] . " 하실 항목을 하나 이상 체크하세요.");
} }
if ($_POST['act_button'] == "선택수정") { if ($_POST['act_button'] == "선택마이그레이션") {
auth_check($auth[$sub_menu], 'w');
if (!count($_POST['chk'])) {
alert("마이그레이션 하실 항목을 하나 이상 체크하세요.");
}
$success_count = 0;
$fail_count = 0;
$messages = [];
for ($i = 0; $i < count($_POST['chk']); $i++) {
$k = $_POST['chk'][$i];
$bo_table = sql_real_escape_string(strip_tags($_POST['board_table'][$k]));
if (empty($bo_table)) {
continue;
}
$result = migrate_board_table($bo_table);
if ($result['success']) {
$success_count++;
$messages[] = "{$bo_table}: 성공 (컬럼 {$result['updated']}개 추가)";
} else {
$fail_count++;
$messages[] = "{$bo_table}: 실패 - {$result['message']}";
}
}
} else if ($_POST['act_button'] == "선택수정") {
auth_check($auth[$sub_menu], 'w'); auth_check($auth[$sub_menu], 'w');

View file

@ -0,0 +1,319 @@
<?php
if (!defined('_GNUBOARD_'))
exit;
// 현재 마이그레이션 버전
define('BOARD_MIGRATION_VERSION', '2.0.1');
// 표준 게시판 테이블 구조 정의
function get_standard_board_structure()
{
return [
'wr_id' => 'int(11) NOT NULL AUTO_INCREMENT',
'wr_num' => 'int(11) NOT NULL DEFAULT 0',
'wr_reply' => 'varchar(10) NOT NULL',
'wr_parent' => 'int(11) NOT NULL DEFAULT 0',
'wr_is_comment' => 'tinyint(4) NOT NULL DEFAULT 0',
'wr_comment' => 'int(11) NOT NULL DEFAULT 0',
'wr_comment_reply' => 'varchar(5) NOT NULL',
'ca_name' => 'varchar(255) NOT NULL',
'wr_option' => "set('html1','html2','secret','mail') NOT NULL",
'wr_subject' => 'varchar(255) NOT NULL',
'wr_content' => 'mediumtext NOT NULL',
'wr_extra_vars' => 'text NOT NULL',
'wr_link1' => 'text NOT NULL',
'wr_link2' => 'text NOT NULL',
'wr_link1_hit' => 'int(11) NOT NULL DEFAULT 0',
'wr_link2_hit' => 'int(11) NOT NULL DEFAULT 0',
'wr_hit' => 'int(11) NOT NULL DEFAULT 0',
'wr_good' => 'int(11) NOT NULL DEFAULT 0',
'wr_nogood' => 'int(11) NOT NULL DEFAULT 0',
'mb_id' => 'varchar(20) NOT NULL',
'wr_password' => 'varchar(255) NOT NULL',
'wr_extrapassword' => 'varchar(255) NOT NULL',
'wr_name' => 'varchar(255) NOT NULL',
'wr_email' => 'varchar(255) NOT NULL',
'wr_homepage' => 'varchar(255) NOT NULL',
'wr_datetime' => "datetime NOT NULL DEFAULT '1970-01-01 00:00:00'",
'wr_file' => 'tinyint(4) NOT NULL DEFAULT 0',
'wr_last' => 'varchar(19) NOT NULL',
'wr_ip' => 'varchar(255) NOT NULL',
'wr_facebook_user' => 'varchar(255) NOT NULL',
'wr_twitter_user' => 'varchar(255) NOT NULL',
'wr_dice1' => 'int(11) NOT NULL DEFAULT 0',
'wr_dice2' => 'int(11) NOT NULL DEFAULT 0',
'wr_log' => 'text NOT NULL',
'wr_item' => 'int(11) NOT NULL DEFAULT 0',
'wr_item_log' => "varchar(255) NOT NULL DEFAULT ''",
'wr_action' => "varchar(255) NOT NULL DEFAULT ''",
'wr_secret' => 'int(11) NOT NULL DEFAULT 0',
'wr_adult' => 'int(11) NOT NULL DEFAULT 0',
'wr_wide' => 'int(11) NOT NULL DEFAULT 0',
'wr_plip' => 'int(11) NOT NULL DEFAULT 0',
'wr_noname' => 'int(11) NOT NULL DEFAULT 0',
'wr_ing' => 'int(11) NOT NULL DEFAULT 0',
'ch_id' => 'int(11) NOT NULL DEFAULT 0',
'ch_side' => 'int(11) NOT NULL DEFAULT 0',
'ch_class' => 'int(11) NOT NULL DEFAULT 0',
'ti_id' => 'int(11) NOT NULL DEFAULT 0',
'ma_id' => 'int(11) NOT NULL DEFAULT 0',
'wr_width' => 'int(11) NOT NULL DEFAULT 0',
'wr_height' => 'int(11) NOT NULL DEFAULT 0',
'wr_url' => "varchar(255) NOT NULL DEFAULT ''",
'wr_type' => "varchar(255) NOT NULL DEFAULT ''",
'wr_1' => "varchar(255) NOT NULL DEFAULT ''",
'wr_2' => "varchar(255) NOT NULL DEFAULT ''",
'wr_3' => "varchar(255) NOT NULL DEFAULT ''",
'wr_4' => "varchar(255) NOT NULL DEFAULT ''",
'wr_5' => "varchar(255) NOT NULL DEFAULT ''",
'wr_6' => "varchar(255) NOT NULL DEFAULT ''",
'wr_7' => "varchar(255) NOT NULL DEFAULT ''",
'wr_8' => "varchar(255) NOT NULL DEFAULT ''",
'wr_9' => "varchar(255) NOT NULL DEFAULT ''",
'wr_10' => "varchar(255) NOT NULL DEFAULT ''"
];
}
// bo_version 컬럼 체크 및 추가
function check_and_add_bo_version()
{
global $g5;
$sql = "SHOW COLUMNS FROM {$g5['board_table']} LIKE 'bo_version'";
$result = sql_query($sql);
if (sql_num_rows($result) == 0) {
$sql = "ALTER TABLE {$g5['board_table']} ADD `bo_version` varchar(255) NOT NULL DEFAULT '0'";
sql_query($sql);
return true;
}
return false;
}
// 컬럼 정의 정규화 (비교를 위해)
function normalize_column_definition($definition)
{
// 소문자로 변환
$def = strtolower($definition);
// 공백 정규화
$def = preg_replace('/\s+/', ' ', $def);
$def = trim($def);
// AUTO_INCREMENT 제거 (비교 시 제외)
$def = str_replace('auto_increment', '', $def);
// int(11) -> int 형식 통일
$def = preg_replace('/int\(\d+\)/', 'int', $def);
$def = preg_replace('/tinyint\(\d+\)/', 'tinyint', $def);
// varchar/char 길이는 유지
// 따옴표 통일 (single quote)
$def = str_replace('"', "'", $def);
return trim($def);
}
// 현재 테이블 구조 가져오기 (원본 정의 포함)
function get_current_table_structure($table_name)
{
$sql = "SHOW COLUMNS FROM `{$table_name}`";
$result = sql_query($sql);
$structure = [];
while ($row = sql_fetch_array($result)) {
$type = $row['Type'];
$null = $row['Null'] == 'NO' ? 'NOT NULL' : '';
$default = '';
if ($row['Default'] !== null) {
if (in_array(strtolower($row['Default']), ['current_timestamp'])) {
$default = "DEFAULT {$row['Default']}";
} else {
$default = "DEFAULT '{$row['Default']}'";
}
} else if ($row['Null'] == 'NO' && $row['Default'] === null && $row['Extra'] != 'auto_increment') {
// NOT NULL이고 DEFAULT가 없는 경우 처리
if (strpos($type, 'int') !== false) {
$default = 'DEFAULT 0';
} else if (strpos($type, 'text') !== false) {
// text 타입은 default를 설정할 수 없음
$default = '';
} else {
$default = "DEFAULT ''";
}
}
$extra = $row['Extra'];
if ($extra == 'auto_increment') {
$extra = 'AUTO_INCREMENT';
}
$definition = trim("{$type} {$null} {$default} {$extra}");
$structure[$row['Field']] = $definition;
}
return $structure;
}
// 테이블 구조 비교 (누락 및 변경된 컬럼 모두 감지)
function compare_table_structure($table_name)
{
$standard = get_standard_board_structure();
$current = get_current_table_structure($table_name);
$missing_columns = []; // 누락된 컬럼
$modified_columns = []; // 속성이 다른 컬럼
foreach ($standard as $column => $definition) {
if (!isset($current[$column])) {
// 컬럼이 존재하지 않음
$missing_columns[$column] = $definition;
} else {
// 컬럼은 존재하지만 속성 비교
$standard_normalized = normalize_column_definition($definition);
$current_normalized = normalize_column_definition($current[$column]);
if ($standard_normalized !== $current_normalized) {
// 속성이 다름
$modified_columns[$column] = [
'current' => $current[$column],
'standard' => $definition
];
}
}
}
return [
'missing' => $missing_columns,
'modified' => $modified_columns
];
}
// 게시판 테이블 마이그레이션 실행
function migrate_board_table($bo_table)
{
global $g5;
$write_table = $g5['write_prefix'] . $bo_table;
// 테이블 존재 확인
$sql = "SHOW TABLES LIKE '{$write_table}'";
$result = sql_query($sql);
if (sql_num_rows($result) == 0) {
return ['success' => false, 'message' => '테이블이 존재하지 않습니다.'];
}
// 누락 및 변경된 컬럼 확인
$comparison = compare_table_structure($write_table);
$missing_columns = $comparison['missing'];
$modified_columns = $comparison['modified'];
if (empty($missing_columns) && empty($modified_columns)) {
// 버전 업데이트만 수행
$sql = "UPDATE {$g5['board_table']} SET bo_version = '" . BOARD_MIGRATION_VERSION . "' WHERE bo_table = '{$bo_table}'";
sql_query($sql);
return [
'success' => true,
'message' => '이미 최신 버전입니다.',
'added' => 0,
'modified' => 0
];
}
$added_count = 0;
$modified_count = 0;
$errors = [];
// 누락된 컬럼 추가
foreach ($missing_columns as $column => $definition) {
$sql = "ALTER TABLE `{$write_table}` ADD `{$column}` {$definition}";
if (sql_query($sql)) {
$added_count++;
} else {
$errors[] = "컬럼 추가 실패: {$column}";
}
}
// 변경된 컬럼 수정
foreach ($modified_columns as $column => $info) {
$sql = "ALTER TABLE `{$write_table}` MODIFY `{$column}` {$info['standard']}";
if (sql_query($sql)) {
$modified_count++;
} else {
$errors[] = "컬럼 수정 실패: {$column}";
}
}
// 버전 업데이트
$sql = "UPDATE {$g5['board_table']} SET bo_version = '" . BOARD_MIGRATION_VERSION . "' WHERE bo_table = '{$bo_table}'";
sql_query($sql);
$message = '마이그레이션이 완료되었습니다.';
if (!empty($errors)) {
$message .= ' (일부 오류: ' . implode(', ', $errors) . ')';
}
return [
'success' => true,
'message' => $message,
'added' => $added_count,
'modified' => $modified_count,
'errors' => $errors
];
}
// 모든 게시판 체크
function check_all_boards_migration()
{
global $g5;
check_and_add_bo_version();
$sql = "SELECT bo_table, bo_version FROM {$g5['board_table']}";
$result = sql_query($sql);
$boards_need_update = [];
while ($row = sql_fetch_array($result)) {
if ($row['bo_version'] != BOARD_MIGRATION_VERSION) {
$write_table = $g5['write_prefix'] . $row['bo_table'];
$comparison = compare_table_structure($write_table);
$boards_need_update[] = [
'bo_table' => $row['bo_table'],
'current_version' => $row['bo_version'],
'missing_columns' => count($comparison['missing']),
'modified_columns' => count($comparison['modified'])
];
}
}
return $boards_need_update;
}
// 특정 게시판의 상세 차이점 확인
function get_board_migration_details($bo_table)
{
global $g5;
$write_table = $g5['write_prefix'] . $bo_table;
// 테이블 존재 확인
$sql = "SHOW TABLES LIKE '{$write_table}'";
$result = sql_query($sql);
if (sql_num_rows($result) == 0) {
return ['success' => false, 'message' => '테이블이 존재하지 않습니다.'];
}
$comparison = compare_table_structure($write_table);
return [
'success' => true,
'bo_table' => $bo_table,
'missing_columns' => $comparison['missing'],
'modified_columns' => $comparison['modified']
];
}

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,286 @@
<?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 (isset($write['wr_is_comment']) && $write['wr_is_comment'] == 0) {
sql_query("UPDATE {$target_table} SET wr_parent = '{$new_wr_id}' WHERE wr_id = '{$new_wr_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

@ -33,4 +33,4 @@ EventHandler::triggerEvent("amber.admin.community_form_update");
sql_query($sql); sql_query($sql);
goto_url('./community_form.php'); goto_url(G5_ADMIN_URL . '/community_form.php');

View file

@ -3,7 +3,7 @@ th a {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
padding: 3px 10px; padding: 3px 10px;
background: var(--theme-color-a); background: var(--theme-sub-500);
color: #fff; color: #fff;
margin: 5px 0 0; margin: 5px 0 0;
} }
@ -12,33 +12,30 @@ th a+a {
margin-top: 3px; margin-top: 3px;
} }
#wrap { html>body #container {
padding: 0;
}
.addon_conf_form {
height: 100%; height: 100%;
} }
#container { #container .addon_config {
padding: 0 !important;
min-height: 100%;
}
#wrapper {
height: 100%;
box-sizing: border-box;
}
#container section.addon_config {
display: flex; display: flex;
height: 100%; height: auto;
padding: 8px;
gap: 8px; gap: 8px;
box-sizing: border-box;
margin-bottom: 0;
padding: 0;
width: calc(100% - 8px);
height: 100%
} }
.addon_config>nav { .addon_config>nav {
min-width: 200px; min-width: 200px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border: 1px solid var(--theme-color-d); background: var(--theme-gray-800);
border-radius: 4px;
overflow:hidden; overflow:hidden;
} }
@ -48,12 +45,13 @@ th a+a {
} }
.addon_config>nav>a.selected { .addon_config>nav>a.selected {
background: var(--theme-color-a); background: var(--theme-sub-300);
color: var(--black);
font-weight: bold; font-weight: bold;
} }
.addon_config>nav>span { .addon_config>nav>span {
background: var(--theme-color-d); background: var(--theme-gray-500);
color: #FFF; color: #FFF;
line-height: 48px; line-height: 48px;
font-size: 14px; font-size: 14px;
@ -71,10 +69,6 @@ td a {
color: var(--theme-color-d); color: var(--theme-color-d);
} }
.footer-copyright {
padding: 20px !important;
}
span.empty { span.empty {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -19,6 +19,7 @@ include_once G5_ADMIN_PATH . '/admin.head.php';
add_stylesheet(get_embed_file("css", G5_PATH . "/adm/css/addon_config.css"), 1); add_stylesheet(get_embed_file("css", G5_PATH . "/adm/css/addon_config.css"), 1);
?> ?>
<form method="POST" action="./addon_config_update.php" class="addon_conf_form">
<section class="addon_config"> <section class="addon_config">
<nav><span>설치된 애드온 목록</span><?php <nav><span>설치된 애드온 목록</span><?php
if (!empty(AddonLoader::$addons)) { if (!empty(AddonLoader::$addons)) {
@ -81,20 +82,12 @@ add_stylesheet(get_embed_file("css", G5_PATH . "/adm/css/addon_config.css"), 1);
</div> </div>
</header> </header>
<content> <content>
<form method="POST" action="./addon_config_update.php">
<input type="hidden" name="addon" value="<?= $addon->className ?>" /> <input type="hidden" name="addon" value="<?= $addon->className ?>" />
<?php <?php
if (method_exists($addon, "printConfigForm")) { if (method_exists($addon, "printConfigForm")) {
$addon->printConfigForm(); $addon->printConfigForm();
} }
?> ?>
<div class="btn_confirm">
<div class="btn">
<span class="material-icons">save</span>
<input type="submit" value="저장" class="btn_submit" accesskey="s">
</div>
</div>
</form>
</content><?php </content><?php
} }
} else { } else {
@ -103,5 +96,12 @@ add_stylesheet(get_embed_file("css", G5_PATH . "/adm/css/addon_config.css"), 1);
?> ?>
</section> </section>
</section> </section>
<div class="btn_confirm">
<div class="btn">
<span class="material-icons">save</span>
<input type="submit" value="저장" class="btn_submit" accesskey="s">
</div>
</div>
</form>
<?php <?php
include_once G5_ADMIN_PATH . '/admin.tail.php'; include_once G5_ADMIN_PATH . '/admin.tail.php';

View file

@ -19,10 +19,10 @@ if (!sql_fetch_array(sql_query("DESC {$g5['font_table']}"))) {
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3"; ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3";
sql_query($sql, false); sql_query($sql, false);
sql_query("INSERT INTO `avo_editor_fonts` sql_query("INSERT INTO `{$g5['font_table']}`
(`font_name`, `font_family`, `font_url`, `font_weight`, `font_style`) (`font_name`, `font_family`, `font_url`, `font_weight`, `font_style`)
VALUES ('에스코어드림', 'S-CoreDream-3Light', 'url(\'https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff\') format(\'woff\')', 'normal', 'normal');"); VALUES ('에스코어드림', 'S-CoreDream-3Light', 'url(\'https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff\') format(\'woff\')', 'normal', 'normal');");
sql_query("INSERT INTO `avo_editor_fonts` (`font_name`, `font_family`, `font_url`, `font_weight`, `font_style`) sql_query("INSERT INTO `{$g5['font_table']}` (`font_name`, `font_family`, `font_url`, `font_weight`, `font_style`)
VALUES ('평창평화체', 'PyeongChangPeace-Light', 'url(\'https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2206-02@1.0/PyeongChangPeace-Light.woff2\') format(\'woff2\')', '300', 'normal');"); VALUES ('평창평화체', 'PyeongChangPeace-Light', 'url(\'https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2206-02@1.0/PyeongChangPeace-Light.woff2\') format(\'woff2\')', '300', 'normal');");
} }

View file

@ -145,6 +145,7 @@ $colspan = 11;
$me_name = str_replace($search, $replace, $row['me_name']); $me_name = str_replace($search, $replace, $row['me_name']);
?> ?>
<article class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>" <article class="<?php echo $bg; ?> menu_list menu_group_<?php echo substr($row['me_code'], 0, 2); ?>"
data-code="<?php echo substr($row['me_code'], 0, 2); ?>"
data-name="<?php echo $me_name; ?>"> data-name="<?php echo $me_name; ?>">
<div class="menu_reqset"> <div class="menu_reqset">
<div class="al_menu" style="width: 50px"> <div class="al_menu" style="width: 50px">
@ -250,23 +251,7 @@ $colspan = 11;
if (!confirm("메뉴를 삭제하시겠습니까?")) if (!confirm("메뉴를 삭제하시겠습니까?"))
return false; return false;
var $tr = $(this).closest("tr"); $(this).parent().parent().remove();
if ($tr.find("td.sub_menu_class").size() > 0) {
$tr.remove();
} else {
var code = $(this).closest("tr").find("input[name='code[]']").val().substr(0, 2);
$("tr.menu_group_" + code).remove();
}
if ($("#menulist tr.menu_list").size() < 1) {
var list = "<tr id=\"empty_menu_list\"><td colspan=\"<?php echo $colspan; ?>\" class=\"empty_table\">자료가 없습니다.</td></tr>\n";
$("#menulist table tbody").append(list);
} else {
$("#menulist tr.menu_list").each(function (index) {
$(this).removeClass("bg0 bg1")
.addClass("bg" + (index % 2));
});
}
}); });
}); });

View file

@ -36,7 +36,7 @@ if ($is_admin && $is_admin == "super") {
} }
if (!sql_table_exists($g5["article_table"])) { if (!sql_table_exists($g5["article_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["article_table"]}` (
`ar_id` INT(11) NOT NULL AUTO_INCREMENT, `ar_id` INT(11) NOT NULL AUTO_INCREMENT,
`ar_theme` VARCHAR(255) NOT NULL DEFAULT '', `ar_theme` VARCHAR(255) NOT NULL DEFAULT '',
`ar_code` VARCHAR(255) NOT NULL DEFAULT '', `ar_code` VARCHAR(255) NOT NULL DEFAULT '',
@ -53,7 +53,7 @@ if ($is_admin && $is_admin == "super") {
} }
if (!sql_table_exists($g5["article_default_table"])) { if (!sql_table_exists($g5["article_default_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article_default` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["article_default_table"]}` (
`ad_id` INT(11) NOT NULL AUTO_INCREMENT , `ad_id` INT(11) NOT NULL AUTO_INCREMENT ,
`ad_use_thumb` INT(11) NOT NULL DEFAULT '0', `ad_use_thumb` INT(11) NOT NULL DEFAULT '0',
`ad_use_head` INT(11) NOT NULL DEFAULT '0', `ad_use_head` INT(11) NOT NULL DEFAULT '0',
@ -83,7 +83,7 @@ if ($is_admin && $is_admin == "super") {
} }
if (!sql_table_exists($g5["value_table"])) { if (!sql_table_exists($g5["value_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article_value` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["value_table"]}` (
`av_id` INT(11) NOT NULL AUTO_INCREMENT , `av_id` INT(11) NOT NULL AUTO_INCREMENT ,
`ch_id` INT(11) NOT NULL DEFAULT '0', `ch_id` INT(11) NOT NULL DEFAULT '0',
`ar_theme` VARCHAR(255) NOT NULL DEFAULT '', `ar_theme` VARCHAR(255) NOT NULL DEFAULT '',

View file

@ -276,7 +276,126 @@ function getWebServerDiskUsage()
// $documentRoot = $_SERVER['DOCUMENT_ROOT'] ?? '/var/www/html'; // $documentRoot = $_SERVER['DOCUMENT_ROOT'] ?? '/var/www/html';
return getDiskUsage(); return getDiskUsage();
} }
function getNetworkTraffic()
{
// G5_PATH의 마지막 폴더명 확인
$pathParts = explode('/', rtrim(G5_PATH, '/'));
$lastFolder = end($pathParts);
if ($lastFolder === 'AvocadoAmber') {
$netJsonPath = dirname(G5_PATH) . '/net.json';
if (file_exists($netJsonPath)) {
$jsonContent = file_get_contents($netJsonPath);
$data = json_decode($jsonContent, true);
if ($data && isset($data['interfaces'][0]['traffic']['fiveminute'])) {
$fiveminute = $data['interfaces'][0]['traffic']['fiveminute'];
if (count($fiveminute) > 0) {
// 현재 날짜 (오늘)
$today = getdate();
$todayYear = $today['year'];
$todayMonth = $today['mon'];
$todayDay = $today['mday'];
$rx = 0;
$tx = 0;
// fiveminute 데이터에서 오늘 날짜와 일치하는 데이터만 합산
foreach ($fiveminute as $entry) {
$entryYear = $entry['date']['year'];
$entryMonth = $entry['date']['month'];
$entryDay = $entry['date']['day'];
$entryHour = $entry['time']['hour'];
$entryMinute = $entry['time']['minute'];
// 오늘 날짜와 일치하고, 0시 0분이 아닌 경우만 합산
if (
$entryYear == $todayYear &&
$entryMonth == $todayMonth &&
$entryDay == $todayDay &&
!($entryHour == 0 && $entryMinute == 0)
) {
$rx += $entry['rx'];
$tx += $entry['tx'];
}
}
$total = $rx + $tx;
// 일일 최대 트래픽 35GB (바이트로 변환)
$maxTraffic = 35 * 1024 * 1024 * 1024;
$usagePercent = round(($total / $maxTraffic) * 100, 2);
// 오늘 날짜 정보
$todayDate = $todayYear . '-' .
str_pad($todayMonth, 2, '0', STR_PAD_LEFT) . '-' .
str_pad($todayDay, 2, '0', STR_PAD_LEFT);
return [
'rx' => $rx,
'tx' => $tx,
'total' => $total,
'max' => $maxTraffic,
'usage_percent' => $usagePercent,
'date' => $todayDate,
'available' => true
];
}
}
}
}
return ['available' => false];
}
$webDiskUsage = getWebServerDiskUsage();
$networkTraffic = getNetworkTraffic();
?> ?>
<style>
.server-info {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.server-info-item {
background: #fff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.server-info-item h3 {
margin: 0 0 15px 0;
font-size: 16px;
font-weight: bold;
color: #333;
}
.chart-container {
position: relative;
height: 200px;
margin-bottom: 15px;
}
.info-text {
font-size: 13px;
line-height: 1.6;
color: #666;
}
.info-text strong {
color: #333;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);" <form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);"
enctype="multipart/form-data"> enctype="multipart/form-data">
<input type="hidden" name="token" value="" id="token"> <input type="hidden" name="token" value="" id="token">
@ -289,16 +408,137 @@ function getWebServerDiskUsage()
<section id="anc_001"> <section id="anc_001">
<h2 class="h2_frm">서버 정보</h2> <h2 class="h2_frm">서버 정보</h2>
<?php echo $pg_anchor ?> <?php echo $pg_anchor ?>
<?php <div class="server-info">
<!-- 디스크 용량 -->
echo "<h3>디스크 용량</h3>"; <div class="server-info-item">
$webDiskUsage = getWebServerDiskUsage(); <h3>디스크 용량</h3>
echo "총 용량: " . formatBytes($webDiskUsage['total']) . "<br>"; <div class="chart-container">
echo "사용 중: " . formatBytes($webDiskUsage['used']) . "<br>"; <canvas id="diskChart"></canvas>
echo "사용 가능: " . formatBytes($webDiskUsage['free']) . "<br>"; </div>
echo "사용률: " . $webDiskUsage['usage_percent'] . "%<br>"; <div class="info-text">
?> <strong> 용량:</strong> <?php echo formatBytes($webDiskUsage['total']); ?><br>
<strong>사용 :</strong> <?php echo formatBytes($webDiskUsage['used']); ?><br>
<strong>사용 가능:</strong> <?php echo formatBytes($webDiskUsage['free']); ?><br>
<strong>사용률:</strong> <?php echo $webDiskUsage['usage_percent']; ?>%
</div>
</div>
<?php if ($networkTraffic['available']): ?>
<!-- 일일 트래픽 -->
<div class="server-info-item">
<h3>일일 트래픽 (<?php echo $networkTraffic['date']; ?>)</h3>
<div class="chart-container">
<canvas id="trafficChart"></canvas>
</div>
<div class="info-text">
<strong>수신(RX):</strong> <?php echo formatBytes($networkTraffic['rx']); ?><br>
<strong>송신(TX):</strong> <?php echo formatBytes($networkTraffic['tx']); ?><br>
<strong> 사용량:</strong> <?php echo formatBytes($networkTraffic['total']); ?><br>
<strong>일일 한도:</strong> <?php echo formatBytes($networkTraffic['max']); ?><br>
<strong>사용률:</strong> <?php echo $networkTraffic['usage_percent']; ?>%
</div>
</div>
<?php endif; ?>
</div>
</section> </section>
<script>
// 디스크 용량 차트
const diskCtx = document.getElementById('diskChart').getContext('2d');
new Chart(diskCtx, {
type: 'pie',
data: {
labels: ['사용 중', '사용 가능'],
datasets: [{
data: [
<?php echo $webDiskUsage['used']; ?>,
<?php echo $webDiskUsage['free']; ?>
],
backgroundColor: [
'rgba(255, 99, 132, 0.8)',
'rgba(75, 192, 192, 0.8)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(75, 192, 192, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
},
tooltip: {
callbacks: {
label: function (context) {
const label = context.label || '';
const value = context.parsed;
const total = context.dataset.data.reduce((a, b) => a + b, 0);
const percentage = ((value / total) * 100).toFixed(2);
// 바이트를 GB로 변환
const gb = (value / (1024 * 1024 * 1024)).toFixed(2);
return label + ': ' + gb + ' GB (' + percentage + '%)';
}
}
}
}
}
});
<?php if ($networkTraffic['available']): ?>
// 트래픽 차트
const trafficCtx = document.getElementById('trafficChart').getContext('2d');
new Chart(trafficCtx, {
type: 'pie',
data: {
labels: ['사용량', '남은 용량'],
datasets: [{
data: [
<?php echo $networkTraffic['total']; ?>,
<?php echo max(0, $networkTraffic['max'] - $networkTraffic['total']); ?>
],
backgroundColor: [
'rgba(54, 162, 235, 0.8)',
'rgba(201, 203, 207, 0.8)'
],
borderColor: [
'rgba(54, 162, 235, 1)',
'rgba(201, 203, 207, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
},
tooltip: {
callbacks: {
label: function (context) {
const label = context.label || '';
const value = context.parsed;
const total = <?php echo $networkTraffic['max']; ?>;
const percentage = ((value / total) * 100).toFixed(2);
// 바이트를 GB로 변환
const gb = (value / (1024 * 1024 * 1024)).toFixed(2);
return label + ': ' + gb + ' GB (' + percentage + '%)';
}
}
}
}
}
});
<?php endif; ?>
</script>
<section id="anc_002"> <section id="anc_002">
<h2 class="h2_frm">홈페이지 기본환경 설정</h2> <h2 class="h2_frm">홈페이지 기본환경 설정</h2>
<?php echo $pg_anchor ?> <?php echo $pg_anchor ?>

View file

@ -23,7 +23,7 @@ $g5['title'] = "테마설정";
include_once "./admin.head.php"; include_once "./admin.head.php";
?> ?>
<script src="<?php echo G5_ADMIN_URL; ?>/js/theme.js"></script> <script src="<?php echo G5_ADMIN_URL; ?>/js/theme.js"></script>
<div class="local_wr"> <div class="local_wr admin_theme">
<span class="btn_ov01"><span class="ov_txt">설치된 테마</span><span class="ov_num"> <span class="btn_ov01"><span class="ov_txt">설치된 테마</span><span class="ov_num">
<?php echo number_format($total_count); ?></span></span> <?php echo number_format($total_count); ?></span></span>
</div> </div>

View file

@ -198,8 +198,10 @@ switch ($day) {
}); });
}); });
</script> </script>
</div>
<?php <?php
} }
include_once "./admin.tail.php";
?> ?>
</div>
<?php
include_once "./admin.tail.php";

View file

@ -21,7 +21,7 @@ if (!($w == '' || $w == 'u' || $w == 'r')) {
} }
if ($w == 'u' || $w == 'r') { if ($w == 'u' || $w == 'r') {
if ($write['wr_id']) { if ($write['wr_id'] || $wr_parent == -1) {
// 가변 변수로 $wr_1 .. $wr_10 까지 만든다. // 가변 변수로 $wr_1 .. $wr_10 까지 만든다.
for ($i = 1; $i <= 10; $i++) { for ($i = 1; $i <= 10; $i++) {
$vvar = "wr_" . $i; $vvar = "wr_" . $i;

View file

@ -45,7 +45,7 @@ if ($w == 'c' && $_SESSION['ss_datetime'] >= (G5_SERVER_TIME - $config['cf_delay
set_session('ss_datetime', G5_SERVER_TIME); set_session('ss_datetime', G5_SERVER_TIME);
$wr = get_write($write_table, $wr_id); $wr = get_write($write_table, $wr_id);
if (empty($wr['wr_id'])) if (empty($wr['wr_id']) && $wr_id != -1)
alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다."); alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다.");

View file

@ -79,7 +79,7 @@ $notice_array = explode(",", $board['bo_notice']);
if ($w == 'u' || $w == 'r') { if ($w == 'u' || $w == 'r') {
$wr = get_write($write_table, $wr_id); $wr = get_write($write_table, $wr_id);
if (!$wr['wr_id']) { if (!$wr['wr_id'] && $wr_parent != -1) {
alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다."); alert("글이 존재하지 않습니다.\\n글이 삭제되었거나 이동하였을 수 있습니다.");
} }
} }

View file

@ -478,10 +478,10 @@ class Setting
"html" => "<td class=\"bo-right\">{$desc}</td> "html" => "<td class=\"bo-right\">{$desc}</td>
<td> <td>
<div class=\"setter\"> <div class=\"setter\">
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:120px;justify-content:end;\">X<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div> <div class=\"css-setting-multi\"><span class=\"css-left-desc\">X</span><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:120px;justify-content:end;\">Y<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div> <div class=\"css-setting-multi\"><span class=\"css-left-desc\">Y</span><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:120px;justify-content:end;\">너비<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div> <div class=\"css-setting-multi\"><span class=\"css-left-desc\">너비</span><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:120px;justify-content:end;\">높이<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div> <div class=\"css-setting-multi\"><span class=\"css-left-desc\">높이</span><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div>
</div> </div>
</td> </td>
</tr>" </tr>"
@ -514,10 +514,10 @@ class Setting
"html" => "<td class=\"bo-right\">{$desc}</td> "html" => "<td class=\"bo-right\">{$desc}</td>
<td> <td>
<div class=\"setter\"> <div class=\"setter\">
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\"><div style=\"width: 16px; height: 16px; background: #866; box-sizing: border-box; border-radius: 8px 0 0 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div> <div class=\"css-setting-multi\"><div class=\"css-setting-radius\" style=\"border-radius: 8px 0 0 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\"><div style=\"width: 16px; height: 16px; background: #866; box-sizing: border-box; border-radius: 0 8px 0 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div> <div class=\"css-setting-multi\"><div class=\"css-setting-radius\" style=\"border-radius: 0 8px 0 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\"><div style=\"width: 16px; height: 16px; background: #866; box-sizing: border-box; border-radius: 0 0 8px 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div> <div class=\"css-setting-multi\"><div class=\"css-setting-radius\" style=\"border-radius: 0 0 8px 0;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\"><div style=\"width: 16px; height: 16px; background: #866; box-sizing: border-box; border-radius: 0 0 0 8px;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div> <div class=\"css-setting-multi\"><div class=\"css-setting-radius\" style=\"border-radius: 0 0 0 8px;\"></div><input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div>
</div> </div>
</td> </td>
</tr>" </tr>"
@ -550,10 +550,10 @@ class Setting
"html" => "<td class=\"bo-right\">{$desc}</td> "html" => "<td class=\"bo-right\">{$desc}</td>
<td> <td>
<div class=\"setter\"> <div class=\"setter\">
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\">상<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div> <div class=\"css-setting-multi\">상<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[1]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\">하<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div> <div class=\"css-setting-multi\">하<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[2]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\">좌<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div> <div class=\"css-setting-multi\">좌<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[3]}\"/>px</div>
<div style=\"display:flex;gap:8px;border:1px solid #F4F4F2;align-items:center;padding:4px 8px;width:100px;justify-content:end;\">우<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div> <div class=\"css-setting-multi\">우<input type=\"number\" id=\"cs_etc_{$idx}_1_{$this->cs_name}\" min=\"-9999\" max=\"9999\" size=\"20\" name=\"cs_etc_{$idx}[{$this->idx}][]\" value=\"{$values[4]}\"/>px</div>
</div> </div>
</td> </td>
</tr>" </tr>"
@ -623,9 +623,9 @@ class Setting
$key1 = "cs_etc_{$idx}"; $key1 = "cs_etc_{$idx}";
$key2 = "cs_etc_{$idx2}"; $key2 = "cs_etc_{$idx2}";
if (is_array($default) && isset($default[0]) && isset($default[1])) { if (is_array($default) && isset($default[0]) && isset($default[1])) {
if (!isset($this->$key1)) if (empty($this->$key1))
$this->$key1 = array_key_exists($default[0], $options) ? $default[0] : ""; $this->$key1 = array_key_exists($default[0], $options) ? $default[0] : "";
if (!isset($this->$key2)) if (empty($this->$key2) && $this->$key2 !== 0)
$this->$key2 = intval($default[1]); $this->$key2 = intval($default[1]);
} }
$options_html = ""; $options_html = "";
@ -665,15 +665,15 @@ class Setting
$key3 = "cs_etc_{$idx3}"; $key3 = "cs_etc_{$idx3}";
if (is_array($default) && isset($default[0]) && isset($default[1])) { if (is_array($default) && isset($default[0]) && isset($default[1])) {
if (!isset($this->$key1)) if (empty($this->$key1))
$this->$key1 = array_key_exists($default[0], $options) ? $default[0] : ""; $this->$key1 = array_key_exists($default[0], $options) ? $default[0] : "";
if (!isset($this->$key2)) if (empty($this->$key2) && $this->$key2 !== 0)
$this->$key2 = intval($default[1]); $this->$key2 = intval($default[1]);
} }
if (is_array($default) && isset($default[2])) { if (empty($this->$key3) && $this->$key3 !== 0) {
if (!isset($this->$key3)) if ($this->$key3 === "" || !isset($this->$key3))
$this->$key3 = intval($default[2]); $this->$key3 = intval($default[2]);
} }

View file

@ -6,7 +6,7 @@
/******************************************************************************* /*******************************************************************************
** 공통 변수, 상수, 코드 ** 공통 변수, 상수, 코드
*******************************************************************************/ *******************************************************************************/
error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_PARSE | E_USER_ERROR); error_reporting(E_CORE_ERROR | E_COMPILE_ERROR | E_ERROR | E_PARSE | E_USER_ERROR);
// 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정 // 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"'); header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"');
@ -420,10 +420,10 @@ if (file_exists($dbconfig_file)) {
<link rel="stylesheet" href="install/install.css"> <link rel="stylesheet" href="install/install.css">
</head> </head>
<body> <body>
<div id="ins_bar"> <?php
<span id="bar_img">AVOCADO EDITION</span> $RIGHT_MESSAGE = "Message";
<span id="bar_txt">Message</span> include G5_PATH . "/install/install_header.php";
</div> ?>
<h1>아보카도 에디션을 먼저 설치해주십시오.</h1> <h1>아보카도 에디션을 먼저 설치해주십시오.</h1>
<div class="ins_inner"> <div class="ins_inner">
<p>다음 파일을 찾을 없습니다.</p> <p>다음 파일을 찾을 없습니다.</p>
@ -462,10 +462,10 @@ if (!defined('G5_IS_ADMIN')) {
<link rel="stylesheet" href="<?= G5_URL ?>/install/install.css"> <link rel="stylesheet" href="<?= G5_URL ?>/install/install.css">
</head> </head>
<body> <body>
<div id="ins_bar"> <?php
<span id="bar_img">AVOCADO EDITION</span> $RIGHT_MESSAGE = "Message";
<span id="bar_txt">Message</span> include G5_PATH . "/install/install_header.php";
</div> ?>
<h1>아보카도 에디션 설정을 완료해주십시오.</h1> <h1>아보카도 에디션 설정을 완료해주십시오.</h1>
<br /> <br />
<div class="ins_inner"> <div class="ins_inner">

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,55 @@
@charset "utf-8";
@font-face {
font-family: 'SCDream';
font-weight: 900;
src: url(./fonts/SCDream9.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 800;
src: url(./fonts/SCDream8.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 700;
src: url(./fonts/SCDream7.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 600;
src: url(./fonts/SCDream6.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 500;
src: url(./fonts/SCDream5.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 400;
src: url(./fonts/SCDream4.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 300;
src: url(./fonts/SCDream3.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 200;
src: url(./fonts/SCDream2.otf);
}
@font-face {
font-family: 'SCDream';
font-weight: 100;
src: url(./fonts/SCDream1.otf);
}

View file

@ -9,7 +9,7 @@ Character::resetSearchCount();
if ($is_admin) { if ($is_admin) {
if (!sql_table_exists($g5["article_table"])) { if (!sql_table_exists($g5["article_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["article_table"]}` (
`ar_id` INT(11) NOT NULL AUTO_INCREMENT, `ar_id` INT(11) NOT NULL AUTO_INCREMENT,
`ar_theme` VARCHAR(255) NOT NULL DEFAULT '', `ar_theme` VARCHAR(255) NOT NULL DEFAULT '',
`ar_code` VARCHAR(255) NOT NULL DEFAULT '', `ar_code` VARCHAR(255) NOT NULL DEFAULT '',
@ -26,7 +26,7 @@ if ($is_admin) {
} }
if (!sql_table_exists($g5["article_default_table"])) { if (!sql_table_exists($g5["article_default_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article_default` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["article_default_table"]}` (
`ad_id` INT(11) NOT NULL AUTO_INCREMENT , `ad_id` INT(11) NOT NULL AUTO_INCREMENT ,
`ad_use_thumb` INT(11) NOT NULL DEFAULT '0', `ad_use_thumb` INT(11) NOT NULL DEFAULT '0',
`ad_use_head` INT(11) NOT NULL DEFAULT '0', `ad_use_head` INT(11) NOT NULL DEFAULT '0',
@ -56,7 +56,7 @@ if ($is_admin) {
} }
if (!sql_table_exists($g5["value_table"])) { if (!sql_table_exists($g5["value_table"])) {
sql_query("CREATE TABLE IF NOT EXISTS `avo_article_value` ( sql_query("CREATE TABLE IF NOT EXISTS `{$g5["value_table"]}` (
`av_id` INT(11) NOT NULL AUTO_INCREMENT , `av_id` INT(11) NOT NULL AUTO_INCREMENT ,
`ch_id` INT(11) NOT NULL DEFAULT '0', `ch_id` INT(11) NOT NULL DEFAULT '0',
`ar_theme` VARCHAR(255) NOT NULL DEFAULT '', `ar_theme` VARCHAR(255) NOT NULL DEFAULT '',

View file

@ -87,9 +87,10 @@ $html_class .= $_COOKIE['header_close'] == 'close' ? " close-header" : "";
include_once __DIR__ . "/_extra_font.php"; include_once __DIR__ . "/_extra_font.php";
if (defined('G5_IS_ADMIN')) { if (defined('G5_IS_ADMIN')) {
echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.css') . PHP_EOL; // echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.css') . PHP_EOL;
echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.layout.css') . PHP_EOL; // echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.layout.css') . PHP_EOL;
echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.amber.lib.css') . PHP_EOL; // echo get_embed_file("css", G5_ADMIN_PATH . '/css/admin.amber.lib.css') . PHP_EOL;
echo get_embed_file("css", G5_ADMIN_PATH . '/css/default.css') . PHP_EOL;
echo get_embed_file("css", G5_ADMIN_PATH . '/css/amberstone.cp.css') . PHP_EOL; echo get_embed_file("css", G5_ADMIN_PATH . '/css/amberstone.cp.css') . PHP_EOL;
} else { } else {
if (defined('G5_THEME_PATH') && file_exists(G5_THEME_PATH . "/css/default.css")) { if (defined('G5_THEME_PATH') && file_exists(G5_THEME_PATH . "/css/default.css")) {

View file

@ -1,13 +1,13 @@
<?php <?php
include_once "../config.php"; include_once "../config.php";
$theme_1 = "#BEBE8E"; $theme_1 = "#ecc6c6";
$theme_2 = "#7F7F5F"; $theme_2 = "#e8b0ae";
$theme_3 = "#7C7C4C"; $theme_3 = "#d6817e";
$theme_4 = "#b0c4de"; $theme_4 = "#b0c4de";
$theme_5 = "#727F99"; $theme_5 = "#88a9db";
$theme_6 = "#7488B2"; $theme_6 = "#779bdb";
$title = G5_VERSION . " 라이센스 확인 1/3"; $title = G5_VERSION . " 라이센스 확인 1/3";

View file

@ -1,11 +1,23 @@
@charset "utf-8"; @charset "utf-8";
/* SIR 지운아빠 */ :root {
--bg-color: #181926;
--text-color: #CAD3F5;
--accent-color: #ffbf00;
--border-color: #6E738D;
--button-bg-color: #ffbf00;
--button-bg-hover-color: #CAD3F5;
--button-text-color: #000;
--header-bg-color: #24273A;
}
/* 공통 */ /* 공통 */
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
background: url('img/pat01.png') #edf0f4; background: var(--bg-color);
color: var(--text-color);
font-size: 14px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
font-size: 0.75em; font-size: 0.75em;
font-family: dotum, helvetica font-family: dotum, helvetica
} }
@ -25,8 +37,8 @@ label {
#ins_bar { #ins_bar {
margin: 0 0 50px; margin: 0 0 50px;
padding: 20px 30px; padding: 20px 30px;
background: #383838; background: var(--header-bg-color);
color: #a1a4a7; color: var(--text-color);
font-family: tahoma, helvetica; font-family: tahoma, helvetica;
font-size: 1.500em; font-size: 1.500em;
zoom: 1 zoom: 1
@ -56,9 +68,9 @@ h1 {
.ins_inner { .ins_inner {
margin: 0 30px 50px; margin: 0 30px 50px;
padding: 20px 30px; padding: 20px 30px;
border-right: 1px solid #dde4e9; border: 1px solid var(--border-color);
border-bottom: 1px solid #dde4e9; border-radius: 4px;
background: #fff background: transparent
} }
.ins_inner ul { .ins_inner ul {
@ -76,7 +88,8 @@ h1 {
} }
.ins_inner p strong { .ins_inner p strong {
color: red font-size: 1.5em;
color: var(--accent-color)
} }
.ins_inner .inner_btn { .ins_inner .inner_btn {
@ -88,11 +101,32 @@ h1 {
.ins_inner .inner_btn input { .ins_inner .inner_btn input {
display: inline-block; display: inline-block;
padding: 10px 20px; padding: 10px 20px;
background: #BEBE8E; background: var(--button-bg-color);
color: #fff; color: var(--button-text-color);
border-radius: 4px;
text-decoration: none text-decoration: none
} }
.ins_inner .inner_btn a:hover,
.ins_inner .inner_btn input:hover,
.ins_inner .inner_btn button:hover {
background: var(--button-bg-hover-color);
}
.ins_inner pre {
font-size: 12px;
margin: 10px 0;
padding: 10px;
overflow: auto
}
.ins_inner pre::before {
content: "[AvocadoAmber ~] ";
display: inline;
height: 0;
overflow: hidden
}
.ins_inner .inner_btn input { .ins_inner .inner_btn input {
border: 0; border: 0;
cursor: pointer cursor: pointer
@ -114,13 +148,12 @@ h1 {
.ins_frm th, .ins_frm th,
.ins_frm td { .ins_frm td {
padding: 5px 3px; padding: 5px 3px;
border-top: 1px solid #dde4e9; border: 1px solid var(--border-color);
border-bottom: 1px solid #dde4e9
} }
.ins_frm th { .ins_frm th {
width: 25%; width: 25%;
background: #f2f5f9 background: var(--header-bg-color)
} }
.ins_frm td span { .ins_frm td span {
@ -130,9 +163,18 @@ h1 {
letter-spacing: -0.1em letter-spacing: -0.1em
} }
.ins_frm input {
background: transparent;
padding: 4px 8px;
border: 1px solid var(--border-color);
color: var(--text-color);
font-size: 1.25em;
}
.ins_ta { .ins_ta {
padding: 5px 0; padding: 5px 0;
border: 1px solid #dde4e9; border: 1px solid var(--border-color);
border-radius: 4px;
text-align: center text-align: center
} }
@ -141,11 +183,13 @@ h1 {
padding: 0; padding: 0;
width: 99%; width: 99%;
height: 250px; height: 250px;
color: var(--text-color);
background: transparent background: transparent
} }
.ins_license { .ins_license {
background: #f2f5f9 background: var(--bg-color);
color: var(--text-color)
} }
#ins_ft { #ins_ft {
@ -168,8 +212,8 @@ h1 {
/* extra */ /* extra */
pre { pre {
padding: 4px; padding: 4px;
background: #0d1117; background: var(--bg-color);
color: #f0f6fc; color: var(--text-color);
font-size: 14px; font-size: 14px;
font-family: monospace; font-family: monospace;
user-select: all; user-select: all;

View file

@ -17,12 +17,9 @@ if (!$title)
</head> </head>
<body> <body>
<?php
<div id="ins_bar"> include "./install_header.php";
<span id="bar_img">AVOCADO EDITION</span> ?>
<span id="bar_txt">INSTALLATION</span>
</div>
<?php <?php
// 파일이 존재한다면 설치할 수 없다. // 파일이 존재한다면 설치할 수 없다.
$dbconfig_file = $data_path . '/' . G5_DBCONFIG_FILE; $dbconfig_file = $data_path . '/' . G5_DBCONFIG_FILE;
@ -70,10 +67,11 @@ if (!$title)
?> ?>
<div class="ins_inner"> <div class="ins_inner">
<p> <p>
<b><?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 705로 변경하여 주십시오.</b><br> <?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 705로 변경하여 주십시오.<br>
<pre>#> chmod 705 <?php echo G5_DATA_DIR ?></pre> 아래 내용을 클릭하면 명령어가 전체 선택됩니다.<br>
<pre>chmod 705 <?php echo G5_DATA_DIR ?></pre>
또는<br> 또는<br>
<pre>#> chmod uo+rx <?php echo G5_DATA_DIR ?></pre><br> <pre>chmod uo+rx <?php echo G5_DATA_DIR ?></pre><br>
명령 실행후 브라우저를 새로고침 하십시오. 명령 실행후 브라우저를 새로고침 하십시오.
</p> </p>
</div> </div>
@ -81,15 +79,20 @@ if (!$title)
$write_data_dir = false; $write_data_dir = false;
} }
} else { } else {
// 생성 시도 후 권한이 없으면 안내
if (!file_exists($data_path)) {
@mkdir($data_path, G5_DIR_PERMISSION);
}
if (!(is_readable($data_path) && is_writeable($data_path) && is_executable($data_path))) { if (!(is_readable($data_path) && is_writeable($data_path) && is_executable($data_path))) {
?> ?>
<div class="ins_inner"> <div class="ins_inner">
<p> <p>
<b><?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 707로 변경하여 주십시오.</b><br> <?php echo G5_DATA_DIR ?> 디렉토리의 퍼미션을 707로 변경하여 주십시오.<br>
<pre>#> chmod 707 <?php echo G5_DATA_DIR ?></pre> 아래 내용을 클릭하면 명령어가 전체 선택됩니다.<br>
<pre>chmod 707 <?php echo G5_DATA_DIR ?></pre>
또는<br> 또는<br>
<pre>#> chmod uo+rwx <?php echo G5_DATA_DIR ?></pre><br> <pre>chmod uo+rwx <?php echo G5_DATA_DIR ?></pre><br>
명령 실행후 브라우저를 새로고침 하십시오. 명령 실행후 브라우저를 새로고침 하십시오.
</p> </p>
</div> </div>
@ -101,10 +104,11 @@ if (!$title)
?> ?>
<div class="ins_inner"> <div class="ins_inner">
<p> <p>
<b><?php echo G5_CSS_DIR ?> 디렉토리의 퍼미션을 707로 변경하여 주십시오.</b><br> <?php echo G5_CSS_DIR ?> 디렉토리의 퍼미션을 707로 변경하여 주십시오.<br>
<pre>#> chmod 707 <?php echo G5_CSS_DIR ?></pre> 아래 내용을 클릭하면 명령어가 전체 선택됩니다.<br>
<pre>chmod 707 <?php echo G5_CSS_DIR ?></pre>
또는<br> 또는<br>
<pre>#> chmod uo+rwx <?php echo G5_CSS_DIR ?></pre><br> <pre>chmod uo+rwx <?php echo G5_CSS_DIR ?></pre><br>
명령 실행후 브라우저를 새로고침 하십시오. 명령 실행후 브라우저를 새로고침 하십시오.
</p> </p>
</div> </div>

View file

@ -1,7 +1,7 @@
<?php <?php
?><div id="ins_ft"> ?><div id="ins_ft">
<strong>AVOCADO EDITION</strong> <strong>AVOCADO EDITION: AMBER</strong>
<p>GPL! OPEN SOURCE GNUBOARD</p> <p>GPL! OPEN SOURCE GNUBOARD</p>
</div> </div>
</body> </body>

View file

@ -102,7 +102,7 @@ if (!isset($_POST['agree']) || $_POST['agree'] != '동의함') {
</table> </table>
<p> <p>
<strong class="st_strong">주의! 이미 <?php echo G5_VERSION ?>이 존재한다면 DB 자료가 망실되므로 주의하십시오.</strong><br> <strong class="st_strong">이미 <?php echo G5_VERSION ?>를 설치한 경우, 재설치 시 기존 데이터베이스를 잃어버리므로 주의해 주시기 바랍니다!</strong><br>
주의사항을 이해했으며, 아보카도 에디션 설치를 계속 진행하시려면 다음을 누르십시오. 주의사항을 이해했으며, 아보카도 에디션 설치를 계속 진행하시려면 다음을 누르십시오.
</p> </p>

View file

@ -32,7 +32,6 @@ $admin_id = $_POST['admin_id'];
$admin_pass = $_POST['admin_pass']; $admin_pass = $_POST['admin_pass'];
$admin_name = $_POST['admin_name']; $admin_name = $_POST['admin_name'];
$admin_email = $_POST['admin_email']; $admin_email = $_POST['admin_email'];
$absolute_password = $_POST['absolute_password'];
$table_url = $_POST['table_url']; $table_url = $_POST['table_url'];
$dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db); $dblink = sql_connect($mysql_host, $mysql_user, $mysql_pass, $mysql_db);
@ -273,6 +272,7 @@ unset($row);
// 디렉토리 생성 // 디렉토리 생성
$dir_arr = array( $dir_arr = array(
$data_path . '/css',
$data_path . '/cache', $data_path . '/cache',
$data_path . '/editor', $data_path . '/editor',
$data_path . '/file', $data_path . '/file',
@ -366,16 +366,9 @@ EOD;
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// CSS 설정 파일 생성 // CSS 설정 파일 생성
$css_data_path = $g5_path['path'] . "/css"; $css_data_path = $data_path . "/css";
$css_data_url = $g5_path['url'] . "/css";
@mkdir($css_data_path, G5_DIR_PERMISSION); $file = $css_data_path . '/_design.config.css';
@chmod($css_data_path, G5_DIR_PERMISSION);
$file = '../' . G5_CSS_DIR . '/_design.config.css';
$file_path = $css_data_path . '/_design.config.css';
@unlink($file_path);
$f = @fopen($file, 'a'); $f = @fopen($file, 'a');
?> ?>
<li style="display:none;"> <li style="display:none;">
@ -403,6 +396,8 @@ EOD;
sql_query(" set time_zone = '" . G5_TIMEZONE . "'"); sql_query(" set time_zone = '" . G5_TIMEZONE . "'");
} }
$g5['css_table'] = $table_prefix . 'css_config';
ob_start(); ob_start();
include "../adm/design_form_css.php"; include "../adm/design_form_css.php";
$css = ob_get_contents(); $css = ob_get_contents();

View file

@ -0,0 +1,2 @@
<?php
?><div id="ins_bar"><span id="bar_img">AVOCADO EDITION: AMBER</span><span id="bar_txt"><?php echo $RIGHT_MESSAGE ? $RIGHT_MESSAGE : "INSTALLATION" ?></span></div>

View file

@ -95,10 +95,7 @@ nhn.husky.SE2M_AttachQuickPhoto = jindo.$Class({
*/ */
_getPhotoTag: function (htPhotoInfo) { _getPhotoTag: function (htPhotoInfo) {
// id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test // id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test
var sTag = '<img src="{=sOriginalImageURL}" title="{=sName}" >'; var sTag = '<br><img src="{=sOriginalImageURL}" title="{=sName}" ><br>';
if (htPhotoInfo.bNewLine) {
sTag += '<br style="clear:both;">';
}
sTag = jindo.$Template(sTag).process(htPhotoInfo); sTag = jindo.$Template(sTag).process(htPhotoInfo);
return sTag; return sTag;

View file

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

View file

@ -1,265 +1,109 @@
@charset "utf-8"; @charset "utf-8";
@import url(//fonts.googleapis.com/earlyaccess/notosanskr.css); @import url(../../../adm/css/default.css);
@font-face { /* override */
font-family: 'icon'; html, body {
src: url('../../../css/fonts/icomoon.eot?y5isk6'); display: block;
src: url('../../../css/fonts/icomoon.eot?y5isk6#iefix') format('embedded-opentype'), padding: 0;
url('../../../css/fonts/icomoon.ttf?y5isk6') format('truetype'), margin: 0;
url('../../../css/fonts/icomoon.woff?y5isk6') format('woff'),
url('../../../css/fonts/icomoon.svg?y5isk6#icomoon') format('svg');
font-weight: normal;
font-style: normal;
} }
html,
body { body {
position: relative; background: var(--white);
height: 100%;
background: #fff;
} }
#login_page_box { #login_page_box {
position: relative; position: relative;
width: 100%;
height: 100%; height: 100%;
} display: flex;
flex-direction: column;
#login_page_box:before { justify-content: center;
content: ""; align-items: center;
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 50%;
box-sizing: border-box;
border-top: 8px solid #ecc6c6;
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);
} }
#login_title { #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; position: absolute;
top: 50%; left: 0;
left: 50%; top: 0;
transform: translateX(-50%) translateY(-50%); width: 100%;
font-family: 'Noto Sans KR', sans-serif; height: 50vh;
font-size: 35px; display: flex;
font-weight: 600; box-sizing: border-box;
} padding: 20px;
justify-content: start;
#login_title em { align-items: center;
font-style: normal; flex-direction: column;
color: #ecc6c6; background: linear-gradient(to top, var(--theme-gray-900) 0%, var(--theme-gray-800) 50%, var(--theme-gray-800) 100%);
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;
} }
#mb_login { #mb_login {
position: absolute;
top: 50%;
left: 50%;
width: 500px;
height: 260px;
border-top: 5px solid #ecc6c6;
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; position: relative;
padding: 30px; padding: 40px;
z-index: 1; border-radius: 16px;
} background: var(--white);
min-width: 360px;
#mb_login fieldset.input {
display: block;
position: relative;
margin-bottom: 5px;
margin-right: 130px;
}
#mb_login fieldset.input input {
display: block;
width: 100%;
box-sizing: border-box; box-sizing: border-box;
filter: drop-shadow(0 0 15px #0002);
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;
} }
#mb_login fieldset.input input:focus { #mb_login fieldset {
border: 2px solid #ecc6c6;
}
#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: #ecc6c6;
}
#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 {
display: block; display: block;
position: relative; position: relative;
padding: 5px; padding-top: 1.5em;
background: #f6f6f6; margin-bottom: 1em;
border: 1px solid #ebebeb;
color: #3a3a3a;
margin: 5px 130px 5px 0;
font-size: 11px;
} }
#mb_login fieldset.check label { #mb_login fieldset label{
cursor: pointer;
}
#mb_login fieldset.button {
display: block; display: block;
position: absolute; position: absolute;
top: 30px; left: 0;
right: 30px; top: 0em;
width: 126px; color: var(--theme-gray-500);
height: 128px;
} }
#mb_login fieldset.button .btn_submit { #mb_login fieldset input:not([type=checkbox]) {
display: block;
width: 100%; width: 100%;
height: 100%; display: block;
background: #ecc6c6; box-sizing: border-box;
font-family: 'Noto Sans KR', sans-serif; padding: 4px 8px;
font-size: 18px; line-height: 2em;
border: none; height: auto;
cursor: pointer; border-radius: 4px;
color: #fff; }
#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 { #copyright {
padding-top: 30px; color: var(--theme-gray-500);
font-size: 12px;
color: #aaa;
text-align: center; 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;
} }