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,235 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$rb_skin = get_rb_module_config($options);
//$rb_skin = sql_fetch (" select * from {$rb_module_table} where md_id = '{$options}' "); //최신글 환경설정 테이블 조회 (삭제금지)
//$thumb_width = 180;
//$thumb_height = 150;
if(isset($rb_skin['md_title']) && $rb_skin['md_title']) {
$bo_subjects = $rb_skin['md_title'];
}
// 💡 [핵심] 설정값 적용 (없으면 기본값)
$thumb_width = (int)($rb_skin['md_width'] ? $rb_skin['md_width'] : 100);
$thumb_height = (int)($rb_skin['md_height'] ? $rb_skin['md_height'] : 100);
$list_count = (is_array($list) && $list) ? count($list) : 0;
// 카테고리 링크 설정
if(isset($rb_skin['md_sca']) && $rb_skin['md_sca']) {
$links_url = get_pretty_url($bo_table,'','sca='.urlencode($rb_skin['md_sca']));
} else {
$links_url = get_pretty_url($bo_table);
}
// 💡 [추가] CSS/JS 로드
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css?ver='.G5_SERVER_TIME.'">', 0);
if(file_exists($latest_skin_path.'/script.js')) {
add_javascript('<script src="'.$latest_skin_url.'/script.js?ver='.G5_SERVER_TIME.'"></script>', 0);
}
// 💡 [추가] 동적 그리드 변수 설정 (기본값 1열)
$pc_columns = (isset($rb_skin['md_col']) && (int)$rb_skin['md_col'] > 0) ? (int)$rb_skin['md_col'] : 1;
$mo_columns = (isset($rb_skin['md_col_mo']) && (int)$rb_skin['md_col_mo'] > 0) ? (int)$rb_skin['md_col_mo'] : 1;
$css_vars = "--pc-columns: {$pc_columns}; --mo-columns: {$mo_columns};";
/*
모듈설정 연동 변수
... (주석 생략) ...
*/
?>
<link rel="stylesheet" href="<?php echo $latest_skin_url ?>/style.css?ver=<?php echo G5_SERVER_TIME ?>">
<!-- 💡 [수정] 메인용 클래스 추가 -->
<div class="latest-tabs-main1" style="<?php echo $css_vars; ?>">
<!-- 제목 영역 -->
<ul class="bbs_main_wrap_tit" style="display:<?php echo (isset($rb_skin['md_title_hide']) && $rb_skin['md_title_hide'] == '1') ? 'none' : 'block'; ?>">
<li class="bbs_main_wrap_tit_l">
<a href="javascript:void(0);">
<!-- 💡 [수정] 폰트 크기 강제 적용 (style.css에서 제어 가능하도록 클래스 추가) -->
<h2 class="<?php echo isset($rb_skin['md_title_font']) ? $rb_skin['md_title_font'] : 'font-B'; ?>" style="color:<?php echo isset($rb_skin['md_title_color']) ? $rb_skin['md_title_color'] : '#25282b'; ?>;"><?php echo $bo_subjects ?></h2>
</a>
</li>
<!-- 💡 [수정] 더보기 버튼을 제목 영역으로 이동 -->
<li class="bbs_main_wrap_tit_r">
<a href="#" class="more_btn" id="more_btn_<?php echo $rb_skin['md_id']; ?>">리스트 +</a>
</li>
<div class="cb"></div>
</ul>
<div class="latest-tabs-wrap">
<!-- 탭 { -->
<?php if (count($tabs) > 1): ?>
<!-- 💡 [수정] swiper-container 제거하고 일반 ul로 변경 (균등 분할을 위해) -->
<nav class="bo_tab main-tab-nav">
<ul class="bo_tab_ul">
<?php foreach ($tabs as $i => $tab): ?>
<?php
$bo_table = $tab['bo_table'];
$cate = $tab['sca'];
if(isset($cate) && $cate) {
$links_url = get_pretty_url($bo_table,'','sca='.urlencode($cate));
} else {
$links_url = get_pretty_url($bo_table);
}
?>
<li class="main-tab-item">
<!-- 💡 [수정] data-href 속성 추가 -->
<a href="javascript:void(0);" data-tab="tab-<?php echo $rb_skin['md_id'].'-'.$i; ?>" data-href="<?php echo $links_url; ?>" class="<?php echo $i == 0 ? 'active' : ''; ?>">
<?php echo $tab['bo_subject']; ?><?php if ($tab['sca']) echo ' / ' . $tab['sca']; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
<?php endif; ?>
<!-- } -->
<div class="latest-tab-wrap">
<!-- 탭별 콘텐츠 -->
<?php foreach ($tabs as $i => $tab): ?>
<?php
$list = $tab['list'];
$list_count = count($list);
$bo_table = $tab['bo_table'];
$cate = $tab['sca'];
// 첫 번째 탭의 링크를 기본값으로 설정
if ($i == 0) {
if(isset($cate) && $cate) {
$first_link_url = get_pretty_url($bo_table,'','sca='.urlencode($cate));
} else {
$first_link_url = get_pretty_url($bo_table);
}
}
?>
<div class="latest-tab-content<?php echo $i == 0 ? ' active' : ''; ?>" id="tab-<?php echo $rb_skin['md_id'].'-'.$i; ?>">
<!-- 💡 [수정] 더보기 버튼 제거 (위로 이동함) -->
<div class="rb_swiper" id="rb_swiper_<?php echo $rb_skin['md_id'].'_'.$i ?>" data-pc-w="<?php echo $rb_skin['md_col'] ?>" data-pc-h="<?php echo $rb_skin['md_row'] ?>" data-mo-w="<?php echo $rb_skin['md_col_mo'] ?>" data-mo-h="<?php echo $rb_skin['md_row_mo'] ?>" data-pc-gap="<?php echo $rb_skin['md_gap'] ?>" data-mo-gap="<?php echo $rb_skin['md_gap_mo'] ?>" data-autoplay="<?php echo $rb_skin['md_auto_is'] ?>" data-autoplay-time="<?php echo $rb_skin['md_auto_time'] ?>" data-pc-swap="<?php echo $rb_skin['md_swiper_is'] ?>" data-mo-swap="<?php echo $rb_skin['md_swiper_is'] ?>">
<div class="rb_swiper_inner">
<div class="rb-swiper-wrapper swiper-wrapper">
<?php foreach ($list as $row): ?>
<?php
$thumb = get_list_thumbnail($bo_table, $row['wr_id'], $thumb_width, $thumb_height, false, true);
$img = ($thumb['src'] && !strstr($row['wr_option'], 'secret')) ? $thumb['src'] : (strstr($row['wr_option'], 'secret') ? G5_THEME_URL.'/rb.img/sec_image.png' : G5_THEME_URL.'/rb.img/no_image.png');
$thumb_alt = $thumb['alt'] ?: '이미지';
$wr_href = get_pretty_url($bo_table, $row['wr_id']);
$wr_content = strip_tags($row['wr_content']);
$is_secret = strstr($row['wr_option'], 'secret');
?>
<div class="rb_swiper_list">
<div>
<?php if ($rb_skin['md_thumb_is']): ?>
<ul class="bbs_main_wrap_con_ul1">
<a href="<?php echo $wr_href ?>">
<img src="<?php echo $img ?>" alt="<?php echo $thumb_alt ?>" class="skin_list_image">
</a>
<?php if($rb_skin['md_icon_is'] == 1) { //모듈설정:아이콘 출력여부(1,0)?>
<div class="icon_abs">
<?php if ($row['icon_new']) echo "<span class=\"bbs_list_label label3\">새글</span>"; ?>
<?php if ($row['icon_hot']) echo "<span class=\"bbs_list_label label1\">인기</span>"; ?>
</div>
<?php } ?>
</ul>
<?php endif; ?>
<ul class="bbs_main_wrap_con_ul2" style="<?php echo !$rb_skin['md_thumb_is'] ? 'padding-left:0px !important; min-height:36px;' : '' ?>">
<?php if($rb_skin['md_subject_is']): ?>
<li class="bbs_main_wrap_con_subj cut">
<a href="<?php echo $wr_href ?>" class="font-B"><?php echo $row['subject'] ?></a>
</li>
<?php endif; ?>
<?php if($rb_skin['md_content_is']): ?>
<li class="bbs_main_wrap_con_cont">
<?php if ($is_secret): ?>
<a href="<?php echo $wr_href ?>" style="opacity:0.6" class="cut2">작성자 및 관리자 외 열람할 수 없습니다.<br>비밀글 기능으로 보호된 글입니다.</a>
<?php else: ?>
<a href="<?php echo $wr_href ?>" class="cut2"><?php echo $wr_content ?></a>
<?php endif; ?>
</li>
<?php endif; ?>
<?php if($rb_skin['md_nick_is'] || $rb_skin['md_date_is'] || $rb_skin['md_comment_is']): ?>
<li class="bbs_main_wrap_con_info">
<?php if($rb_skin['md_nick_is']) echo '<span class="prof_tiny_name font-B">'.$row['wr_name'].'</span>'; ?>
<?php if($rb_skin['md_date_is']) echo passing_time($row['wr_datetime']).' '; ?>
<?php if($rb_skin['md_ca_is']) echo $row['ca_name'].' '; ?>
<?php if($rb_skin['md_comment_is'] && $row['wr_comment']) echo '댓글 '.number_format($row['wr_comment']).' '; ?>
조회 <?php echo number_format($row['wr_hit']) ?>
</li>
<?php endif; ?>
</ul>
<div class="cb"></div>
</div>
</div>
<?php endforeach; ?>
<?php if ($list_count == 0): ?>
<div class="no_data" style="width:100% !important;">데이터가 없습니다.</div>
<?php endif; ?>
</div>
</div>
<?php if($rb_skin['md_swiper_is']): ?>
<div class="rb_swiper_paging_btn" style="display:<?php echo (isset($rb_skin['md_title_hide']) && $rb_skin['md_title_hide'] == '1') ? 'none' : 'block'; ?>">
<button type="button" class="swiper-button-prev rb-swiper-prev">
<img src="<?php echo G5_THEME_URL ?>/rb.img/icon/arr_prev.svg">
</button>
<button type="button" class="swiper-button-next rb-swiper-next">
<img src="<?php echo G5_THEME_URL ?>/rb.img/icon/arr_next.svg">
</button>
</div>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<script>
// 초기 더보기 링크 설정
$(document).ready(function() {
$('#more_btn_<?php echo $rb_skin['md_id']; ?>').attr('href', '<?php echo $first_link_url; ?>');
});
$(document).on('click', '.main-tab-nav a', function(e) {
e.preventDefault();
const $this = $(this);
const targetId = $this.data('tab');
const targetHref = $this.data('href'); // 💡 [수정] 탭에 저장된 링크 가져오기
const $wrap = $this.closest('.latest-tabs-wrap');
const $mainWrap = $this.closest('.latest-tabs-main1');
// 탭 버튼 상태 변경
$wrap.find('.main-tab-nav a').removeClass('active');
$this.addClass('active');
// 탭 콘텐츠 전환
$wrap.find('.latest-tab-content').removeClass('active');
const $targetTab = $wrap.find('#' + targetId).addClass('active');
// 💡 [수정] 더보기 버튼 링크 업데이트
$mainWrap.find('.more_btn').attr('href', targetHref);
// 탭 콘텐츠가 보이도록 된 후 슬라이더 초기화
setTimeout(() => {
$targetTab.find('.rb_swiper').each(function() {
if (!$(this).hasClass('swiper-initialized')) {
setupResponsiveSlider($(this));
}
});
}, 10);
});
</script>
@@ -0,0 +1,214 @@
.latest-tabs-main1 {
width: 100%;
box-sizing: border-box;
position: relative;
overflow: hidden;
background: #fff;
padding: 15px;
/* 💡 [핵심 수정] Flexbox 컬럼 방향으로 설정하여 세로 배치 강제 */
display: flex;
flex-direction: column;
}
.latest-tabs-main1 .bbs_main_wrap_tit {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid #333;
flex-shrink: 0;
}
.latest-tabs-main1 .bbs_main_wrap_tit_l { min-width: 0; }
.latest-tabs-main1 .bbs_main_wrap_tit_l h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest-tabs-main1 .bbs_main_wrap_tit_r { flex-shrink: 0; margin-left: 15px; }
.latest-tabs-main1 .more_btn {
position: relative; /* 💡 [핵심 수정] absolute 속성 덮어쓰기 */
background: none;
border: 1px solid #ddd;
padding: 5px 10px;
font-size: 12px;
color: #666;
cursor: pointer;
border-radius: 3px;}
.latest-tabs-main1 .cb { display: none; }
.pic-list-grid {
list-style: none;
padding: 0;
margin: 0;
display: grid;
grid-template-columns: repeat(var(--pc-columns, 1), 1fr);
gap: 15px;
}
.latest-tabs-main1 li { display: flex; align-items: flex-start; padding: 15px 0; border-bottom: 1px solid #f0f0f0; }
/*.latest-tabs-main1 li:last-child { border-bottom: 1px solid #f0f0f0; }*/
/*.latest-tabs-main1 .lt_img { display: block; width: 100px; height: 75px; flex-shrink: 0; margin-right: 15px; border-radius: 4px; overflow: hidden; background: #f8f8f8; }*/
/*.latest-tabs-main1 .lt_img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }*/
/*.latest-tabs-main1 li:hover .lt_img img { transform: scale(1.05); }*/
/*.latest-tabs-main1 .lt_txt_wrap { flex-grow: 1; min-width: 0; }*/
/*.latest-tabs-main1 .lt_tit { display: block; font-size: 15px; font-weight: 600; color: #333; text-decoration: none; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }*/
/*.latest-tabs-main1 .lt_date { font-size: 12px; color: #999; display: block; }*/
/*.empty_li { grid-column: 1 / -1; text-align: center; padding: 50px 0; color: #999; }*/
/* 탭 제목 스타일 */
.main-tab-title {
font-size: 24px !important;
font-weight: 700;
margin-bottom: 0;
display: block;
line-height: 1.2; /* 줄 간격 조정 */
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
/* 탭 메뉴 스타일 */
.main-tab-nav {
margin-bottom: 20px;
}
.main-tab-nav ul {
display: flex;
width: 100%;
padding: 0;
margin: 0;
list-style: none;
border: 1px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
.main-tab-nav li {
display: grid; !important;
/*align-items: flex-start; */
padding: 0px ; !important;
border-bottom: 1px solid #f0f0f0;
}
.main-tab-item {
flex: 1;
text-align: center;
border-right: 1px solid #ddd;
}
.main-tab-item:last-child {
border-right: none;
}
.main-tab-item a {
display: block;
padding: 12px 0;
font-size: 15px;
font-weight: 500;
color: #555;
text-decoration: none;
background-color: #f9f9f9;
transition: all 0.3s;
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
.main-tab-item a.active {
color: #fff;
background-color: #333;
font-weight: 700;
}
.main-tab-item a:hover {
background-color: #eee;
}
/* 탭 콘텐츠 스타일 (기존 유지) */
.latest-tab-content {
display: none;
}
.latest-tab-content.active {
display: block;
}
/* 더보기 버튼 */
.more_btn {
background: none;
border: 1px solid #ddd;
padding: 5px 10px;
font-size: 12px;
color: #666;
cursor: pointer;
border-radius: 3px;
text-decoration: none;
display: inline-block;
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
.more_btn:hover {
background-color: #f5f5f5;
color: #333;
}
/* 리스트 스타일 (기존 유지) */
.rb_swiper_list {
margin-bottom: 15px;
border-bottom: 1px solid #f0f0f0;
padding-bottom: 15px;
}
.rb_swiper_list:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.bbs_main_wrap_con_ul1 {
float: left;
width: 120px;
margin-right: 20px;
position: relative;
}
.skin_list_image {
width: 100%;
height: 90px;
object-fit: cover;
border-radius: 4px;
}
.bbs_main_wrap_con_ul2 {
overflow: hidden;
}
.bbs_main_wrap_con_subj a {
font-size: 16px;
color: #333;
display: block;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
.bbs_main_wrap_con_cont a {
font-size: 13px;
color: #666;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
max-height: 3em;
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
.bbs_main_wrap_con_info {
font-size: 12px;
color: #999;
margin-top: 5px;
font-family: inherit !important; /* 💡 [추가] 폰트 상속 강제 */
}
@media (max-width: 1024px) {
.pic-list-grid {
grid-template-columns: repeat(var(--mo-columns, 1), 1fr);
}
}