Full UBB code in BBS
<%
Function out (STR)
Out = server. htmlencode (STR)
Out = Replace (Out, vbcrlf, "<br> ")
Out = ubbcode (Out, "/[img/] (. *?) /[// Img/] "," ")
Out = ubbcode (Out, "/[img align = left/] (. *?) /[// Img/] "," ")
Out = ubbcode (Out, "/[img align = right/] (. *?) /[// Img/] "," ")
Out = ubbcode (Out, "/[img align = center/] (. *?) /[// Img/] ", "<Div align =" "center" "> </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/] "," Out = ubbcode (Out, "/[H2/] (. *?) /[// H2/] "," <H2 >1 1 </H2> ")
Out = ubbcode (Out, "/[H3/] (. *?) /[// 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
%>