first commit 2
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
|
||||
|
||||
// 💡 [핵심] 라이브러리 함수를 사용하여 모듈 설정 로드
|
||||
$rb_skin = get_rb_module_config($options);
|
||||
|
||||
// 💡 [핵심] 설정값 적용 (없으면 기본값)
|
||||
$thumb_width = (int)($rb_skin['md_width'] ? $rb_skin['md_width'] : 400);
|
||||
$thumb_height = (int)($rb_skin['md_height'] ? $rb_skin['md_height'] : 300);
|
||||
$list_count = (is_array($list) && $list) ? count($list) : 0;
|
||||
|
||||
// 모듈 타이틀 설정
|
||||
if(isset($rb_skin['md_title']) && $rb_skin['md_title']) {
|
||||
$bo_subject = $rb_skin['md_title'];
|
||||
}
|
||||
|
||||
// 카테고리 링크 설정
|
||||
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);
|
||||
}
|
||||
|
||||
// 💡 [수정] 컬럼 수 설정값 확인 및 기본값 5로 변경 (사용자 요청 반영)
|
||||
// md_col 값이 0이거나 비어있으면 5로 설정
|
||||
$pc_columns = (isset($rb_skin['md_col']) && (int)$rb_skin['md_col'] > 0) ? (int)$rb_skin['md_col'] : 5;
|
||||
$mo_columns = (isset($rb_skin['md_col_mo']) && (int)$rb_skin['md_col_mo'] > 0) ? (int)$rb_skin['md_col_mo'] : 2;
|
||||
|
||||
$css_vars = "--pc-columns: {$pc_columns}; --mo-columns: {$mo_columns};";
|
||||
|
||||
// 내용 표시 여부에 따라 클래스 결정
|
||||
$content_class = $rb_skin['md_content_is'] ? 'has-content' : 'image-only';
|
||||
|
||||
/*
|
||||
모듈설정 연동 변수
|
||||
... (주석 생략) ...
|
||||
*/
|
||||
?>
|
||||
<link rel="stylesheet" href="<?php echo $latest_skin_url ?>/style.css?ver=<?php echo G5_SERVER_TIME ?>">
|
||||
|
||||
<div class="latest-main-visual-skin <?php echo $content_class; ?>" 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="<?php echo $links_url; ?>">
|
||||
<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'; ?>; font-size:<?php echo isset($rb_skin['md_title_size']) ? $rb_skin['md_title_size'] : '20'; ?>px; "><?php echo $bo_subject ?></h2>
|
||||
</a>
|
||||
<!-- } -->
|
||||
</li>
|
||||
|
||||
|
||||
<li class="bbs_main_wrap_tit_r">
|
||||
<button type="button" class="more_btn" onclick="location.href='<?php echo $links_url ?>';">더보기</button>
|
||||
</li>
|
||||
|
||||
<div class="cb"></div>
|
||||
</ul>
|
||||
<!-- } -->
|
||||
|
||||
<ul class="visual-grid">
|
||||
<?php
|
||||
for ($i=0; $i<$list_count; $i++) {
|
||||
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
|
||||
$thumb_src = $thumb['src'] ?: G5_THEME_URL . '/rb.img/no_image.png';
|
||||
?>
|
||||
<li class="visual-item">
|
||||
<a href="<?php echo $list[$i]['href'] ?>">
|
||||
<?php if ($rb_skin['md_thumb_is']) { ?>
|
||||
<div class="visual-image">
|
||||
<img src="<?php echo $thumb_src; ?>" alt="<?php echo $thumb['alt']; ?>">
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($rb_skin['md_content_is'] || $rb_skin['md_subject_is']) { ?>
|
||||
<div class="visual-text">
|
||||
<?php if ($rb_skin['md_subject_is']) { ?>
|
||||
<span class="subject"><?php echo $list[$i]['subject']; ?></span>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($rb_skin['md_content_is']) { ?>
|
||||
<p class="content"><?php echo cut_str(strip_tags($list[$i]['wr_content']), 80); ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if ($list_count == 0) { ?>
|
||||
<li class="empty_li">게시물이 없습니다.</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,150 @@
|
||||
/* Latest Main Visual Skin Style - Title Fix */
|
||||
|
||||
.latest-main-visual-skin {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin .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-main-visual-skin .bbs_main_wrap_tit_l { min-width: 0; }
|
||||
.latest-main-visual-skin .bbs_main_wrap_tit_l h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.latest-main-visual-skin .bbs_main_wrap_tit_r { flex-shrink: 0; margin-left: 15px; }
|
||||
.latest-main-visual-skin .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-main-visual-skin .cb { display: none; }
|
||||
|
||||
/* --- 이하 기존 스타일 유지 --- */
|
||||
|
||||
.visual-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--pc-columns, 4), 1fr);
|
||||
gap: 15px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.visual-item {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
|
||||
transition: transform 0.3s;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.visual-item:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.visual-item a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.image-only .visual-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-top: 75%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.image-only .visual-image img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.image-only .visual-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.has-content .visual-image {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.has-content .visual-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.latest-main-visual-skin.has-content .visual-text {
|
||||
padding: 15px;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.visual-text .subject {
|
||||
display: block;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.visual-text .content {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
max-height: 3em;
|
||||
}
|
||||
|
||||
.empty_li {
|
||||
grid-column: 1 / -1;
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user