新闻中心

shlcms怎么整合Ueditor编辑器

作者 / 无忧主机 时间 2016-02-18 17:02:10

百度公司为了帮助到更多的站长朋友开发出了Ueditor编辑器,很多时候我们也叫做百度编辑器,主要是这款编辑器确实比较优秀,使用起来很简单,并且还完美的可以在php免备案空间中运行,都得到很多站长朋友的喜爱,所以说在更大程度上站长们都要去实现,但是很多站长朋友知道,但是实现不了,小编为了更好的去帮助到大家,那么今天就来讲讲怎么在shlcms中去整合。 1、首先我们去下载 ueditor1.4.3版本,上传到我们的站点的根目录,把该文件夹修改为 ueditor的命名方式。 2、找到admini\views\system\options\index.php打开编辑找到如下代码:

$editor_arr = array('ewebeditor'=>'eWebEditor','fckeditor'=>'FCKeditor');
        select($editor_arr,'editorstyle',EDITORSTYLE);
将其修改为:
$editor_arr = array('ewebeditor'=>'eWebEditor','fckeditor'=>'FCKeditor','ueditor'=>'Ueditor');
        select($editor_arr,'editorstyle',EDITORSTYLE);
这样我们就成功的在我们后台的系统设置里面加上了“ueditor”的选项了,但是到了这步骤还是没有完成,我们还需要完成更多的步骤。 3、打开站点inc目录下的common.php,查找如下代码:
case 'fckeditor':
        $oFCKeditor = new FCKeditor($name) ;
    $oFCKeditor->Value = $content;
    $oFCKeditor->Create() ;
break;
在这个的后面加上如下代码:
case 'ueditor':
    echo '<script type="text/javascript" charset="utf-8" src="'.ROOTPATH.'/ueditor/ueditor.config.js"></script>';
    echo '<script type="text/javascript" src="'.ROOTPATH.'/ueditor/ueditor.all.js"></script>';
    echo '<link rel="stylesheet" href="'.ROOTPATH.'/ueditor/themes/default/ueditor.css"/>';
    echo '<textarea id="'.$name.'" name="'.$name.'" cols="100" rows="8" style="width:95%;height:400px;">'.$content.'</textarea>';
    echo '<script type="text/javascript">';
    echo '    var editor = new baidu.editor.ui.Editor();';
    echo '    editor.render("'.$name.'");';
    echo '</script>';
break;
就这样我们就简单的完成了我们想要的编辑器的整合,其实整合的思路是差不多的,就是要看我们怎么去找对这个位置,所以小编写下这篇文章也是更好的帮助到在使用shlcms的站长朋友,希望您们喜欢。 无忧主机相关文章推荐阅读: SHLCMS(深喉咙CMS)源码程序安装教程 DOCCMS后台功能介绍 DOCCMS怎么设置伪静态

本文地址:https://www.51php.com/others/21668.html

1
1
1
1
1
1
1

客户服务热线

0791-8623-3537

在线客服