discuz 二次开发后台调用编辑器的方法!

来源:互联网 发布:log4j 输出sql语句 编辑:程序博客网 时间:2024/05/22 21:22

纠结了两个晚上,一个白天,无数次的Google,无数次的baidu,依旧没搜到合理的方案,奇怪难道没人有这个需求吗??好在功夫不负有心人,终于解决了!!得意


但是有个缺憾是无法使用图片上传功能。。但是也算不错了!有谁能解决得了这个图片上传的功能,还请分享~~~奋斗

下面分享一下解决方法!大笑


[php] view plaincopy在CODE上查看代码片派生到我的代码片
  1. showtablerow(''array('class="td27"''class="td28"'), array('内容:<textarea class="userData" name="content" id="uchome-ttHtmlEditor" style="height: 100%; width: 100%; display: none; border: 0px">'.$info['content'].'</textarea>'));  
  2.             showtablerow(''array('class="td25"''class="td28"'), array(" <iframe src='home.php?mod=editor&charset={CHARSET}&allowhtml=1&isportal=0' name='uchome-ifrHtmlEditor' id='uchome-ifrHtmlEditor'  scrolling='no' style='width:700px;height:400px;border:1px solid #C5C5C5;position:relative;' border=0 frameborder=0 ></iframe>",));  
  3.             showtablerow(''array('class="td25"''class="td28"'), array("<input id='submit_editsubmit' class='btn' type='submit' value='提交'  name='editsubmit' onClick='validate(this);'>"));  

提交时候的那个js触发是关键,不然编辑器里的值是没办法传递的!

需要提前加载js调用

[php] view plaincopy在CODE上查看代码片派生到我的代码片
  1. echo <<<EOT  
  2. <script type="text/javascript" src="static/image/editor/editor_function.js"></script>  
  3. <script type="text/JavaScript">  
  4. function validate(obj) {  
  5.        edit_save();  
  6.     window.onbeforeunload = null;  
  7.     obj.form.submit();  
  8.     return false;  
  9. }  
  10. </script>  
  11. EOT;  


本帖永久访问地址:http://blog.csdn.net/kof820/article/details/18053029


综上!over!如果我的方法解决了你的问题,希望回个贴哦!!

如需转帖请注明出处哦!!谢谢!生气

0 0