Allow FCKeditor to support multi-user Web environment (for example, PHP) _ Web page Editor

Source: Internet
Author: User
Only under the/userfiles/folder. This is obviously inappropriate for a multiuser member system's Web site system because it is not possible for all users to share the same resource folder.
Therefore, it is necessary to dynamically configure, so that different users to the picture, Flash and other resource files uploaded to their own private folders.
FCKeditor is configured in the editor\filemanager\connectors\php\config.php configuration file for uploading directories, and the core statement is:
$Config [' userfilespath '] = '/userfiles/';
As long as you modify the statement, you can achieve the purpose of configuring the upload directory.
Take lightphp This popular CMS for example, its multi-user folder is under the/datas/userfiles/folder, for example,/datas/userfiles/admin is User Admin user directory, other users and so on. So if a user logs on, the value of the $Config [' Userfilespath '] array should be equal to/datas/userfiles/[username]. This can be achieved through a session. For example, $_session[' Current_User ' represents the current user name, so the configuration statement is:

Copy Code code as follows:

$Config [' userfilespath '] = '/datas/userfiles/'. $_session[' Current_User ']. ‘/';


In this way, the dynamic configuration of uploading directory under Multi-User environment is realized.
In the concrete realization, should pay attention to the problem is, to use session, must first implement session_start (); Statement. Also, in some cases, if the session is lost, you need to pay attention to the path problem of the session.
In the lightphp system, the complete configuration statement is:

Copy Code code as follows:

Session_save_path (Realpath) ('. /.. /.. /.. /.. /.. /datas/temp '));
Session_Start ();
$Config [' userfilespath '] = '/datas/userfiles/'. $_session[' Current_User ']. ‘/';


More questions, please discuss with the author himself.

This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/zhangking/archive/2009/06/24/4293725.aspx

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.