当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP教程:php调用fckeditor函数

PHP
PHP高级OOP技术演示
PHP注入的安全规范
PHP魔法函数应用详解
在PHP中实现用户身份认证两种方法
关于PHP中for循环语句的几种变型
php对gzip文件或者字符串解压实例参考
PHP 构建语义 Web CRUD 操作
php任意图像裁剪成固定大小
PHP IDE程序 phpeclipse
PHP5中的PDO的使用和介绍
PHP中strtr和str_replace比较
PHP在特定目录中找特定类型的文件
PHP5环境下采用sqlite数据库开发小小总结
PHP5+APACHE2.2配置成功案例
深入浅析:用于MySQL的PHP XML类
PHP通过header实现文本文件的下载
PHP函数使用入门
如何在PHP中定义一个类
教你在PHP中使用全局变量
PHP+AJAX实现实时显示在线用户信息

PHP教程:php调用fckeditor函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 92 ::
收藏到网摘: n/a

PHP代码

/*
* showfck() 编辑器调用函数
* @name 名字 (必须)
* @val value默认值
* @toolbarset fck工具栏名字
* @width 宽度
* @height 高度
*/

function showfck($name, $val= '', $toolbarset = '', $width = '100%', $height = '200'){ 

$classname = 'fckname'; 

echo "<div class=\"$classname\">"; 

require_once WEB_ROOT . './include/fckeditor/fckeditor.php'; 

$fck = new FCKeditor($name); 

$fck->BasePath = './include/fckeditor/'; 

$fck->Config['CustomConfigurationsPath'] = $fck->BasePath . 'custom_config.js'; 

$fck->ToolbarSet = $toolbarset; 

$fck->Value = $val; 

$fck->Width = $width; 

$fck->Height = $height; 

$fck->Create(''); 

echo "</div>";
}