diff --git a/.gitignore b/.gitignore
index edd55b606..2d7490ba7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ test.php
g4s_tree
itzimara*
nemoluv*
+cheditor*
diff --git a/adm/board_copy_update.php b/adm/board_copy_update.php
index 0ebc1d5de..038291819 100644
--- a/adm/board_copy_update.php
+++ b/adm/board_copy_update.php
@@ -18,7 +18,7 @@ if ($row['cnt'])
// 게시판 테이블 생성
$sql = get_table_define($g4['write_prefix'] . $bo_table);
$sql = str_replace($g4['write_prefix'] . $bo_table, $g4['write_prefix'] . $target_table, $sql);
-sql_query($sql);
+sql_query($sql, false);
$file_copy = array();
@@ -118,7 +118,7 @@ $sql = " insert into {$g4['board_table']}
bo_8 = '{$board['bo_8']}',
bo_9 = '{$board['bo_9']}',
bo_10 = '{$board['bo_10']}' ";
-sql_query($sql);
+sql_query($sql, false);
// 게시판 폴더 생성
@mkdir(G4_DATA_PATH.'/file/'.$target_table, G4_DIR_PERMISSION);
@@ -141,8 +141,8 @@ if ($copy_case == 'schema_data_both') {
// 김선용 201007 :
if(is_dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry)){
$dd = dir(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry);
- @mkdir(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry G4_DIR_PERMISSION);
- @chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry G4_DIR_PERMISSION);
+ @mkdir(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
+ @chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
while ($entry2 = $dd->read()) {
if ($entry2 == '.' || $entry2 == '..') continue;
@copy(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry.'/'.$entry2, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry.'/'.$entry2);
@@ -153,7 +153,7 @@ if ($copy_case == 'schema_data_both') {
}
else {
@copy(G4_DATA_PATH.'/file/'.$bo_table.'/'.$entry, G4_DATA_PATH.'/file/'.$target_table.'/'.$entry);
- @chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry G4_DIR_PERMISSION);
+ @chmod(G4_DATA_PATH.'/file/'.$target_table.'/'.$entry, G4_DIR_PERMISSION);
$copy_file++;
}
}
@@ -161,18 +161,18 @@ if ($copy_case == 'schema_data_both') {
// 글복사
$sql = " insert into {$g4['write_prefix']}$target_table select * from {$g4['write_prefix']}$bo_table ";
- sql_query($sql);
+ sql_query($sql, false);
// 게시글수 저장
$sql = " select bo_count_write, bo_count_comment from {$g4['board_table']} where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$sql = " update {$g4['board_table']} set bo_count_write = '{$row['bo_count_write']}', bo_count_comment = '{$row['bo_count_comment']}' where bo_table = '$target_table' ";
- sql_query($sql);
+ sql_query($sql, false);
// 4.00.01
// 위의 코드는 같은 테이블명을 사용하였다는 오류가 발생함. (희한하네 ㅡㅡ;)
$sql = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' ";
- $result = sql_query($sql);
+ $result = sql_query($sql, false);
for ($i=0; $row=sql_fetch_array($result); $i++)
$file_copy[$i] = $row;
}
@@ -192,7 +192,7 @@ if (count($file_copy)) {
bf_height = '{$file_copy[$i]['bf_height']}',
bf_type = '{$file_copy[$i]['bf_type']}',
bf_datetime = '{$file_copy[$i]['bf_datetime']}' ";
- sql_query($sql, FALSE);
+ sql_query($sql, false);
}
}
diff --git a/adm/board_form.php b/adm/board_form.php
index 9a517847b..093745514 100644
--- a/adm/board_form.php
+++ b/adm/board_form.php
@@ -1,7 +1,7 @@
+
+ |
+
+
+
+ |
+
|
diff --git a/adm/config_form_update.php b/adm/config_form_update.php
index 881239c7c..2abfc9915 100644
--- a/adm/config_form_update.php
+++ b/adm/config_form_update.php
@@ -101,6 +101,7 @@ $sql = " update {$g4['config_table']}
cf_mobile_connect_skin = '{$_POST['cf_mobile_connect_skin']}',
cf_mobile_member_skin = '{$_POST['cf_mobile_member_skin']}',
cf_gcaptcha_mp3 = '{$_POST['cf_gcaptcha_mp3']}',
+ cf_editor = '{$_POST['cf_editor']}',
cf_googl_shorturl_apikey = '{$_POST['cf_googl_shorturl_apikey']}',
cf_kcpcert_site_cd = '{$_POST['cf_kcpcert_site_cd']}',
cf_kcpcert_use = '{$_POST['cf_kcpcert_use']}',
diff --git a/adm/mail_form.php b/adm/mail_form.php
index fc1df022a..415657e75 100644
--- a/adm/mail_form.php
+++ b/adm/mail_form.php
@@ -1,7 +1,7 @@
|
|
- |
+ |
@@ -65,13 +65,17 @@ function fmailform_check(f)
errfld = "";
check_field(f.ma_subject, "제목을 입력하세요.");
- check_field(f.ma_content, "내용을 입력하세요.");
+ //check_field(f.ma_content, "내용을 입력하세요.");
if (errmsg != "") {
alert(errmsg);
errfld.focus();
return false;
}
+
+
+
+
return true;
}
diff --git a/bbs/write.php b/bbs/write.php
index e6ac6970c..71099e646 100644
--- a/bbs/write.php
+++ b/bbs/write.php
@@ -1,6 +1,6 @@
= $board['bo_html_level']) {
+if ($config['cf_editor'] && !G4_IS_MOBILE && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
$is_dhtml_editor = true;
- $editor_js .= get_editor_js('wr_content', $is_dhtml_editor);
- $editor_js .= chk_editor_js('wr_content', $is_dhtml_editor);
}
$editor_html = editor_html('wr_content', $content, $is_dhtml_editor);
+$editor_js = '';
+$editor_js .= get_editor_js('wr_content', $is_dhtml_editor);
+$editor_js .= chk_editor_js('wr_content', $is_dhtml_editor);
// 임시 저장된 글 갯수
$autosave_count = autosave_count($member['mb_id']);
diff --git a/common.php b/common.php
index 9d360364c..ef6a00491 100644
--- a/common.php
+++ b/common.php
@@ -163,8 +163,12 @@ ini_set("session.cookie_domain", G4_COOKIE_DOMAIN);
// 기본적으로 사용하는 필드만 얻은 후 상황에 따라 필드를 추가로 얻음
$config = sql_fetch(" select * from {$g4['config_table']} ");
-define('G4_HTTP_BBS_URL', https_url(G4_BBS_DIR, false));
-define('G4_HTTPS_BBS_URL', https_url(G4_BBS_DIR, true));
+define('G4_HTTP_BBS_URL', https_url(G4_BBS_DIR, false));
+define('G4_HTTPS_BBS_URL', https_url(G4_BBS_DIR, true));
+if ($config['cf_editor'])
+ define('G4_EDITOR_LIB', G4_EDITOR_PATH."/{$config['cf_editor']}/editor.lib.php");
+else
+ define('G4_EDITOR_LIB', G4_LIB_PATH."/editor.lib.php");
//==============================================================================
// Mobile 모바일 설정
diff --git a/config.php b/config.php
index f78408bf8..1243aee60 100644
--- a/config.php
+++ b/config.php
@@ -46,7 +46,7 @@ define('G4_LIB_DIR', 'lib');
define('G4_PLUGIN_DIR', 'plugin');
define('G4_SKIN_DIR', 'skin');
define('G4_GCAPTCHA_DIR', 'gcaptcha');
-define('G4_CKEDITOR_DIR', 'ckeditor');
+define('G4_EDITOR_DIR', 'editor');
define('G4_MOBILE_DIR', 'mobile');
define('G4_KCPCERT_DIR', 'kcpcert');
@@ -80,7 +80,7 @@ define('G4_JS_URL', G4_URL.'/'.G4_JS_DIR);
define('G4_SKIN_URL', G4_URL.'/'.G4_SKIN_DIR);
define('G4_PLUGIN_URL', G4_URL.'/'.G4_PLUGIN_DIR);
define('G4_GCAPTCHA_URL', G4_PLUGIN_URL.'/'.G4_GCAPTCHA_DIR);
-define('G4_CKEDITOR_URL', G4_PLUGIN_URL.'/'.G4_CKEDITOR_DIR); // CKEDITOR 의 라이브러리 경로
+define('G4_EDITOR_URL', G4_PLUGIN_URL.'/'.G4_EDITOR_DIR);
define('G4_KCPCERT_URL', G4_PLUGIN_URL.'/'.G4_KCPCERT_DIR);
define('G4_SNS_URL', G4_PLUGIN_URL.'/'.G4_SNS_DIR);
define('G4_SYNDI_URL', G4_PLUGIN_URL.'/'.G4_SYNDI_DIR);
@@ -95,7 +95,7 @@ define('G4_LIB_PATH', G4_PATH.'/'.G4_LIB_DIR);
define('G4_PLUGIN_PATH', G4_PATH.'/'.G4_PLUGIN_DIR);
define('G4_SKIN_PATH', G4_PATH.'/'.G4_SKIN_DIR);
define('G4_GCAPTCHA_PATH', G4_PLUGIN_PATH.'/'.G4_GCAPTCHA_DIR);
-define('G4_CKEDITOR_PATH', G4_PLUGIN_PATH.'/'.G4_CKEDITOR_DIR);
+define('G4_EDITOR_PATH', G4_PLUGIN_PATH.'/'.G4_EDITOR_DIR);
define('G4_KCPCERT_PATH', G4_PLUGIN_PATH.'/'.G4_KCPCERT_DIR);
diff --git a/head.sub.php b/head.sub.php
index c1ebd903c..7f069dc09 100644
--- a/head.sub.php
+++ b/head.sub.php
@@ -63,6 +63,7 @@ var g4_is_admin = "";
var g4_is_mobile = "";
var g4_bo_table = "";
var g4_sca = "";
+var g4_editor = "";
var g4_cookie_domain = "";
- 디렉토리의 퍼미션을 707로 변경하여 주십시오.
- $> chmod 707 또는 chmod uo+rwx
- 위 명령 실행후 브라우저를 새로고침 하십시오.
-
+ 디렉토리의 퍼미션을 705로 변경하여 주십시오.
+ $> chmod 705 또는 chmod uo+rx
+ 위 명령 실행후 브라우저를 새로고침 하십시오.
+
+ 디렉토리의 퍼미션을 707로 변경하여 주십시오.
+ $> chmod 707 또는 chmod uo+rwx
+ 위 명령 실행후 브라우저를 새로고침 하십시오.
+
\ No newline at end of file
diff --git a/js/autosave.js b/js/autosave.js
index f9684db1a..bc295d9f8 100644
--- a/js/autosave.js
+++ b/js/autosave.js
@@ -7,8 +7,11 @@ var save_wr_content = null;
function autosave() {
$("form#fwrite").each(function() {
- if (typeof(CKEDITOR.instances.wr_content)!="undefined")
+ if (g4_editor=="ckeditor4" && typeof(CKEDITOR.instances.wr_content)!="undefined") {
this.wr_content.value = CKEDITOR.instances.wr_content.getData();
+ } else if (g4_editor=="cheditor5" && typeof(ed_wr_content)!="undefined") {
+ this.wr_content.value = ed_wr_content.outputBodyHTML();
+ }
// 변수에 저장해 놓은 값과 다를 경우에만 임시 저장함
if (save_wr_subject != this.wr_subject.value || save_wr_content != this.wr_content.value) {
$.ajax({
@@ -72,8 +75,10 @@ $(function(){
var subject = $(data).find("item").find("subject").text();
var content = $(data).find("item").find("content").text();
$("#wr_subject").val(subject);
- if (typeof(CKEDITOR.instances.wr_content)!="undefined") {
+ if (g4_editor=="ckeditor4" && typeof(CKEDITOR.instances.wr_content)!="undefined") {
CKEDITOR.instances.wr_content.setData(content);
+ } else if (g4_editor=="cheditor5" && typeof(ed_wr_content)!="undefined") {
+ ed_wr_content.putContents(content);
} else {
$("#fwrite #wr_content").val(content);
}
diff --git a/lib/editor.lib.php b/lib/editor.lib.php
new file mode 100644
index 000000000..d3650ad83
--- /dev/null
+++ b/lib/editor.lib.php
@@ -0,0 +1,27 @@
+$content";
+}
+
+
+// textarea 로 값을 넘긴다. javascript 반드시 필요
+function get_editor_js($id)
+{
+ return "var {$id}_editor = document.getElementById('{$id}');\n";
+}
+
+
+// textarea 의 값이 비어 있는지 검사
+function chk_editor_js($id)
+{
+ return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
+}
+?>
\ No newline at end of file
diff --git a/plugin/ckeditor/CHANGES.md b/plugin/editor/ckeditor4/CHANGES.md
similarity index 100%
rename from plugin/ckeditor/CHANGES.md
rename to plugin/editor/ckeditor4/CHANGES.md
diff --git a/plugin/ckeditor/LICENSE.md b/plugin/editor/ckeditor4/LICENSE.md
similarity index 100%
rename from plugin/ckeditor/LICENSE.md
rename to plugin/editor/ckeditor4/LICENSE.md
diff --git a/plugin/ckeditor/README.md b/plugin/editor/ckeditor4/README.md
similarity index 100%
rename from plugin/ckeditor/README.md
rename to plugin/editor/ckeditor4/README.md
diff --git a/plugin/ckeditor/build-config.js b/plugin/editor/ckeditor4/build-config.js
similarity index 100%
rename from plugin/ckeditor/build-config.js
rename to plugin/editor/ckeditor4/build-config.js
diff --git a/plugin/ckeditor/ckeditor.js b/plugin/editor/ckeditor4/ckeditor.js
similarity index 100%
rename from plugin/ckeditor/ckeditor.js
rename to plugin/editor/ckeditor4/ckeditor.js
diff --git a/plugin/ckeditor/config.js b/plugin/editor/ckeditor4/config.js
similarity index 99%
rename from plugin/ckeditor/config.js
rename to plugin/editor/ckeditor4/config.js
index 0326750a6..87b0d8669 100644
--- a/plugin/ckeditor/config.js
+++ b/plugin/editor/ckeditor4/config.js
@@ -108,7 +108,7 @@ CKEDITOR.editorConfig = function( config ) {
config.fontSize_sizes = "7pt/9px;8pt/11px;9pt/12px;10pt/13px;11pt/15px;14pt/19px;18pt/24px;24pt/32px;36/48px;";
config.enterMode = CKEDITOR.ENTER_DIV;
config.shiftEnterMode = CKEDITOR.ENTER_DIV;
- config.filebrowserUploadUrl = g4_ckeditor_url+"/upload.php?type=Images";
+ config.filebrowserUploadUrl = g4_editor_url+"/upload.php?type=Images";
config.keystrokes=[
// Formatting
[ CKEDITOR.CTRL + 81 /*Q*/, 'blockquote' ],
diff --git a/plugin/ckeditor/contents.css b/plugin/editor/ckeditor4/contents.css
similarity index 100%
rename from plugin/ckeditor/contents.css
rename to plugin/editor/ckeditor4/contents.css
diff --git a/plugin/ckeditor/ckeditor.lib.php b/plugin/editor/ckeditor4/editor.lib.php
similarity index 56%
rename from plugin/ckeditor/ckeditor.lib.php
rename to plugin/editor/ckeditor4/editor.lib.php
index 1e7e1a12f..b341cf9df 100644
--- a/plugin/ckeditor/ckeditor.lib.php
+++ b/plugin/editor/ckeditor4/editor.lib.php
@@ -1,20 +1,22 @@
웹에디터 시작";
- if ($ckeditor)
+ if ($is_dhtml_editor)
$html .= '';
if ($js) {
- $html .= "\n".'';
- $html .= "\n".'';
- $html .= "\n".'';
+ $html .= "\n".'';
+ $html .= "\n".'';
+ $html .= "\n".'';
$html .= "\n