ASP UBB function summary

xiaoxiao2021-03-06  102

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]", "", 1, -1, 1)

UBB = Replace (UBB, "[i]", "", 1, -1, 1)

UBB = Replace (UBB, "[/ i]", "", 1, -1, 1)

UBB = Replace (Ubb, "[u]", "", 1, -1, 1)

UBB = Replace (UBB, "[/ u]", "", 1, -1, 1)

UBB = Replace (UBB, "[Blue]", ", 1, -1, 1)

Ubb = replace (ubb, "[/ blue]", "", 1, -1, 1)

Ubb = replace (ubb, "[red]", ", 1, -1, 1)

Ubb = replace (ubb, "[/ red]", "", 1, -1, 1)

For i = 1 to 28

UBB = Replace (UBB, "{: EM" & I & "}", " , 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]", "", 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, "
", CHR (13), 1, -1, 1)

CODETEXT = Replace (CodeText, ", CHR (32), 1, -1, 1)

Randomize

Rid = "TEMP" & INT (100000 * RND)

Ctext = replace (ctext, "[html]" & text, "code segment is as follows: