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()”>

相关文章

php递归列出所有文件和目录的代码

<?php /*我的程序在国外的SREVER上,自己编的程序存放到哪,我很难记清。 所以编了一个简单的目录递归函数,查看我的程序,很方便的。 */ function tree($d...

PHP微信企业号开发之回调模式开启与用法示例

本文实例讲述了PHP微信企业号开发之回调模式开启与用法。分享给大家供大家参考,具体如下: 暑假实习,领导安排开发微信企业号。在此对遇到的问题进行记录,分享给遇到同样问题的小伙伴,希望对小...

详解php设置session(过期、失效、有效期)

在php中设置session有很多方面包有给session设置值或直接设置过期、失效和有效期,下面小编来给大家给各位朋友介绍怎么使用。 我们先来看看在php.ini中session怎么设...

php5编程中的异常处理详细方法介绍

1 首先是try,catch  <?php  $path = "D:\\\\in.txt";  try //检...

php中一个有意思的日期逻辑处理

今天处理了一个很小的问题。 需求是这样的,从周一到周日只能看到上周一到上周日的数据。 这里直接从数据库里根据 date 字段查询 范围即可。 但需要PHP生成 开始日期和结束日期。 最开...