diff --git a/bbs/register_form.php b/bbs/register_form.php index 4729c7692..39a4a5aaa 100644 --- a/bbs/register_form.php +++ b/bbs/register_form.php @@ -30,6 +30,9 @@ if ($w == "") { alert('개인정보처리방침안내의 내용에 동의하셔야 회원가입 하실 수 있습니다.', G5_BBS_URL.'/register.php'); } + $agree = preg_replace('#[^0-9]#', '', $_POST['agree']); + $agree2 = preg_replace('#[^0-9]#', '', $_POST['agree2']); + $member['mb_birth'] = ''; $member['mb_sex'] = ''; $member['mb_name'] = ''; diff --git a/bbs/write.php b/bbs/write.php index 3f026298a..accff38db 100644 --- a/bbs/write.php +++ b/bbs/write.php @@ -390,9 +390,17 @@ if ($is_guest) { } $is_dhtml_editor = false; -// 모바일에서는 DHTML 에디터 사용불가 -if ($config['cf_editor'] && !G5_IS_MOBILE && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) { +$is_dhtml_editor_use = false; +$editor_content_js = ''; +if(!G5_IS_MOBILE || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE) + $is_dhtml_editor_use = true; + +// 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용 +if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) { $is_dhtml_editor = true; + + if(is_file(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/autosave.editor.js')) + $editor_content_js = ''.PHP_EOL; } $editor_html = editor_html('wr_content', $content, $is_dhtml_editor); $editor_js = ''; diff --git a/config.php b/config.php index 6f6a6bfed..3c71769bd 100644 --- a/config.php +++ b/config.php @@ -192,6 +192,9 @@ define('G5_THUMB_JPG_QUALITY', 90); // 썸네일 png Compress 설정 define('G5_THUMB_PNG_COMPRESS', 5); +// 모바일 기기에서 DHTML 에디터 사용여부를 설정합니다. +define('G5_IS_MOBILE_DHTML_USE', false); + // ip 숨김방법 설정 /* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은 \\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로 diff --git a/js/autosave.js b/js/autosave.js index b65891ff8..3de56cd81 100644 --- a/js/autosave.js +++ b/js/autosave.js @@ -7,13 +7,18 @@ var save_wr_content = null; function autosave() { $("form#fwrite").each(function() { - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - this.wr_content.value = CKEDITOR.instances.wr_content.getData(); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - this.wr_content.value = ed_wr_content.outputBodyHTML(); - } else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) { - this.wr_content.value = oEditors.getById['wr_content'].getIR(); + if(g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { + this.wr_content.value = CKEDITOR.instances.wr_content.getData(); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { + this.wr_content.value = ed_wr_content.outputBodyHTML(); + } else { + if(typeof get_editor_wr_content == "function") { + this.wr_content.value = get_editor_wr_content(); + } + } } + // 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함 if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) { $.ajax({ @@ -78,14 +83,16 @@ $(function(){ var subject = $(data).find("item").find("subject").text(); var content = $(data).find("item").find("content").text(); $("#wr_subject").val(subject); - if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { - CKEDITOR.instances.wr_content.setData(content); - } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { - ed_wr_content.putContents(content); - } else if (g5_editor.indexOf("smarteditor2") != -1 && typeof(oEditors)!="undefined" && typeof(oEditors.getById['wr_content'])!="undefined" ) { - oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]); - //oEditors.getById["wr_content"].exec("SET_IR", [""]); - oEditors.getById["wr_content"].exec("PASTE_HTML", [content]); + if(g5_editor != "") { + if (g5_editor.indexOf("ckeditor4") != -1 && typeof(CKEDITOR.instances.wr_content)!="undefined") { + CKEDITOR.instances.wr_content.setData(content); + } else if (g5_editor.indexOf("cheditor5") != -1 && typeof(ed_wr_content)!="undefined") { + ed_wr_content.putContents(content); + } else { + if(typeof put_editor_wr_content == "function") { + put_editor_wr_content(content); + } + } } else { $("#fwrite #wr_content").val(content); } diff --git a/mobile/skin/board/basic/write.skin.php b/mobile/skin/board/basic/write.skin.php index b28d9abb7..8d9076d2f 100644 --- a/mobile/skin/board/basic/write.skin.php +++ b/mobile/skin/board/basic/write.skin.php @@ -193,8 +193,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -243,7 +242,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/mobile/skin/board/gallery/write.skin.php b/mobile/skin/board/gallery/write.skin.php index f40d8db61..4aec1baaf 100644 --- a/mobile/skin/board/gallery/write.skin.php +++ b/mobile/skin/board/gallery/write.skin.php @@ -192,8 +192,7 @@ function html_auto_br(obj) function fwrite_submit(f) { - - + var subject = ""; var content = ""; @@ -242,7 +241,7 @@ function fwrite_submit(f) } } - + document.getElementById("btn_submit").disabled = "disabled"; diff --git a/plugin/editor/smarteditor2/autosave.editor.js b/plugin/editor/smarteditor2/autosave.editor.js new file mode 100644 index 000000000..49978765a --- /dev/null +++ b/plugin/editor/smarteditor2/autosave.editor.js @@ -0,0 +1,13 @@ +function get_editor_wr_content() +{ + return oEditors.getById['wr_content'].getIR();; +} + +function put_editor_wr_content(content) +{ + oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]); + //oEditors.getById["wr_content"].exec("SET_IR", [""]); + oEditors.getById["wr_content"].exec("PASTE_HTML", [content]); + + return; +} \ No newline at end of file diff --git a/skin/board/basic/write.skin.php b/skin/board/basic/write.skin.php index f0e7e91e8..34d190e7e 100644 --- a/skin/board/basic/write.skin.php +++ b/skin/board/basic/write.skin.php @@ -111,6 +111,7 @@ add_stylesheet('', 0 +