first commit 2
This commit is contained in:
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
/**
|
||||
* notice :: view.skin.php
|
||||
*/
|
||||
|
||||
// 0. 중앙 광고 설정 파일을 로드합니다.
|
||||
include_once(G5_THEME_PATH . '/skin/board/board_ad_config.php');
|
||||
|
||||
$config_path = __DIR__ . '/config.php';
|
||||
if (file_exists($config_path)) {
|
||||
include_once($config_path);
|
||||
}
|
||||
|
||||
// 이 스킨의 전용 스타일시트를 불러옵니다.
|
||||
$style_ver = file_exists($board_skin_path . '/css/style.css') ? filemtime($board_skin_path . '/css/style.css') : G5_CSS_VER;
|
||||
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/css/style.css?ver=' . $style_ver . '">', 0);
|
||||
add_javascript('<script src="'.$board_skin_url.'/js/script.js?ver='.G5_SERVER_TIME.'"></script>', 0);
|
||||
|
||||
// --- 노출 상태 계산 ---
|
||||
$status_text = '정보 없음';
|
||||
$status_class = 'expired';
|
||||
$is_hidden = ($view['wr_10'] == '1');
|
||||
$today = G5_TIME_YMD;
|
||||
|
||||
if ($is_hidden) {
|
||||
$status_text = '숨김 (노출 안 함)';
|
||||
$status_class = 'hidden';
|
||||
} else if ($view['wr_9'] == 'RESERVED') {
|
||||
$start_date = $view['wr_2'];
|
||||
$end_date = $view['wr_3'];
|
||||
|
||||
if ($today >= $start_date && $today <= $end_date) {
|
||||
$status_text = '노출중 (예약)';
|
||||
$status_class = 'active';
|
||||
} elseif ($today < $start_date) {
|
||||
$status_text = '예약됨 (대기)';
|
||||
$status_class = 'scheduled';
|
||||
} else {
|
||||
$status_text = '기간만료';
|
||||
$status_class = 'expired';
|
||||
}
|
||||
} else {
|
||||
$status_text = '즉시 노출';
|
||||
$status_class = 'active';
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="notice-board">
|
||||
<div class="three-column-layout container">
|
||||
<?php if ((isset($board_ad_config['view_ad']['left']) && $board_ad_config['view_ad']['left'] === true) ): ?>
|
||||
<aside class="layout-sidebar-left">
|
||||
<div class="sidebar-inner">
|
||||
<?php if($is_admin) { ?> <h3 class="sidebar-title">좌측 광고 영역</h3> <?php } ?>
|
||||
<div class="flex_box flex_box_l" data-layout="notice-view-left"></div>
|
||||
</div>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
|
||||
<main class="layout-main-content">
|
||||
<div id="bo_v">
|
||||
<!-- 1. 제목 영역 -->
|
||||
<h3 id="bo_v_title">
|
||||
<?php if ($category_name) { ?><span class="item-category">[<?php echo $view['ca_name']; ?>]</span><?php } ?>
|
||||
<?php echo cut_str(get_text($view['wr_subject']), 70); ?>
|
||||
<span class="status-badge status-<?php echo $status_class; ?>" style="font-size: 14px; vertical-align: middle; margin-left: 10px;"><?php echo $status_text; ?></span>
|
||||
</h3>
|
||||
|
||||
<!-- 2. 정보 영역 (작성자, 날짜, 조회수 등) -->
|
||||
<div id="bo_v_info">
|
||||
<dl>
|
||||
<dt>작성자</dt>
|
||||
<dd><?php echo $view['name'] ?><?php if ($is_ip_view) { echo " ($ip)"; } ?></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>작성일</dt>
|
||||
<dd><?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>조회</dt>
|
||||
<dd><?php echo number_format($view['wr_hit']) ?>회</dd>
|
||||
</dl>
|
||||
<?php if ($view['wr_link1']) { ?>
|
||||
<dl>
|
||||
<dt>링크</dt>
|
||||
<dd><a href="<?php echo $view['wr_link1']; ?>" target="_blank"><?php echo $view['wr_link1']; ?></a></dd>
|
||||
</dl>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<!-- 3. 본문 영역 -->
|
||||
<div id="bo_v_con">
|
||||
<?php
|
||||
// 파일 출력
|
||||
$v_img_count = count($view['file']);
|
||||
if($v_img_count) {
|
||||
echo "<div id=\"bo_v_img\">\n";
|
||||
for ($i=0; $i<=count($view['file']); $i++) {
|
||||
if (isset($view['file'][$i])) {
|
||||
echo get_file_thumbnail($view['file'][$i]);
|
||||
}
|
||||
}
|
||||
echo "</div>\n";
|
||||
}
|
||||
?>
|
||||
<div class="view_content">
|
||||
<?php echo conv_content($view['wr_content'], 1); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 4. 첨부파일 영역 -->
|
||||
<?php if (isset($view['file']) && count($view['file']) > 0) { ?>
|
||||
<div id="bo_v_file">
|
||||
<h3>첨부파일</h3>
|
||||
<ul class="file-list">
|
||||
<?php
|
||||
for ($i = 0; $i < count($view['file']); $i++) {
|
||||
if (isset($view['file'][$i]['source']) && $view['file'][$i]['source']) {
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $view['file'][$i]['href']; ?>" class="view_file_download">
|
||||
<i class="fa fa-download" aria-hidden="true"></i>
|
||||
<strong><?php echo $view['file'][$i]['source'] ?></strong>
|
||||
<?php echo $view['file'][$i]['content'] ?> (<?php echo $view['file'][$i]['size'] ?>)
|
||||
</a>
|
||||
<span class="bo_v_file_cnt"><?php echo $view['file'][$i]['download'] ?>회 다운로드 | DATE : <?php echo $view['file'][$i]['datetime'] ?></span>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!-- 5. 하단 버튼 영역 -->
|
||||
<div id="bo_v_bot">
|
||||
<?php if ($update_href) { ?><a href="<?php echo $update_href ?>" class="btn btn-primary">수정</a><?php } ?>
|
||||
<?php if ($delete_href) { ?><a href="<?php echo $delete_href ?>" onclick="del(this.href); return false;" class="btn btn-danger">삭제</a><?php } ?>
|
||||
<?php if ($write_href) { ?><a href="<?php echo $write_href ?>" class="btn btn-primary">글쓰기</a><?php } ?>
|
||||
<a href="<?php echo $list_href ?>" class="btn btn-secondary">목록</a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php if ((isset($board_ad_config['view_ad']['right']) && $board_ad_config['view_ad']['right'] === true) ): ?>
|
||||
<aside class="layout-sidebar-right">
|
||||
<div class="sidebar-inner">
|
||||
<?php if($is_admin) { ?> <h3 class="sidebar-title">우측 광고 영역</h3> <?php } ?>
|
||||
<div class="flex_box flex_box_r" data-layout="notice-view-right"></div>
|
||||
</div>
|
||||
</aside>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function del(href) {
|
||||
if(confirm("한번 삭제한 자료는 복구할 수 없습니다.\n\n정말 삭제하시겠습니까?")) {
|
||||
document.location.href = href;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user