您现在的位置是:首页 > 教程 > dedecms教程dedecms教程

实现织梦dedecms前台会员中心上传附件的实现方法

石和革2024-06-02 22:46:26dedecms教程已有人查阅

导读要在会员发布文章时要能发布一些doc,xsl,ppt之裡的小附件。以为只是设置问题,于是百度一下,就知道DEDECMS根本没有预留这个功能

要在会员发布文章时要能发布一些doc,xsl,ppt之裡的小附件。以为只是设置问题,于是百度一下,就知道DEDECMS根本没有预留这个功能,没办法,只好去研究一下它,终于找到解决方法
修改以下几个文件
1.\include\FCKeditor\fckconfig.js
FCKConfig.ToolbarSets["Member"] = [
['Source','Preview','-','PasteText','PasteWord','-','Bold','Italic','Underline','StrikeThrough'],
['ImageUser','flashUser','-','Link','Unlink','-','Table','Rule','Codes','Quote','Br','-','TextColor','FontSize']
] ;
替换成
FCKConfig.ToolbarSets["Member"] = [
['Source','Preview','-','PasteText','PasteWord','-','Bold','Italic','Underline','StrikeThrough'],
['ImageUser','FlashUser','AddonUser','-','Link','Unlink','-','Table','Rule','Codes','Quote','Br','-','TextColor','FontSize']
] ;
FCKConfig.ToolbarSets["MemberLit"] = [
['Source','Preview','-','PasteText','PasteWord','-','Bold','Italic','Underline','StrikeThrough'],
['ImageUser','FlashUser','-','Link','Unlink','-','Table','Rule','Codes','Quote','Br','-','TextColor','FontSize']
] ;
替换成
FCKConfig.ToolbarSets["MemberLit"] = [
['Source','Preview','-','PasteText','PasteWord','-','Bold','Italic','Underline','StrikeThrough'],
['ImageUser','FlashUser','AddonUser','-','Link','Unlink','-','Table','Rule','Codes','Quote','Br','-','TextColor','FontSize']
] ;
2.\include\FCKeditor\editor\js\fckeditorcode_ie.js 和\include\FCKeditor\editor\js\fckeditorcode_gecko.js
编辑fckeditorcode_ie.js
case 'Addon':B=new FCKDialogCommand('Addon',FCKLang.InsertAddon,'dialog/dede_addon.php',480,250);break;
下面添加
case 'AddonUser':B=new FCKDialogCommand('AddonUser',FCKLang.InsertAddon,'dialog/dede_addonuser.php',480,250);break;
case 'Addon':B=new FCKToolbarButton('Addon',FCKLang.InsertAddon,FCKLang.InsertAddon,null,false,true,76);break;
下面添加
case 'AddonUser':B=new FCKToolbarButton('AddonUser',FCKLang.InsertAddon,FCKLang.InsertAddon,null,false,true,76);break;
同理fckeditorcode_gecko.js做類似的修改
3.
在\include\FCKeditor\editor\dialog里,复制一份dede_addon.php,重命名为dede_addonuser.php。
编辑dede_addonuser.php
require_once(dirname(__FILE__)."/../../../common.inc.php");
替换成
require_once(dirname(__FILE__)."/../../../../member/config.php");
CheckRank(0,0);
window.open("../../../dialog/select_soft.php?f="+fname, "popUpSoftWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left="+posLeft+", top="+posTop);
替换成
window.open("../../../../member/uploads_select.php?mediatype=4&f="+fname, "popUpSoftWin", "scrollbars=yes,resizable=yes,statebar=no,width=500,height=350,left="+posLeft+", top="+posTop);
4. 登录管理后台,在会员系统开启了会员可以上传图片以外的附件.
5.完成,测试

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签