_CAPTCHA_, _EDITOR_ 선언하지 않아도 오류나지 않도록 수정
캡챠와 에디터를 plugin 디렉토리에서 extend 디렉토리로 변경
This commit is contained in:
@ -558,7 +558,7 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<tr>
|
||||
<th scope="row"><label for="tx_bo_content_head">상단 내용</label></th>
|
||||
<td>
|
||||
<?=editor_textarea("bo_content_head", $board['bo_content_head']);?>
|
||||
<?=editor("bo_content_head", $board['bo_content_head']);?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_content_head" name="chk_content_head" value="1">
|
||||
@ -568,7 +568,7 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<tr>
|
||||
<th scope="row"><label for="tx_bo_content_tail">하단 내용</label></th>
|
||||
<td>
|
||||
<?=editor_textarea("bo_content_tail", $board['bo_content_tail']);?>
|
||||
<?=editor("bo_content_tail", $board['bo_content_tail']);?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_content_tail" name="chk_content_tail" value="1">
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?
|
||||
define('_CAPTCHA_', true);
|
||||
include_once('./_common.php');
|
||||
|
||||
if (!$board['bo_table']) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?
|
||||
define('_CAPTCHA_', 1);
|
||||
define('_CAPTCHA_', true);
|
||||
include_once('./_common.php');
|
||||
include_once($g4['path'].'/lib/register.lib.php');
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?
|
||||
define('_CAPTCHA_', true);
|
||||
include_once('./_common.php');
|
||||
|
||||
set_session('ss_bo_table', $bo_table);
|
||||
@ -11,7 +10,7 @@ if (!$board['bo_table']) {
|
||||
}
|
||||
|
||||
if (!$bo_table) {
|
||||
alert('bo_table 값이 넘어오지 않았습니다.'.PHP_EOL.PHP_EOL.'write.php?bo_table=code 와 같은 방식으로 넘겨 주세요.', $g4['path']);
|
||||
alert("bo_table 값이 넘어오지 않았습니다.\\nwrite.php?bo_table=code 와 같은 방식으로 넘겨 주세요.", $g4['path']);
|
||||
}
|
||||
|
||||
@include_once ($g4['path'].'/skin/board/write.head.skin.php');
|
||||
@ -198,16 +197,9 @@ if ($member['mb_level'] >= $board['bo_html_level'])
|
||||
|
||||
$is_secret = $board['bo_use_secret'];
|
||||
|
||||
$is_dhtml_editor = false;
|
||||
if ($board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) {
|
||||
define('_EDITOR_', true);
|
||||
$is_dhtml_editor = true;
|
||||
} else {
|
||||
$is_dhtml_editor = false;
|
||||
}
|
||||
|
||||
$captcha_html = "";
|
||||
if ($is_guest) {
|
||||
$captcha_html = captcha_html('wr_key');
|
||||
}
|
||||
|
||||
$is_mail = false;
|
||||
@ -369,4 +361,4 @@ include_once('./board_tail.php');
|
||||
include_once($g4['path'].'/tail.sub.php');
|
||||
|
||||
@include_once ($board_skin_path.'/write.tail.skin.php');
|
||||
?>
|
||||
?>
|
||||
@ -1,11 +1,8 @@
|
||||
<?
|
||||
define('_CAPTCHA_', true);
|
||||
include_once('./_common.php');
|
||||
|
||||
$g4['title'] = '게시글 저장';
|
||||
|
||||
if (isset($captcha->lib)) include_once($captcha->lib);
|
||||
|
||||
$msg = array();
|
||||
|
||||
$wr_subject = '';
|
||||
@ -151,8 +148,10 @@ if ($w == '' || $w == 'u') {
|
||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||
}
|
||||
|
||||
if (!chk_captcha('wr_key')) {
|
||||
alert('자동등록방지의 답변으로 입력한 숫자가 틀렸습니다.');
|
||||
if (defined('_CAPTCHA_')) {
|
||||
if ($is_guest && !chk_captcha()) {
|
||||
alert('스팸방지의 답변으로 입력한 숫자가 틀렸습니다.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($w == '' || $w == 'r') {
|
||||
@ -283,8 +282,8 @@ if ($w == '' || $w == 'r') {
|
||||
} else {
|
||||
$mb_id = '';
|
||||
// 비회원의 경우 이름이 누락되는 경우가 있음
|
||||
$wr_name = strip_tags(mysql_escape_string($_POST['wr_name']));
|
||||
if (!trim($wr_name))
|
||||
$wr_name = escape_trim($_POST['wr_name']);
|
||||
if (!$wr_name)
|
||||
alert('이름은 필히 입력하셔야 합니다.');
|
||||
$wr_password = sql_password($wr_password);
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
if (defined('_CAPTCHA_')) {
|
||||
$captcha = (object)Array(
|
||||
'lib' => $g4['path']."/plugin/captcha/captcha.lib.php",
|
||||
'js' => $g4['path']."/plugin/captcha/captcha.js",
|
||||
'fonts' => $g4['path']."/plugin/captcha/fonts"
|
||||
);
|
||||
|
||||
include_once($captcha->lib);
|
||||
$g4['js_file'][] = $captcha->js;
|
||||
|
||||
$captcha_obj = new captcha();
|
||||
$captcha_obj->run();
|
||||
} else {
|
||||
unset($_SESSION['ss_captcha_use']);
|
||||
}
|
||||
?>
|
||||
@ -1,12 +1,20 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$editor = (object)array(
|
||||
'lib' => $g4['path']."/plugin/ckeditor/ckeditor.lib.php",
|
||||
'js' => $g4['path']."/plugin/ckeditor/ckeditor.js",
|
||||
'config_js' => $g4['path']."/plugin/ckeditor/config.js",
|
||||
'data' => "data/editor"
|
||||
);
|
||||
// _EDITOR_ 의 값에 상관없이 선언 되었는지의 여부만 따짐
|
||||
// if (defined('_EDITOR_')) true;
|
||||
define('_EDITOR_', 1);
|
||||
|
||||
include_once($editor->lib);
|
||||
if (defined('_EDITOR_')) {
|
||||
$ckeditor = new stdClass;
|
||||
$ckeditor->url = $g4['url']."/extend/ckeditor";
|
||||
$ckeditor->path = $g4['path']."/extend/ckeditor";
|
||||
$ckeditor->data = "data/editor";
|
||||
|
||||
include_once($ckeditor->path."/ckeditor.lib.php");
|
||||
|
||||
$g4['js_code'][] = "var g4_ckeditor_path = \"{$ckeditor->path}\";";
|
||||
$g4['js_file'][] = $ckeditor->url."/ckeditor.js";
|
||||
$g4['js_file'][] = $ckeditor->url."/config.js";
|
||||
}
|
||||
?>
|
||||
23
extend/ckeditor/ckeditor.lib.php
Normal file
23
extend/ckeditor/ckeditor.lib.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
function editor($id, $content="", $class="")
|
||||
{
|
||||
global $g4;
|
||||
$str = "<textarea id=\"$id\" name=\"$id\" class=\"ckeditor $class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
||||
//if (_EDITOR_) $str .= "<script>CKEDITOR.replace('$id',{height:'500px'});</script>\n";
|
||||
return $str;
|
||||
}
|
||||
|
||||
// textarea 로 값을 넘김
|
||||
function editor_getdata($id)
|
||||
{
|
||||
return "var {$id}_data = CKEDITOR.instances.{$id}.getData();\n";
|
||||
}
|
||||
|
||||
// textarea 의 값이 비어 있는지 검사
|
||||
function editor_empty($id, $textarea_name="내용을")
|
||||
{
|
||||
return "if (!{$id}_data) { alert(\"$textarea_name 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n";
|
||||
}
|
||||
?>
|
||||
@ -26,5 +26,5 @@ 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_BR;
|
||||
config.shiftEnterMode = CKEDITOR.ENTER_P;
|
||||
config.filebrowserUploadUrl = g4_path+"/plugin/ckeditor/upload.php?type=Images";
|
||||
config.filebrowserUploadUrl = g4_ckeditor_path+"/upload.php?type=Images";
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user