CopyCode The Code is as follows: function unhtml (content)
Unhtml = content
If content <> "" then
Unhtml = Replace (unhtml ,"&","&")
Unhtml = Replace (unhtml, "<", "<")
Unhtml = Replace (unhtml, ">", "> ")
Unhtml = Replace (unhtml, CHR (34 ),""")
Unhtml = Replace (unhtml, CHR (13), "<br> ")
Unhtml = Replace (unhtml, CHR (32 ),"")
'Unhtml = UBB (unhtml)
End if
End Function
function UBB (content)
dim nowtime, I
UBB = content
nowtime = now ()
UBB = convert (UBB, "Code")
UBB = convert (UBB, "html")
UBB = convert (UBB, "url")
UBB = convert (UBB, "color")
UBB = convert (UBB, "font")
UBB = convert (UBB, "size")
UBB = convert (UBB, "quote")
UBB = convert (UBB, "email")
UBB = convert (UBB, "IMG")
UBB = convert (UBB, "SWF")
UBB = autourl (UBB)
UBB = Replace (UBB, "[B]", "<B>", 1,-1, 1)
UBB = Replace (UBB, "[/B]", "</B>", 1,-1, 1)
UBB = Replace (UBB, "[I]", "<I>", 1,-1, 1)
UBB = Replace (UBB, "[/I]", "</I>", 1,-1, 1)
UBB = Replace (UBB, "[u]", "<u>", 1,-1, 1)
UBB = Replace (UBB, "[/u]", "</u>", 1,-1, 1)
UBB = Replace (UBB, "[Blue]", "<font color = '# 000000'>", 1,-000099)
UBB = Replace (UBB, "[/Blue]", "</font>", 1,-1, 1)
UBB = Replace (UBB, "[Red]", "<font color = '# 000000'>", 1,-990000)
UBB = Replace (UBB, "[/Red]", "</font>", 1,-1, 1)
For I = 1 to 28
UBB = Replace (UBB, "{: em" & I & "}", " </img> ", 1, 6, 1)
UBB = Replace (UBB, "{: em" & I & "}", "", 1,-1, 1)
Next
UBB = Replace (UBB, "[" & CHR (176), "[", 1)
UBB = Replace (UBB, CHR (176) & "]", "]", 1)
UBB = Replace (UBB, "/" & CHR (176), "/", 1)
'Ubb = Replace (UBB, "{; em", "{: em", 1,-1, 1)
End Function
Function convert (UBB, covt)
Dim ctext, startubb, endubb, lcovt, text, codetext
Ctext = UBB
Startubb = 1
Do While covt = "url" or covt = "color" or covt = "font" or covt = "size"
Startubb = instr (startubb, ctext, "[" & covt & "=", 1)
If startubb = 0 Then exit do
Endubb = instr (startubb, ctext, "]", 1)
If endubb = 0 Then exit do
Lcovt = covt
Startubb = startubb + Len (lcovt) + 2
TEXT = mid (ctext, startubb, endubb-startubb)
Codetext = Replace (text, "[", "[" & CHR (176), 1)
Codetext = Replace (codetext, "]", CHR (176) & "]", 1)
'Codetext = Replace (codetext, "{: em", "{; em", 1,-1, 1)
Codetext = Replace (codetext, "/", "/" & CHR (176), 1)
Select case covt
Case "color"
Ctext = Replace (ctext, "[color =" & text & "]", "<font color = '" & text & "'>", 1, 1)
Ctext = Replace (ctext, "[/color]", "</font>", 1, 1)
Case "font"
Ctext = Replace (ctext, "[font =" & text & "]", "<font face = '" & text & "'>", 1, 1)
Ctext = Replace (ctext, "[/font]", "</font>", 1, 1)
Case "size"
If isnumeric (text) then
If text> 6 then text = 6
If text <1 then text = 1
Ctext = Replace (ctext, "[size =" & text & "]", "<font size = '" & text & "'>", 1, 1)
Ctext = Replace (ctext, "[/size]", "</font>", 1, 1)
End if
Case "url"
Ctext = Replace (ctext, "[url =" & text & "]", "<a href = '" & codetext & "'target = _ blank>", 1, 1, 1)
Ctext = Replace (ctext, "[/url]", "</a>", 1, 1)
Case "email"
Ctext = Replace (ctext, "[" & covt & "=" & text & "]", "<a href = mailto:" & text & ">", 1, 1, 1)
Ctext = Replace (ctext, "[/" & covt & "]", "</a>", 1, 1)
End select
Loop
Startubb = 1
Do
Startubb = instr (startubb, ctext, "[" & covt & "]", 1)
If startubb = 0 Then exit do
Endubb = instr (startubb, ctext, "[/" & covt & "]", 1)
If endubb = 0 Then exit do
Lcovt = covt
Startubb = startubb + Len (lcovt) + 2
TEXT = mid (ctext, startubb, endubb-startubb)
Codetext = Replace (text, "[", "[" & CHR (176), 1)
Codetext = Replace (codetext, "]", CHR (176) & "]", 1)
'Codetext = Replace (codetext, "{: em", "{; em", 1,-1, 1)
Codetext = Replace (codetext, "/", "/" & CHR (176), 1)
Select case covt
Case "url"
Ctext = Replace (ctext, "[" & covt & "]" & text, "<a href = '" & codetext & "'target = _ blank>" & codetext, 1, 1)
Ctext = Replace (ctext, "<a href = '" & codetext & "'target = _ blank>" & codetext & "[/" & covt & "]", "<a href =" & codetext & "target = _ blank>" & codetext & "</a>", 1, 1)
Case "email"
Ctext = Replace (ctext, "[" & covt & "]", "<a href = mailto:" & text & ">", 1, 1)
Ctext = Replace (ctext, "[/" & covt & "]", "</a>", 1, 1)
Case "html"
Codetext = Replace (codetext, "<br>", CHR (13), 1,-1, 1)
Codetext = Replace (codetext, "", CHR (32), 1,-1, 1)
Randomize
Rid = "Temp" & int (100000 * RND)
Ctext = Replace (ctext, "{HTML}" & text, "the code snippet is as follows: <textarea id =" & rid & "rows = 15 style = 'width: 100% 'class = 'bk '> "& codetext, 1)
Ctext = Replace (ctext, "the code snippet is as follows: <textarea id =" & rid & "rows = 15 style = 'width: 100% 'class = 'bk '> "& codetext &" {/html} "," the code snippet is as follows: <textarea id = "& rid &" rows = 15 style = 'width: 100% 'class = 'bk '> "& codetext &" </textarea> <input onclick = runex (' "& rid &"') type = button value = run this code section name = button1 class = 'tips _ Bo'> <input onclick = jm_cc ('"& rid &"') type = button value = copy to my clipboard name = button2 class = 'tips _ Bo'> ", 1, 1, 1)
Case "IMG"
Ctext = Replace (ctext, "[img]" & text, "<a href =" & CHR (34) & "about: "& CHR (34) &" target = _ blank> Ctext = Replace (ctext, "[/img]", "vspace = 2 hspace = 2 border = 0 alt =: click the picture to open in a new window:> </a> ", 1, 1)
Case "code"
Ctext = Replace (ctext, "[Code]" & text, "the following content isProgram Code <HR noshade> "& codetext, 1, 1)
Ctext = Replace (ctext, "the following content is the program code <HR noshade>" & codetext & "[/Code]", "The following content is the program code <HR noshade>" & codetext & "<HR noshade>", 1)
Case "quote"
Atext = Replace (text, "[img]", "", 1,-1, 1)
Atext = Replace (atext, "[/img]", "", 1,-1, 1)
Atext = Replace (atext, "[SWF]", "", 1,-1, 1)
Atext = Replace (atext, "[/SWF]", "", 1,-1, 1)
Atext = Replace (atext, "{HTML}", "", 1,-1, 1)
Atext = Replace (atext, "{/html}", "", 1,-1, 1)
'Atext = Replace (atext, "{: em", "{; em", 1,-1, 1)
Atext = splitwords (atext, 350)
Atext = Replace (atext, CHR (32), "", 1,-1, 1)
Ctext = Replace (ctext, "[quote]" & text, "<BLOCKQUOTE> <HR noshade>" & atext, 1,1, 1)
Ctext = Replace (ctext, "<BLOCKQUOTE> <HR noshade>" & atext & "[/quote]", "<BLOCKQUOTE> <HR noshade>" & atext & "<HR noshade> </BLOCKQUOTE>", 1, 1)
Case "SWF"
Ctext = Replace (ctext, "[SWF]" & text, "video address: <br>" & text & "<br> <object classid = 'clsid: d27CDB6E-AE6D-11cf-96B8-444553540000 'codebase = 'HTTP: // adjust width = '000000' Height = '000000'> <Param name = movie value = '"& codetext &"'> <Param name = Quality value = high> <embed src = '"& codetext &" 'quality = high pluginspage = 'HTTP: // www.macromedia.com/shockwave/downloa D/index. cgi? P1_prod_version = shockwaveflash 'Type = 'application/X-Shockwave-flash' width = '000000' Height = '000000'> ", 500, 1)
Ctext = Replace (ctext, "<object classid = 'clsid: D27CDB6E-AE6D-11cf-96B8-444553540000 'codebase = 'HTTP: // adjust width = '000000' Height = '000000'> <Param name = movie value = '"& codetext &"'> <Param name = Quality value = high> <embed src = '"& codetext &" 'quality = high pluginspage = 'HTTP: // www.macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash 'Type = 'application/X-Shockwave-flash' width = '000000' Height = '000000'> "&" [/SWF] ", "<object classid = 'clsid: D27CDB6E-AE6D-11cf-96B8-444553540000 'codebase = 'HTTP: // adjust width = '000000' Height = '000000'> <Param name = movie value = '"& codetext &"'> <Param name = Quality value = high> <embed src = '"& codetext &"' Quality = high plugi Nspage = 'HTTP: // www.macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash 'Type = 'application/X-Shockwave-flash' width = '000000' Height = '000000'> "&" </embed> </Object> ", 1, 1)
End select
Loop
Convert = ctext
End Function