171 lines
7.9 KiB
PHP
171 lines
7.9 KiB
PHP
<?php
|
|
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
|
|
|
|
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
|
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
|
|
add_javascript('<script src="'.G5_JS_URL.'/viewimageresize.js"></script>', 0);
|
|
add_javascript('<script src="'.$board_skin_url.'/script.js"></script>', 10);
|
|
|
|
// 💡 [추가] 노출 상태 계산
|
|
$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';
|
|
}
|
|
?>
|
|
|
|
<!-- 게시물 읽기 시작 { -->
|
|
<article id="bo_v" style="width:<?php echo $width; ?>">
|
|
<header>
|
|
<h2 id="bo_v_title">
|
|
<?php if ($category_name) { ?>
|
|
<span class="bo_v_cate"><?php echo $view['ca_name']; // 분류 출력 끝 ?></span>
|
|
<?php } ?>
|
|
<span class="bo_v_tit">
|
|
<?php
|
|
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
|
|
?></span>
|
|
<!-- 💡 [추가] 노출 상태 배지 -->
|
|
<span class="status-badge status-<?php echo $status_class; ?>">
|
|
<?php echo $status_text; ?>
|
|
</span>
|
|
</h2>
|
|
</header>
|
|
|
|
<section id="bo_v_info">
|
|
<div class="profile_info">
|
|
<div class="pf_img"><?php echo get_member_profile_img($view['mb_id']) ?></div>
|
|
<div class="profile_info_ct">
|
|
<strong><?php echo $view['name'] ?><?php if ($is_ip_view) { echo " ($ip)"; } ?></strong><br>
|
|
<a href="#bo_vc"> <i class="far fa-comment-dots" aria-hidden="true"></i> <?php echo number_format($view['wr_comment']) ?>건</a>
|
|
<span><i class="far fa-eye" aria-hidden="true"></i> <?php echo number_format($view['wr_hit']) ?>회</span>
|
|
<strong class="if_date"><i class="far fa-clock" aria-hidden="true"></i> <?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 💡 [수정] 게시물 상단 버튼 구조 원복 -->
|
|
<div id="bo_v_top">
|
|
<ul class="btn_bo_user bo_v_com">
|
|
<li><a href="<?php echo $list_href ?>" class="btn_b01 btn"><i class="fas fa-list" aria-hidden="true"></i> 목록</a></li>
|
|
<?php if ($reply_href) { ?><li><a href="<?php echo $reply_href ?>" class="btn_b01 btn"><i class="fas fa-reply" aria-hidden="true"></i> 답변</a></li><?php } ?>
|
|
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02 btn"><i class="fas fa-pencil-alt" aria-hidden="true"></i> 글쓰기</a></li><?php } ?>
|
|
|
|
<?php if($update_href || $delete_href || $copy_href || $move_href || $search_href) { ?>
|
|
<li class="more_opt_wrapper">
|
|
<button type="button" class="btn_more_opt is_view_btn btn_b01 btn">
|
|
<i class="fas fa-ellipsis-v" aria-hidden="true"></i> 더보기
|
|
</button>
|
|
<ul class="more_opt is_view_btn">
|
|
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>">수정<i class="fas fa-pencil-alt" aria-hidden="true"></i></a></li><?php } ?>
|
|
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" onclick="del(this.href); return false;">삭제<i class="far fa-trash-alt" aria-hidden="true"></i></a></li><?php } ?>
|
|
<?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" onclick="board_move(this.href); return false;">복사<i class="far fa-copy" aria-hidden="true"></i></a></li><?php } ?>
|
|
<?php if ($move_href) { ?><li><a href="<?php echo $move_href ?>" onclick="board_move(this.href); return false;">이동<i class="fas fa-arrows-alt" aria-hidden="true"></i></a></li><?php } ?>
|
|
<?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>">검색<i class="fas fa-search" aria-hidden="true"></i></a></li><?php } ?>
|
|
</ul>
|
|
</li>
|
|
<?php } ?>
|
|
</ul>
|
|
</div>
|
|
<!-- } 게시물 상단 버튼 끝 -->
|
|
</section>
|
|
|
|
<section id="bo_v_atc">
|
|
<h2 id="bo_v_atc_title">본문</h2>
|
|
|
|
<!-- 💡 [추가] 커스텀 필드 출력 -->
|
|
<div class="custom-fields">
|
|
<?php if ($view['wr_1']) { ?>
|
|
<h3 class="subtitle"><?php echo $view['wr_1']; ?></h3>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
<?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 ($view['file'][$i]['view']) {
|
|
// 파일의 내용(bf_content)을 이미지 설명으로 사용
|
|
$alt_text = $view['file'][$i]['bf_content'] ? get_text($view['file'][$i]['bf_content']) : get_text($view['subject']);
|
|
echo get_view_thumbnail($view['file'][$i]['view'], $alt_text);
|
|
}
|
|
}
|
|
echo "</div>\n";
|
|
}
|
|
?>
|
|
|
|
<!-- 본문 내용 시작 { -->
|
|
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
|
|
<!-- } 본문 내용 끝 -->
|
|
|
|
<!-- 💡 [추가] 서명 출력 -->
|
|
<?php if ($view['wr_6'] || $view['wr_7']) { ?>
|
|
<div class="custom-signature">
|
|
<?php if ($view['wr_6']) { ?>
|
|
<p class="sign-name"><?php echo $view['wr_6']; ?></p>
|
|
<?php } ?>
|
|
<?php if ($view['wr_7']) { ?>
|
|
<p class="sign-company"><?php echo $view['wr_7']; ?></p>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>
|
|
|
|
<!-- 스크랩 추천 비추천 시작 { -->
|
|
<?php if ($scrap_href || $good_href || $nogood_href) { ?>
|
|
<div id="bo_v_act">
|
|
<?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn_b01 btn" onclick="win_scrap(this.href); return false;"><i class="fas fa-thumbtack" aria-hidden="true"></i> 스크랩</a><?php } ?>
|
|
<?php if ($good_href) { ?>
|
|
<span class="bo_v_act_gng">
|
|
<a href="<?php echo $good_href.'&'.$qstr ?>" id="good_button" class="btn_b01 btn"><i class="far fa-thumbs-up" aria-hidden="true"></i> 추천 <strong><?php echo number_format($view['wr_good']) ?></strong></a>
|
|
<b id="bo_v_act_good"></b>
|
|
</span>
|
|
<?php } ?>
|
|
<?php if ($nogood_href) { ?>
|
|
<span class="bo_v_act_gng">
|
|
<a href="<?php echo $nogood_href.'&'.$qstr ?>" id="nogood_button" class="btn_b01 btn"><i class="far fa-thumbs-down" aria-hidden="true"></i> 비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></a>
|
|
<b id="bo_v_act_nogood"></b>
|
|
</span>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
<!-- } 스크랩 추천 비추천 끝 -->
|
|
</section>
|
|
|
|
<?php
|
|
include_once(G5_BBS_PATH.'/view_comment.php');
|
|
?>
|
|
</article>
|
|
<!-- } 게시물 읽기 끝 -->
|
|
|
|
<script>
|
|
// PHP 변수를 JavaScript로 전달
|
|
var gallery_general_config = {
|
|
bo_download_point: <?php echo (int)$board['bo_download_point']; ?>
|
|
};
|
|
</script>
|