그누보드 데모 사이트의 글쓰기 페이지 URL
: http://demo.sir.kr/gnuboard5/bbs/write.php?bo_table=test22323
에서 소스보기를 하시면, view-source:http://demo.sir.kr/gnuboard5/bbs/write.php?bo_table=test22323
279 Line 에
<script>var g5_editor_url = "http://demo.sir.kr/gnuboard5/plugin/editor/smarteditor2", oEditors = [], ed_nonce = "XFtLPbLC2N|1531823164|806a0b295be1e2cfcc7fc9578095a9b2f8550212";</script>
라고 나옵니다. 이 이후 코드부터는 oEditors 가 쓰일 수 있습니다.
저 코드는 write.skin.php 파일에서 <?php echo $editor_html; ?> 에서 출력되는 부분입니다.
또 아래에,
function fwrite_submit(f) {
안에
<?php echo $editor_js;
도 소스보기로 확인해보면,
oEditors 로 내용이 입력되어있는지 필수체크를 하고 있는 것을 확인하실 수 있습니다.
그리고 예제의 contents 는 wr_content 로 바꾸어주면 됩니다.
oEditors.getById["contents"].exec("PASTE_HTML", [내용]);
->
oEditors.getById["wr_content"].exec("PASTE_HTML", [내용]);