first commit 2
This commit is contained in:
@@ -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; ?>">
|
||||
Reference in New Issue
Block a user