ASP UBB function
Function unHtml (Content)
UnHtml = Content
IF content <> "" "
UnHtml = Replace (UnHtml, "&", "&")
UnHtml = Replace (unHtml, "<", "<")
UnHtml = Replace (unHtml, ">,"> ")
UnHtml = Replace (unHtml, Chr (34), "" ")
UnHtml = Replace (unHtml, Chr (13), "
")
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]", "", 1, -1, 1)
UBB = Replace (UBB, "[/ B]", " b>", 1, -1, 1)
UBB = Replace (UBB, "[i]", "", 1, -1, 1)
UBB = Replace (UBB, "[/ i]", " i>", 1, -1, 1)
UBB = Replace (Ubb, "[u]", "", 1, -1, 1)
UBB = Replace (UBB, "[/ u]", " u>", 1, -1, 1)
UBB = Replace (UBB, "[Blue]", ", 1, -1, 1)
Ubb = replace (ubb, "[/ blue]", " font>", 1, -1, 1)
Ubb = replace (ubb, "[red]", ", 1, -1, 1)
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, -1, 1)
UBB = Replace (UBB, CHR (176) & "]", "]", 1, -1, 1)
UBB = Replace (UBB, "/" & chr (176), "/", 1, -1, 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
STARTUBBB = Startubb LEN (LCOVT) 2
Text = MID (CText, Startubb, Endubb-Startubb)
CodeText = Replace (Text, "[", "[" & chr (176), 1, -1, 1)
CODETEXT = Replace (CODETEXT, "]", CHR (176) & "]", 1, -1, 1)
'CodeText = Replace (CODETEXT, "{: EM", "{; em", 1, -1, 1)
CODETEXT = Replace (CodeText, "/", "/" & chr (176), 1, -1, 1)
Select Case Covt
Case "color"
CText = Replace (ctext, "[color =" & text & "]", " ", 1, 1, 1)
CText = Replace (ctext, "[/ font]", " font>", 1, 1) Case "Size"
IF isnumeric (text) THEN
IF text> 6 TEXT = 6
If Text <1 THEN TEXT = 1
CText = Replace (ctext, "[size =" & text & "]", "
Ctext = replace (ctext, "[/ url]", "", 1, 1, 1) Case "email" CText = Replace (ctext, "[" & COVT & "=" & Text & "]", "", 1, 1, 1) CText = Replace (ctext, "[/" & covt & "]", "", 1, 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 STARTUBBB = Startubb LEN (LCOVT) 2 Text = MID (CText, Startubb, Endubb-Startubb) CodeText = Replace (Text, "[", "[" & chr (176), 1, -1, 1) CODETEXT = Replace (CODETEXT, "]", CHR (176) & "]", 1, -1, 1) 'CodeText = Replace (CODETEXT, "{: EM", "{; em", 1, -1, 1) CODETEXT = Replace (CodeText, "/", "/" & chr (176), 1, -1, 1) Select Case Covt Case "URL" CText = Replace (ctext, "[" & COVT & "]" & text, " & CODETEXT & "[/" & COVT & "]", " "& CodeText &" ", 1, 1, 1) Case "email" CText = Replace (ctext, "[" & COVT & "]", "", 1, 1, 1) CText = Replace (ctext, "[/" & covt & "]", "", 1, 1, 1) Case "html" CodeText = Replace (CODETEXT, " CODETEXT = Replace (CodeText, ", CHR (32), 1, -1, 1) Randomize Rid = "TEMP" & INT (100000 * RND) Ctext = replace (ctext, "[html]" & text, "code segment is as follows: CText = Replace (CText, "The code segment is as follows: CText = Replace (ctext, "[img]" & text, " < IMG SRC = "& CODETEXT, 1, 1, 1) ctext = replace (ctext, "[/ img]", "vSpace = 2 hspace = 2 border = 0 alt = :: Click on the picture Open in the new window ::> ", 1, 1) Case "Code" CText = Replace (ctext, "[code]" & text, "The following is the program code
", CHR (13), 1, -1, 1)
& CodeText, 1, 1, 1)
CText = Replace (ctext, "The following is program code
Case "quote"
Atext = Replace (text, "[iv]", "", 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, "
" & atext, 1, 1, 1)Ctext = replace (ctext, "
" & atext & "[/ quote]", "
" & atext & "
block quote>, 1, 1, 1)Case "SWF"
Ctext = replace (ctext, "[swF]" & text, "Video address:
" & text & "
cText = replace (cText, "
loop
Convert = ctext
END FUNCTION