tinymce+ibrowser使用笔记

今天处于项目需要,用tinymce做编辑器,花了点时间熟悉了tinymce,起初大概配置了一下。能用,但是用到图片上传的时候,出了点问题。原来tinymce本身不支持图片上传,但是有一个官方插件支持,但需要花钱。于是只能另找出路,google了半天,找到了ibrowser这个插件,配置看了下,挺好用的,就决定用这个插件。废话不多说,配置如下:

tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    language: "zh",
    skin: "o2k7",
    plugins: "ibrowser,safari,pagebreak,style,table,advhr,advimage,advlink,emotions,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
    theme_advanced_buttons1 :     "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect,|,blockquote,forecolor,backcolor,|,styleprops",
    theme_advanced_buttons2 : "tablecontrols,|,hr,|,replace,removeformat,visualaid,pagebreak,|,charmap,emotions,media,advhr,searchreplace,|,insertdate,inserttime,preview,||,preview,fullscreen,|,print", 
    theme_advanced_buttons3_add : "ibrowser",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true
});

具体每一个tinymce的配置命令意思,可以上网去查。

下面讲ibrowser的配置,由于我下的是ibrowser1.4.1的,所以有一些配置可以省去,如果有人下的是1.2或者其他版本,可能还要做一下其他配置(复制ibrowser/interface/tinyMCE.editor_plugin.js文件到plugins\ibrowser目录中,并改名为editor_plugin.js)

2>修改ibrowser/config.inc.php,找到$cfg['ilibs'] = array (                                                                // image library path with slashes; absolute to root directory - please make sure that the directories have write permissions
        array (
            'value'       => '/images/upload/',//根据你自己上传图片的目录配置
            'text'        => 'Site Pictures',
        ),
        array (
            'value'       => '/images/upload/',
            'text'        => 'Gallery',
        ),
    );

最后,如果在unix/linux上不要忘记将这些目录, ibrowser/scripts/phpThumb/cache目录, ibrowser/temp目录设为可读写的.

如果在上传图片的时候遇到"ibrowser error building image list",是因为上面设置的图片目录不正确

转载于:https://www.cnblogs.com/weblack/archive/2010/07/30/1789025.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值