How to configure the FCKeditor Editor in PHP _php tutorial

Source: Internet
Author: User
Tags php file upload
FCKeditor Editor is a support multi-language multi-page online editor, he can support asp,asp.net,jsp,php, but it is not the default PHP but ASP oh, let's see how to configure the FCKeditor editor in PHP.

Download after decompression for the folder weight loss:

Delete all files except Fckconfig.js, Fckeditor.js, Fckstyles.xml, fcktemplates.xml,fckeditor.php Five files under the/fckeditor/directory
Delete Directory/editor/_source,_testcases (basically, all folders or files beginning with _ are optional),
Delete all directories under/editor/filemanager/browser/default/connectors/except for the PHP directory
Delete all directories except PHP directory under/editor/filemanager/upload/
Delete all files under/editor/lang/except En.js, Zh.js, zh-cn.js three files


One: Modified file upload language for PHP
Open Fckconfig.js
Found it:
var _filebrowserlanguage = ' asp '
var _quickuploadlanguage = ' asp '
Change to:
var fckconfig.defaultlanguage = ' ZH-CN ';
var _filebrowserlanguage = ' php '
var _quickuploadlanguage = ' php '


Second: Enable PHP file Upload

1: Enable Filebrowser:
Open fckeditor/editor/filemanager/connectors/php/config.php (Chinese support is not good here, you can have to deal with the Chinese name on your own)

To enable file uploads:

Found it:
$Config [' Enabled '] = False

Change to:
$Config [' Enabled '] = True

To set the upload directory:

Found it:
$Config [' userfilespath '] = '/userfiles/'
Change to:
$Config [' userfilespath '] = ' your own project path '


2: Enable Quickupload
Open fckeditor/editor/filemanager/upload/php/config.php
To enable file uploads:

Found it:
$Config [' Enabled '] = False
Change to:
$Config [' Enabled '] = True


To set the upload directory:

Found it:
$Config [' userfilespath '] = '/userfiles/'
Change to:
$Config [' userfilespath '] = ' your own project path '

Test


Place FCKeditor in the Web site root directory
Inside the php file, contains the/fckeditor/fckeditor.php file

The code is as follows Copy Code

Contains the FCKeditor class
Include (".. /fckeditor/fckeditor.php ");
Set Editor Path
$sBasePath = "/fckeditor/";
Create a FCKeditor, the name of the form is ipaddr
$oFCKeditor = new FCKeditor (' ipaddr ');
$oFCKeditor->basepath = $sBasePath;
Set the form initial value
$oFCKeditor->value = ' This is some sample text';
$oFCKeditor->create ();

You can also set
$oFCKeditor->width
$oFCKeditor->height
$oFCKeditor->toolbarset

OK, so that our PHP configuration FCKeditor tutorial is here, the above mentioned if the upload Chinese name will be garbled, we can search in this site, there are related solutions.

http://www.bkjia.com/PHPjc/631623.html www.bkjia.com true http://www.bkjia.com/PHPjc/631623.html techarticle FCKeditor Editor is a support multi-language multi-page online editor, he can support asp,asp.net,jsp,php, etc., but it is not the default PHP but ASP oh, let's see how in ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.