简体   繁体   中英

my ckeditor doesn't integrate with my ckfinder

I have a problem with CKEditor and CKFinder, i've already read the documentation several time and i didn't know what is wrong with my CKFinder. The problem is , that the button of "Browse Server" didn't show up if i click the Image icon uploader.

Is there something wrong with the code ?

<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>

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

This code is from the Officail demo.

// 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/").

I think your code's ERROR: CKFinder.setupCKEditor( null, './ckfinder/' );

May be you forget to edit CKfinder config.php page .

function CheckAuthentication() { return true; }

You need to change $baseUrl and $baseDir according to your project location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM