답변 13개
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
?>
<?php
if ($w == "u") {
$wr_body_1 = explode("|",substr($write[wr_1],1));
$wr_body_2 = explode("|",substr($write[wr_2],1));
}
?>
<?php
$ex4_filed = explode("|",$write[wr_4]);
$ext4_00 = $ex4_filed[0];//상호
$ext4_01 = $ex4_filed[1];//오전,오후 (시작)
$ext4_02 = $ex4_filed[2];//시작시간
$ext4_03 = $ex4_filed[3];//오전오후(끝)
$ext4_04 = $ex4_filed[4];//끝시간
$ext4_05 = $ex4_filed[5];//24시간
$ext4_06 = $ex4_filed[6];//배달가부
$ext4_07 = $ex4_filed[7];//포장
$ext4_08 = $ex4_filed[8];//전화1-1
$ext4_09 = $ex4_filed[9];//전화1-2
$ext4_10 = $ex4_filed[10];//전화1-3
$ext4_11 = $ex4_filed[11];//전화2-1
$ext4_12 = $ex4_filed[12];//전화2-2
$ext4_13 = $ex4_filed[13];//전화2-3
$ext4_14 = $ex4_filed[14];//
$ext4_15 = $ex4_filed[15];//
$ext4_16 = $ex4_filed[16];//
$ext4_17 = $ex4_filed[17];//
$ext4_18 = $ex4_filed[18];//
$ext4_19 = $ex4_filed[19];//
$ext4_20 = $ex4_filed[20];//
/*
$wr_5 //휴일
$wr_6 //대표메뉴
$wr_7 //배달가능지역
$wr_8//오시는 길
$wr_9
$wr_10
*/
// 주소입력
$wr3 = explode('|',$write['wr_3']);
$ex_zip = $wr3[0];
$ex_addr1 = $wr3[1];
$ex_addr2 = $wr3[2];
$ex_addr3 = $wr3[3];
$ex_jibeon = $wr3[4];
?>
<script>
function addRow() {
var oRow = dyntbl1.insertRow();
oRow.onmouseover=function(){dyntbl1.clickedRowIndex=this.rowIndex};
if(navigator.userAgent.indexOf("MSIE")){
var oCell1 = oRow.insertCell();
var oCell2 = oRow.insertCell();
var oCell6 = oRow.insertCell();
oCell1.innerHTML = "<input class='frm_input_a' name=wr_body_1[] itemname='메뉴' maxlength='60'>";
oCell2.innerHTML = "<input class='frm_input_b' name=wr_body_2[] itemname='가격' maxlength='160'> 원";
oCell6.innerHTML = " <input type=button class='del' value=\" 삭제 \" onClick=\"delRow()\">";
document.recalc();
}
else if(navigator.userAgent.indexOf("Chrome")){
var oCell1 = oRow.insertCell();
var oCell2 = oRow.insertCell();
var oCell6 = oRow.insertCell();
oCell1.innerHTML = "<input class='frm_input_a' required name=wr_body_1[] itemname='메뉴' maxlength='60'>";
oCell2.innerHTML = "<input class='frm_input_b' name=wr_body_2[] itemname='가격' maxlength='160'> 원";
oCell6.innerHTML = " <input type=button class='del' value=\" 삭제 \" onClick=\"delRow()\">";
}
else if(navigator.userAgent.indexOf("Safari")){
var oCell6 = oRow.insertCell();
var oCell2 = oRow.insertCell();
var oCell1 = oRow.insertCell();
oCell6.innerHTML = " <input type=button class='del' value=\" 삭제 \" onClick=\"delRow()\">";
oCell2.innerHTML = "<input class='frm_input_b' name=wr_body_2[] itemname='가격' maxlength='160'> 원";
oCell1.innerHTML = "<input class='frm_input_a' required name=wr_body_1[] itemname='메뉴' maxlength='60'>";
}
else if(navigator.userAgent.indexOf("Firefox")){
var oCell6 = oRow.insertCell();
var oCell2 = oRow.insertCell();
var oCell1 = oRow.insertCell();
oCell6.innerHTML = " <input type=button class='del' value=\" 삭제 \" onClick=\"delRow()\">";
oCell2.innerHTML = "<input class='frm_input_b' name=wr_body_2[] itemname='가격' maxlength='160'> 원";
oCell1.innerHTML = "<input class='frm_input_a' required name=wr_body_1[] itemname='메뉴' maxlength='60'>";
}
else{
var oCell1 = oRow.insertCell();
var oCell2 = oRow.insertCell();
var oCell6 = oRow.insertCell();
oCell1.innerHTML = "<input class='frm_input_a' required name=wr_body_1[] itemname='메뉴' maxlength='60'>";
oCell2.innerHTML = "<input class='frm_input_b' name=wr_body_2[] itemname='가격' maxlength='160'> 원";
oCell6.innerHTML = " <input type=button class='del' value=\" 삭제 \" onClick=\"delRow()\">";
}
}
function delRow() {
dyntbl1.deleteRow(dyntbl1.clickedRowIndex);
}
function delRow_php(r)
{
var i=r.parentNode.parentNode.rowIndex;
document.getElementById('dyntbl2').deleteRow(i);
}
function fixscreen() {
var buffer = document.all.item(0).outerHTML;
document.open("text/html", "replace");
document.write(buffer);
document.close();
}
function addCol() {
var vCell,tmp;
for (var i=0; i<dyntbl1.rows.length; i++) {
tmp=dyntbl1.rows[i].cells[dyntbl1.rows[i].cells.length-1].cloneNode(true);
dyntbl1.rows[i].deleteCell();
vCell=dyntbl1.rows[i].insertCell();
vCell.innerHTML=i==0?"<input type=button value=' X ' onclick='delCol(parentNode.cellIndex)'>":" ";
vCell=dyntbl1.rows[i].insertCell();
vCell.innerHTML=tmp.innerHTML;
}
}
function delCol(idx) {
for (var i=0; i<=dyntbl1.rows.length; i++) {
dyntbl1.rows[i].cells[idx].removeNode();
}
}
</script>
<script>
function onlyNumber(objtext1){
var inText = objtext1.value;
var ret;
for (var i = 0; i < inText.length; i++) {
ret = inText.charCodeAt(i);
if (!((ret > 47) && (ret < 58))) {
alert("숫자만을 입력하세요");
objtext1.value = "";
objtext1.focus();
return false;
}
}
if (objtext1.value.length==6) {
document.form1.RNI_idnum2.focus() ;
}
return true;
}
</script>
<script>
$(document).ready(function(){
// 라디오버튼 클릭시 이벤트 발생
$("input:radio[name=ext4_06]").click(function(){
if($("input[name=ext4_06]:checked").val() == "1"){
$("input:text[name=wr_7]").attr("disabled",false);
// radio 버튼의 value 값이 1이라면 활성화
}else if($("input[name=ext4_06]:checked").val() == "2"){
$("input:text[name=wr_7]").attr("disabled",true);
// radio 버튼의 value 값이 2이라면 비활성화
}
});
});
</script>
<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" style="width:<?php echo $width; ?>">
<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 = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
$option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
}
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" '.$recv_email_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="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email " placeholder="이메일">
<?php } ?>
</div>
<?php if ($is_homepage) { ?>
<div class="write_div">
<label for="wr_homepage" class="sound_only">홈페이지</label>
<input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input full_input" size="50" placeholder="홈페이지">
</div>
<?php } ?>
<?php if ($option) { ?>
<div class="write_div">
<span class="sound_only">옵션</span>
<?php echo $option ?>
</div>
<?php } ?>
<div class="bo_w_tit write_div">
<label for="wr_subject" class="sound_only">제목<strong>필수</strong></label>
<div id="autosave_wrapper write_div">
<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="제목">
<?php if ($is_member) { // 임시 저장된 글 기능 ?>
<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>
<?php } ?>
</div>
</div>
<div class="write_box">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td class="left_con" width="15%" height="33">상호</td>
<td class="right_con" width="35%">
<INPUT class="info_input" style="width:80%;" name='ext4_00' id='ext4_00' value="<?php echo $ext4_00;?>" maxlength='70' itemname="상호" placeholder="상호를 입력해주세요">
</td>
<td class="left_con" width="15%">업종</td>
<td class="right_con" width="35%">
<select name="ca_name" id="ca_name" required class="info_input">
<option value="">분류를 선택하세요</option>
<?php echo $category_option ?>
</select>
</td>
</tr>
<tr>
<td class="left_con" height="33">주소</td>
<td class="right_con" colspan="3" style="padding-top:5px;padding-bottom:5px;">
<div id="autosave_wrapper write_div">
<label for="ex_zip" class="sound_only">우편번호</label>
<input type="text" name="ex_zip" value="<?php echo $ex_zip; ?>" id="ex_zip" class="frm_input" size="6" maxlength="6">
<button type="button" class="btn_frmline" onclick="win_zip('fwrite', 'ex_zip', 'ex_addr1', 'ex_addr2', 'ex_addr3', 'ex_jibeon');">주소 검색</button><br>
<input type="text" name="ex_addr1" value="<?php echo $ex_addr1; ?>" id="ex_addr1" class="info_input frm_address" size="50">
<label for="ex_addr1">기본주소</label><br>
<input type="hidden" name="ex_addr2" value="<?php echo " ".$ex_addr2; ?>" id="ex_addr2" class="info_input frm_address" size="50">
<!--<label for="ex_addr2">상세주소</label>-->
<input type="text" name="ex_addr3" value="<?php echo $ex_addr3; ?>" id="ex_addr3" class="info_input frm_address" size="50" readonly="readonly">
<label for="ex_addr3">참고항목</label>
<input type="hidden" name="ex_jibeon" value="<?php echo $ex_jibeon; ?>">
</div>
</td>
</tr>
<tr>
<td class="left_con" height="33">영업시간</td>
<td class="right_con" colspan="3">
<input name='ext4_05' type=radio value='1' <?php if ($w == '' || $ext4_05 == '1') echo "checked";?>>
<SELECT name='ext4_01' class="info_input" itemname='시작'>
<option value='오전' <?php if($ext4_01 == "오전") echo "selected"; ?>>오전</option>
<option value='오후' <?php if($ext4_01 == "오후") echo "selected"; ?>>오후</option>
</select>
<input class="info_input" style="width:30px;" name='ext4_02' id='ext4_02' value="<?php echo $ext4_02?>" onkeydown='onlyNumber(this);' maxlength='4' itemname="시작"> 시 부터
<SELECT name='ext4_03' class="info_input" itemname='end'>
<option value='오전' <?php if($ext4_03 == "오전") echo "selected"; ?>>오전</option>
<option value='오후' <?php if($ext4_03 == "오후") echo "selected"; ?>>오후</option>
</select>
<input class="info_input" style="width:30px;" name='ext4_04' id='ext4_04' value="<?php echo $ext4_04?>" onkeydown='onlyNumber(this);' maxlength='4' itemname="end"> 시 까지
/
<input name='ext4_05' type=radio value='2' <?php if($ext4_05 == '2') echo "checked";?>> 24시간 영업
</td>
</tr>
<tr>
<td class="left_con" height="33">휴일</td>
<td class="right_con"><input class="info_input" style="width:80%;" name='wr_5' id='wr_5' value="<?php echo $write[wr_5];?>" maxlength='70' itemname="휴일" placeholder="정기휴일"></td>
<td class="left_con">대표 메뉴</td>
<td class="right_con"><input class="info_input" style="width:80%;" name='wr_6' id='wr_6' value="<?php echo $write[wr_6];?>" maxlength='70' itemname="대표메뉴" placeholder="대표메뉴"></td>
</tr>
<tr>
<td class="left_con" height="33">배달</td>
<td class="right_con">
<input type=radio name='ext4_06' value="1"<?php if($ext4_06 == '1') {echo "checked";} ?>checked> 가능
<input type=radio name='ext4_06' value="2"<?php if($ext4_06 == '2') {echo "checked";} ?>> 불가
</td>
<td class="left_con">배달가능지역</td>
<td class="right_con">
<input class="info_input_a" style="width:80%;" name='wr_7' id='wr_7' value="<?php echo $write[wr_7];?>" maxlength='70' itemname="배달">
</td>
</tr>
<tr>
<td class="left_con" height="33">포장</td>
<td class="right_con" colspan="3">
<input type=radio name='ext4_07' value="1" <?php if($ext4_07 == '1') {echo "checked";} ?>checked> 전메뉴 포장가능
<input type=radio name='ext4_07' value="2" <?php if($ext4_07 == '2') {echo "checked";} ?>> 일부메뉴 포장가능
<input type=radio name='ext4_07' value="3" <?php if($ext4_07 == '3') {echo "checked";} ?>> 포장불가
</td>
</tr>
<tr>
<td class="left_con" height="33">주차</td>
<td class="right_con" colspan="3">
<input type=radio name='ext4_14' value="1" <?php if($ext4_14 == '1') {echo "checked";} ?>checked> 주차가능
<input type=radio name='ext4_14' value="2" <?php if($ext4_14 == '2') {echo "checked";} ?>> 주차장 없음
</td>
</tr>
<tr>
<td class="left_con" height="33">전화 1</td>
<td class="right_con">
<SELECT name='ext4_08' class='info_input' itemname='전화번호'>
<option value=''>선택</option>
<option value='02' <?php if($ext4_08 == "02") echo "selected"; ?>>02</option>
<option value='031' <?php if($ext4_08 == "031") echo "selected"; ?>>031</option>
<option value='032' <?php if($ext4_08 == "032") echo "selected"; ?>>032</option>
<option value='033' <?php if($ext4_08 == "033") echo "selected"; ?>>033</option>
<option value='041' <?php if($ext4_08 == "041") echo "selected"; ?>>041</option>
<option value='042' <?php if($ext4_08 == "042") echo "selected"; ?>>042</option>
<option value='043' <?php if($ext4_08 == "043") echo "selected"; ?>>043</option>
<option value='051' <?php if($ext4_08 == "051") echo "selected"; ?>>051</option>
<option value='052' <?php if($ext4_08 == "052") echo "selected"; ?>>052</option>
<option value='053' <?php if($ext4_08 == "053") echo "selected"; ?>>053</option>
<option value='054' <?php if($ext4_08 == "054") echo "selected"; ?>>054</option>
<option value='055' <?php if($ext4_08 == "055") echo "selected"; ?>>055</option>
<option value='061' <?php if($ext4_08 == "061") echo "selected"; ?>>061</option>
<option value='062' <?php if($ext4_08 == "062") echo "selected"; ?>>062</option>
<option value='063' <?php if($ext4_08 == "063") echo "selected"; ?>>063</option>
<option value='064' <?php if($ext4_08 == "064") echo "selected"; ?>>064</option>
<option value='070' <?php if($ext4_08 == "070") echo "selected"; ?>>070</option>
</select> -
<input name='ext4_09' class="info_input" value='<?php echo $ext4_09?>' type='text' size='8' maxlength='4' onkeydown='onlyNumber(this);' itemname='일반전화 두번째자리'> -
<input name='ext4_10' class="info_input" value='<?php echo $ext4_10?>' type='text' size='8' maxlength='4' onkeydown='onlyNumber(this);' itemname='일반전화 세번째자리'>
</td>
<td class="left_con">전화 2</td>
<td class="right_con">
<input name='ext4_11' class="info_input" value='<?=$ext4_11?>' type='text' size='8' maxlength='4' onkeydown='onlyNumber(this);' itemname='전화 첫번째자리'> -
<input name='ext4_12' class="info_input" value='<?=$ext4_12?>' type='text' size='8' maxlength='4' onkeydown='onlyNumber(this);' itemname='전화 두번째자리'> -
<input name='ext4_13' class="info_input" value='<?=$ext4_13?>' type='text' size='8' maxlength='4' onkeydown='onlyNumber(this);' itemname='전화 세번째자리'>
</td>
</tr>
<tr>
<td class="left_con" height="33">오시는 길</td>
<td class="right_con" colspan="3">
<input class="info_input" style="width:90%;" name='wr_8' id='wr_8' value="<?php echo $write[wr_8];?>" maxlength='100' itemname="오시는길" placeholder="간단하게 한 줄 설명해 주세요.">
</td>
</tr>
</tbody>
</table>
</div>
<div style="height:40px;"> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td colspan=2 height=40 align=center><b>메뉴판</b> <font color=red>(오른쪽 버튼을 눌러 한 행씩 추가하십시오.)</font> <input type="button" class="add" value="ADD ONE +" onClick="addRow()"></td></tr>
<tr>
<td colspan="2">
<table width="100%" cellspacing=1 cellpadding=3 bgcolor="#CCCCCC">
<col width="60%"></col>
<col width="30%"></col>
<col width="10%"></col>
<tr height="30">
<td class=write_cb><b>메뉴</b></td>
<td class=write_cb><b>가격</b></td>
<td class=write_cb><b>삭제</b></td>
</tr>
</table>
<?php if ($w == "u") { ?>
<table id=dyntbl2 width="100%" cellspacing=1 cellpadding=3 bgcolor="#CCCCCC">
<col bgcolor="#FFFFFF" align="center" width="60%"></col>
<col bgcolor="#FFFFFF" align="center" width="30%"></col>
<col bgcolor="#FFFFFF" align="center" width="10%"></col>
<div>
<?php for ($i = 0; $i < count($wr_body_1); $i++) { ?>
<tr height="30" id=v_<?=$i?>>
<td><input class='frm_input_a' name='wr_body_1[]' type='text' required itemname='메뉴' value='<?php echo $wr_body_1[$i];?>' maxlength='140'></td>
<td><input class='frm_input_b' name='wr_body_2[]' type='text' itemname='가격' value='<?php echo $wr_body_2[$i]; ?>' maxlength='10'> 원</td>
<td> <input type="button" class="del" value=" 삭제 " onClick="delRow_php(this)"></td>
</tr>
<?php } ?>
</div>
</table>
<?php } ?>
<table id=dyntbl1 width="100%" cellspacing=1 cellpadding=3 bgcolor="#EEEEEE">
<col bgcolor="#FFFFFF" align="center" width="60%"></col>
<col bgcolor="#FFFFFF" align="center" width="30%"></col>
<col bgcolor="#FFFFFF" align="center" width="10%"></col>
</table>
</td></tr></table>
<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 id="char_count_desc">이 게시판은 최소 <strong><?php echo $write_min; ?></strong>글자 이상, 최대 <strong><?php echo $write_max; ?></strong>글자 이하까지 글을 쓰실 수 있습니다.</p>
<?php } ?>
<?php echo $editor_html; // 에디터 사용시는 에디터로, 아니면 textarea 로 노출 ?>
<?php if($write_min || $write_max) { ?>
<!-- 최소/최대 글자 수 사용 시 -->
<div id="char_count_wrap"><span id="char_count"></span>글자</div>
<?php } ?>
</div>
</div>
<?php for ($i=1; $is_link && $i<=G5_LINK_COUNT; $i++) { ?>
<div class="bo_w_link write_div">
<label for="wr_link<?php echo $i ?>"><i class="fa fa-link" aria-hidden="true"></i><span class="sound_only"> 링크 #<?php echo $i ?></span></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 for ($i=0; $is_file && $i<$file_count; $i++) { ?>
<div class="bo_w_flie write_div">
<div class="file_wr write_div">
<label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i class="fa fa-download" aria-hidden="true"></i><span class="sound_only"> 파일 #<?php echo $i+1 ?></span></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 ">
</div>
<?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="full_input 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 } ?>
<?php if ($is_use_captcha) { //자동등록방지 ?>
<div class="write_div">
<?php echo $captcha_html ?>
</div>
<?php } ?>
<div class="btn_confirm write_div">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel btn">취소</a>
<input type="submit" value="작성완료" id="btn_submit" accesskey="s" class="btn_submit btn">
</div>
</form>
<script>
<?php if($write_min || $write_max) { ?>
// 글자수 제한
var char_min = parseInt(<?php echo $write_min; ?>); // 최소
var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count");
$(function() {
$("#wr_content").on("keyup", function() {
check_byte("wr_content", "char_count");
});
});
<?php } ?>
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)
{
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
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;
}
}
}
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
</script>
</section>
<!-- } 게시물 작성/수정 끝 -->
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<script>
// 글자수 제한
var char_min = parseInt(<?php echo $comment_min ?>); // 최소
var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</script>
<button type="button" class="cmt_btn"><i class="fa fa-commenting-o" aria-hidden="true"></i> 댓글목록</button>
<!-- 댓글 시작 { -->
<section id="bo_vc">
<h2>댓글목록</h2>
<?php
$cmt_amt = count($list);
for ($i=0; $i<$cmt_amt; $i++) {
$comment_id = $list[$i]['wr_id'];
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
$comment = $list[$i]['content'];
/*
if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str;
}
*/
$comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>>
<header style="z-index:<?php echo $cmt_sv; ?>">
<h2><?php echo get_text($list[$i]['wr_name']); ?>님의 <?php if ($cmt_depth) { ?><span class="sound_only">댓글의</span><?php } ?> 댓글</h2>
<?php echo $list[$i]['name'] ?>
<?php if ($is_ip_view) { ?>
<span class="sound_only">아이피</span>
<span>(<?php echo $list[$i]['ip']; ?>)</span>
<?php } ?>
<span class="sound_only">작성일</span>
<span class="bo_vc_hdinfo"><i class="fa fa-clock-o" aria-hidden="true"></i> <time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php
include(G5_SNS_PATH.'/view_comment_list.sns.skin.php');
?>
</header>
<!-- 댓글 출력 -->
<div class="cmt_contents">
<p>
<?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?>
<?php echo $comment ?>
</p>
<?php if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {
$query_string = clean_query_string($_SERVER['QUERY_STRING']);
if($w == 'cu') {
$sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";
$cmt = sql_fetch($sql);
if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))
$cmt['wr_content'] = '';
$c_wr_content = $cmt['wr_content'];
}
$c_reply_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=c#bo_vc_w';
$c_edit_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=cu#bo_vc_w';
?>
<ul class="bo_vc_act">
<?php if ($list[$i]['is_reply']) { ?><li><a href="<?php echo $c_reply_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'c'); return false;" class="btn_b03">답변</a></li><?php } ?>
<?php if ($list[$i]['is_edit']) { ?><li><a href="<?php echo $c_edit_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;" class="btn_b03">수정</a></li><?php } ?>
<?php if ($list[$i]['is_del']) { ?><li><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();" class="btn_b03">삭제</a></li><?php } ?>
</ul>
<?php } ?>
</div>
<span id="edit_<?php echo $comment_id ?>" class="bo_vc_w"></span><!-- 수정 -->
<span id="reply_<?php echo $comment_id ?>" class="bo_vc_w"></span><!-- 답변 -->
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<?php echo $comment_id ?>">
<textarea id="save_comment_<?php echo $comment_id ?>" style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
</article>
<?php } ?>
<?php if ($i == 0) { //댓글이 없다면 ?><p id="bo_vc_empty">등록된 댓글이 없습니다.</p><?php } ?>
</section>
<!-- } 댓글 끝 -->
<?php if ($is_comment_write) {
if($w == '')
$w = 'c';
?>
<!-- 댓글 쓰기 시작 { -->
<aside id="bo_vc_w" class="bo_vc_w">
<h2>댓글쓰기</h2>
<form name="fviewcomment" id="fviewcomment" action="<?php echo $comment_action_url; ?>" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>" id="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="comment_id" value="<?php echo $c_id ?>" id="comment_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="page" value="<?php echo $page ?>">
<input type="hidden" name="is_good" value="">
<span class="sound_only">내용</span>
<?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용" placeholder="댓글내용을 입력해주세요"
<?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea>
<?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?>
<script>
$(document).on("keyup change", "textarea#wr_content[maxlength]", function() {
var str = $(this).val()
var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) {
$(this).val(str.substr(0, mx));
return false;
}
});
</script>
<div class="bo_vc_w_wr">
<div class="bo_vc_w_info">
<?php if ($is_guest) { ?>
<label for="wr_name" class="sound_only">이름<strong> 필수</strong></label>
<input type="text" name="wr_name" value="<?php echo get_cookie("ck_sns_name"); ?>" id="wr_name" required class="frm_input required" size="25" placeholder="이름">
<label for="wr_password" class="sound_only">비밀번호<strong> 필수</strong></label>
<input type="password" name="wr_password" id="wr_password" required class="frm_input required" size="25" placeholder="비밀번호">
<?php
}
?>
<?php
if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<span class="sound_only">SNS 동시등록</span>
<span id="bo_vc_send_sns"></span>
<?php } ?>
<?php if ($is_guest) { ?>
<?php echo $captcha_html; ?>
<?php } ?>
</div>
<div class="btn_confirm">
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret">
<label for="wr_secret"><i class="fa fa-lock" aria-hidden="true"></i><span class="sound_only">비밀글사용</span></label>
<input type="submit" id="btn_submit" class="btn_submit" value="댓글등록">
</div>
</div>
</form>
</aside>
<script>
var save_before = '';
var save_html = document.getElementById('bo_vc_w').innerHTML;
function good_and_write()
{
var f = document.fviewcomment;
if (fviewcomment_submit(f)) {
f.is_good.value = 1;
f.submit();
} else {
f.is_good.value = 0;
}
}
function fviewcomment_submit(f)
{
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
f.is_good.value = 0;
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": "",
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
f.wr_content.focus();
return false;
}
// 양쪽 공백 없애기
var pattern = /(^\s*)|(\s*$)/g; // \s 공백 문자
document.getElementById('wr_content').value = document.getElementById('wr_content').value.replace(pattern, "");
if (char_min > 0 || char_max > 0)
{
check_byte('wr_content', 'char_count');
var cnt = parseInt(document.getElementById('char_count').innerHTML);
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;
}
}
else if (!document.getElementById('wr_content').value)
{
alert("댓글을 입력하여 주십시오.");
return false;
}
if (typeof(f.wr_name) != 'undefined')
{
f.wr_name.value = f.wr_name.value.replace(pattern, "");
if (f.wr_name.value == '')
{
alert('이름이 입력되지 않았습니다.');
f.wr_name.focus();
return false;
}
}
if (typeof(f.wr_password) != 'undefined')
{
f.wr_password.value = f.wr_password.value.replace(pattern, "");
if (f.wr_password.value == '')
{
alert('비밀번호가 입력되지 않았습니다.');
f.wr_password.focus();
return false;
}
}
<?php if($is_guest) echo chk_captcha_js(); ?>
set_comment_token(f);
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
function comment_box(comment_id, work)
{
var el_id,
form_el = 'fviewcomment',
respond = document.getElementById(form_el);
// 댓글 아이디가 넘어오면 답변, 수정
if (comment_id)
{
if (work == 'c')
el_id = 'reply_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
else
el_id = 'bo_vc_w';
if (save_before != el_id)
{
if (save_before)
{
document.getElementById(save_before).style.display = 'none';
}
document.getElementById(el_id).style.display = '';
document.getElementById(el_id).appendChild(respond);
//입력값 초기화
document.getElementById('wr_content').value = '';
// 댓글 수정
if (work == 'cu')
{
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_'+comment_id).value)
document.getElementById('wr_secret').checked = true;
else
document.getElementById('wr_secret').checked = false;
}
document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;
if(save_before)
$("#captcha_reload").trigger("click");
save_before = el_id;
}
}
function comment_delete()
{
return confirm("이 댓글을 삭제하시겠습니까?");
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<?php if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
$(function() {
// sns 등록
$("#bo_vc_send_sns").load(
"<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>",
function() {
save_html = document.getElementById('bo_vc_w').innerHTML;
}
);
});
<?php } ?>
$(function() {
//댓글열기
$(".cmt_btn").click(function(){
$(this).toggleClass("cmt_btn_op");
$("#bo_vc").toggle();
});
});
</script>
<?php } ?>
<!-- } 댓글 쓰기 끝 -->
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인