Ckeditor与ckfinder简单整合使用
功能:主要用来发送图文的email,图片上传到本地服务器,但是email的图片地址要写上该服务器的远程地址(图片地址;例如:http://www.baidu.com/logo/1.png[s1] )
注意版本:ckeditor4.0和ckfinder2.4
阅读技巧:红色为要解释的目标,蓝色为要解释的内容
其他什么修改文件存放路径啊,语言什么的网上都有,这只是展示了简单的整合。
1、 创建页面并编写HTML
<textarea cols="30" rows="30" name="ck[s2] "></textarea>
2、 引用AjaxUpload.js文件
<script type="text/javascript" src="public/ckeditor/ckeditor.js[s3] "></script>
<scripttype="text/javascript" src="public/ckeditor/ckfinder/ckfinder.js[s4] "></script>
3、 编写JS脚本
<script type="text/javascript">
ck = CKEDITOR.replace( 'ck[s5] ',
{
filebrowserBrowseUrl : '<?php echo base_url();?>[s6] public/ckeditor/ckfinder/ckfinder.html',
filebrowserImageBrowseUrl : 'public/ckeditor/ckfinder/ckfinder.html?Type=Images',
filebrowserFlashBrowseUrl : 'public/ckeditor/ckfinder/ckfinder.html?Type=Flash',
filebrowserUploadUrl:'public/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', filebrowserImageUploadUrl :'public/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUploadtype=Images',
filebrowserFlashUploadUrl :'public/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'[s7] });
</script>
4.获取ckeditor的值
<script>
ck_val[s8] = ck[s9] .document.getBody().getHtml();[s10]
</script>