fck完美整合ecms改动最小
4月1日,今天通过努力自己可以添加fck的按钮,当然是按钮直接连接到ecms的上传组件,经过了两三次js和php间的传值,特别麻烦,还是下面的外挂式整合来的轻松,这就是天使不在他的精简编辑器中不加入上传自己的原因,其中的漏洞也没有人知道。
参考了
http://blog.csdn.net/flying_huang/archive/2007/03/23/1539206.aspx
http://www.javaeye.com/topic/150487
在/html/1.php合适位置加入
<a onclick="window.open('editor/file.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=1&classid=<?=$classid?>&filepass=<?=$filepass?>','','width=700,height=550,scrollbars=yes');" title="上传图片"><img src="editor/images/img.gif" /></a><a onclick="window.open('editor/file.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=2&classid=<?=$classid?>&filepass=<?=$filepass?>','','width=700,height=550,scrollbars=yes');" title="上传FLASH"><img src="editor/images/flash.gif" /></a><a onclick="window.open('editor/file.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=0&classid=<?=$classid?>&filepass=<?=$filepass?>','','width=700,height=550,scrollbars=yes');" title="上传附件"><img src="editor/images/file.gif" /></a><a onclick="window.open('editor/file.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=3&classid=<?=$classid?>&filepass=<?=$filepass?>','','width=700,height=550,scrollbars=yes');" title="上传多媒体文件"><img src="editor/images/rm.gif" /></a><a onclick="window.open('editor/TranMore.php?userid=<?=$logininid?>&username=<?=$loginin?>&rnd=<?=$loginrnd?>&type=1&classid=<?=$classid?>&filepass=<?=$filepass?>','','width=700,height=550,scrollbars=yes');" title="上传多图片"><img src="editor/images/tranmoreimg.gif" /></a>
充分利用帝国自身的文件
在file.php加入
function DoFile(html1)
{ var oEditor = opener.FCKeditorAPI.GetInstance('newstext') ;
oEditor.InsertHtml(html1);
}
function InsertFile(filename,fname,fileid,filesize,filetype,fileno,dotype){
var vstr="";
if(dotype!=undefined)
{
vstr=showModalDialog("popups/insertfile.php?ecms="+dotype+"&fname="+fname+"&fileid="+fileid+"&filesize="+filesize+"&filetype="+filetype+"&filename="+filename, "", "dialogWidth:45.5em; dialogHeight:27.5em; status:0");
if(vstr==undefined)
{
return false;
}
}
DoFile(vstr);
window.close();
}
其他的参看其他帖子
关注了你的博客,果然问题解决了不少,虽然加上代码后模样很丑,不过很实用。先凑合用着了。谢谢啊!
现在不再弄这个东西了,时间不够