에디터, 캡챠를 bbs 밑으로 이동후 코드 수정

This commit is contained in:
gnuboard
2013-01-14 13:15:49 +09:00
parent 7b04f8a6d2
commit c0ecb1cdec
306 changed files with 138 additions and 115 deletions

View File

@ -1,6 +1,6 @@
<?
$sub_menu = "300100";
//define('_EDITOR_', true);
define('_EDITOR_', 1);
include_once('./_common.php');
auth_check($auth[$sub_menu], 'w');
@ -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("bo_content_head", $board['bo_content_head']);?>
<?=editor_html("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("bo_content_tail", $board['bo_content_tail']);?>
<?=editor_html("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">
@ -819,8 +819,8 @@ function set_point(f) {
function fboardform_submit(f)
{
<?=editor_getdata("bo_content_head");?>
<?=editor_getdata("bo_content_tail");?>
<?=get_editor_js("bo_content_head");?>
<?=get_editor_js("bo_content_tail");?>
if (parseInt(f.bo_count_modify.value) < 1) {
alert("원글 수정 불가 댓글수는 1 이상 입력하셔야 합니다.");

View File

@ -276,18 +276,5 @@ if ($fields) {
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}&amp;{$qstr}");
?>

View File

@ -1,4 +1,5 @@
<?
define('_CAPTCHA_', 1);
include_once('./_common.php');
if (!$board['bo_table']) {

View 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