Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] ubb for DZ4.0

[复制链接]
九天 发表于 2005-12-14 13:32:45 | 显示全部楼层 |阅读模式
打开
templates/default/post_bbinsert.htm

找:

  1. <!--{if $bbinsert}-->
复制代码

在下面加上:

  1. <script>
  2. function html_trans(str) {
  3. str = str.replace(/\r/g,"");
  4. str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
  5. str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
  6. str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"[url=$1]$2[/url]");
  7. str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[color=$1]$2[/color]");
  8. str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"[img]$1[/img]");
  9. str = str.replace(/<([\/]?)b>/ig,"[$1b]");
  10. str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
  11. str = str.replace(/<([\/]?)u>/ig,"[$1u]");
  12. str = str.replace(/<([\/]?)i>/ig,"[$1i]");
  13. str = str.replace(/ /g," ");
  14. str = str.replace(/&/g,"&");
  15. str = str.replace(/"/g,""");
  16. str = str.replace(/&lt;/g,"<");
  17. str = str.replace(/&gt;/g,">");
  18. str = str.replace(/<br>/ig,"\n");
  19. str = str.replace(/<[^>]*?>/g,"");
  20. str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
  21. str = str.replace(/\n+/g,"\n");
  22. return str;
  23. }
  24. function trans(){
  25. var str = "";
  26. rtf.focus();
  27. rtf.document.body.innerHTML = "";
  28. rtf.document.execCommand("paste");
  29. str = rtf.document.body.innerHTML;
  30. if(str.length == 0) {
  31. alert("剪切版不存在超文本数据!");
  32. return "";
  33. }
  34. return html_trans(str);
  35. }
  36. </script>
复制代码

再找:

  1. <a href="javascript:alipay()"><img src="{IMGDIR}/bb_alipay.gif" border="0" alt="{lang post_discuzcode_alipay}"></a>
复制代码

在下面加上:

  1.     <iframe scrolling="no" id="rtf" src="about:blank" MARGINHEIGHT="0" MARGINWIDTH="0" style="width:0px; height:0px;"></iframe>
  2.             <span style=cursor:hand onclick="document.getElementById('message').value += trans()"><img src="{IMGDIR}/bb_ub2.gif" border="0" alt="自动帖超文本"></span>
  3.     <SCRIPT>
  4. rtf.document.designMode="On";
  5. </SCRIPT>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
踏雪无痕㊣ 发表于 2005-12-14 13:34:23 | 显示全部楼层
这个不错,占个沙发先
回复

使用道具 举报

青春E族 发表于 2005-12-14 13:36:13 | 显示全部楼层
太酷了,顶,不过这个图片能不能美化成D4的那种,好像不太好看哦.
回复

使用道具 举报

天才白痴梦 发表于 2005-12-14 13:53:36 | 显示全部楼层
干什么用的 呼...........
回复

使用道具 举报

cpanel 发表于 2005-12-14 13:56:53 | 显示全部楼层
我提供一个好看点的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

天才白痴梦 发表于 2005-12-14 14:02:08 | 显示全部楼层
转贴工具?
回复

使用道具 举报

cpanel 发表于 2005-12-14 14:04:03 | 显示全部楼层
也似
回复

使用道具 举报

cpanel 发表于 2005-12-14 14:04:20 | 显示全部楼层
集成到论坛的转贴工具
回复

使用道具 举报

天才白痴梦 发表于 2005-12-14 14:09:28 | 显示全部楼层
不错 不错  不过就是麻烦点

还有 就是不能   在快速回复的地方用

有很多论坛都是  在输入内容框的下面有一个 按钮的
回复

使用道具 举报

yqlb 发表于 2005-12-14 15:10:00 | 显示全部楼层

在所有的发帖和回复框上都加入UBB转换

打开

include/common.js

在最后加上:
  1. function html_trans(str) {
  2. str = str.replace(/\r/g,"");
  3. str = str.replace(/on(load|click|dbclick|mouseover|mousedown|mouseup)="[^"]+"/ig,"");
  4. str = str.replace(/<script[^>]*?>([\w\W]*?)<\/script>/ig,"");
  5. str = str.replace(/<a[^>]+href="([^"]+)"[^>]*>(.*?)<\/a>/ig,"[url=$1]$2[/url]");
  6. str = str.replace(/<font[^>]+color=([^ >]+)[^>]*>(.*?)<\/font>/ig,"[color=$1]$2[/color]");
  7. str = str.replace(/<img[^>]+src="([^"]+)"[^>]*>/ig,"[img]$1[/img]");
  8. str = str.replace(/<([\/]?)b>/ig,"[$1b]");
  9. str = str.replace(/<([\/]?)strong>/ig,"[$1b]");
  10. str = str.replace(/<([\/]?)u>/ig,"[$1u]");
  11. str = str.replace(/<([\/]?)i>/ig,"[$1i]");
  12. str = str.replace(/ /g," ");
  13. str = str.replace(/&/g,"&");
  14. str = str.replace(/"/g,""");
  15. str = str.replace(/&lt;/g,"<");
  16. str = str.replace(/&gt;/g,">");
  17. str = str.replace(/<br>/ig,"\n");
  18. str = str.replace(/<[^>]*?>/g,"");
  19. str = str.replace(/\[url=([^\]]+)\]\n(\[img\]\1\[\/img\])\n\[\/url\]/g,"$2");
  20. str = str.replace(/\n+/g,"\n");
  21. return str;
  22. }
  23. function trans(){
  24. var str = "";
  25. rtf.focus();
  26. rtf.document.body.innerHTML = "";
  27. rtf.document.execCommand("paste");
  28. str = rtf.document.body.innerHTML;
  29. if(str.length == 0) {
  30. alert("剪切版不存在超文本数据!");
  31. return "";
  32. }
  33. return html_trans(str);
  34. }
复制代码


打开
templates/default/post_bbinsert.htm

查找
  1. <a href="javascript:alipay()"><img src="{IMGDIR}/bb_alipay.gif" border="0" alt="{lang post_discuzcode_alipay}"></a>
复制代码


在下面加上:
  1. <iframe scrolling="no" id="rtf" src="about:blank" MARGINHEIGHT="0" MARGINWIDTH="0" style="width:0px; height:0px;"></iframe>
  2.             <span style=cursor:hand onclick="document.getElementById('message').value += trans()"><img src="{IMGDIR}/bb_ub2.gif" border="0" alt="自动帖超文本"></span>
  3.     <SCRIPT>
  4. rtf.document.designMode="On";
  5. </SCRIPT>
复制代码

图片见一楼。

打开
templates/default/viewthread.htm

查找
  1. <input type="reset" name="topicsreset" value="{lang post_topicreset}" tabindex="5">&nbsp; &nbsp;
复制代码


在后面加入
  1. <iframe scrolling="no" id="rtf" src="about:blank" MARGINHEIGHT="0" MARGINWIDTH="0" style="width:0px; height:0px;"></iframe>
  2.             <input type="button" style=cursor:hand onclick="document.getElementById('message').value += trans()" value="转换数据">
  3.     <SCRIPT>
  4. rtf.document.designMode="On";
  5. </SCRIPT>&nbsp; &nbsp;
复制代码


打开
templates/default/forumdisplay.htm

查找
  1. <input type="reset" name="topicsreset" value="{lang post_topicreset}" tabindex="5">&nbsp; &nbsp;
复制代码


在后面加入
  1. <iframe scrolling="no" id="rtf" src="about:blank" MARGINHEIGHT="0" MARGINWIDTH="0" style="width:0px; height:0px;"></iframe>
  2.             <input type="button" style=cursor:hand onclick="document.getElementById('message').value += trans()" value="转换数据">
  3.     <SCRIPT>
  4. rtf.document.designMode="On";
  5. </SCRIPT>&nbsp; &nbsp;
复制代码


演示: http://bbs.best4u.cn/

[ 本帖最后由 yqlb 于 2005-12-14 18:09 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-6 04:13 , Processed in 0.283778 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表