php下安装配置fckeditor编辑器的方法
程序员文章站
2023-02-26 14:50:05
一、php调用fckeditor方法。 二、js调用fckeditor方法。 复制代码 代码如下:
一、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()”>
二、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()”>
上一篇: WordPress判断用户是否登录的代码