【问题标题】:my ckeditor doesn't integrate with my ckfinder我的 ckeditor 没有与我的 ckfinder 集成
【发布时间】:2014-03-11 08:05:23
【问题描述】:

我在使用 CKEditor 和 CKFinder 时遇到问题,我已经多次阅读文档,但我不知道我的 CKFinder 出了什么问题。问题是,如果我单击图像图标上传器,“浏览服务器”按钮没有出现。

代码有问题吗?

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

<script type="text/javascript">

// This is a check for the CKEditor class. If not defined, the paths must be checked.
if ( typeof CKEDITOR == 'undefined' )
{
    document.write(
        '<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
        'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
        'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
        'this file, changing the wrong paths in the &lt;head&gt; (line 5) and the "BasePath"' +
        'value (line 32).' ) ;
}
else
{
    var editor = CKEDITOR.replace( 'strength',{
    filebrowserBrowseUrl : '/ckfinder/ckfinder.html',
    filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?type=Images',
    filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?type=Flash',
    filebrowserUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
    filebrowserImageUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
    filebrowserFlashUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
});


    // Just call CKFinder.setupCKEditor and pass the CKEditor instance as the first argument.
    // The second parameter (optional), is the path for the CKFinder installation (default = "/ckfinder/").
    CKFinder.setupCKEditor( null, './ckfinder/' );

    // It is also possible to pass an object with selected CKFinder properties as a second argument.
    // CKFinder.setupCKEditor( editor, { basePath : '../', skin : 'v1' } ) ;
}

</script>

【问题讨论】:

    标签: javascript php ckeditor ckfinder


    【解决方案1】:

    var editor = CKEDITOR.replace( 'editor1' ); CKFinder.setupCKEditor( editor, '../' ) ;

    此代码来自官方演示。

    // 只需调用 CKFinder.setupCKEditor 并将 CKEditor 实例作为第一个参数传递。

    //第二个参数(可选),是CKFinder的安装路径(默认=“/ckfinder/”)。

    我认为您的代码的错误:CKFinder.setupCKEditor(null, './ckfinder/');

    【讨论】:

      【解决方案2】:

      可能是你忘记编辑 CKfinder config.php 页面。

      function CheckAuthentication() { return true; }

      您需要根据您的项目位置更改$baseUrl 和$baseDir。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-10-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-02-23
        相关资源
        最近更新 更多