FCKEditor Custom User Directory modification steps (with source code) _ Page Editor

Source: Internet
Author: User

Due to my side of the network reasons, no use from the official website of FCK download to the source code ...
This set of source code is FCK2.2 version of the reverse compiled
Source: Click here to download the main changes in the source to do the comments
The general changes are as follows:
Get the source of the user directory: FileWorkerBase.cs
Here's a few notes.
Can be specified in a program directly when the user logs in
This scheme is only convenient for users to specify a different file directory when using
session["Fckeditor:userfilespath"]= "User file relative directory";

Copy Code code as follows:

<summary>
User Files Directory
</summary>
Protected string Userfilespath
{
Get
{
if (This.suserfilespath = null)
{
Read from Applictaion
This.suserfilespath = (string) base. application["Fckeditor:userfilespath"];
if ((This.suserfilespath = null) | | (this.sUserFilesPath.Length = 0))
{
Read from session
This.suserfilespath = (string) this. session["Fckeditor:userfilespath"];
if ((This.suserfilespath = null) | | (this.sUserFilesPath.Length = 0))
{
Reading from a site configuration file
This.suserfilespath = configurationsettings.appsettings["Fckeditor:userfilespath"];
if ((This.suserfilespath = null) | | (this.sUserFilesPath.Length = 0))
{
This.suserfilespath = "/uploadfiles/";
}
if ((This.suserfilespath = null) | | (this.sUserFilesPath.Length = 0))
{
Read from URL
This.suserfilespath = base. request.querystring["Serverpath"];
}
}
}
if (!this.suserfilespath.endswith ("/"))
{
This.suserfilespath = This.suserfilespath + "/";
}
}
return this.suserfilespath;
}
}

This specifies that FCK will need to have image,files folders.
Modify this file: Uploader. cs (Download address)
Modified upload file Action class here: (if you want to modify the original version of the file does not need to get to your Web application directory, I am here only to facilitate the use of my project in the App_Code method, the same below no longer repeat!)
Fckeditor\editor\filemanager\upload\aspx\upload.aspx.cs
I forgot to make a record when I changed it. It doesn't seem to change anything, just a little comment.
Uh, found it, Filebrowserconnector here.
Fckeditor\editor\filemanager\browser\default\connectors\aspx\connector.aspx.cs (modified address)
Copy Code code as follows:

<summary>
Select folder based on file type
</summary>
<param name= "ResourceType" ></param>
<param name= "FolderPath" ></param>
<returns></returns>
private string Servermapfolder (string resourcetype, String folderpath)
{
2010-3-29 14:00:56
String path = Path.Combine (base. Userfilesdirectory, ResourceType);
String path = base. Userfilesdirectory;
Util.createdirectory (path);
Return Path.Combine (Path, Folderpath.trimstart (new char[] {'});
}

This is where the resourcetype is ruled out. (Remove the Judgment file type)
This method will affect the picture path after the selected picture
Copy Code code as follows:

private string Geturlfrompath (string resourcetype, String folderpath)
{
if ((resourcetype = null) | | (resourcetype.length = 0))
{
Return (base. Userfilespath.trimend (new char[] {'/'}) + FolderPath);
}
2010-3-29 14:00:20 Hyz
Return (base. Userfilespath + resourcetype + folderpath);
String p=base. Userfilespath + folderpath;//New
P=p.replace ("//", "/")/New
return (P);//Add
}

You can then modify some of the code in other HTML files
1. Translation of the prompt information
This thing will not be said. It's simple. You can also search by the full text of the message ...
2. Change the sample text after the selected picture is Chinese
File in: Line 52nd
Fckeditor\editor\dialog\fck_image\fck_image_preview.html
3. Modify the file browser to increase the file preview (the effect is very rough)
Master of the modified good-looking also hope to send a portion of the younger brother.
File is located at:
Fckeditor\editor\filemanager\browser\default\frmresourceslist.html
I've modified the 63rd line of JS display preview effect
And, of course, a custom look and stuff like that.
But because the current project needs so little things. So I'm too lazy to do it ...
Source: Click here to download
Reprint please indicate the source: http://Qbit.cnblogs.com

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.