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),"
")
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
startubb=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,"[/color]","",1,1,1)
case "font"
cText=replace(cText,"[font="&text&"]","",1,1,1)
cText=replace(cText,"[/font]","",1,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&"]","",1,1,1)
cText=replace(cText,"[/size]","",1,1,1)
end if
case "url"
cText=replace(cText,"[url="&text&"]","",1,1,1)
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
startubb=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,1,1,1)
cText=replace(cText,""&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,"代码片断如下:
"&text&"