📄 ubbcode.aspx.vb
字号:
' ***************************************************
' * 本程序由AspToAspX风火轮0.99转换生成 *
' * http://Www.AspToAspX.Cn *
' * Q Q : 139227536 *
' * QQ群: 17152722 *
' * MSN : gzliangjianhua@hotmail.com *
' * EMail AspToDll@vip.163.com *
' ***************************************************
Imports Microsoft.VisualBasic
Imports System.Web
Imports System.Math
Imports System.Web.SessionState
Public Class _INC_UBBCODE
Public AspToAspX_Host_Class_Object As Object
Dim _aspx_AspToAspX_Str
#Region "..."
Public Sub AspToAspX_InitIncludeFiles()
End Sub
Public Sub AspToAspX_UnloadIncludeFiles()
End Sub
#End Region
Public Sub AspToAspX_Page_Init()
On Error GoTo _AspToAspX_Err
Response.Write ( vbCrLf )
Exit Sub
_AspToAspX_Err:
AspToAspX_WriteLog ("ubbcode_aspx Page_Init:" & Err.Description)
Resume Next
End Sub
'E:\FTBBS_UTF8_7.0\UPLOAD\INC\UBBCODE.ASP
Function UBBCode(ByRef strContent )
On Error GoTo _AspToAspX_Err
Dim re
Dim reContent
strContent = FilterJS ( strContent ) '3
re = New VBScript_RegExp_55.RegExp '7
re.IgnoreCase = true '8
re.Global = True '9
re.Pattern = "\[img\](.[^\[]*)\[\/img\]" '12
strContent = re.Replace ( strContent , "<a href=""$1"" target=""_blank""><img src=""$1"" border=0 alt=""按此在新窗口浏览图片"" resize=""1""></a>" ) '13
re.Pattern = "\[upload=(.[^\[]*)\](.[^\[]*)\[\/upload\]" '14
strContent = re.Replace ( strContent , "<a href=""$2"">点击下载该文件</a>" ) '15
re.Pattern = "(\[mp=(.[^\[]*),(.[^\[]*),(.[^\[]*)\])(.[^\[]*)(\[\/mp\])" '16
strContent = re.Replace ( strContent , "<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=$2 height=$3 ><param name=ShowStatusBar value=-1><param name=Filename value=$5><param name=AutoStart value=$4><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src=$5 width=$2 height=$3></embed></object>" ) '17
re.Pattern = "(\[rm=(.[^\[]*),(.[^\[]*),(.[^\[]*)\])(.[^\[]*)(\[\/rm\])" '18
strContent = re.Replace ( strContent , "<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA class=OBJECT id=RAOCX width=$2 height=$3><PARAM NAME=SRC VALUE=$5><PARAM NAME=CONSOLE VALUE=Clip1><PARAM NAME=CONTROLS VALUE=imagewindow><PARAM NAME=AUTOSTART VALUE=$4></OBJECT><br><OBJECT classid=CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA height=32 id=video2 width=$2><PARAM NAME=SRC VALUE=$5><PARAM NAME=AUTOSTART VALUE=$4><PARAM NAME=CONTROLS VALUE=controlpanel><PARAM NAME=CONSOLE VALUE=Clip1></OBJECT>" ) '19
re.Pattern = "(\[flv=(.[^\[]*),(.[^\[]*),(.[^\[]*)\])(.[^\[]*)(\[\/flv\])" '20
strContent = re.Replace ( strContent , "<object type=""application/x-shockwave-flash"" data=""../flv/ftplayer.swf?xml=<vcastr>" & "<channel><item><source>$5</source><duration></duration><title></title></item></channel></vcastr>"" width=""$2"" height=""$3"" id=""ftbbs"">" & "<param name=""movie"" value=""../flv/ftplayer.swf?xml=<vcastr><channel><item><source>$5</source><duration></duration><title></title></item></channel><config>" & "<bufferTime>4</bufferTime>" & "<contralPanelAlpha>0.75</contralPanelAlpha>" & "<controlPanelBgColor>0x000000</controlPanelBgColor>" & "<controlPanelBtnColor>0xffffff</controlPanelBtnColor>" & "<contralPanelBtnGlowColro>0xffff00</contralPanelBtnGlowColro>" & "<controlPanelMode>float</controlPanelMode>" & "<defautVolume>0.8</defautVolume>" & "<isAutoPlay>true</isAutoPlay>" & "<isLoadBegin>$4</isLoadBegin>" & "<isShowAbout>true</isShowAbout>" & "<scaleMode>showAll</scaleMode></config>" & "<plugIns><logoPlugIn><url>../flv/LogoPlugIn.swf</url><logoText>FTBBS.CN</logoText><logoTextAlpha>0.75</logoTextAlpha><logoTextFontSize>30</logoTextFontSize>" & "<logoTextColor>0xffffff</logoTextColor><textMargin>0 auto auto 10</textMargin></logoPlugIn></plugIns></vcastr>"" />" & "<param name=""allowFullScreen"" value=""true"" /></object>" ) '21
re.Pattern = "(\[flash\])(.[^\[]*)(\[\/flash\])" '22
strContent = re.Replace ( strContent , "<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=""$2""><PARAM NAME=quality VALUE=high><embed src=""$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shockwaveflash' type='application/x-shockwave-flash' width=500 height=400>$2</embed></OBJECT>" ) '23
re.Pattern = "(\[flash=*([0-9]*),*([0-9]*)\])(.[^\[]*)(\[\/flash\])" '24
strContent = re.Replace ( strContent , "<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3><PARAM NAME=movie VALUE=""$4""><PARAM NAME=quality VALUE=high><embed src=""$4"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shockwaveflash' type='application/x-shockwave-flash' width=$2 height=$3>$4</embed></OBJECT>" ) '25
re.Pattern = "(\[url\])(.[^\[]*)(\[\/url\])" '26
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$2</font></A>" ) '27
re.Pattern = "(\[url=(.[^\[]*)\])(.[^\[]*)(\[\/url\])" '28
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$3</font></A>" ) '29
re.Pattern = "(\[html\])(.[^\[]*)(\[\/html\])" '30
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$2</font></A>" ) '31
re.Pattern = "(\[html=(.[^\[]*)\])(.[^\[]*)(\[\/html\])" '32
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$3</font></A>" ) '33
re.Pattern = "(\[email\])(\S+\@.[^\[]*)(\[\/email\])" '34
strContent = re.Replace ( strContent , "<A HREF=""mailto:$2"">$2</A>" ) '35
re.Pattern = "(\[email=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/email\])" '36
strContent = re.Replace ( strContent , "<A HREF=""mailto:$2"" TARGET=_blank>$3</A>" ) '37
re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)" '39
strContent = re.Replace ( strContent , "<a target=_blank href=$1>$1</a>" ) '40
re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$" '41
strContent = re.Replace ( strContent , "<a target=_blank href=$1>$1</a>" ) '42
re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)" '43
strContent = re.Replace ( strContent , "$1<a target=_blank href=$2>$2</a>" ) '44
re.Pattern = "([^(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)" '46
strContent = re.Replace ( strContent , "<a target=_blank href=http://$2>$2</a>" ) '47
re.Pattern = "\[html\](.[^\[]*)\[\/html\]" '51
strContent = re.Replace ( strContent , "<table width='100%' border='0' cellspacing='0' cellpadding='6'><td><b>以下内容为程序代码:</b><br>$1</td></table>" ) '52
re.Pattern = "\[code\](.[^\[]*)\[\/code\]" '53
strContent = re.Replace ( strContent , "<table width='100%' border='0' cellspacing='0' cellpadding='6'><td><b>以下内容为程序代码:</b><br>$1</td></table>" ) '54
re.Pattern = "\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]" '55
strContent = re.Replace ( strContent , "<font color=$1>$2</font>" ) '56
re.Pattern = "\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]" '57
strContent = re.Replace ( strContent , "<font face=$1>$2</font>" ) '58
re.Pattern = "\[left\](.*)\[\/left\]" '59
strContent = re.Replace ( strContent , "<div align=left>$1</div>" ) '60
re.Pattern = "\[center\](.*)\[\/center\]" '61
strContent = re.Replace ( strContent , "<div align=center>$1</div>" ) '62
re.Pattern = "\[right\](.*)\[\/right\]" '63
strContent = re.Replace ( strContent , "<div align=right>$1</div>" ) '64
re.Pattern = "\[quote\](.*)\[\/quote\]" '67
strContent = re.Replace ( strContent , "<table style=""width:99%"" cellpadding=5 cellspacing=1 bgcolor=#999999><TR><TD bgcolor=#ffffee>引用:<br>$1</td></tr></table><br>" ) '68
re.Pattern = "\[fly\](.*)\[\/fly\]" '69
strContent = re.Replace ( strContent , "<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>" ) '70
re.Pattern = "\[move\](.*)\[\/move\]" '71
strContent = re.Replace ( strContent , "<marquee scrollamount=3>$1</marquee>" ) '72
re.Pattern = "\[i\](.[^\[]*)\[\/i\]" '73
strContent = re.Replace ( strContent , "<i>$1</i>" ) '74
re.Pattern = "\[u\](.[^\[]*)(\[\/u\])" '75
strContent = re.Replace ( strContent , "<u>$1</u>" ) '76
re.Pattern = "\[b\](.[^\[]*)(\[\/b\])" '77
strContent = re.Replace ( strContent , "<b>$1</b>" ) '78
re.Pattern = "\[size=([1-4])\](.[^\[]*)\[\/size\]" '79
strContent = re.Replace ( strContent , "<font size=$1>$2</font>" ) '80
re.Pattern = "\[strike\](.[^\[]*)(\[\/strike\])" '81
strContent = re.Replace ( strContent , "<strike>$1</strike>" ) '82
re.Pattern = "\[bgcolor=(.[^\[]*)\](.[^\[]*)\[\/bgcolor\]" '83
strContent = re.Replace ( strContent , "<FONT style=$1>$2</FONT>" ) '84
re.Pattern = "\[sup\](.[^\[]*)\[\/sup\]" '85
strContent = re.Replace ( strContent , "<sup>$1</sup>" ) '86
re.Pattern = "\[sub\](.[^\[]*)\[\/sub\]" '87
strContent = re.Replace ( strContent , "<sub>$1</sub>" ) '88
strContent = replace ( strContent , "<I></I>" , "" ) '89
re = Nothing '90
UBBCode = strContent '91
Exit Function
_AspToAspX_Err:
AspToAspX_WriteLog("E:\FTBBS_UTF8_7.0\UPLOAD\INC\UBBCODE.ASP UBBCode:" & Err.Description)
Resume Next
End Function
'E:\FTBBS_UTF8_7.0\UPLOAD\INC\UBBCODE.ASP
Function ftbbsubbcode(ByRef strContent )
On Error GoTo _AspToAspX_Err
Dim re
Dim reContent
strContent = FilterJS ( strContent ) '95
re = New VBScript_RegExp_55.RegExp '98
re.IgnoreCase = true '99
re.Global = True '100
re.Pattern = "\[img\](.[^\[]*)\[\/img\]" '103
strContent = re.Replace ( strContent , "<img src=""$1"" border=0 resize=""2"">" ) '104
re.Pattern = "(\[url\])(.[^\[]*)(\[\/url\])" '105
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$2</font></A>" ) '106
re.Pattern = "(\[url=(.[^\[]*)\])(.[^\[]*)(\[\/url\])" '107
strContent = re.Replace ( strContent , "<A HREF=""$2""><font color=#568AC2>$3</font></A>" ) '108
re.Pattern = "(\[email\])(\S+\@.[^\[]*)(\[\/email\])" '109
strContent = re.Replace ( strContent , "<A HREF=""mailto:$2"">$2</A>" ) '110
re.Pattern = "(\[email=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/email\])" '111
strContent = re.Replace ( strContent , "<A HREF=""mailto:$2"" TARGET=_blank>$3</A>" ) '112
re.Pattern = "\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]" '113
strContent = re.Replace ( strContent , "<font color=$1>$2</font>" ) '114
re.Pattern = "\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]" '115
strContent = re.Replace ( strContent , "<font face=$1>$2</font>" ) '116
re.Pattern = "\[fly\](.*)\[\/fly\]" '117
strContent = re.Replace ( strContent , "<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>" ) '118
re.Pattern = "\[move\](.*)\[\/move\]" '119
strContent = re.Replace ( strContent , "<marquee scrollamount=3>$1</marquee>" ) '120
re.Pattern = "\[i\](.[^\[]*)\[\/i\]" '121
strContent = re.Replace ( strContent , "<i>$1</i>" ) '122
re.Pattern = "\[u\](.[^\[]*)(\[\/u\])" '123
strContent = re.Replace ( strContent , "<u>$1</u>" ) '124
re.Pattern = "\[b\](.[^\[]*)(\[\/b\])" '125
strContent = re.Replace ( strContent , "<b>$1</b>" ) '126
re.Pattern = "\[size=([1-4])\](.[^\[]*)\[\/size\]" '127
strContent = re.Replace ( strContent , "<font size=$1>$2</font>" ) '128
re = Nothing '129
ftbbsubbcode = strContent '130
Exit Function
_AspToAspX_Err:
AspToAspX_WriteLog("E:\FTBBS_UTF8_7.0\UPLOAD\INC\UBBCODE.ASP ftbbsubbcode:" & Err.Description)
Resume Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -