Heim  >  Artikel  >  php教程  >  phpweb更换百度编辑器的配置教程

phpweb更换百度编辑器的配置教程

WBOY
WBOYOriginal
2016-05-26 08:20:41987Durchsuche

phpweb是一个企业建站系统了可以快速的实现企业群站创建了,但这款使用的编辑器并不是百度编辑器对于小编来讲是非常喜欢百度编辑器了,下面一起来看看phpweb更换百度编辑器的配置。

准备工作:

1.从UEditor 官网上面下载 最新版本的UEditor,现在最新版本为ueditor1_4_3-utf8-php,请下载php版本。

2.我们更换的是 news 模块下的编辑器,也就是新闻模块,请确保news/admin/下面,news_conadd.php,news_conmod.php,已经破解出源码,如果没有,请自行百度!

开始动手:

1.解压下载的压缩包直接到phpweb根目录

2.打开news_conadd.php文件夹

找到以下代码:

<input type="hidden" name="body" value="<?php echo $body; ?>" />
<script type="text/javascript" src="../../kedit/KindEditor.js"></script>
<script type="text/javascript">
var editor = new KindEditor("editor");
editor.hiddenName = "body";
editor.editorWidth = "680px";
editor.editorHeight = "300px";
editor.skinPath = "../../kedit/skins/default/";
editor.uploadPath = "../../kedit/upload_cgi/upload.php";
editor.imageAttachPath = "news/pics/";
editor.iconPath = "../../kedit/icons/";
editor.show();
function KindSubmit() {
editor.data();
}
</script>

然后直接注释掉,或者删除。

加入

然后在下面插入

<!-- 配置文件 -->
<script type="text/javascript" src="../../ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../../ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
var ue = UE.getEditor(&#39;container&#39;,{
   initialFrameWidth:"800",
   initialFrameHeight:"200"
});
</script>

这样,新闻的添加就好了。

下面就是新闻的修改;

步骤和添加一样只是在实例化编辑器后面加入

<script type="text/javascript">
var ue = UE.getEditor(&#39;container&#39;,{
   initialFrameWidth:"800",
   initialFrameHeight:"200",
});
ue.ready(function() {
   //设置编辑器的内容
   ue.setContent(&#39;<?php echo htmlspecialchars_decode($body);?>&#39;);
});
</script>

这样 修改就可以了。

注意:更换完成编辑器后,原来phpweb自带的分页就不能使用了

phpweb更换百度编辑器的配置教程

phpweb更换百度编辑器的配置教程

下面是修改新闻的时候:

phpweb更换百度编辑器的配置教程

写在最后:

百度UEditor 的上传图片路径是统一默认的,如果要修改,请打开 ueditor/php/config.json 下面进行修改。

文章链接:

随便收藏,请保留本文地址!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn