<%
'===========PBlog2 UBB代码转换代码==========
' Author:PuterJam
' Copryright PBlog2
' Update: 2005-12-29
'===========================================
Function UBBCode(ByVal strContent,DisSM,DisUBB,DisIMG,AutoURL,AutoKEY)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
Dim re, strMatchs, strMatch, rndID,tmpStr1,tmpStr2,tmpStr3,tmpStr4
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
IF AutoURL=1 Then
re.Pattern="([^=\]][\s]*?|^)(http|https|rstp|ftp|mms|ed2k)://([A-Za-z0-9\.\/=\?%\-_~`@':+!]*)"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,tmpStr1&"<a href="""&tmpStr2&"://"&tmpStr3&""" target=""_blank"">"&tmpStr2&"://"&tmpStr3&"</a>",1,-1,0)
Next
're.Pattern="(^|\s)(www\.\S+)"
'strContent=re.Replace(strContent,"$1<a href=""http://$2"" target=""_blank"">$2</a>")
End IF
IF Not DisUBB=1 Then
IF Not DisIMG=1 Then
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<img src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<img align="""&tmpStr1&""" src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(\d*|),(\d*|)\](.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,"<img width="""&tmpStr1&""" height="""&tmpStr2&""" src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(\d*|),(\d*|),(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
tmpStr4=checkURL(strMatch.SubMatches(3))
strContent=replace(strContent,strMatch.Value,"<img width="""&tmpStr1&""" height="""&tmpStr2&""" align="""&tmpStr3&""" src="/UploadFiles/2021-04-02/"> Next
else
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr1&""" target=""_blank"" title="""&tmpStr1&"""><img src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=checkURL(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr2&""" target=""_blank"" title="""&tmpStr2&"""><img src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(\d*|),(\d*|)\](.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=checkURL(strMatch.SubMatches(2))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr3&""" target=""_blank"" title="""&tmpStr3&"""><img src="/UploadFiles/2021-04-02/"> Next
re.Pattern="\[img=(\d*|),(\d*|),(left|right|center|absmiddle|)\](.[^\]]*)(\[\/img\])"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=strMatch.SubMatches(0)
tmpStr2=strMatch.SubMatches(1)
tmpStr3=strMatch.SubMatches(2)
tmpStr4=checkURL(strMatch.SubMatches(3))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr4&""" target=""_blank"" title="""&tmpStr4&"""><img src="/UploadFiles/2021-04-02/"> Next
End IF
'-----------多媒体标签----------------
re.Pattern="\[(swf|wma|wmv|rm|ra|qt)(=\d*?|)(,\d*?|)\]([^<>]*?)\[\/(swf|wma|wmv|rm|ra|qt)\]"
Set strMatchs=re.Execute(strContent)
dim strType,strWidth,strHeight,strSRC,TitleText
For Each strMatch in strMatchs
RAndomize
strType=strMatch.SubMatches(0)
if strType="swf" then
TitleText="<img src="/UploadFiles/2021-04-02/"> elseif strType="wma" then
TitleText="<img src=""> elseif strType="wmv" then
TitleText="<img src=""> elseif strType="rm" then
TitleText="<img src=""> elseif strType="ra" then
TitleText="<img src=""> elseif strType="qt" then
TitleText="<img src=""> end if
strWidth=strMatch.SubMatches(1)
strHeight=strMatch.SubMatches(2)
if (len(strWidth)=0) then
strWidth="400"
else
strWidth=right(strWidth,(len(strWidth)-1))
end if
if (len(strHeight)=0) then
strHeight="300"
else
strHeight=right(strHeight,(len(strHeight)-1))
end if
strSRC=checkURL(strMatch.SubMatches(3))
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div class=""UBBPanel""><div class=""UBBTitle"">"&TitleText&"</div><div class=""UBBContent""><a id="""+rndID+"_href"" href=""javascript:MediaShow('"+strType+"','"+rndID+"','"+strSRC+"','"+strWidth+"','"+strHeight+"')""><img name="""+rndID+"_img"" src="/UploadFiles/2021-04-02/"> Next
Set strMatchs=nothing
re.Pattern="(\[mid\])(.[^\]]*)\[\/mid\]"
strContent= re.Replace(strContent,"<embed src="/UploadFiles/2021-04-02/">'-----------常规标签----------------
re.Pattern = "\[url=(.[^\]]*)\](.[^\[]*)\[\/url]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<a target=""_blank"" href="""&tmpStr1&""">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[url](.[^\[]*)\[\/url]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<a target=""_blank"" href="""&tmpStr1&""">"&tmpStr1&"</a>",1,-1,0)
Next
re.Pattern = "\[ed2k=([^\r]*?)\]([^\r]*?)\[\/ed2k]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img border="""" src="/UploadFiles/2021-04-02/"> Next
re.Pattern = "\[ed2k]([^\r]*?)\[\/ed2k]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<img border="""" src="/UploadFiles/2021-04-02/"> Next
re.Pattern = "\[email=(.[^\]]*)\](.[^\[]*)\[\/email]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<a href=""mailto:"&tmpStr1&""">"&tmpStr2&"</a>",1,-1,0)
Next
re.Pattern = "\[email](.[^\[]*)\[\/email]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<a href=""mailto:"&tmpStr1&""">"&tmpStr1&"</a>",1,-1,0)
Next
'-----------字体格式----------------
re.Pattern="\[align=(\w{4,6})\]([^\r]*?)\[\/align\]"
strContent=re.Replace(strContent,"<div align=""$1"">$2</div>")
re.Pattern="\[color=(#\w{3,10}|\w{3,10})\]([^\r]*?)\[\/color\]"
strContent=re.Replace(strContent,"<span style=""color:$1"">$2</span>")
re.Pattern="\[size=(\d{1,2})\]([^\r]*?)\[\/size\]"
strContent=re.Replace(strContent,"<span style=""font-size:$1pt"">$2</span>")
re.Pattern="\[font=([^\r]*?)\]([^\r]*?)\[\/font\]"
strContent=re.Replace(strContent,"<span style=""font-family:$1"">$2</span>")
re.Pattern="\[b\]([^\r]*?)\[\/b\]"
strContent=re.Replace(strContent,"<strong>$1</strong>")
re.Pattern="\[i\]([^\r]*?)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")
re.Pattern="\[u\]([^\r]*?)\[\/u\]"
strContent=re.Replace(strContent,"<u>$1</u>")
re.Pattern="\[s\]([^\r]*?)\[\/s\]"
strContent=re.Replace(strContent,"<s>$1</s>")
re.Pattern="\[sup\]([^\r]*?)\[\/sup\]"
strContent=re.Replace(strContent,"<sup>$1</sup>")
re.Pattern="\[sub\]([^\r]*?)\[\/sub\]"
strContent=re.Replace(strContent,"<sub>$1</sub>")
re.Pattern="\[fly\]([^\r]*?)\[\/fly\]"
strContent=re.Replace(strContent,"<marquee width=""90%"" behavior=""alternate"" scrollamount=""3"">$1</marquee>")
End IF
'-----------特殊标签----------------
re.Pattern = "\[down=(.[^\]]*)\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
strContent=replace(strContent,strMatch.Value,"<img src="/UploadFiles/2021-04-02/"> Next
re.Pattern = "\[down\](.[^\[]*)\[\/down]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
strContent=replace(strContent,strMatch.Value,"<img src="/UploadFiles/2021-04-02/"> Next
re.Pattern = "\[mDown=(.[^\]]*)\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
tmpStr2=strMatch.SubMatches(1)
if len(memName)>0 then
strContent=replace(strContent,strMatch.Value,"<img src="/UploadFiles/2021-04-02/"> else
strContent=replace(strContent,strMatch.Value,"<img src=""> end if
Next
re.Pattern = "\[mDown\](.[^\[]*)\[\/mDown]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=checkURL(strMatch.SubMatches(0))
if len(memName)>0 then
strContent=replace(strContent,strMatch.Value,"<img src="/UploadFiles/2021-04-02/"> else
strContent=replace(strContent,strMatch.Value,"<img src=""> end if
Next
re.Pattern="\[code\](.*?)\[\/code\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/">
re.Pattern="\[quote\](.*?)\[\/quote\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/"> re.Pattern="\[quote=(.[^\]]*)\](.*?)\[\/quote\]"
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/">
re.Pattern="\[hidden\](.*?)\[\/hidden\]"
if len(memName)>0 then
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/"> else
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""> end if
re.Pattern="\[hidden=(.[^\]]*)\](.*?)\[\/hidden\]"
if len(memName)>0 then
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/"> else
strContent= re.Replace(strContent,"<div class=""UBBPanel""><div class=""UBBTitle""><img src=""> end if
re.Pattern="\[html\](.*?)\[\/html\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
RAndomize
rndID="temp"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<div class=""UBBPanel""><div class=""UBBTitle""><img src="/UploadFiles/2021-04-02/"> Next
Set strMatchs=nothing
'-----------List标签----------------
strContent = Replace(strContent,"[list]","<ul>")
re.Pattern = "\[list=(.[^\]]*)\]"
strContent = re.Replace(strContent,"<ul style=""list-style-type:$1"">")
re.Pattern = "\[\*\](.[^\[]*)(\n|)"
strContent = re.Replace(strContent,"<li>$1</li>")
strContent = Replace(strContent,"[/list]","</ul>")
'-----------表情图标----------------
IF Not DisSM=1 Then
dim log_Smilies,log_SmiliesContent
For Each log_Smilies IN Arr_Smilies
log_SmiliesContent=Split(log_Smilies,"|")
strContent=Replace(strContent,log_SmiliesContent(2)," <img src="/UploadFiles/2021-04-02/"> Next
End IF
'-----------关键词识别----------------
IF AutoKEY=1 Then
dim log_Keywords,log_KeywordsContent
For Each log_Keywords IN Arr_Keywords
log_KeywordsContent=Split(log_Keywords,"$|$")
IF log_KeywordsContent(3)<>"None" Then
strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank""><img src=""> Else
strContent=Replace(strContent,log_KeywordsContent(1),"<a href="""&log_KeywordsContent(2)&""" target=""_blank"">"&log_KeywordsContent(1)&"</a>")
End IF
Next
End IF
Set re=Nothing
UBBCode=strContent
End IF
End Function
%>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]