如何将 CKFinder 与 CKEditor 集成?

发布于 2024-09-17 13:18:13 字数 144 浏览 10 评论 0原文

如何将 CKFinder 与新的 CKEditor 集成。

网站上的记录非常少,我实际上一无所获。

据我所知,如果有分步指南,我将不胜感激。对于所见即所得编辑器来说,这是唯一免费/良好的图像上传解决方案。有人可以确认吗?

谢谢

How do you integrate CKFinder with the new CKEditor.

It is very underdocumented on the website, and i am literally getting nowhere.

A step by step guide would be greatly appreciate as, as far as i am aware.. this is the only free/good image upload solution for a wysiwyg editor that is any good. Can someone confirm?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

演多会厌 2024-09-24 13:19:48

首先,您必须有一个文本框来转换为 CKEditor:

<textarea id="newTextArea">Some text</textarea>

然后您所需要的只是一些 javascript 代码,用于将此文本编辑器转换为 CKEditor 实例,并将此编辑器与 CKFinder 集成。

<script type="text/javascript">
    var newCKEdit = CKEDITOR.replace('newTextArea');
    CKFinder.setupCKEditor(newCKEdit, '/ckfinder/');
</script>

setupCKEditor 函数的第二个参数必须是您网站中上传 ckfinder 的文件夹。

http://docs.cksource.com/CKFinder_2.x/Developers_Guide/PHP/CKEditor_Integration

First you must have a textbox to convert to CKEditor:

<textarea id="newTextArea">Some text</textarea>

Then all you need is some javascript code for the conversion of this texteditor to a CKEditor instance and the integration of this editor with CKFinder.

<script type="text/javascript">
    var newCKEdit = CKEDITOR.replace('newTextArea');
    CKFinder.setupCKEditor(newCKEdit, '/ckfinder/');
</script>

The second parameter of the setupCKEditor function must be the folder in your website where you uploaded ckfinder.

http://docs.cksource.com/CKFinder_2.x/Developers_Guide/PHP/CKEditor_Integration

孤星 2024-09-24 13:19:34

检查您的服务器语言的文档站点:http://docs.cksource.com/CKFinder_2.x
例如 PHP 文档的这一部分:
http://docs.cksource.com /CKFinder_2.x/Developers_Guide/PHP/CKEditor_Integration

顺便说一句,CKFinder 不是免费的,您必须获得许可证才能使用它。

Check the documentation site for your server language: http://docs.cksource.com/CKFinder_2.x
For example this part of the PHP docs: http://docs.cksource.com/CKFinder_2.x/Developers_Guide/PHP/CKEditor_Integration

And btw, CKFinder is not free, you must get a license in order to use it.

泪痕残 2024-09-24 13:19:18

您可以在此处找到有关将 CKFinder 与 CKEditor 集成的教程:
http://www.webshaolin.com/index.php?page=article& ;articleid=40

You can find a tutorial on integrating CKFinder with CKEditor here:
http://www.webshaolin.com/index.php?page=article&articleid=40

紅太極 2024-09-24 13:19:02

尝试执行以下步骤。

1.下载CKEditor和CKFinder。集成代码可在 http://dwij.co.in/ckeditor- ckfinder-integration-using-php/
2. 将两者的提取代码放入 xampp 内的一个文件夹中,如下所示。
3. 创建索引文件 (index.html),其中将包含编辑器,如下代码。

    <html>
    <head>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="ckfinder/ckfinder.js"></script>
    </head>
    <body>
        <h1>CKEditor CKFinder Integration using PHP</h1>
        <textarea id="editor1" name="editor1" rows="10" cols="80"></textarea>
    <script type="text/javascript">
    var editor = CKEDITOR.replace( 'editor1', {
        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'
    });
    CKFinder.setupCKEditor( editor, '../' );
    </script>
    </body>
    </html>

因此您的文件夹结构将如下所示:

htdocs
|_integrated
    |_ckeditor
    |   |_config.js
    |   |_...
    |_ckfinder
    |   |_config.php
    |   |_...
    |_uploads
    |_index.html
  1. 现在在 ckfinder & 中打开文件 config.php;进行以下更改:

    函数 CheckAuthentication() {
        // 警告:不要简单地返回“true”。通过这样做,您允许
        // “任何人”上传并列出服务器中的文件。你必须实施
        // 这里进行某种会话验证。即使是非常简单的事情,例如...
        // 返回 isset($_SESSION['IsAuthorized']) && $_SESSION['已授权'];
        返回真; // 但这不是一个好的选择;参加会议
    }
    $baseUrl = 'http://localhost/integrated/uploads/';
    $启用=真;
    $config['SecureImageUploads'] = false;
    $config['ChmodFolders'] = 0777 ;
    
  2. 现在打开 url http://localhost/integrated/ 并尝试上传图像。

Try doing following steps.

1. Download CKEditor and CKFinder. Integrated code may be available on http://dwij.co.in/ckeditor-ckfinder-integration-using-php/
2. Put extracted code of both in one folder inside xampp as below.
3. Create index file (index.html) which will be containing the editor as below code.

    <html>
    <head>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="ckfinder/ckfinder.js"></script>
    </head>
    <body>
        <h1>CKEditor CKFinder Integration using PHP</h1>
        <textarea id="editor1" name="editor1" rows="10" cols="80"></textarea>
    <script type="text/javascript">
    var editor = CKEDITOR.replace( 'editor1', {
        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'
    });
    CKFinder.setupCKEditor( editor, '../' );
    </script>
    </body>
    </html>

so your folder structure will be something like this:

htdocs
|_integrated
    |_ckeditor
    |   |_config.js
    |   |_...
    |_ckfinder
    |   |_config.php
    |   |_...
    |_uploads
    |_index.html
  1. Now open file config.php inside ckfinder & make following changes:

    function CheckAuthentication() {
        // WARNING : DO NOT simply return "true". By doing so, you are allowing
        // "anyone" to upload and list the files in your server. You must implement
        // some kind of session validation here. Even something very simple as...
        // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
        return true; // not good option though; go for sessions
    }
    $baseUrl = 'http://localhost/integrated/uploads/';
    $enabled = true;
    $config['SecureImageUploads'] = false;
    $config['ChmodFolders'] = 0777 ;
    
  2. Now open url http://localhost/integrated/ and try uploading image.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文