濮阳杆衣贸易有限公司

主頁 > 知識庫 > FCKEditor 自定義用戶目錄的修改步驟 (附源碼)

FCKEditor 自定義用戶目錄的修改步驟 (附源碼)

熱門標簽:企業(yè)電話機器人辦理 天津電銷卡外呼系統(tǒng)線路 興化400電話辦理多少錢 長春銷售外呼系統(tǒng)業(yè)務(wù) 靈聲智能電話機器人招聘 智能電銷機器人真的好嗎 長春防封卡電銷卡套餐 四平電話機器人哪家好 株洲外呼營銷系統(tǒng)有哪些

由于我這邊的網(wǎng)絡(luò)原因,沒用從FCK的官網(wǎng)下載到源碼...
這套源碼是FCK2.2版反編譯出來的
源碼:點此下載 源碼中主要修改的地方做了注釋
大致的修改如下 :
獲取用戶目錄的源碼: FileWorkerBase.cs
這里主要是做了一些注釋
在程序中可以直接在用戶登錄的時候指定
這個方案只是方便多用戶使用的時候為用戶指定不同的文件目錄
Session["FCKeditor:UserFilesPath"]="用戶文件相對目錄";

復制代碼 代碼如下:

/// summary>
/// 用戶文件目錄
/// /summary>
protected string UserFilesPath
{
get
{
if (this.sUserFilesPath == null)
{
//從APPlictaion 讀取
this.sUserFilesPath = (string)base.Application["FCKeditor:UserFilesPath"];
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
//從Session讀取
this.sUserFilesPath = (string)this.Session["FCKeditor:UserFilesPath"];
if ((this.sUserFilesPath == null) || (this.sUserFilesPath.Length == 0))
{
//從站點配置文件讀取
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))
{
//從URL讀取
this.sUserFilesPath = base.Request.QueryString["ServerPath"];
}
}
}
if (!this.sUserFilesPath.EndsWith("/"))
{
this.sUserFilesPath = this.sUserFilesPath + "/";
}
}
return this.sUserFilesPath;
}
}

這樣指定了之后會發(fā)現(xiàn) FCK需要有Image,Files等文件夾
修改這個文件:Uploader .cs (下載地址)
修改過的上傳文件操作類在這里:(如果你要修改原版的不必去把這個類文件搞到你的Web程序目錄中來,我這里只是為了方便使用我項目中的APP_Code中的方法,下同不再贅述!)
Fckeditor\editor\filemanager\upload\aspx\upload.aspx.cs
修改的時候忘了做記錄..這里貌似沒改什么內(nèi)容 只是做了點注釋
呃找到了在這里 FileBrowserConnector
Fckeditor\editor\filemanager\browser\default\connectors\aspx\connector.aspx.cs(修改后的地址)
復制代碼 代碼如下:

/// summary>
/// 根據(jù)文件類型選擇文件夾
/// /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[] { '/' }));
}

這里直接把那個resourceType給排除掉了(去掉判斷文件類型)
這個方法將影響選定圖片后的圖片路徑
復制代碼 代碼如下:

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;//新增
p=p.Replace("http://","/");//新增
return (p);//新增
}

然后在其他的HTML文件中也修改有部分代碼
1.翻譯了提示信息
這東西就不說了..很簡單你也可以根據(jù)提示信息全文搜索...
2.修改選定圖片后的示例文本為中文
文件位于: 第52行
Fckeditor\editor\dialog\fck_image\fck_image_preview.html
3.修改文件瀏覽器增加了文件預覽 (效果很粗糙)
高手們修改好看了還望能給小弟發(fā)一份兒..
文件位于:
Fckeditor\editor\filemanager\browser\default\frmresourceslist.html
我這里修改了第63行的js 顯示預覽效果
當然還有自定義表情之類的玩意兒..
但因為目前項目需要的就這么點兒東西.所以也懶得去搞了...
源碼:點此下載
轉(zhuǎn)載請注明出處:http://Qbit.cnblogs.com

標簽:新疆 巴彥淖爾 運城 黑龍江 青海 貴港 石嘴山 漯河

巨人網(wǎng)絡(luò)通訊聲明:本文標題《FCKEditor 自定義用戶目錄的修改步驟 (附源碼)》,本文關(guān)鍵詞  FCKEditor,自定義,用戶,目錄,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《FCKEditor 自定義用戶目錄的修改步驟 (附源碼)》相關(guān)的同類信息!
  • 本頁收集關(guān)于FCKEditor 自定義用戶目錄的修改步驟 (附源碼)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    襄城县| 沂南县| 科技| 黑山县| 牡丹江市| 广水市| 鹤峰县| 山东| 剑阁县| 崇左市| 怀柔区| 惠东县| 观塘区| 海盐县| 石门县| 托里县| 牙克石市| 汕头市| 大荔县| 长治市| 三河市| 吴江市| 阿城市| 博爱县| 云和县| 元氏县| 错那县| 樟树市| 肇东市| 叙永县| 宝应县| 邵东县| 金昌市| 池州市| 棋牌| 罗田县| 庆安县| 隆尧县| 巧家县| 满洲里市| 桂阳县|