168 lines
6.4 KiB
PHP
168 lines
6.4 KiB
PHP
<?php
|
|
if (!defined('_GNUBOARD_'))
|
|
exit; // 개별 페이지 접근 불가
|
|
|
|
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
|
add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">', 0);
|
|
?>
|
|
<section id="bo_w">
|
|
<hr class="padding small">
|
|
<!-- 게시물 작성/수정 시작 -->
|
|
<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 ?>" id="write_w">
|
|
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
|
|
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>" id="write_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
|
|
include_once(G5_PLUGIN_PATH . '/jquery-ui/datepicker.php');
|
|
$offset = $board['bo_3'] ? " " . $board['bo_3'] . " hours" : "";
|
|
$today = date('Ymd', strtotime(date('Y/m/d H:i:s') . $offset));
|
|
if (empty($fr_date))
|
|
$fr_date = $today;
|
|
if ($w == '') {
|
|
if ($_GET['fr_date']) {
|
|
$write['wr_1'] = $_GET['fr_date'];
|
|
} else {
|
|
|
|
$write['wr_1'] = $today;
|
|
}
|
|
}
|
|
$option = '';
|
|
$option_hidden = '';
|
|
echo $option_hidden;
|
|
?>
|
|
<section class="wr_content">
|
|
<div id="wr_info">
|
|
<?php if ($is_name) { ?>
|
|
<p>
|
|
<label for="wr_name">이름<strong class="sound_only">필수</strong></label>
|
|
<input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required"
|
|
size="10" maxlength="20">
|
|
</p>
|
|
<?php } ?>
|
|
<?php if ($is_password) { ?>
|
|
<p>
|
|
<label for="wr_password">패스워드<strong class="sound_only">필수</strong></label>
|
|
<input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?>
|
|
class="frm_input <?php echo $password_required ?>" maxlength="20">
|
|
</p>
|
|
<?php } ?>
|
|
<?php if ($option) { ?>
|
|
<p>
|
|
<?php echo $option ?>
|
|
</p>
|
|
<?php } ?>
|
|
<?php if ($is_category) { ?>
|
|
<p>
|
|
<select name="ca_name" id="ca_name" required class="required">
|
|
<option value="">선택하세요</option>
|
|
<?php echo $category_option ?>
|
|
</select>
|
|
</p>
|
|
<?php } ?>
|
|
<p>
|
|
<input type="hidden" name="wr_subject" value="<?php echo $write['wr_1']; ?>" id="wr_subject" required
|
|
maxlength="255">
|
|
<input type="text" name="wr_1" value="<?php echo $write['wr_1']; ?>" id="wr_1" required
|
|
class="date full frm_input required" size="21" maxlength="8" placeholder="날짜">
|
|
</p>
|
|
</div>
|
|
<section class="options">
|
|
<input type="text" name="wr_4" id="wr_4" value="<?= $write['wr_4'] ?>"
|
|
placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3"
|
|
value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>">
|
|
</section>
|
|
<textarea name="wr_content" id="wr_content" maxlength="255" required></textarea>
|
|
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
|
|
class="frm_file frm_input full">
|
|
<div class="btn_confirm txt-right">
|
|
<label id="file_del" for="bf_file_del0" class="sound_only"><input type="checkbox" id="bf_file_del0"
|
|
name="bf_file_del[0]" value="1"> 파일 삭제</label>
|
|
<?php if ($is_secret) { ?><label for="secret" id="wr_secret"><input type="checkbox" id="secret" value="secret"
|
|
name="secret"> 비밀글 </label><?php } ?>
|
|
<input type="submit" value="입력" id="btn_submit" accesskey="s" class="ui-btn point">
|
|
</div>
|
|
</section>
|
|
</form>
|
|
|
|
</section>
|
|
<!-- 게시물 작성/수정 끝 -->
|
|
|
|
<script>
|
|
$(function () {
|
|
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });
|
|
});
|
|
|
|
function html_auto_br(obj) {
|
|
if (obj.checked) {
|
|
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
|
|
if (result)
|
|
obj.value = "html2";
|
|
else
|
|
obj.value = "html1";
|
|
}
|
|
else
|
|
obj.value = "";
|
|
}
|
|
|
|
function fwrite_submit(f) {
|
|
|
|
var frdate = "<?= $fr_date ?>";
|
|
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;
|
|
}
|
|
else if (char_max > 0 && char_max < cnt) {
|
|
alert("내용은 " + char_max + "글자 이하로 쓰셔야 합니다.");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
document.getElementById("btn_submit").disabled = "disabled";
|
|
|
|
return true;
|
|
}
|
|
</script>
|