안녕하세요.
휴대폰 메세지로 답변 알림을 받을지 체크 박스로 여부를 묻고
체크 박스에 체크가 되어 있으면 휴대폰 번호를 입력하는 폼을 보여주고 ( 비밀글 설정시 패스워드 폼이 사라졌다 생겼다 하듯이) 싶은데
체크 박스를 클릭후 저장 하고 수정하면 체크박스가 풀려있고 휴대폰 번호도 저장이 되어 있지 않습니다. 디비에 저장이 안되는건지..
어느 부분이 잘못됐는지 잘모르겠습니다 ㅠㅠ
참고로 스킨은 에스크원 스킨 사용중입니다.
체크박스 부분
<div class="kboard-attr-row">
<div class="attr-name">
<?php echo __( 'Options', 'kboard')?>
</div>
<div class="attr-value">
<?php if($board->isAdmin()):?>
<label class="attr-value-option">
<input type="checkbox" name="secret" value="true" onchange="kboard_toggle_password_field(this)" <?php if($content->secret):?> checked
<?php endif?>>
<?php echo __( 'Secret', 'kboard')?>
</label>
<label class="attr-value-option">
<input type="checkbox" name="notice" value="true" <?php if($content->notice):?> checked
<?php endif?>>
<?php echo __( 'Notice', 'kboard')?>
</label>
<?php else:?>
<input type="hidden" name="secret" value="true">
<label class="attr-value-option">
<input type="checkbox" name="replyalarm" onchange="kboard_toggle_password_field(this)" value="true" <?php if($content->option->replyalarm):?> checked
<?php endif?>>답변 알림톡</label>
<?php endif?>
</div>
</div>
휴대폰 폼 부분
<?php if($board->viewUsernameField()):?>
<div class="kboard-attr-row secret-password-row" <?php if(!$content->replyalarm):?> style="display:none"
<?php endif?>>
<label class="attr-name" for="kboard-input-password">휴대폰 번호</label>
<div class="attr-value">
<input type="text" id="kboard_option_tel" name="tel" value="<?php echo $content->option->tel?>" placeholder="<?php echo __('tel', 'kboard')?>..." numberOnly>
</div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-member-display">
<?php echo __( 'Author', 'kboard')?>
</label>
<div class="attr-value">
<input type="text" id="kboard-input-member-display" name="member_display" maxlength="5" value="<?php echo $content->member_display?>">
</div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-password">
<?php echo __( 'Password', 'kboard')?>
</label>
<div class="attr-value">
<input type="password" id="kboard-input-password" name="password" minlength='6' value="<?php echo $content->password?>">
</div>
</div>
<?php else:?>
<input style="display:none" type="text" name="fake-autofill-fields">
<input style="display:none" type="password" name="fake-autofill-fields">
전체 소스
<div id="kboard-ask-one-editor">
<form class="kboard-form" method="post" action="<?php echo $url->getContentEditorExecute()?>" enctype="multipart/form-data" onsubmit="return kboard_editor_execute(this);">
<?php wp_nonce_field( 'kboard-editor-execute', 'kboard-editor-execute-nonce')?>
<input type="hidden" name="action" value="kboard_editor_execute">
<input type="hidden" name="mod" value="editor">
<input type="hidden" name="uid" value="<?php echo $content->uid?>">
<input type="hidden" name="board_id" value="<?php echo $content->board_id?>">
<input type="hidden" name="parent_uid" value="<?php echo $content->parent_uid?>">
<input type="hidden" name="member_uid" value="<?php echo $content->member_uid?>">
<input type="hidden" name="member_display" value="<?php echo $content->member_display?>">
<input type="hidden" name="date" value="<?php echo $content->date?>">
<input type="hidden" name="user_id" value="<?php echo get_current_user_id()?>">
<div class="kboard-attr-wrap">
<div class="kboard-attr-row kboard-attr-title">
<label class="attr-name" for="kboard-input-title">
<?php echo __( 'Title', 'kboard')?>
</label>
<div class="attr-value">
<input type="text" id="kboard-input-title" name="title" value="<?php echo $content->title?>">
</div>
</div>
<div class="kboard-attr-row">
<div class="attr-name">
<?php echo __( 'Options', 'kboard')?>
</div>
<div class="attr-value">
<?php if($board->isAdmin()):?>
<label class="attr-value-option">
<input type="checkbox" name="secret" value="true" onchange="kboard_toggle_password_field(this)" <?php if($content->secret):?> checked
<?php endif?>>
<?php echo __( 'Secret', 'kboard')?>
</label>
<label class="attr-value-option">
<input type="checkbox" name="notice" value="true" <?php if($content->notice):?> checked
<?php endif?>>
<?php echo __( 'Notice', 'kboard')?>
</label>
<?php else:?>
<input type="hidden" name="secret" value="true">
<label class="attr-value-option">
<input type="checkbox" name="replyalarm" onchange="kboard_toggle_password_field(this)" value="true" <?php if($content->option->replyalarm):?> checked
<?php endif?>>답변 알림톡</label>
<?php endif?>
</div>
</div>
<?php if($board->use_category):?>
<?php if($board->initCategory1()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-select-category1">
<?php echo __( 'Category', 'kboard')?>
</label>
<div class="attr-value">
<select id="kboard-select-category1" name="category1">
<option value="">
<?php echo __( 'Category', 'kboard')?>
<?php echo __( 'Select', 'kboard')?>
</option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>" <?php if($content->category1 == $board->currentCategory()):?> selected
<?php endif?>>
<?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
</div>
</div>
<?php endif?>
<?php endif?>
<?php if(!$board->initCategory2()){ $board->category = kboard_ask_status(); } ?>
<?php if($board->isAdmin()):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-select-category2">
<?php echo __( 'Status', 'kboard')?>
</label>
<div class="attr-value">
<select id="kboard-select-category2" name="category2">
<option value="">상태없음</option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>" <?php if($content->category2 == $board->currentCategory()):?> selected
<?php endif?>>
<?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
</div>
</div>
<?php else:?>
<input type="hidden" name="category2" value="<?php echo $content->category2?$content->category2:$board->category[0]?>">
<?php endif?>
<?php if($board->viewUsernameField()):?>
<div class="kboard-attr-row secret-password-row" <?php if(!$content->replyalarm):?> style="display:none"
<?php endif?>>
<label class="attr-name" for="kboard-input-password">휴대폰 번호</label>
<div class="attr-value">
<input type="text" id="kboard_option_tel" name="tel" value="<?php echo $content->option->tel?>" placeholder="<?php echo __('tel', 'kboard')?>..." numberOnly>
</div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-member-display">
<?php echo __( 'Author', 'kboard')?>
</label>
<div class="attr-value">
<input type="text" id="kboard-input-member-display" name="member_display" maxlength="5" value="<?php echo $content->member_display?>">
</div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-password">
<?php echo __( 'Password', 'kboard')?>
</label>
<div class="attr-value">
<input type="password" id="kboard-input-password" name="password" minlength='6' value="<?php echo $content->password?>">
</div>
</div>
<?php else:?>
<input style="display:none" type="text" name="fake-autofill-fields">
<input style="display:none" type="password" name="fake-autofill-fields">
<!-- 비밀글 비밀번호 필드 시작 -->
<div class="kboard-attr-row secret-password-row" <?php if(!$content->secret):?> style="display:none"
<?php endif?>>
<label class="attr-name" for="kboard-input-password">
<?php echo __( 'Password', 'kboard')?>
</label>
<div class="attr-value">
<input type="password" id="kboard-input-password" name="password" minlength='6' value="<?php echo $content->password?>">
</div>
</div>
<!-- 비밀글 비밀번호 필드 끝 -->
<?php endif?>
<?php if($board->useCAPTCHA() && !$content->uid):?>
<?php if(kboard_use_recaptcha()):?>
<div class="kboard-attr-row">
<label class="attr-name"></label>
<div class="attr-value">
<div class="g-recaptcha" data-sitekey="<?php echo kboard_recaptcha_site_key()?>"></div>
</div>
</div>
<?php else:?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-captcha">
<img src="<?php echo kboard_captcha()?>" alt="">
</label>
<div class="attr-value">
<input type="text" id="kboard-input-captcha" name="captcha" value="">
</div>
</div>
<?php endif?>
<?php endif?>
</div>
<div class="kboard-content">
<?php if($board->use_editor):?>
<?php wp_editor($content->content, 'kboard_content', array('media_buttons'=>$board->isAdmin(), 'editor_height'=>400))?>
<?php else:?>
<textarea name="kboard_content" id="kboard_content">
<?php echo $content->content?></textarea>
<?php endif?>
</div>
<div class="kboard-attr-wrap">
<?php if($board->isAdmin()):?>
<div class="kboard-attr-row">
<label class="attr-name">
<?php echo __( 'Photos', 'kboard')?>
</label>
<div class="attr-value">
<a href="#" onclick="kboard_editor_open_media();return false;">
<?php echo __( 'KBoard Add Media', 'kboard')?>
</a>
</div>
</div>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-thumbnail">
<?php echo __( 'Thumbnail', 'kboard')?>
</label>
<div class="attr-value">
<?php if($content->thumbnail_file):?>
<?php echo $content->thumbnail_name?> -
<a href="<?php echo $url->getDeleteURLWithAttach($content->uid);?>" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');">
<?php echo __( 'Delete file', 'kboard')?>
</a>
<?php endif?>
<input type="file" id="kboard-input-thumbnail" name="thumbnail" accept="image/*">
</div>
</div>
<?php endif?>
<?php if($board->meta->max_attached_count > 0):?>
<!-- 첨부파일 시작 -->
<?php for($attached_index=1; $attached_index<=$board->meta->max_attached_count; $attached_index++):?>
<div class="kboard-attr-row">
<label class="attr-name" for="kboard-input-file<?php echo $attached_index?>">
<?php echo __( 'Attachment', 'kboard')?>
<?php echo $attached_index?>
</label>
<div class="attr-value">
<?php if(isset($content->attach->{"file{$attached_index}"})):?>
<?php echo $content->attach->{"file{$attached_index}"}[1]?> -
<a href="<?php echo $url->getDeleteURLWithAttach($content->uid, " file{$attached_index} ");?>" onclick="return confirm('<?php echo __('Are you sure you want to delete?', 'kboard')?>');">
<?php echo __( 'Delete file', 'kboard')?>
</a>
<?php endif?>
<input type="file" id="kboard-input-file<?php echo $attached_index?>" name="kboard_attach_file<?php echo $attached_index?>">
</div>
</div>
<?php endfor?>
<!-- 첨부파일 끝 -->
<?php endif?>
<div class="kboard-attr-row">
<input type="hidden" name="wordpress_search" value="3">
</div>
</div>
<div class="kboard-control">
<div class="left">
<?php if($content->uid):?>
<a href="<?php echo $url->getDocumentURLWithUID($content->uid)?>" class="kboard-ask-one-button-small-back">
<?php echo __( 'Back', 'kboard')?>
</a>
<a href="<?php echo $url->set('mod', 'list')->toString()?>" class="kboard-ask-one-button-small">
<?php echo __( 'List', 'kboard')?>
</a>
<?php else:?>
<a href="<?php echo $url->set('mod', 'list')->toString()?>" class="kboard-ask-one-button-small-back">
<?php echo __( 'Back', 'kboard')?>
</a>
<?php endif?>
</div>
<div class="right">
<?php if($board->isWriter()):?>
<button type="submit" class="kboard-ask-one-button-small">
<?php echo __( 'Save', 'kboard')?>
</button>
<?php endif?>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="<?php echo $skin_path?>/script.js?<?php echo KBOARD_VERSION?>"></script>
<script>
jQuery(document).ready(function(){
var auto_secret_check = false;
var document_uid = <?php echo intval($content->uid)?>;
if(auto_secret_check && !document_uid){
jQuery('input[name=secret]').prop('checked', true);
kboard_toggle_password_field(jQuery('input[name=secret]'));
}
});
jQuery("input:text[numberOnly]").on("focus", function() {
var x = jQuery(this).val();
jQuery(this).val(x);
}).on("focusout", function() {
var x = jQuery(this).val();
if(x && x.length > 0) {
if(!jQuery.isNumeric(x)) {
x = x.replace(/[^0-9]/g,"");
}
jQuery(this).val(x);
}
}).on("keyup", function() {
jQuery(this).val(jQuery(this).val().replace(/[^0-9]/g,""));
});
</script>
항상 도움주셔서 감사합니다.
안녕하세요~^^
KBoard 플러그인에서 입력 필드의 내용을 저장할 때는
name 값을 kboard_option_메타키 이런 식으로 적용해주셔야 합니다.
아래 링크에도 해당 내용이 안내되어 있으니 참고해보시겠어요?
워드프레스 게시판 KBoard(케이보드) 새로운 입력 필드 추가 방법 (커스터마이징)
고맙습니다.