PHP FCKeditor 在线编辑器的配置和使用实例


1.配置

        fckconfig.js

                皮肤样式
                        FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/';//default,office2003,silver

                定制界面功能
                        FCKConfig.ToolbarSets["Default"]
                        FCKConfig.ToolbarSets["Basic"]


2.使用

        php方式

                直接输出
                        <?php
                        require_once("fckeditor/fckeditor.php") ;
                        ?>

                        <form action="sampleposteddata.php" method="post" target="_blank">
                                <?php
                                    $obj_fckeditor = new FCKeditor('FCKeditor');
                                    $obj_fckeditor->BasePath = "fckeditor/";
                                    //$obj_fckeditor->InstanceName = "str_fckeditor_test" ;
                                    //$obj_fckeditor->ToolbarSet = 'Basic';
                                    $obj_fckeditor->Width = 500;
                                    $obj_fckeditor->Height = 400;
                                    $obj_fckeditor->Value ='<p>This is some <strong>sample text</strong>. Youare using <ahref="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
                                    $obj_fckeditor->Create();
                                ?>
                            <br/>
                            <input type="submit" value="Submit">
                        </form>


                smarty版
                        $str_fckeditor_test = $obj_fckeditor->CreateHtml();


        html方式

                <script type="text/javascript" src="fckeditor/fckeditor.js"></script>

                <form action="sampleposteddata.asp" method="post" target="_blank">
                    <script type="text/javascript">
                        var oFCKeditor = new FCKeditor( 'FCKeditor' ) ;
                        oFCKeditor.BasePath    = 'fckeditor/' ;
                        oFCKeditor.Height    = 300 ;
                        oFCKeditor.Value    = '<p>This is some<strong>sample text<\/strong>. You are using <ahref="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;
                        oFCKeditor.Create() ;
                        //-->
                    </script>
                    <br/>
                    <input type="submit" value="Submit" />
                </form>


3.图片上传

        fckeditor\editor\filemanager\connectors\php\config.php

                $Config['Enabled'] = true;
                $Config['UserFilesPath'] = '/userfiles/';


4.文件管理器插件

        kfm
                http://kfm.verens.com/
                http://kfm.verens.com/Using-KFM-as-a-plugin-for-FCKeditor
                用到数据库

                安装
                    * Unzip KFM into FCKeditor's editor/plugins/ directory
                    * rename the kfm-1.x directory to kfm
                    * copy configuration.php.dist to configuration.php
                    * edit configuration.php to your satisfaction.
                          o most variables are already set to a good default.
                          o you must configure a database. it can be a database you are already using for some other purpose.
                          o to use a database you are already using forsome other purpose, set the $kfm_db_prefix variable. that way, tableswill be created with that prefix (helps you tell them apart from yourother tables).
                    * add this to the bottom of your fckconfig.js:

                      FCKConfig.Plugins.Add('kfm');

                    * important: clear the cache in your browser

                配置
                    fckeditor\editor\plugins\kfm\configuration.php
                            $kfm_db_type = 'mysql';
                            $kfm_db_prefix   = 'kfm_';
                            $kfm_db_host     = 'localhost';
                            $kfm_db_name     = 'test';
                            $kfm_db_username = 'root';
                            $kfm_db_password = '';
                            $kfm_db_port     = '';
                            $kfm_userfiles_address = 'D:/www/userfiles';

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值