ASP UBB function (recommended)

zhaozj2021-02-16  60

ASP UBB function (recommended)

Function UnHtml (Content) unHtml = Contentif Content <> "" "" ") 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 ifend function

Function UBB (Content) DIM NOWTIME, IUBB = ContentNowTime = now () UBB = Convert (UBB, "CODE") UBB = Convert (UBB, "HTML") UBB = Convert (UBB, "URL") UBB = Convert (UBB , "color") UBB = Convert (UBB, "font") UBB = Convert (UBB, "quote") UBB = Convert (UBB, "Email") UBB = Convert (UBB , "img") UBB = Convert (UBB, "SWF")

Ubb = autOourn (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] "," < / 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 28uBB = Replace (UBB, "{: EM" & I & "}", " ", 1, 6, 1) UBB = Replace (Ubb," {: EM "& I &"} "," ", 1, -1 , 1) Nextubb = 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, codetextcText = ubbstartubb = 1do while Covt = "url" or Covt = "color" or Covt = "font" or Covt = "size" startubb = instr (Startubb, CText, "[" & COVT & "=", 1) if Startubb = 0 THEN EXIT DOENDUBBB = INSTR (Startubb, ctext, "]", 1) if endubb = 0 THEN EXIT DOLCOVT = COVTSTARTUBBBBBBBBBBBBBBBB = Startubb LEN (LCOVT 2Text = 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 Covtcase "Color" ctext = replace (ctext, "[color =" & text & "]", " "CText = Replace (ctext," [/ font] "," ", 1, 1, 1) case Size "if isnumeric (text) Thenif Text> 6 TEXT = 6if text <1 TEXT = 1 CText = Replace (ctext," [size = "& text &"] ","

_BLANK> ", 1, 1, 1) ctext = replace (ctext," [/ url] "," ", 1, 1) case" email "ctext = replace (ctext," ["& COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & COVT & CTEXT "=" & text & "]", "", 1, 1, 1) ctext = replace (ctext, "[/" & covt & "]", "", 1 , 1, 1) End SelectLoop

Startubb = 1dostartubbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = INSTR (Startubb, CText, "[" & COVT & "]", 1) IF Startubb = 0 THEN EXIT DOENDUBB = INSTR (Startubb, Ctext, "[/" & COVT & "]", 1) if endubb = 0 THEN Exit Dolcovt = COVTSTARTUBBBBBBBBBBB LEN (LCOVT) 2Text = MID (ctext, startubb, endubb-start = 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 Covtcase "URL" ctext = replace (ctext, "[" & covt & "]" & text, " "& coretext, 1, 1, 1) ctext = replace (ctext," "& codext &" [/ "& covt &"] " , "", 1, 1) Case "email" ctext = replace (ctext, "[" & covt & "]", " ", 1, 1, 1) ctext = replace (ctext," [/ "& covt &"] "," ", chr (13), 1, -1, 1) CodeText = Replace (CODETEXT, "", CHR (32), 1, -1, 1) RandomizerId = "Temp" & int (100000 * RND) ctext = replace (ctext, "[html]" & text, "The code segment is as follows: &

CodeText, 1, 1, 1) ctext = replace (ctext, "The code segment is as follows: