php下安装配置fckeditor编辑器的方法

yipeiwu_com5年前PHP代码库
一、PHP调用fckeditor方法。
二、JS调用fckeditor方法。
复制代码 代码如下:

<?php
require_once(PATH_PRE.”fckeditor.php”); // 包含fckeditor类,
$oFCKeditor = new FCKeditor('content') ; //创建一个fckeditor对象,表单的名称为content
$oFCKeditor->BasePath=”../fckeditor/”; //编辑器所在目录
$oFCKeditor->ToolbarSet=”Yiyunnet”; // 默认编辑器工具栏有Basic(基本工具) Default(所有工具)Soft(分一栏可以插入图片视频 ) Renpeng (可以上传图片视频分为两栏 ) Full (三栏)
$oFCKeditor->Height='100%'; //高度
$oFCKeditor->Width='100%'; //宽度
$oFCKeditor->Value=”"; //初始值 还可设置以下部分(”=”包含部分),并非必须:
$oFCKeditor->Config['SkinPath'] = ‘../editor/skins/silver/'; // 设置编辑器皮肤共有三种皮肤default
$oFCKeditor->Create(); //在要显示编缉器的地方输出变量$myeditor的值就行了
?>


FCKeditor js调用方法一
复制代码 代码如下:

<script src=”fckeditor/fckeditor.js”></script>
<script type=”text/javascript”>
var oFCKeditor = new FCKeditor( ‘Content' ) ;
oFCKeditor.BasePath = ‘fckeditor/' ;
oFCKeditor.ToolbarSet = ‘Basic' ;
oFCKeditor.Width = ‘100%' ;
oFCKeditor.Height = ‘400′ ;
oFCKeditor.Value = ” ;
oFCKeditor.Create() ;
</script>

FCKeditor js调用方法二
复制代码 代码如下:

<script src=”fckeditor/fckeditor.js”></script>
<script type=”text/javascript”>
function showFCK(){
var oFCKeditor = new FCKeditor('Content') ;
oFCKeditor.BasePath = ‘fckeditor/' ;
oFCKeditor.ToolbarSet = ‘Basic' ;
oFCKeditor.Width = ‘100%' ;
oFCKeditor.Height = ‘200′ ;
oFCKeditor.Value = ” ;
oFCKeditor.ReplaceTextarea() ;
document.getElementByIdx(”btnShow”).disabled = ‘true';
document.getElementByIdx(”btnShow”).style.display = ‘none';
}
</script>
<textarea name=”Content”></textarea>
<input id=btnShow style=”display:inline” type=button onclick=”showFCK()”>

相关文章

如何取得中文字符串中出现次数最多的子串

直接上代码,子串的长度可自己设置(比如连续4个字符的或5个字符的)。复制代码 代码如下:$str ='我是中国人我是外国人我是韩国人我是美国人我是中国人我是英国人我是中国人我是外国人';...

解析CI的AJAX分页 另类实现方法

看了一下CI的分页类没有写到关于AJAX的内容,也在论坛上看到其他几位大神写的分页类扩展,感觉其实是没有必要。在现有的基础上做了一下小小的改动还是能实现的。下面进入正题:CI的原生分页类...

自制PHP框架之路由与控制器

自制PHP框架之路由与控制器

我们为什么要使用路由?原因1:一个更漂亮的URI 1.URI的改进 刚刚开始学PHP时,我们一定写过blog.php?id=1之类的URI,使用GET方式获取参数。这样的URI有...

thinkphp备份数据库的方法分享

貌似THINKPHP没有备份数据库的方法,所以我自己写了一个,数据库连接和事务处理用的是pdo,如果有需要的可以联系我,写个mysql或者mysqli的 复制代码 代码如下: <&...

解析php利用正则表达式解决采集内容排版的问题

做采集经常遇到的问题是内容排版问题,用了一些时间写了个用正则替换html标签和样式的函数,共享下。复制代码 代码如下:/** * 格式化内容 * @param str...