경로 정리 - 큰일었어요!!!

This commit is contained in:
gnuboard
2013-01-27 15:48:08 +09:00
parent 5891f1a77a
commit 023d9233d2
623 changed files with 822 additions and 7680 deletions

View File

@ -1,32 +1,40 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function editor_html($id, $content, $class="")
function editor_html($id, $content, $ckeditor=true, $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 (G4_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";
global $g4;
static $js = true;
$html = "";
if ($js) {
$html .= PHP_EOL.'<script src="'.G4_CKEDITOR_URL.'/ckeditor.js"></script>';
$html .= PHP_EOL.'<script>var g4_ckeditor_url = "'.G4_CKEDITOR_URL.'";</script>';
$html .= PHP_EOL.'<script src="'.G4_CKEDITOR_URL.'/config.js"></script>';
$js = false;
}
return $str;
$ckeditor_class = $ckeditor ? "ckeditor" : "";
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$ckeditor_class $class\" style=\"width:100%;\">$content</textarea>";
return $html;
}
// textarea 로 값을 넘긴다. javascript 반드시 필요
function get_editor_js($id)
function get_editor_js($id, $ckeditor=true)
{
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";
if ( $ckeditor ) {
return "var {$id}_editor_data = CKEDITOR.instances.{$id}.getData();\n";
} else {
$str = "var {$id}_editor = document.getElementById('{$id}');\n";
return "var {$id}_editor = document.getElementById('{$id}');\n";
}
return $str;
}
// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $textarea_name="내용을")
function chk_editor_js($id, $ckeditor=true, $textarea_name="내용을")
{
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
if ( $ckeditor ) {
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";

View File

@ -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_ckeditor_path+"/upload.php?type=Images";
config.filebrowserUploadUrl = g4_ckeditor_url+"/upload.php?type=Images";
};

View File

@ -1,12 +1,10 @@
<?php
define('G4_EDITOR', 1);
$g4_path = "../.."; // common.php 의 상대 경로
include_once("$g4_path/common.php");
include_once("../../common.php");
$ym = date('ym', $g4['server_time']);
$ym = date('ym', G4_SERVER_TIME);
$data_dir = $g4['ckeditor_data_path'].'/'.$ym;
$data_url = $g4['ckeditor_data_url'].'/'.$ym;
$data_dir = G4_EDITOR_PATH.'/'.$ym;
$data_url = G4_EDITOR_URL.'/'.$ym;
@mkdir($data_dir, 0707);
@chmod($data_dir, 0707);
@ -14,8 +12,6 @@ $data_url = $g4['ckeditor_data_url'].'/'.$ym;
$funcNum = $_GET['CKEditorFuncNum'] ;
$CKEditor = $_GET['CKEditor'] ;
$langCode = $_GET['langCode'] ;
header("Content-Type: text/html; charset=$g4[charset]");
if(isset($_FILES['upload']['tmp_name'])) {
$file_name = $_FILES['upload']['name'];