BBS裡UBB的全碼

來源:互聯網
上載者:User

BBS裡UBB的全碼
<%
function out(str)
out=Server.HTMLEncode(str)
out=replace(out,vbcrlf,"<br>")
out=ubbcode(out,"/[img/](.*?)/[//img/]","<img src=""$1"" border=""0"">")
out=ubbcode(out,"/[img align=left/](.*?)/[//img/]","<img src=""$1"" align=""left"" border=""0"">")
out=ubbcode(out,"/[img align=right/](.*?)/[//img/]","<img src=""$1"" align=""right"" border=""0"">")
out=ubbcode(out,"/[img align=center/](.*?)/[//img/]","<div align=""center""><img src=""$1"" border=""0""></div>")
out=ubbcode(out,"/(.*?)/[//color/]","<font color=""$1"">$2</font>")
out=ubbcode(out,"/[url=(.*?)/](.*?)/[//url/]","<a href=""$1"" target=""_blank"">$2</a>")
out=ubbcode(out,"/[url/](.*?)/[//url/]","<a href=""$1"" target=""_blank"">$1</a>")
out=ubbcode(out,"/[center/](.*?)/[//center/]","<center>$1</center>")
out=ubbcode(out,"/[b/](.*?)/[//b/]","<b>$1</b>")
out=ubbcode(out,"/[i/](.*?)/[//i/]","<i>$1</i>")
out=ubbcode(out,"/[u/](.*?)/[//u/]","<u>$1</u>")
out=ubbcode(out,"/[h1/](.*?)/[//h1/]","<h1>$1</h1>")
out=ubbcode(out,"/[h2/](.*?)/[//h2/]","<h2>$1</h2>")
out=ubbcode(out,"/[h3/](.*?)/[//h3/]","<h3>$1</h3>")
out=HTMLcode(out)
end function
%>

<%
function HTMLcode(str)
Set re=new RegExp
re.IgnoreCase=True
re.Global=True
re.Pattern="(?:^|>)(?:.*?)(?:<|$)"
Set Searchs=re.Execute(str)
For Each Search In Searchs
s=replace(Search.value," ","&nbsp;")
str=replace(str,Search.value,s)
Next
HTMLcode=str
End Function
%>

<%
function ubbcode(str1,str2,str3)
Set re = new RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = str2
ubbcode = re.replace(str1,str3)
end function
%>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.