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,203 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
/**
* notice :: write.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);
}
// jQuery UI의 CSS와 JS를 불러와 달력(Datepicker) 기능을 사용합니다.
add_stylesheet('<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">', 0);
add_javascript('<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>', 0);
// 이 스킨의 전용 스타일시트를 불러옵니다.
$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);
// 이 스킨의 전용 자바스크립트 파일을 불러옵니다.
$write_js_path = $board_skin_path . '/js/write.js';
$write_js_ver = file_exists($write_js_path) ? filemtime($write_js_path) : G5_JS_VER;
add_javascript('<script src="' . $board_skin_url . '/js/write.js?ver=' . $write_js_ver . '"></script>', 0);
?>
<div id="notice-board">
<div class="three-column-layout container">
<?php if (isset($board_ad_config['write_ad']['left']) && $board_ad_config['write_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-write-left"></div>
</div>
</aside>
<?php endif; ?>
<main class="layout-main-content">
<div id="bo_w">
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);"
method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<?php
// 스마트에디터를 사용하기 위해 html1로 고정
$option_hidden = '<input type="hidden" name="html" value="1">';
echo $option_hidden;
?>
<div class="write_div">
<label for="wr_subject" class="frm_label">제목</label>
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required
class="frm_input" size="50" maxlength="255" placeholder="제목을 입력하세요.">
</div>
<!-- 노출 설정 -->
<div class="write_div">
<label class="frm_label">노출 설정</label>
<div class="option_group">
<label>
<input type="radio" name="wr_9"
value="IMMEDIATE" <?php if ($w == '' || $write['wr_9'] != 'RESERVED') echo 'checked'; ?>>
<span class="custom-radio"></span> 즉시 노출
</label>
<label>
<input type="radio" name="wr_9"
value="RESERVED" <?php if ($w == 'u' && $write['wr_9'] == 'RESERVED') echo 'checked'; ?>>
<span class="custom-radio"></span> 예약 노출
</label>
<label style="margin-left: 20px;">
<input type="checkbox" name="wr_10" value="1" <?php echo ($write['wr_10'] == '1') ? 'checked' : ''; ?>>
<span class="custom-checkbox"></span> 숨김 (노출 안 함)
</label>
</div>
</div>
<div id="reservation_fields" class="write_div"
style="display: <?php echo ($w == 'u' && $write['wr_9'] == 'RESERVED') ? 'block' : 'none'; ?>;">
<div class="date_picker_group">
<div class="date_item">
<label for="wr_2" class="frm_label"><?php echo $board['bo_2_subj'] ?: '시작일' ?></label>
<input type="text" name="wr_2" value="<?php echo $wr_2 ?>" id="wr_2" class="frm_input datepicker"
maxlength="10" placeholder="YYYY-MM-DD" readonly> <!-- readonly 추가하여 달력으로만 입력 유도 -->
</div>
<span class="date_divider">~</span>
<div class="date_item">
<label for="wr_3" class="frm_label"><?php echo $board['bo_3_subj'] ?: '종료일' ?></label>
<input type="text" name="wr_3" value="<?php echo $wr_3 ?>" id="wr_3" class="frm_input datepicker"
maxlength="10" placeholder="YYYY-MM-DD" readonly>
</div>
</div>
</div>
<!-- 링크 입력 -->
<div class="write_div">
<label for="wr_link1" class="frm_label">링크 #1</label>
<input type="text" name="wr_link1" value="<?php echo $write['wr_link1']; ?>" id="wr_link1" class="frm_input" size="50" placeholder="http://...">
</div>
<div class="write_div">
<label for="wr_content" class="frm_label">내용</label>
<?php echo $editor_html; // 스마트에디터 출력 ?>
</div>
<?php // 파일 업로드 ?>
<fieldset class="write_div">
<legend class="frm_label">파일 첨부 (최대 <?php echo $board['bo_upload_count']; ?>개, 각 10MB 이하)</legend>
<div class="file_upload_grid">
<?php
for ($i = 0; $i < $board['bo_upload_count']; $i++) {
$file_label_id = 'bf_file_' . $i;
$is_existing_file = ($w == 'u' && isset($file[$i]['file']) && $file[$i]['file']);
$preview_class = '';
$preview_style = '';
$preview_text_style = '';
if ($is_existing_file) {
$file_url = $file[$i]['path'] . '/' . $file[$i]['file'];
$file_ext = strtolower(pathinfo($file_url, PATHINFO_EXTENSION));
if (in_array($file_ext, ['mp4', 'mov', 'webm'])) {
$preview_class = 'is-video';
} else {
$preview_style = "background-image: url('{$file_url}');";
}
$preview_text_style = 'display:none;';
}
?>
<div class="file_preview_wrapper">
<div class="file_preview <?php echo $preview_class; ?>" id="preview_<?php echo $i; ?>"
style="<?php echo $preview_style; ?>">
<span class="preview_text" style="<?php echo $preview_text_style; ?>">클릭하여 파일 업로드</span>
</div>
<?php if ($is_existing_file) { ?>
<div class="preview_info">
<span class="current_file_name" title="<?php echo $file[$i]['source'] ?>">
<?php echo $file[$i]['source'] ?>
</span>
<span class="file_del">
<input type="checkbox" id="bf_file_del_<?php echo $i ?>"
name="bf_file_del[<?php echo $i ?>]" value="1">
<label for="bf_file_del_<?php echo $i ?>">삭제</label>
</span>
</div>
<?php } ?>
<input type="file" name="bf_file[]" id="<?php echo $file_label_id; ?>" style="display:none;"
accept="image/*, video/mp4, video/mov, video/webm">
</div>
<?php } ?>
</div>
</fieldset>
<div class="btn_confirm">
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn btn-secondary">취소</a>
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn btn-primary">
</div>
</form>
</div>
</main>
<?php if (isset($board_ad_config['write_ad']['right']) && $board_ad_config['write_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-write-right"></div>
</div>
</aside>
<?php endif; ?>
</div>
</div>
<script>
function fwrite_submit(f) {
<?php echo $editor_js; // 에디터 사용시 자바스크립트 부분 ?>
// 예약 노출 선택 시 날짜 입력 유효성 검사
if (document.querySelector('input[name="wr_9"]:checked').value === 'RESERVED') {
if (f.wr_2.value === '' || f.wr_3.value === '') {
alert('예약 시작일과 종료일을 모두 선택해주세요.');
return false;
}
if (f.wr_2.value > f.wr_3.value) {
alert('예약 종료일은 시작일보다 빠를 수 없습니다.');
return false;
}
}
return true;
}
</script>