Web Content Management System (Web CMS) is the best way to maximize your efforts. An effective Web CMS system will enable you to update the content in your site simply using admin panel. This means you have full control of your site and updating site can be completed in minutes.
What is FCKEditor?
FCKEditor is a web-based WYSIWYG (What You See Is What You GET) HTML text editor which enable you to edit your website content as much as like using Microsoft Word. Its easy to use and doesn’t need installation on client computer.
FCKEditor is distributed under GPL (General Public License), LGPL (Lesser General Public License), and MPL (Mozilla Public License) source licenses and currently supported ASP.NET, Active-FoxPro, ASP, Lasso, ColdFusion, Perl, PHP, Phyton and Java. FCKEditor is Multi Browser Compatibility, support file uploads and outputs XHTML 1.0. This editor is also customizable, easy to configure, integrated spell checker, and the most important is CSS Support so you can see the real preview of your site before the content is published.
I myself have used FCKEditor for a long time for my client projects in both PHP and ASP version. For me, FCKEditor is easy to use than TinyMCE, openWYSIWYG, TextArea Rich and the other WYSIWYG editor.
Where can I download FCKEditor?
You can download FCKEditor by go to FCKEditor official site: http://www.fckeditor.net . The current latest released is 2.6.3
How can I integrate FCKEditor with PHP?
FCKEditor is simply a replacement for text box or textarea input. Here is the simple steps:
1. Extract the downloaded zip file (from http://www.fckeditor.net) to your web directory.
2. In your php file, include the fckeditor.php file:
Note: In this case, fckeditor folder is located at the same directory as my current php file.
3. Put the code below between <form> tag or just replace the text box or textarea control:
$ctrl_name = 'product_long_desc';
$sBasePath = 'fckeditor/';
$oFCKeditor = new FCKeditor($ctrl_name) ;
$oFCKeditor->Height = "300px";
$oFCKeditor->Width = "730px";
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = "" ;
$ctrl_name - Control name
$sBasePath - The location of your fckeditor folder with trailing slash
$oFCKeditor - FCKEditor class instance
$oFCKeditor->Height - define the height of the editor
$oFCKeditor->Width - define the width of the editor
$oFCKeditor->BasePath - fckeditor folder location
$oFCKeditor->Value - Initial value for the control. You can also use PHP variable (for sticky form)
$oFCKeditor->Create() - create and display the editor
4. For the file/image uploader function to work, you need to create the upload folder and configure the PHP connector file.
a. Create the upload folder
To create the upload folder, simply create a new folder named fckdata (optionally you can named it whatever you want) in your web directory and give the write permission (chmod 777) to the folder.
b. Configure the connector file.
The connector file (config.php) is located at:
Open config.php file and set the configuration below:
$Config['Enabled'] = true ;
$Config['UserFilesPath'] = ‘http://www.technologytricks.com/fckdata/’;
$Config['UserFilesAbsolutePath'] = ‘/home/tech/public_html/fckdata/’;
$Config['UserFilesPath'] - absolute url for your upload folder
$Config['UserFilesAbsolutePath'] - absolute directory location to the upload folder.
5. You have successfully integrated FCKEditor in your PHP application.
Please post a comment if you have problem with the installation.
To receive updates on new articles, subscribe to Technology Tricks today.