Home > 整站程序 > fck完美整合ecms改动最小

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();
}

其他的参看其他帖子

Categories: 整站程序 Tags: ,
  1. TopBoy
    February 7th, 2009 at 22:30 | #1

    关注了你的博客,果然问题解决了不少,虽然加上代码后模样很丑,不过很实用。先凑合用着了。谢谢啊!

  2. humker
    February 13th, 2009 at 13:36 | #2

    现在不再弄这个东西了,时间不够

  1. No trackbacks yet.

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).