| 关键词: nbsp ckfinder ckeditor 目录 以下 代码 php config WWW basePath |
下载ckeditor_3.6.2.zip ckfinder_php_2.1.zip CKFinderKeyGen.exe 解压于WWW目录下。打开ckfinder目当下的config.php,第33行改成true//第38,39行加上注册码:$config['LicenseName'] = 'abc.domain.com';$config['LicenseKey'] = 'B5E3BCF4RTURH7T1EHVQT4EZ2DWTUMVE'第63行$baseUrl = '/ckfinder/userfiles/' 第107 108 109 将值都改成0不限制上传图片的长宽。第194行可更改允许上传的文件的后缀 将以下代码保存为index.php放于WWW目录(输入): <html><body><form action="welcome.php" method="post"><?phpinclude_once 'ckeditor/ckeditor.php' ;require_once 'ckfinder/ckfinder.php' ; $initialValue = '<p>pl inpunt</p>' ; $ckeditor = new CKEditor( ) ; $ckeditor->basePath = '/ckeditor/' ; CKFinder::SetupCKEditor( $ckeditor, '/ckfinder/' ) ; $ckeditor->editor('CKEditor1', $initialValue);?> <input type="submit" value="Submit"/></form> </body></html> 将以下代码保存为welcome.php放于www目录(输出结果):(注意魔术引号!!!) <html><body> <?phpecho $_POST[CKEditor1]= stripslashes( $_POST[CKEditor1] ) ;?></body></html> 将以下代码保存为upload.php放于www目录(上传文件用。) <html ><head> <script type="text/javascript"> // This is a sample function which is called when a file is selected in CKFinder.function ShowFileInfo( fileUrl, data ){ var msg = 'The selected URL is: ' + fileUrl + ' '; // Display additional information available in the "data" object. // For example, the size of a file (in KB) is available in the data["fileSize"] variable. if ( fileUrl != data['fileUrl'] ) msg += 'File url: ' + data['fileUrl'] + ' '; msg += 'File size: ' + data['fileSize'] + 'KB '; msg += 'Last modified: ' + data['fileDate']; alert( msg );} </script></head><body> <?php require_once 'ckfinder/ckfinder.php' ; // You can use the "CKFinder" class to render CKFinder in a page:$finder = new CKFinder() ;$finder->BasePath = '/ckfinder/' ; // The path for the installation of CKFinder (default = "/ckfinder/").$finder->SelectFunction = 'ShowFileInfo' ;$finder->Create() ; ?> </form></body></html> 本文出自 “辛-碌-力-成” 博客,请务必保留此出处http://orzorz.blog.51cto.com/4228156/756853 |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|