UBB 转换函数演示 (经典论坛)(7)

re.Pattern="(\[UPLOAD=(.[^\[]*)\])(.*?)(\[\/UPLOAD\])"
 strContent= re.Replace(strContent,"<br><IMG SRC="""https://www.jb51.net/&picurl&"$2.gif"" border=0> <a href=""https://www.jb51.net/article/$3"">点击浏览该文件</a>")

re.Pattern="(\[URL\])(.*?)(\[\/URL\])"
 strContent= re.Replace(strContent,"<A HREF=""https://www.jb51.net/article/$2"" TARGET=_blank>$2</A>")
 re.Pattern="(\[URL=(.[^\[]*)\])(.*?)(\[\/URL\])"
 strContent= re.Replace(strContent,"<A HREF=""https://www.jb51.net/article/$2"" TARGET=_blank>$3</A>")

re.Pattern="(\[EMAIL\])(.*?)(\[\/EMAIL\])"
 strContent= re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/email1.gif><A HREF=""mailto:$2"">$2</A>")
 re.Pattern="(\[EMAIL=(.[^\[]*)\])(.*?)(\[\/EMAIL\])"
 strContent= re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/email1.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")

re.Pattern = "^([A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "([A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "(<BR>|<P>)([A-Za-z0-9\./=\?%\-&_~`@':+!]+)(<BR>|<P>)"
 strContent = re.Replace(strContent,"$1<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$2>$2</a>$3")
 re.Pattern = "^(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "(ftp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "[^>=""](ftp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "^(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "(rtsp://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "[^>=""](rtsp://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "^(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "(mms://[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re.Pattern = "[^>=""](mms://[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)"
 strContent = re.Replace(strContent,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")

if strIcons = "1" then                       '笑脸转换
 re.Pattern="(\["&ImgName&"(.*?)\])"
 strContent=re.Replace(strContent,"<img src="https://www.jb51.net/&picurl&ImgName&"$2.gif border=0 align=middle>")
 end if

if strSmile = "1" then                       '笑脸转换
 re.Pattern="(\[s(\d{1,2})\])"
 strContent=re.Replace(strContent,"<img src=https://www.jb51.net/smile/face$2.gif border=0 align=middle>")
 end if


 re.Pattern="(\[color=(.[^\[]*)\])(.*?)(\[\/color\])"
 strContent=re.Replace(strContent,"<font color=https://www.jb51.net/article/$2font-size:"&FontSize&"pt;line-height:"&FontHeight&"pt"">$3</font>")
 re.Pattern="(\[face=(.[^\[]*)\])(.*?)(\[\/face\])"
 strContent=re.Replace(strContent,"<font face=https://www.jb51.net/article/$2font-size:"&FontSize&"pt;line-height:"&FontHeight&"pt"">$3</font>")
 re.Pattern="(\[align=(.[^\[]*)\])(.*?)(\[\/align\])"
 strContent=re.Replace(strContent,"<div align=https://www.jb51.net/article/$2>$3</div>")
'循环转换quote
 re.Pattern="(\[QUOTE\])(.*?)(\[\/QUOTE\])"
 while (instr(strContent,"[quote]")>0 and instr(strContent,"[/quote]")>0)
 strContent=re.Replace(strContent,"<blockquote>引用:<hr><span>$2</span><hr></blockquote>")
 wend
 re.Pattern="(\[fly\])(.*?)(\[\/fly\])"
 strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
 re.Pattern="(\[move\])(.*?)(\[\/move\])"
 strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$2</marquee>") 
 re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]"
 strContent=re.Replace(strContent,"<table width=https://www.jb51.net/article/$1filter:glow(color=https://www.jb51.net/article/$2, strength=https://www.jb51.net/article/$3)"">$4</table>")
 re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]"
 strContent=re.Replace(strContent,"<table width=https://www.jb51.net/article/$1filter:shadow(color=https://www.jb51.net/article/$2, strength=https://www.jb51.net/article/$3)"">$4</table>")

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wfzzgd.html