很不错的一个UBB代码

2016-02-19 12:08 5 1 收藏

下面,图老师小编带您去了解一下很不错的一个UBB代码,生活就是不断的发现新事物,get新技能~

【 tulaoshi.com - Web开发 】

%
Function HTMLEncode(ByVal strValue)
 '忽略错误
 On Error Resume Next
 '定义变量
 Dim strNewValue
 If strValue  "" Then
  strNewValue = Replace(strValue,"","")
  strNewValue = Replace(strNewValue,"","")
  strNewValue = Replace(strNewValue,"'","'")
  strNewValue = Replace(strNewValue,"""",""")
  strNewValue = Replace(strNewValue,vbCrLf,"br")
  strNewValue = Replace(strNewValue," "," ")
 End If
 HTMLEncode = strNewValue
 '输出错误
 If Err.Number0 Then
  Response.Write Err.Description
  Response.End
 End If
End Function

Function UBBCode(strValue) 
Dim RegExp 
'strValue=HTMLEncode(strValue)
Set RegExp=New RegExp 
RegExp.IgnoreCase =True 
RegExp.Global=True 

If strValue  "" Then
RegExp.Pattern="([IMG])(.[^[]*)([/IMG])" 
strValue=RegExp.Replace(strValue,"a href=""$2"" target=_blankIMG SRC=""$2"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.widthscreen.width-333)this.width=screen.width-333""/a") 

RegExp.Pattern="([FLASH])(.[^[]*)([/FLASH])" 
strValue=RegExp.Replace(strValue,"OBJECT codebase=""http://download.macromedia.com/pub/sho ... h/swflash.cab#version=4,0,2,0"" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400 id=ShockwaveFlash1PARAM NAME=movie VALUE=""$2""PARAM NAME=quality VALUE=highembed src=""$2"" quality=high pluginspage=""") ' target=_blank rel=nofollow>http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""appl ... 00 height=400/embed/OBJECT") 

RegExp.Pattern="([ZIP])(.[^[]*)([/ZIP])" 
strValue=RegExp.Replace(strValue,"bra href=""$2""点击下载该文件/a") 

RegExp.Pattern="([RAR])(.[^[]*)([/RAR])" 
strValue=RegExp.Replace(strValue,"bra href=""$2""点击下载该文件/a") 

'RegExp.Pattern="([UPLOAD=(.[^[]*)])(.[^[]*)([/UPLOAD])" 
'strValue=RegExp.Replace(strValue,"brIMG SRC=""$2.gif"" border=0 A HREF=""$3"" TARGET=_blank点击查看或下载该文件/A") 
'strValue=RegExp.Replace(strValue,"brIMG SRC=""$2.gif"" border=0此主题相关图片如下:brA HREF=""$3"" TARGET=_blankIMG SRC=""$3"" border=0 alt=按此在新窗口浏览图片 onload=""javascript:if(this.widthscreen.width-333)this.width=screen.width-333""/A") 

RegExp.Pattern="([URL])(http://.[^[]*)([/URL])" 
strValue=RegExp.Replace(strValue,"A HREF=""$2"" TARGET=_blank$2/A") 

RegExp.Pattern="([URL])(.[^[]*)([/URL])" 
strValue=RegExp.Replace(strValue,"A HREF=""$2") ' target=_blank rel=nofollow>http://$2"" TARGET= ... t;/A") 

RegExp.Pattern="(*)])(.[^[]*)([/URL])" 
strValue=RegExp.Replace(strValue,"A HREF=""$2"" TARGET=_blank$3/A") 

RegExp.Pattern="([URL=(.[^[]*)])(.[^[]*)([/URL])" 
strValue=RegExp.Replace(strValue,"A HREF=""[url]http://$2"" TARGET=_blank$3/A") 

RegExp.Pattern="([EMAIL])(S+@.[^[]*)([/EMAIL])" 
strValue=RegExp.Replace(strValue,"A HREF=""mailto:$2""$2/A") 

RegExp.Pattern="([EMAIL=(S+@.[^[]*)])(.[^[]*)([/EMAIL])" 
strValue=RegExp.Replace(strValue,"A HREF=""mailto:$2"" TARGET=_blank$3/A") 

RegExp.Pattern = "^(http://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "(http://[A-Za-z0-9./=?%-&_~`@':+!]+)$" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "[^=""](http://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "^(ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "(ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)$" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "[^=""](ftp://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "^(rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "(rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)$" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "[^=""](rtsp://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "^(mms://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "(mms://[A-Za-z0-9./=?%-&_~`@':+!]+)$" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern = "[^=""](mms://[A-Za-z0-9./=?%-&_~`@':+!]+)" 
strValue=RegExp.Replace(strValue,"a target=_blank href=$1$1/a") 

RegExp.Pattern="([HTML])(.[^[]*)([/HTML])" 
strValue=RegExp.Replace(strValue,"table width='100%' border='0' cellspacing='0' cellpadding='6' bgcolor='#FFFFFF'tdb以下内容为程序代码:/bbr$2/td/table") 

RegExp.Pattern="([code])(.[^[]*)([/code])" 
strValue=RegExp.Replace(strValue,"table width='100%' border='0' cellspacing='0' cellpadding='6' bgcolor='#FFFFFF'tdb以下内容为程序代码:/bbr$2/td/table") 

RegExp.Pattern="([color=(.[^[]*)])(.[^[]*)([/color])" 
strValue=RegExp.Replace(strValue,"font color=$2$3/font") 

RegExp.Pattern="([face=(.[^[]*)])(.[^[]*)([/face])" 
strValue=RegExp.Replace(strValue,"font face=$2$3/font") 

RegExp.Pattern="([align=(.[^[]*)])(.*)([/align])" 
strValue=RegExp.Replace(strValue,"div align=$2$3/div") 

RegExp.Pattern="([QUOTE])(.*)([/QUOTE])" 
strValue=RegExp.Replace(strValue,"table cellpadding=0 cellspacing=0 border=0 WIDTH=94% bgcolor=#000000 align=centertrtdtable width=100% cellpadding=5 cellspacing=1 border=0TRTD BGCOLOR='#FFFFFF'$2/table/tablebr") 

RegExp.Pattern="([fly])(.*)([/fly])" 
strValue=RegExp.Replace(strValue,"marquee width=90% behavior=alternate scrollamount=3$2/marquee") 

RegExp.Pattern="([move])(.*)([/move])" 
strValue=RegExp.Replace(strValue,"MARQUEE scrollamount=3$2/marquee")  

RegExp.Pattern="[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)](.[^[]*)[/GLOW]" 
strValue=RegExp.Replace(strValue,"table width=$1 style=""filter:glow(color=$2, strength=$3)""$4/table") 

RegExp.Pattern="[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)](.[^[]*)[/SHADOW]" 
strValue=RegExp.Replace(strValue,"table width=$1 style=""filter:shadow(color=$2, strength=$3)""$4/table") 

RegExp.Pattern="([i])(.[^[]*)([/i])" 
strValue=RegExp.Replace(strValue,"i$2/i") 

RegExp.Pattern="([u])(.[^[]*)([/u])" 
strValue=RegExp.Replace(strValue,"u$2/u") 

RegExp.Pattern="([b])(.[^[]*)([/b])" 
strValue=RegExp.Replace(strValue,"b$2/b") 

RegExp.Pattern="([fly])(.[^[]*)([/fly])" 
strValue=RegExp.Replace(strValue,"marquee$2/marquee") 

RegExp.Pattern="([size=1])(.[^[]*)([/size])" 
strValue=RegExp.Replace(strValue,"font size=1$2/font") 

RegExp.Pattern="([size=2])(.[^[]*)([/size])" 
strValue=RegExp.Replace(strValue,"font size=2$2/font") 

RegExp.Pattern="([size=3])(.[^[]*)([/size])" 
strValue=RegExp.Replace(strValue,"font size=3$2/font") 

RegExp.Pattern="([size=4])(.[^[]*)([/size])" 
strValue=RegExp.Replace(strValue,"font size=4$2/font") 

RegExp.Pattern="([center])(.[^[]*)([/center])" 
strValue=RegExp.Replace(strValue,"center$2/center") 
End If
Set RegExp=Nothing 
UBBCode=strValue 

'输出错误
If Err.Number0 Then
  Response.Write Err.Description
  Response.End
End If
End Function
%
调用:%=UBBCode(Content)%

来源:https://www.tulaoshi.com/n/20160219/1599953.html

延伸阅读
标签: 养生食谱
卷饼的做法 自制卷饼味道很不错 卷饼是人们喜爱吃的一种食物之一,现在已经被人多人所喜爱,之所以被喜爱,是因为他可以根据广大食客的喜爱替换食材,满足大家的要求。那么大家知道卷饼的做法吗?卷饼怎么做好吃呢?下面图老师小编就为大家介绍一下卷饼的做法大全吧。 美味卷饼 材料 春饼,酱肉,黄瓜,...
标签: 养生食谱
烤茄子的做法 自制烤茄子味道很不错 烤茄子是一种很好吃的做法,这样做出来的茄子味道很美味,口感也很爽口,那么大家知道烤茄子的做法吗?烤茄子怎么做好吃呢?下面图老师小编就为大家介绍一下烤茄子的做法大全吧。 烤茄子的做法很多,也很简单,下面这几种做法味道都很不错,喜欢的朋友不妨动手试试看。 做法一...
标签: 养生食谱
黑豆红枣汤 美容养颜汤很不错 黑豆红枣汤是女性朋友喜爱的食物,黑豆红枣汤具有一定的滋补功效,多吃黑豆红枣汤对人体有很大的好处,那么大家知道黑豆红枣汤的做法吗?知道黑豆红枣汤怎么做好吃呢?如果你想了解一下的话,图老师小编就为大家介绍一下黑豆红枣汤的做法大全吧。 苹果银耳红枣汤 材料:银耳,苹果...
标签: 眉粉 画眉 眉毛
SUQQU三色眉粉01苔绿色 粉压的不会很硬,但是也不会飞粉,上手比较快。如果是粗黑眉可能需要多叠加几次,但是日常画画是没有问题。绿色很适合黑粗眉,上脸后不是绿色,会比较发灰,而且对于黑粗眉来说,眉毛呈现一种毛绒绒的质感,比较可爱。必赢色略微发黄一点,并且也不是很好取粉,还会有点结块。配套的刷子是一个眉刷和鼻影刷,眉刷出...
《狂怒》真的很不错!为其正名! 好吧,鉴于许多人说对狂怒很失望,本人决定出来为其正名: 首先说说优点: 1. 画面,全场稳定在60帧,开到极致选项也是如此,灰常给力!我玩过的大作还未碰到这样的,当然CS除外 2.射击感:个人觉的比COD,MOH系列好多了!操作感设计感超爽! 3.游戏性:射击,赛车,小游戏等(目前进度慢,没完成) 4.武器:武器...

经验教程

700

收藏

25
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部