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,15 @@
<?php
if (!defined('_GNUBOARD_')) exit;
/**
* rb.custom :: news_focus_lwd/config.php
* 뉴스 포커스 모듈 설정
*/
$news_focus_config = array(
'board_id' => 'news', // 게시판 ID
'limit' => 5, // 가져올 게시물 수 (1개는 좌측 큰 이미지, 나머지는 우측 리스트)
'title' => 'NEWS FOCUS', // 섹션 타이틀
'link_url' => G5_BBS_URL . '/board.php?bo_table=news', // 더보기 링크
);
?>
@@ -0,0 +1,127 @@
.news-focus-lwd {
margin-top: 40px;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
.news-focus-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid #333;
padding-bottom: 10px;
margin-bottom: 20px;
}
.news-focus-header h2 {
font-size: 1.5rem;
font-weight: 700;
color: #333;
margin: 0;
}
.news-focus-header .btn-more {
font-size: 0.9rem;
color: #666;
text-decoration: none;
}
.news-focus-content {
display: flex;
gap: 30px;
}
/* 좌측 메인 포스트 */
.main-post {
width: 40%;
}
.main-post a {
text-decoration: none;
color: inherit;
}
.main-post .post-thumb {
width: 100%;
height: 250px;
overflow: hidden;
margin-bottom: 15px;
background-color: #f5f5f5;
}
.main-post .post-thumb img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.3s;
}
.main-post:hover .post-thumb img {
transform: scale(1.05);
}
.main-post .post-info h3 {
font-size: 1.2rem;
font-weight: 700;
margin-bottom: 10px;
line-height: 1.4;
}
.main-post .post-info p {
font-size: 0.95rem;
color: #666;
line-height: 1.6;
height: 4.8em; /* 3줄 제한 */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* 우측 서브 포스트 리스트 */
.sub-post-list {
width: 60%;
}
.sub-post-list ul {
list-style: none;
padding: 0;
margin: 0;
}
.sub-post-list li {
border-bottom: 1px solid #eee;
}
.sub-post-list li:last-child {
border-bottom: none;
}
.sub-post-list a {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
text-decoration: none;
color: #333;
transition: color 0.2s;
}
.sub-post-list a:hover {
color: #0056b3;
}
.sub-post-list .post-subject {
font-size: 1rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 80%;
}
.sub-post-list .post-date {
font-size: 0.85rem;
color: #999;
}
@@ -0,0 +1,60 @@
<?php
if (!defined('_GNUBOARD_')) exit;
$config_path = __DIR__ . '/config.php';
if (!file_exists($config_path)) return;
include_once($config_path);
$visual_id = 'news-focus-lwd-' . uniqid();
// 게시물 가져오기
$list = get_latest($news_focus_config['board_id'], $news_focus_config['limit'], 50);
if (empty($list)) return;
$main_post = $list[0]; // 첫 번째 게시물은 좌측 큰 이미지
$sub_posts = array_slice($list, 1); // 나머지는 우측 리스트
?>
<div class="news-focus-lwd" id="<?php echo $visual_id; ?>">
<div class="news-focus-header">
<h2><?php echo $news_focus_config['title']; ?></h2>
<a href="<?php echo $news_focus_config['link_url']; ?>" class="btn-more">+ 더보기</a>
</div>
<div class="news-focus-content">
<!-- 좌측 메인 포스트 -->
<div class="main-post">
<a href="<?php echo $main_post['href']; ?>">
<div class="post-thumb">
<?php
$thumb = get_list_thumbnail($main_post['bo_table'], $main_post['wr_id'], 400, 300);
if ($thumb['src']) {
echo '<img src="' . $thumb['src'] . '" alt="' . $main_post['subject'] . '">';
} else {
echo '<span class="no-img">No Image</span>';
}
?>
</div>
<div class="post-info">
<h3><?php echo $main_post['subject']; ?></h3>
<p><?php echo cut_str(strip_tags($main_post['wr_content']), 120); ?></p>
</div>
</a>
</div>
<!-- 우측 서브 포스트 리스트 -->
<div class="sub-post-list">
<ul>
<?php foreach ($sub_posts as $post): ?>
<li>
<a href="<?php echo $post['href']; ?>">
<span class="post-subject"><?php echo $post['subject']; ?></span>
<span class="post-date"><?php echo date("Y.m.d", strtotime($post['wr_datetime'])); ?></span>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<link rel="stylesheet" href="<?php echo G5_THEME_URL; ?>/rb.custom/news_focus_lwd/module.css?ver=<?php echo G5_CSS_VER; ?>">