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,171 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// 모듈 설정 가져오기
$rb_skin = get_rb_module_config($options);
$thumb_width = 180;
$thumb_height = 150;
if(isset($rb_skin['md_title']) && $rb_skin['md_title']) {
$bo_subjects = $rb_skin['md_title'];
}
// 💡 [수정] 설정된 출력 개수
$limit_count = isset($rb_skin['md_cnt']) ? (int)$rb_skin['md_cnt'] : 6;
// 💡 [수정] 모든 탭(게시판)의 최신글을 직접 가져와서 통합
$all_list = array();
// 💡 [수정] 소수점 발생 시 내림 처리 (floor 사용)
$limit_count = (int)floor(($limit_count < 1 ? 1 : $limit_count)/(count($tabs) < 1 ? 1 : count($tabs)));
foreach ($tabs as $tab) {
$bo_table = $tab['bo_table'];
// 각 게시판에서 limit_count만큼 가져옴 (충분히 가져오기 위함)
// 제목 길이는 적당히 255로 설정 (스킨에서 자름)
$latest_list = get_latest($bo_table, $limit_count, 255);
foreach ($latest_list as $row) {
// 게시판 정보 추가
$row['bo_table'] = $bo_table;
// 썸네일 생성을 위해 wr_id, bo_table 등이 필요함
// get_latest 결과에는 이미 필요한 정보가 포함되어 있음
$all_list[] = $row;
}
}
// 💡 [수정] 날짜순 정렬 (최신순)
usort($all_list, function($a, $b) {
return strtotime($b['wr_datetime']) - strtotime($a['wr_datetime']);
});
// 💡 [수정] 전체 합친 것 중에서 설정된 개수만큼 자르기
// $limit_count는 위에서 나눗셈을 했으므로, 전체 개수는 원래 설정값($rb_skin['md_cnt'])을 써야 할 수도 있지만
// 현재 로직상 각 게시판별로 $limit_count만큼 가져와서 합친 후, 다시 전체 개수 제한을 두는 것이 좋을 수 있음.
// 하지만 질문의 의도는 각 게시판별 할당량을 계산할 때 내림을 하고 싶다는 것이므로 위에서 floor 처리함.
// 여기서는 전체 리스트를 다시 원래 설정된 총 개수만큼 자르는 것이 안전함.
$total_limit = isset($rb_skin['md_cnt']) ? (int)$rb_skin['md_cnt'] : 6;
$all_list = array_slice($all_list, 0, $total_limit);
$list_count = count($all_list);
?>
<link rel="stylesheet" href="<?php echo $latest_skin_url ?>/style.css?ver=<?php echo G5_SERVER_TIME ?>">
<!-- 💡 [수정] 메인용 클래스 추가 -->
<div class="latest-tabs-main-all">
<!-- 제목 영역 -->
<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);">
<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>
<div class="cb"></div>
</ul>
<div class="latest-list-wrap">
<div class="rb_swiper" id="rb_swiper_<?php echo $rb_skin['md_id'] ?>"
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 ($all_list as $row): ?>
<?php
$bo_table = $row['bo_table'];
$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) { ?>
<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['wr_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>
</div>
<script>
// 슬라이더 초기화
$(document).ready(function() {
var $swiper = $('#rb_swiper_<?php echo $rb_skin['md_id'] ?>');
if ($swiper.length > 0 && !$swiper.hasClass('swiper-initialized')) {
setupResponsiveSlider($swiper);
}
});
</script>
@@ -0,0 +1,173 @@
/* Latest Tabs Main Style */
.latest-tabs-main {
position: relative;
}
/* 💡 [수정] 제목 영역 스타일 (밑줄 강화 및 위치 수정) */
.bbs_main_wrap_tit {
margin-bottom: 20px;
border-bottom: 2px solid #333; /* 💡 밑줄 두께 2px, 색상 진하게(#333) */
padding-bottom: 7px; /* 💡 [수정] 밑줄과 텍스트 사이 간격 줄임 (15px -> 7px) */
overflow: hidden; /* 💡 float 해제 (높이 잡기) */
}
.bbs_main_wrap_tit_l {
float: left;
}
.bbs_main_wrap_tit_r {
float: right;
padding-top: 5px; /* 버튼 위치 미세 조정 */
}
.cb {
clear: both;
}
/* 탭 제목 스타일 */
.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-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; /* 💡 [추가] 폰트 상속 강제 */
}