-
从http://www.kindsoft.net/ 下载最新版KindEditor。
-
将KindEditor解压到OJ的kindeditor目录。
-
将kindeditor/php目录下的file_manager_json.php,upload_json.php,JSON.php复制到OJ的根目录。
-
编辑upload_json.php文件,下面两行对应修改如下:
$root_path = $php_path . 'upload/';
$root_url = $php_url . 'upload/';
同样的修改file_manager_json.php。
- 编辑admin/problem_edit.php文件(下面行号以svn1109为例)
-
- 删除16-18行:
<?php
include_once("../fckeditor/fckeditor.php") ;
?>
-
- 在第4行下面添加如下内容:
<link rel="stylesheet" href="../kindeditor/themes/default/default.css" />
<script charset="utf-8" src="../kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K){
K.create('textarea[name="description"]',{
uploadJson : '../upload_json.php',
fileManagerJson : '../file_manager_json.php',
allowFileManager: true,
});
K.create('textarea[name="input"]',{
uploadJson : '../upload_json.php',
fileManagerJson : '../file_manager_json.php',
allowFileManager: true,
});
K.create('textarea[name="output"]',{
uploadJson : '../upload_json.php',
fileManagerJson : '../file_manager_json.php',
allowFileManager: true,
});
K.create('textarea[name="hint"]',{
uploadJson : '../upload_json.php',
fileManagerJson : '../file_manager_json.php',
allowFileManager: true,
});
});
</script>
- 修改第44行为:
<p align=left>Description:<br><textarea rows=13 name=description cols=80><?php echo $row->description;?></textarea>
- 删除第46-54行:
<?php
$description = new FCKeditor('description') ;
$description->BasePath = '../fckeditor/' ;
$description->Height = 600 ;
$description->Width=600;
$description->Value = $row->description ;
$description->Create() ;
?>
- 重复6,7两步,修改57,71,86行,注意86行需要添加:
<p align=left>Description:<br><textarea rows=13 name=description cols=80><?php echo $row->hint;?></textarea>