ckeditor + ckfinder + php 的详细配置。
来源:互联网 发布:ubuntu 17.10输入法 编辑:程序博客网 时间:2024/05/09 23:22
1. 让ckeditor的编辑界面更简单.
在ckeditor根目录中修改config.js
CKEDITOR.editorConfig = function( config ){// Define changes to default configuration here. For example: config.language = 'zh-cn';// config.uiColor = '#AADC6E';config.toolbar_Full = [['Source'],['Cut','Copy','Paste','PasteText','PasteFromWord',],['Undo','Redo','-','Find','Replace']['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor'],'/',['Format','Font','FontSize'],['TextColor','BGColor'],['Image','Flash','Link','HorizontalRule','Smiley','SpecialChar','PageBreak']];config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names;
};
2. php中配置ckfinder + editor
<?phpclass Das_CKEditor { protected $ckeditor_path ; protected $ckfinder_path ; protected $ckeditor_webpath; protected $ckfinder_webpath; protected $_content; public function __construct(){ $this->ckeditor_path = APPLICATION_PATH . "/resources/scripts/ckeditor/"; $this->ckfinder_path = APPLICATION_PATH . "/resources/scripts/ckfinder/"; //echo $this->ckeditor_path; //d:\xampp\htdocs\etc..... $app_web_path = 'http://' .$_SERVER['SERVER_NAME'] . '' . $_SERVER['SCRIPT_NAME']; $app_web_path = strtolower($app_web_path); $app_web_path = str_replace( "index.php" , "" , $app_web_path); $this->ckeditor_webpath = $app_web_path . "resources/scripts/ckeditor/"; $this->ckfinder_webpath = $app_web_path . "resources/scripts/ckfinder/"; } public function init($content = null) { require_once $this->ckeditor_path . "ckeditor.php"; require_once $this->ckfinder_path . "ckfinder.php"; $ckeditor = new CKEditor(); $ckeditor->returnOutput = true; $ckeditor->basePath = $this->ckeditor_webpath; CKFinder::SetupCKEditor($ckeditor , $this->ckfinder_webpath);//die($this->_content); $contentarea = $ckeditor->editor("editor_content" ,$content); return $contentarea; } }
3,配置ckfinder的真实地址与上传后的url的配置,在ckfinder的config.php中修改
function CheckAuthentication(){return true;}// LicenseKey : Paste your license key here. If left blank, CKFinder will be// fully functional, in demo mode.$config['LicenseName'] = '';$config['LicenseKey'] = '';//$baseUrl = '../../../uploads/';$baseUrl = 'http://www.name.com/xinxibaosong/uploads/';$baseDir = "d:/webphp/xinxibaosong/uploads/";
4.上传后修改文件的名为随机数字和字符
在ckfinder/core/connector/php/php5/CommandHandler/FileUpload.php中加入
public function mySetFileName() { $gettime = explode(' ', microtime()); $string = 'abcdefghijklmnopgrstuvwxyz0123456789'; $rand = ''; for ($x = 0; $x < 5; $x++) { $rand .= substr($string, mt_rand(0, strlen($string) - 1), 1); } return date("ymdHis") . substr($gettime[0], 2, 6) . $rand; }
完后修改63行左右的
if ($sFileName != $sUnsafeFileName) { $iErrorNumber = CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID_NAME_RENAMED; }
修改为:
if ($sFileName != $sUnsafeFileName) { $iErrorNumber = CKFINDER_CONNECTOR_ERROR_UPLOADED_INVALID_NAME_RENAMED; } $sExtension = CKFinder_Connector_Utils_FileSystem::getExtension($sFileName); $sFileName = $this->mySetFileName() . '.' . $sExtension;
- ckeditor + ckfinder + php 的详细配置。
- CKEditor与CKFinder的配置
- PHP中CKEditor和CKFinder配置
- PHP中CKEditor和CKFinder配置
- PHP中CKEditor和CKFinder配置
- C# ckeditor+ckfinder的图片上传配置
- ckeditor+ckfinder配置用法
- ckeditor/ckfinder配置
- ckeditor+ckfinder配置用法
- ckfinder+ckeditor文件配置
- 在php中整合ckeditor、ckfinder详细终结版
- 详细配置CKEditor 和 CKFinder 插件上传图片
- ckeditor和ckfinder集成详细配置及其优化
- PHP 中配置 ckeditor(fckeditor的新版本)+ckfinder ,实现上传图片功能。
- PHP中配置Ckeditor和Ckfinder(实现图片上传)
- ckeditor的详细配置
- ckeditor的详细配置
- CKEditor+CKFinder+php使用心得
- 代码片段管理工具Sublime+SVN
- git创建一个新的仓库(共享库)
- MVC模式:jsp+servlet+javabean
- java 代理
- php值传递 与引用传递
- ckeditor + ckfinder + php 的详细配置。
- 怎么处理加密解密核心问题
- 引用传递及其应用
- 奋斗才能成功(摘要)
- 数据结构学习之回溯法求解迷宫问题
- Eclipse中的快捷键
- Objective-c,iOS应用开发随笔
- MongoDB 在Linux 下的安装与启动
- listview加载性能优化ViewHolder