그누보드 리스트에서 바로 글작성,글쓰기
이온디
406
리스트에서 글쓰기를 보여주려면
글쓰기 form 안에 저장시키고자 하는 input을 생성하고,
write_update.php로 값을 보내주면 됩니다.
게시판 가입인사 스킨
그누보드 - 가입인사 스킨 > 그누보드5 스킨 (sir.kr)

기본적인 구조는 이 게시판 스킨을 다운로드받아서 확인해보면 될 듯 합니다.
게시판 스킨 다운로드에서 '빠른상담'으로 키워드 검색해도 비슷한 스킨들이 나옵니다.
그누보드 - 그누보드5 스킨 1 페이지 (sir.kr)
if( !$is_admin) goto_url("write.php?bo_table=$bo_table");
리스트에서 관리자일 경우는 리스트에 그대로, 관리자가 아닐 경우에는 글쓰기 페이지로 넘기는 코드입니다.
여분필드 사용하는 방법
write.skin.php
<input type="text" name="wr_1" value="<?php echo $write['wr_1'] ?>" id="wr_1" class="frm_input" size="50">
list.skin.php
<?php echo $list[$i]['wr_1'] ?> list.skin.php
<?php
$action_url = "/bbs/write_update.php";
?>
<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 ?>">
<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="제목">
<input type="text" name="wr_content" id="wr_content" value="내용">
<input type="submit" id="btn_submit">
<?php
include_once(G5_CAPTCHA_PATH . '/captcha.lib.php');
$captcha_html = captcha_html();
$captcha_js = chk_captcha_js();
//echo $captcha_html;
?>
</form>
<script>
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>