文章管理 - 如何使用FCKeditor编辑器上传图片 imag1
文章管理 :: Xoops综合 :: Xoops API使用

如何使用FCKeditor编辑器上传图片


FCKeditor编辑器是目前最流行的可视化(WYSIWYG)编辑器之一,使用它可以很方便的管理图片和多媒体等的上传
设置步骤:

1 确认已经上传了编辑器:XOOPS/class/xoopseditor/FCKeditor/

2 确认以下文件已经存在于要使用该编辑器的模块目录下
- XOOPS/modules/$module_dirname/fckeditor.connector.php
- XOOPS/modules/$module_dirname/fckeditor.upload.php
- XOOPS/modules/$module_dirname/fckeditor.config.js

3 建立相应模块的上传目录:
- XOOPS/uploads/$module_dirname/
- XOOPS/uploads/$module_dirname/Image
- XOOPS/uploads/$module_dirname/Flash
- XOOPS/uploads/$module_dirname/File

4 如果想让所有模块通过FCKeditor上传的文件放置于一个统一的目录下则跳过上边第3步,建立:
- XOOPS/uploads/fckeditor/
- XOOPS/uploads/fckeditor/Image
- XOOPS/uploads/fckeditor/Flash
- XOOPS/uploads/fckeditor/File

5 设定上述所建上传目录的属性为可写

常见问题:
问:我上传图片的时候发生如下错误"The file is corrupt or has an incorrect extension. Please check the file and upload again."
答:参考wikipedia的说明.
<< 如何用article模块替代新闻管理 XOOPS 2.2* -> 2.0* 转换程序 >>
跟踪网址
  • 文章地址: http://xoops.org.cn/modules/article/view.article.php/c10/17
  • 跟踪地址: http://xoops.org.cn/modules/article/trackback.php/17
API: 工具箱 短消息 Email PDF 书签 打印 | RSS | RDF | ATOM
Copyright© D.J. & XOOPS CHINA
网友个人意见,不代表本站立场。对于发言内容,由发表者自负责任。
发表者 树状展开
taogx
发表日期: 03月25日 01:17  更新: 03月25日 01:17
高级会员
注册日期: 07月16日
来自:
发表总数: 126
 评: 如何使用FCKeditor编辑器上传图片
使用过程中可能出现问题。有以下几个地方要修改
modules\article\fckeditor.upload.php
中必须定义
define("FCKUPLOAD_DISABLED", 1);
修改class\xoopseditor\FCKeditor\editor\filemanager\upload\php\upload.php
文件头部为
//Modifyed By XuYong 解决有时不能顺利获取config.php等文件
$current_path =dirname(__FILE__);
if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( DIRECTORY_SEPARATOR, "/", $current_path);
require($current_path.'/config.php') ;
require($current_path.'/util.php') ;
/*
require('config.php') ;
require('util.php') ;
*/
//End Modifyed
修改class\xoopseditor\FCKeditor\editor\filemanager\upload\php\connector.php
文件头部为
//Modifyed By XuYong 解决有时不能顺利获取config.php等文件
$current_path =dirname(__FILE__);
if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( DIRECTORY_SEPARATOR, "/", $current_path);
require($current_path.'/config.php') ;
require($current_path.'/util.php') ;
require($current_path.'/io.php') ;
require($current_path.'/basexml.php') ;
require($current_path.'/commands.php') ;
/*
include('config.php') ;
include('util.php') ;
include('io.php') ;
include('basexml.php') ;
include('commands.php') ;
*/
//End Modifyed