/*
* $Id: AutoFilter.java,v 1.1 2003/05/03 12:24:14 acai Exp $
*
* Copyright 2003 Acai Software All Rights Reserved.
*
* This file AutoFilter.java is part of the UBB Code Style Powered by Java.
* The UBB Code Style Powered by Java is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* The UBB Code Style Powered by Java is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with the UBB Code Style Powered by Java; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* http://www.justhis.com
* CONTACT: email = webmaster@justhis.com
*/
package com.justhis.filter;
/*
* TODO
* @author acai
* @version 1.0, 2003-5-3
*/
public class AutoFilter extends RegexFilter {
public AutoFilter(String source) {
super(source);
String picurl = "pic/";
String abgcolor = "#000000";
String FontSize = "12";
String FontHeight = "10";
regex = "(\\[UPLOAD=gif\\])(.[^\\[]*)(\\[\\/UPLOAD\\])";
rpStr = "<br><IMG SRC=\"" + picurl +
"gif.gif\" border=0>此主题相关图片如下:<br><A HREF=\"$2\" TARGET=_blank><IMG SRC=\"$2\" border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>";
this.doFiltration();
regex = "(\\[UPLOAD=jpg\\])(.[^\\[]*)(\\[\\/UPLOAD\\])";
rpStr = "<br><IMG SRC=\"" + picurl +
"jpg.gif\" border=0>此主题相关图片如下:<br><A HREF=\"$2\" TARGET=_blank><IMG SRC=\"$2\" border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>";
this.doFiltration();
regex = "(\\[UPLOAD=bmp\\])(.[^\\[]*)(\\[\\/UPLOAD\\])";
rpStr = "<br><IMG SRC=\"" + picurl +
"bmp.gif\" border=0>此主题相关图片如下:<br><A HREF=\"$2\" TARGET=_blank><IMG SRC=\"$2\" border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>";
this.doFiltration();
regex = "(\\[UPLOAD=(.[^\\[]*)\\])(.[^\\[]*)(\\[\\/UPLOAD\\])";
rpStr = "<br><IMG SRC=\"" + picurl +
"$2.gif\" border=0> <a href=\"$3\">点击浏览该文件</a>";
this.doFiltration();
regex = "(\\[URL\\])(.[^\\[]*)(\\[\\/URL\\])";
rpStr = "<A HREF=\"$2\" TARGET=_blank>$2</A>";
this.doFiltration();
regex = "(\\[URL=(.[^\\[]*)\\])(.[^\\[]*)(\\[\\/URL\\])";
rpStr = "<A HREF=\"$2\" TARGET=_blank>$3</A>";
this.doFiltration();
regex = "(\\[EMAIL\\])(.[^\\[]*)(\\[\\/EMAIL\\])";
rpStr = "<img align=absmiddle src=pic/email1.gif><A HREF=\"mailto:$2\">$2</A>";
this.doFiltration();
regex = "(\\[EMAIL=(.[^\\[]*)\\])(.[^\\[]*)(\\[\\/EMAIL\\])";
rpStr = "<img align=absmiddle src=pic/email1.gif><A HREF=\"mailto:$2\" TARGET=_blank>$3</A>";
this.doFiltration();
regex = "^(http://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "(http://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)$";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "[^>=\"](http://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "^(ftp://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "(ftp://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)$";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "[^>=\"](ftp://[A-Za-z0-9\\.\\/=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "^(rtsp://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "(rtsp://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)$";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "[^>=\"](rtsp://[A-Za-z0-9\\.\\/=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "^(mms://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "(mms://[A-Za-z0-9\\./=\\?%\\-&_~`@':+!]+)$";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "[^>=\"](mms://[A-Za-z0-9\\.\\/=\\?%\\-&_~`@':+!]+)";
rpStr = "<img align=absmiddle src=pic/url.gif><a target=_blank href=$1>$1</a>";
this.doFiltration();
regex = "(\\[HTML\\])(.[^\\[]*)(\\[\\/HTML\\])";
rpStr = "<table width='100%' border='0' cellspacing='0' cellpadding='6' bgcolor='" +
abgcolor + "'><td><b>以下内容为程序代码:</b><br>$2</td></table>";
this.doFiltration();
regex = "(\\[code\\])(.[^\\[]*)(\\[\\/code\\])";
rpStr = "<table width='100%' border='0' cellspacing='0' cellpadding='6' bgcolor='" +
abgcolor + "'><td><b>以下内容为程序代码:</b><br>$2</td></table>";
this.doFiltration();
regex = "(\\[color=(.[^\\[]*)\\])(.[^\\[]*)(\\[\\/color\\])";
rpStr = "<font color=$2 style=\"font-size:" + FontSize +
"pt;line-height:" + FontHeight + "pt\">$3</font>";
this.doFiltration();
regex = "(\\[face=(.[^\\[]*)\\])(.[^\\[]*)(\\[\\/face\\])";
rpStr = "<font face=$2 style=\"font-size:" + FontSize +
"pt;line-height:" + FontHeight + "pt\">$3</font>";
this.doFiltration();
regex = "(\\[align=(.[^\\[]*)\\])(.*)(\\[\\/align\\])";
rpStr = "<div align=$2>$3</div>";
this.doFiltration();
regex = "(\\[QUOTE\\])(.*)(\\[\\/QUOTE\\])";
rpStr = "<table cellpadding=0 cellspacing=0 border=0 WIDTH=94% bgcolor=#000000 align=center><tr><td><table width=100% cellpadding=5 cellspacing=1 border=0><TR><TD BGCOLOR='" +
abgcolor + "'>$2</table></table><br>";
this.doFiltration();
regex = "(\\[fly\\])(.*)(\\[\\/fly\\])";
rpStr = "<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>";
this.doFiltration();
regex = "(\\[move\\])(.*)(\\[\\/move\\])";
rpStr = "<MARQUEE scrollamount=3>$2</marquee>";
this.doFiltration();
regex = "\\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\\](.[^\\[]*)\\[\\/GLOW]";
rpStr = "<table width=$1 style=\"filter:glow(color=$2, strength=$3)\">$4</table>";
this.doFiltration();
regex = "\\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\\](.[^\\[]*)\\[\\/SHADOW]";
rpStr = "<table width=$1 style=\"filter:shadow(color=$2, strength=$3)\">$4</table>";
this.doFiltration();
regex = "(\\[i\\])(.[^\\[]*)(\\[\\/i\\])";
rpStr = "<i>$2</i>";
this.doFiltration();
regex
实现ubb代码的java类
3星 · 超过75%的资源 需积分: 50 196 浏览量
2003-10-05
00:00:00
上传
评论
收藏 31KB RAR 举报
microrain
- 粉丝: 1015
- 资源: 598
最新资源
- DMN3052L-7-F-VB一款SOT23封装N-Channel场效应MOS管
- 111111111111111
- 粒子群算法与遗传算法的对比&串行混合优化仿真 - 基于Rastrigin测试函数 博文对应的代码
- 建设.apk
- DMN3051L-7-F-VB一款SOT23封装N-Channel场效应MOS管
- JAVA+SQL办公自动化系统(源代码+参考文献+外文翻译).zip
- "Java开发+JDK8+API文档+完整参考资料"
- DMN3050S-7-VB一款SOT23封装N-Channel场效应MOS管
- 反取证工具-windows日志全部自动清除工具
- DMN2300U-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈