first commit 2

This commit is contained in:
hmw1001
2026-06-11 18:47:38 +09:00
parent c768729ce6
commit 6f534e33a6
11095 changed files with 1595758 additions and 0 deletions
@@ -0,0 +1,189 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
/**
* skin/nav/lwd_basic/nav.skin.php
* LWD 미디어 스타일 메뉴 스킨 (복원)
*/
// 메뉴 데이터 가져오기 (그누보드 공통 함수 사용)
$menu_datas = get_menu_db(0, false);
// 배너 데이터 가져오기 (최신 1개)
$bn_left = sql_fetch(" select * from rb_banner where '".G5_TIME_YMDHIS."' between bn_begin_time and bn_end_time and bn_position = 'topbanner_left' and bn_device IN ('pc', 'both') order by bn_id desc limit 1 ");
$bn_right = sql_fetch(" select * from rb_banner where '".G5_TIME_YMDHIS."' between bn_begin_time and bn_end_time and bn_position = 'topbanner_rite' and bn_device IN ('pc', 'both') order by bn_id desc limit 1 ");
// 💡 [추가] 한글/영문 분리 함수
function split_menu_name($name) {
$ko = '';
$en = '';
// 1. 한글과 영문의 시작 위치 찾기
$pos_ko = -1;
$pos_en = -1;
if (preg_match('/[가-힣]/u', $name, $matches, PREG_OFFSET_CAPTURE)) {
$pos_ko = $matches[0][1];
}
if (preg_match('/[a-zA-Z]/', $name, $matches, PREG_OFFSET_CAPTURE)) {
$pos_en = $matches[0][1];
}
// 2. 위치에 따라 분리
if ($pos_ko !== -1 && $pos_en !== -1) {
if ($pos_ko < $pos_en) {
// 한글이 먼저 나오는 경우: 영문 시작 위치 기준으로 분리
// 예: "한글 12 English" -> ko="한글 12", en="English"
$ko = substr($name, 0, $pos_en);
$en = substr($name, $pos_en);
} else {
// 영문이 먼저 나오는 경우: 한글 시작 위치 기준으로 분리
// 예: "English 12 한글" -> en="English 12", ko="한글"
$en = substr($name, 0, $pos_ko);
$ko = substr($name, $pos_ko);
}
} elseif ($pos_ko !== -1) {
// 한글만 있는 경우
$ko = $name;
} elseif ($pos_en !== -1) {
// 영문만 있는 경우
$en = $name;
} else {
// 둘 다 없는 경우 (숫자 등) -> 한글 변수에 담음
$ko = $name;
}
// 💡 [디버깅] 콘솔 로그 출력
// $log_msg = "Name: $name | pos_ko: $pos_ko | pos_en: $pos_en | KO: $ko | EN: $en";
// echo "<script>console.log(" . json_encode($log_msg) . ");</script>";
return array(trim($ko), trim($en));
}
// 💡 [추가] URL에서 bo_table 파라미터 추출 함수
function get_bo_table_from_url($url) {
$query_str = parse_url($url, PHP_URL_QUERY);
parse_str($query_str, $query_params);
return isset($query_params['bo_table']) ? $query_params['bo_table'] : '';
}
?>
<div class="lwd-header-wrap">
<!-- 1. 상단 유틸리티 바 (로그인, 회원가입 등) -->
<div class="header-top">
<div class="container" style="display:flex; justify-content:space-between; align-items:center;">
<ul class="top-util">
<?php if ($is_member) { ?>
<li><a href="<?php echo G5_BBS_URL ?>/logout.php">로그아웃</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/member_confirm.php?url=<?php echo G5_BBS_URL ?>/register_form.php">정보수정</a></li>
<?php } else { ?>
<li><a href="<?php echo G5_BBS_URL ?>/login.php">로그인</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/register.php">회원가입</a></li>
<?php } ?>
<li><a href="<?php echo G5_BBS_URL ?>/faq.php">고객센터</a></li>
</ul>
</div>
</div>
<!-- 2. 메인 헤더 (로고, 검색창) -->
<div class="header-main">
<div class="container" style="display:flex; justify-content:space-between; align-items:center;">
<!-- 왼쪽 배너 -->
<div class="banner-left" style="flex:1; text-align:left;">
<?php if ($bn_left) {
$bimg = G5_DATA_PATH.'/banners/'.$bn_left['bn_id'];
if (file_exists($bimg)) {
echo '<a href="'.$bn_left['bn_url'].'" target="'.($bn_left['bn_new_win']?'_blank':'_self').'">';
echo '<img src="'.G5_DATA_URL.'/banners/'.$bn_left['bn_id'].'" alt="'.get_text($bn_left['bn_alt']).'" style="max-width:100%;">';
echo '</a>';
}
} ?>
</div>
<h1 class="logo" style="flex:0 0 auto; margin:0 20px;">
<a href="<?php echo G5_URL ?>" alt="<?php echo $config['cf_title']; ?>">
<picture id="logo_img">
<?php if (!empty($rb_builder['bu_logo_mo']) && !empty($rb_builder['bu_logo_mo_w'])) { ?>
<source id="sourceSmall" srcset="<?php echo G5_URL ?>/data/logos/mo?ver=<?php echo G5_SERVER_TIME ?>" media="(max-width: 1024px)">
<?php } else { ?>
<source id="sourceSmall" srcset="<?php echo G5_THEME_URL ?>/rb.img/logos/mo.png?ver=<?php echo G5_SERVER_TIME ?>" media="(max-width: 1024px)">
<?php } ?>
<?php if (!empty($rb_builder['bu_logo_pc']) && !empty($rb_builder['bu_logo_pc_w'])) { ?>
<source id="sourceLarge" srcset="<?php echo G5_URL ?>/data/logos/pc?ver=<?php echo G5_SERVER_TIME ?>" media="(min-width: 1025px)">
<?php } else { ?>
<source id="sourceLarge" srcset="<?php echo G5_THEME_URL ?>/rb.img/logos/pc.png?ver=<?php echo G5_SERVER_TIME ?>" media="(max-width: 1024px)">
<?php } ?>
<?php if (!empty($rb_builder['bu_logo_pc']) && !empty($rb_builder['bu_logo_pc_w'])) { ?>
<img id="fallbackImage" src="<?php echo G5_URL ?>/data/logos/pc?ver=<?php echo G5_SERVER_TIME ?>" alt="<?php echo $config['cf_title']; ?>" class="responsive-image">
<?php } else { ?>
<img id="fallbackImage" src="<?php echo G5_THEME_URL ?>/rb.img/logos/pc.png?ver=<?php echo G5_SERVER_TIME ?>" alt="<?php echo $config['cf_title']; ?>" class="responsive-image">
<?php } ?>
</picture>
</a>
</h1>
<!-- 오른쪽 배너 -->
<div class="banner-right" style="flex:1; text-align:right;">
<?php if ($bn_right) {
$bimg = G5_DATA_PATH.'/banners/'.$bn_right['bn_id'];
if (file_exists($bimg)) {
echo '<a href="'.$bn_right['bn_url'].'" target="'.($bn_right['bn_new_win']?'_blank':'_self').'">';
echo '<img src="'.G5_DATA_URL.'/banners/'.$bn_right['bn_id'].'" alt="'.get_text($bn_right['bn_alt']).'" style="max-width:100%;">';
echo '</a>';
}
} ?>
</div>
</div>
</div>
<!-- 3. GNB 네비게이션 -->
<nav class="gnb-wrap">
<div class="container">
<ul class="gnb">
<?php foreach ($menu_datas as $row) {
// 💡 [수정] 함수 사용하여 분리
list($name_ko, $name_en) = split_menu_name($row['me_name']);
?>
<li class="gnb-item <?php echo isset($row['sub']) && count($row['sub']) > 0 ? 'has-sub' : ''; ?>">
<a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>" class="gnb-link">
<span class="gnb-txt-ko"><?php echo $name_ko ?></span>
<?php if($name_en) { ?><span class="gnb-txt-en"><?php echo $name_en ?></span><?php } ?>
</a>
<?php if (isset($row['sub']) && count($row['sub']) > 0) { ?>
<ul class="gnb-sub">
<?php foreach ($row['sub'] as $sub) {
// 💡 [수정] 함수 사용하여 분리
list($sub_ko, $sub_en) = split_menu_name($sub['me_name']);
?>
<li>
<a href="<?php echo $sub['me_link']; ?>" target="_<?php echo $sub['me_target']; ?>">
<span class="sub-txt-ko"><?php echo $sub_ko ?></span>
<?php if($sub_en) { ?><span class="sub-txt-en"><?php echo $sub_en ?></span><?php } ?>
</a>
</li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</nav>
</div>
<script>
function fsearchbox_submit(f)
{
if (f.stx.value.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
return false;
}
return true;
}
</script>
@@ -0,0 +1,334 @@
@charset "utf-8";
/* LWD Basic 메뉴 스킨 스타일 (nobeltimes.com 참고) */
.lwd-header-wrap {
width: 100%;
background: #fff;
border-bottom: 1px solid #ddd;
}
.lwd-header-wrap .container {
max-width: 1600px;
margin: 0 auto;
position: relative;
padding: 0 15px;
}
/* 1. 상단 헤더 (로고, 검색, 유틸) */
.header-top {
border-bottom: 1px solid #eee;
background: #fff;
}
.header-top .container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}
.header-top .logo {
flex-shrink: 0;
margin: 0;
}
.header-top .logo img {
max-height: 40px;
width: auto;
vertical-align: middle;
}
.header-search {
flex-grow: 1;
max-width: 400px;
margin: 0 30px; /* 간격 조정 */
position: relative;
}
.header-search input[type="text"] {
width: 100%;
height: 40px;
border: 2px solid #0056b3; /* 포인트 컬러 적용 */
padding: 0 45px 0 15px;
font-size: 14px;
border-radius: 20px;
background: #fff;
box-sizing: border-box;
}
.header-search button {
position: absolute;
top: 0;
right: 5px;
width: 40px;
height: 40px;
background: none;
border: none;
color: #0056b3;
font-size: 18px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
}
.header-top .top-util {
display: flex;
list-style: none;
margin: 0;
padding: 0;
flex-shrink: 0;
margin-left: auto;
}
.header-top .top-util li {
margin-left: 20px;
font-size: 13px;
color: #555;
white-space: nowrap;
}
.header-top .top-util li a {
color: #555;
text-decoration: none;
transition: color 0.2s;
}
.header-top .top-util li a:hover {
color: #0056b3;
}
/* 2. 메인 헤더 (로고, 배너) */
.header-main {
padding: 20px 0;
}
.header-main .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.header-main .logo {
flex: 0 0 auto;
margin: 0 20px;
text-align: center;
}
.header-main .logo img {
height: 120px;
width: auto;
}
/* 배너 영역 */
.header-main .banner-left,
.header-main .banner-right {
flex: 1;
display: flex;
align-items: center;
overflow: hidden;
}
.header-main .banner-left {
justify-content: flex-start;
margin-right: 80px;
}
.header-main .banner-right {
justify-content: flex-end;
margin-left: 80px;
}
.header-main .banner-left img,
.header-main .banner-right img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
/* 3. GNB 네비게이션 */
.gnb-wrap {
background: #0056b3;
border-top: 1px solid #eee;
}
.gnb {
display: flex;
list-style: none;
margin: 0;
padding: 0;
justify-content: center;
}
.gnb-item {
position: relative;
}
/* GNB 링크 스타일 (2줄 표시) */
.gnb-link {
display: flex;
flex-direction: column; /* 세로 정렬 */
justify-content: center;
align-items: center;
padding: 10px 25px;
height: 60px;
color: #fff;
text-decoration: none;
transition: background-color 0.2s;
text-align: center;
/* 💡 [수정] 강제로 라인 제거 */
border: none !important;
outline: none !important;
}
.gnb-txt-ko {
font-size: 16px;
font-weight: 700;
line-height: 1.2;
}
.gnb-txt-en {
font-size: 11px;
font-weight: 400;
opacity: 0.8;
margin-top: 2px;
text-transform: uppercase;
}
.gnb-item:hover .gnb-link {
background-color: #004494;
/* 💡 [수정] 강제로 라인 제거 */
text-decoration: none !important;
border: none !important;
outline: none !important;
}
/* 💡 [추가] 가상 요소(::before, ::after)로 인한 애니메이션 라인 제거 */
.gnb-item:hover .gnb-link::before,
.gnb-item:hover .gnb-link::after,
.gnb-link::before,
.gnb-link::after {
display: none !important;
content: none !important;
width: 0 !important;
height: 0 !important;
opacity: 0 !important;
transition: none !important;
}
/* 서브 메뉴 스타일 (너비 축소 및 세로 나열) */
.gnb-sub {
display: none;
position: absolute;
top: 60px;
left: 50%;
transform: translateX(-50%);
min-width: 300px;
background: #fff;
border: none;
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
z-index: 999;
list-style: none;
padding: 15px 0;
text-align: left;
}
.gnb-item:hover .gnb-sub {
display: block;
}
.gnb-sub li {
display: block;
width: 100%;
box-sizing: border-box;
}
.gnb-sub li a {
display: block;
padding: 10px 20px;
color: #333;
text-decoration: none;
transition: background-color 0.2s, color 0.2s;
/* 💡 [수정] 강제로 라인 제거 */
border: none !important;
outline: none !important;
}
.sub-txt-ko {
display: block;
font-size: 16px;
font-weight: 600;
line-height: 1.3;
}
.sub-txt-en {
display: block;
font-size: 11px;
color: #888;
margin-top: 2px;
text-transform: uppercase;
}
.gnb-sub li a:hover {
background-color: #f0f2f5;
color: #0056b3;
/* 💡 [수정] 강제로 라인 제거 */
text-decoration: none !important;
border: none !important;
outline: none !important;
}
.gnb-sub li a:hover .sub-txt-en {
color: #0056b3;
}
/* 반응형 */
@media (max-width: 991px) {
.header-top .container {
flex-wrap: wrap;
justify-content: center;
}
.header-top .logo {
width: 100%;
text-align: center;
margin-bottom: 15px;
}
.header-search {
width: 100%;
max-width: 100%;
margin: 0 0 15px 0;
order: 2;
}
.header-top .top-util {
width: 100%;
justify-content: center;
margin-bottom: 15px;
order: 1;
margin-left: 0;
}
.gnb-wrap {
overflow-x: auto;
}
.gnb-link {
padding: 10px 15px;
height: auto;
}
/* 모바일에서는 서브메뉴 너비 자동 */
.gnb-sub {
min-width: 200px;
left: 0;
transform: none;
}
.gnb-sub li {
display: block;
width: 100%;
}
}