에디터, 캡챠를 bbs 밑으로 이동후 코드 수정
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
<?
|
<?
|
||||||
$sub_menu = "300100";
|
$sub_menu = "300100";
|
||||||
//define('_EDITOR_', true);
|
define('_EDITOR_', 1);
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], 'w');
|
auth_check($auth[$sub_menu], 'w');
|
||||||
@ -558,7 +558,7 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="tx_bo_content_head">상단 내용</label></th>
|
<th scope="row"><label for="tx_bo_content_head">상단 내용</label></th>
|
||||||
<td>
|
<td>
|
||||||
<?=editor("bo_content_head", $board['bo_content_head']);?>
|
<?=editor_html("bo_content_head", $board['bo_content_head']);?>
|
||||||
</td>
|
</td>
|
||||||
<td class="group_setting">
|
<td class="group_setting">
|
||||||
<input type="checkbox" id="chk_content_head" name="chk_content_head" value="1">
|
<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>
|
<tr>
|
||||||
<th scope="row"><label for="tx_bo_content_tail">하단 내용</label></th>
|
<th scope="row"><label for="tx_bo_content_tail">하단 내용</label></th>
|
||||||
<td>
|
<td>
|
||||||
<?=editor("bo_content_tail", $board['bo_content_tail']);?>
|
<?=editor_html("bo_content_tail", $board['bo_content_tail']);?>
|
||||||
</td>
|
</td>
|
||||||
<td class="group_setting">
|
<td class="group_setting">
|
||||||
<input type="checkbox" id="chk_content_tail" name="chk_content_tail" value="1">
|
<input type="checkbox" id="chk_content_tail" name="chk_content_tail" value="1">
|
||||||
@ -819,8 +819,8 @@ function set_point(f) {
|
|||||||
|
|
||||||
function fboardform_submit(f)
|
function fboardform_submit(f)
|
||||||
{
|
{
|
||||||
<?=editor_getdata("bo_content_head");?>
|
<?=get_editor_js("bo_content_head");?>
|
||||||
<?=editor_getdata("bo_content_tail");?>
|
<?=get_editor_js("bo_content_tail");?>
|
||||||
|
|
||||||
if (parseInt(f.bo_count_modify.value) < 1) {
|
if (parseInt(f.bo_count_modify.value) < 1) {
|
||||||
alert("원글 수정 불가 댓글수는 1 이상 입력하셔야 합니다.");
|
alert("원글 수정 불가 댓글수는 1 이상 입력하셔야 합니다.");
|
||||||
|
|||||||
@ -276,18 +276,5 @@ if ($fields) {
|
|||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($_FILES['bo_image_head']['name']) {
|
|
||||||
$bo_image_head_path = $board_path.'/'.$bo_image_head_urlencode;
|
|
||||||
move_uploaded_file($_FILES['bo_image_head']['tmp_name'], $bo_image_head_path);
|
|
||||||
chmod($bo_image_head_path, 0606);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_FILES['bo_image_tail']['name']) {
|
|
||||||
$bo_image_tail_path = $board_path.'/'.$bo_image_tail_urlencode;
|
|
||||||
move_uploaded_file($_FILES['bo_image_tail']['tmp_name'], $bo_image_tail_path);
|
|
||||||
chmod($bo_image_tail_path, 0606);
|
|
||||||
}
|
|
||||||
|
|
||||||
goto_url("./board_form.php?w=u&bo_table={$bo_table}&{$qstr}");
|
goto_url("./board_form.php?w=u&bo_table={$bo_table}&{$qstr}");
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
|
define('_CAPTCHA_', 1);
|
||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
if (!$board['bo_table']) {
|
if (!$board['bo_table']) {
|
||||||
|
|||||||
35
bbs/ckeditor/ckeditor.lib.php
Normal file
35
bbs/ckeditor/ckeditor.lib.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
|
function editor_html($id, $content, $class="")
|
||||||
|
{
|
||||||
|
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||||
|
$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";
|
||||||
|
} else {
|
||||||
|
$str = "<textarea id=\"$id\" name=\"$id\" class=\"$class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
||||||
|
}
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// textarea 로 값을 넘긴다. javascript 반드시 필요
|
||||||
|
function get_editor_js($id)
|
||||||
|
{
|
||||||
|
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||||
|
$str = "var {$id}_editor_data = CKEDITOR.instances.{$id}.getData();\n";
|
||||||
|
} else {
|
||||||
|
$str = "var {$id}_editor = document.getElementById('{$id}');\n";
|
||||||
|
}
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// textarea 의 값이 비어 있는지 검사
|
||||||
|
function chk_editor_js($id, $textarea_name="내용을")
|
||||||
|
{
|
||||||
|
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||||
|
return "if (!{$id}_editor_data) { alert(\"$textarea_name 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n";
|
||||||
|
} else {
|
||||||
|
return "if (!{$id}_editor.value) { alert(\"$textarea_name 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user