first commit 2
This commit is contained in:
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">', 0);
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
|
||||
|
||||
add_javascript('<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>', 0);
|
||||
add_javascript('<script src="'.$board_skin_url.'/script.js"></script>', 10);
|
||||
|
||||
// PHP 변수를 JavaScript로 전달
|
||||
$gallery_general_config_js = [
|
||||
'write_min' => (int)$write_min,
|
||||
'write_max' => (int)$write_max,
|
||||
];
|
||||
add_javascript('<script>var gallery_general_config = '.json_encode($gallery_general_config_js).';</script>', 0);
|
||||
?>
|
||||
|
||||
<section id="bo_w">
|
||||
<h2 class="sound_only"><?php echo $g5['title'] ?></h2>
|
||||
|
||||
<!-- 게시물 작성/수정 폼 시작 { -->
|
||||
<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
|
||||
$option = '';
|
||||
$option_hidden = '';
|
||||
// 💡 [수정] 공지($is_notice) 옵션 제거
|
||||
if ($is_html || $is_secret || $is_mail) {
|
||||
$option = '';
|
||||
|
||||
if ($is_html) {
|
||||
if ($is_dhtml_editor) {
|
||||
$option_hidden .= '<input type="hidden" value="html1" name="html">';
|
||||
} else {
|
||||
$option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">HTML</label>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_secret) {
|
||||
if ($is_admin || $is_secret==1) {
|
||||
$option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">비밀글</label>';
|
||||
} else {
|
||||
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_mail) {
|
||||
$option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$mail_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
|
||||
}
|
||||
}
|
||||
|
||||
echo $option_hidden;
|
||||
?>
|
||||
|
||||
<?php if ($is_category) { ?>
|
||||
<div class="bo_w_select write_div">
|
||||
<label for="ca_name" class="sound_only">분류<strong>필수</strong></label>
|
||||
<select name="ca_name" id="ca_name" required>
|
||||
<option value="">분류 선택</option>
|
||||
<?php echo $category_option ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="bo_w_info write_div">
|
||||
<?php if ($is_name) { ?>
|
||||
<label for="wr_name" class="sound_only">이름<strong>필수</strong></label>
|
||||
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" placeholder="이름">
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($is_password) { ?>
|
||||
<label for="wr_password" class="sound_only">비밀번호<strong>필수</strong></label>
|
||||
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" placeholder="비밀번호">
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($is_email) { ?>
|
||||
<label for="wr_email" class="sound_only">이메일</label>
|
||||
<input type="email" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email" placeholder="이메일">
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($is_homepage) { ?>
|
||||
<label for="wr_homepage" class="sound_only">홈페이지</label>
|
||||
<input type="url" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input" placeholder="홈페이지">
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<!-- 💡 [수정] 옵션 및 임시저장글 영역 통합 -->
|
||||
<div class="write_div write_options">
|
||||
<div class="left_area">
|
||||
<?php if ($option) { ?>
|
||||
<span class="sound_only">옵션</span>
|
||||
<?php echo $option ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="right_area">
|
||||
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
|
||||
<div id="autosave_wrapper">
|
||||
<script src="<?php echo G5_JS_URL; ?>/autosave.js"></script>
|
||||
<?php if($editor_content_js) echo $editor_content_js; ?>
|
||||
<button type="button" id="btn_autosave" class="btn_frmline">임시 저장된 글 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
|
||||
<div id="autosave_pop">
|
||||
<strong>임시 저장된 글 목록</strong>
|
||||
<ul></ul>
|
||||
<div><button type="button" class="autosave_close">닫기</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bo_w_tit write_div">
|
||||
<label for="wr_subject" class="sound_only">제품명<strong>필수</strong></label>
|
||||
<input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input full_input required" size="50" maxlength="255" placeholder="제품명을 입력하세요">
|
||||
</div>
|
||||
|
||||
<!-- 💡 [추가] 노출 설정 UI -->
|
||||
<div class="write_div">
|
||||
<label class="frm_label" style="font-weight:bold; display:block; margin-bottom:10px;">노출 설정</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 style="margin-left: 15px;">
|
||||
<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="hidden" name="wr_10" value="0">
|
||||
<input type="checkbox" name="wr_10" id="wr_10" value="1" <?php echo (( isset($write['wr_10']) && $write['wr_10'] == '1')) ? 'checked' : ''; ?>>
|
||||
<span class="custom-checkbox"></span> 숨김 (노출 안 함)
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 💡 [추가] 예약 날짜 설정 UI -->
|
||||
<div id="reservation_fields" class="write_div" style="display: <?php echo ($w == 'u' && $write['wr_9'] == 'RESERVED') ? 'block' : 'none'; ?>; background:#f7f7f7; padding:15px; border-radius:5px;">
|
||||
<div class="date_picker_group" style="display:flex; align-items:center; gap:10px;">
|
||||
<div class="date_item">
|
||||
<label for="wr_2" class="frm_label">시작일</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" style="width:120px;">
|
||||
</div>
|
||||
<span class="date_divider">~</span>
|
||||
<div class="date_item">
|
||||
<label for="wr_3" class="frm_label">종료일</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" style="width:120px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 💡 [추가] 추가 필드 입력 UI -->
|
||||
<div class="write_div">
|
||||
<label class="frm_label">추가 정보</label>
|
||||
|
||||
<div class="bo_w_link write_div">
|
||||
<label for="wr_1"제품코드</label>
|
||||
<input type="text" name="wr_1" value="<?php echo $wr_1 ?>" id="wr_1" class="frm_input full_input" size="50" placeholder="제품 코드를 입력하세요">
|
||||
</div>
|
||||
|
||||
<div class="bo_w_link write_div">
|
||||
<label for="wr_6">요약 설명</label>
|
||||
<input type="text" name="wr_6" value="<?php echo $wr_6 ?>" id="wr_6" class="frm_input full_input" size="50" placeholder= "제펌에 대한 요약 설명을입력하세요 ">
|
||||
</div>
|
||||
|
||||
<!-- <div class="bo_w_link write_div">-->
|
||||
<!-- <label for="wr_7">제품 위치</label>-->
|
||||
<!-- <input type="text" name="wr_7" value="--><?php //echo $wr_7 ?><!--" id="wr_7" class="frm_input full_input" size="50" placeholder="예: (주)레이저월드">-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div class="write_div">
|
||||
<label for="wr_content" class="sound_only">내용<strong>필수</strong></label>
|
||||
<div class="wr_content <?php echo $is_dhtml_editor ? $config['cf_editor'] : ''; ?>">
|
||||
<?php if($write_min || $write_max) { ?>
|
||||
<!-- 최소/최대 글자 수 사용 시 -->
|
||||
<p class="text_right font-12">글자 수 : <span id="char_count">0</span>글자</p>
|
||||
<?php } ?>
|
||||
<?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($is_link) { ?>
|
||||
<?php for ($i=1; $i<=G5_LINK_COUNT; $i++) { ?>
|
||||
<div class="bo_w_link write_div">
|
||||
<label for="wr_link<?php echo $i ?>"><i class="fas fa-link" aria-hidden="true"></i> 링크 #<?php echo $i ?></label>
|
||||
<input type="text" name="wr_link<?php echo $i ?>" value="<?php if($w=="u"){echo $write['wr_link'.$i];} ?>" id="wr_link<?php echo $i ?>" class="frm_input full_input" size="50">
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($is_file) { ?>
|
||||
<div class="bo_w_flie write_div">
|
||||
<div class="file_writ_div">
|
||||
<?php for ($i=0; $i<$file_count; $i++) { ?>
|
||||
<div class="file_input_wrap">
|
||||
<label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fas fa-folder-open" aria-hidden="true"></i> 파일 #<?php echo $i+1 ?></label>
|
||||
<input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
|
||||
<?php if ($is_file_content) { ?>
|
||||
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50" placeholder="파일 설명">
|
||||
<?php } ?>
|
||||
<?php if($w == 'u' && $file[$i]['file']) { ?>
|
||||
<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 ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($is_use_captcha) { //자동등록방지 ?>
|
||||
<div class="write_div">
|
||||
<?php echo $captcha_html; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="btn_confirm write_div">
|
||||
<a href="<?php echo get_pretty_url($bo_table); ?>" class="btn_cancel btn">취소</a>
|
||||
<?php if ($is_member) { // 💡 [추가] 수동 임시저장 버튼 ?>
|
||||
<button type="button" id="btn_manual_autosave" class="btn_b01 btn">임시저장</button>
|
||||
<?php } ?>
|
||||
<button type="submit" id="btn_submit" accesskey="s" class="btn_submit btn">작성완료</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function fwrite_submit(f)
|
||||
{
|
||||
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
|
||||
|
||||
// 💡 [추가] 예약 노출 유효성 검사 (script.js의 함수 호출)
|
||||
if (typeof validate_reservation === 'function') {
|
||||
if (!validate_reservation(f)) return false;
|
||||
}
|
||||
|
||||
var subject = "";
|
||||
var content = "";
|
||||
$.ajax({
|
||||
url: g5_bbs_url+"/ajax.filter.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
"subject": f.wr_subject.value,
|
||||
"content": f.wr_content.value
|
||||
},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
subject = data.subject;
|
||||
content = data.content;
|
||||
}
|
||||
});
|
||||
|
||||
if (subject) {
|
||||
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
|
||||
f.wr_subject.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (content) {
|
||||
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
|
||||
if (typeof(ed_wr_content) != "undefined")
|
||||
ed_wr_content.returnFalse();
|
||||
else
|
||||
f.wr_content.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (document.getElementById("char_count")) {
|
||||
if (char_min > 0 || char_max > 0) {
|
||||
var cnt = parseInt(check_byte("wr_content", "char_count"));
|
||||
if (char_min > 0 && char_min > cnt) {
|
||||
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
|
||||
return false;
|
||||
}
|
||||
if (char_max > 0 && char_max < cnt) {
|
||||
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
|
||||
|
||||
document.getElementById("btn_submit").disabled = "disabled";
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
<!-- } 게시물 작성/수정 폼 끝 -->
|
||||
Reference in New Issue
Block a user