站長(zhǎng)資訊網(wǎng)
最全最豐富的資訊網(wǎng)站

asp的ubb函數(shù)(推薦)

復(fù)制代碼 代碼如下:
 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=’#000099′>”,1,-1,1)
ubb=replace(ubb,”[/blue]”,”</font>”,1,-1,1)
ubb=replace(ubb,”[red]”,”<font color=’#990000′>”,1,-1,1)
ubb=replace(ubb,”[/red]”,”</font>”,1,-1,1)
for i=1 to 28
ubb=replace(ubb,”{:em”&i&”}”,”<IMG SRC=emot/emotface/em”&i&”.gif></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
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&”]”,”<font color='”&text&”‘>”,1,1,1)
cText=replace(cText,”[/color]”,”</font>”,1,1,1)
case “font”
cText=replace(cText,”[font=”&text&”]”,”<font face='”&text&”‘>”,1,1,1)
cText=replace(cText,”[/font]”,”</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&”]”,”<font size='”&text&”‘>”,1,1,1)
cText=replace(cText,”[/size]”,”</font>”,1,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,1)
case “email”
cText=replace(cText,”[“&CovT&”=”&text&”]”,”<a href=mailto:”&text&”>”,1,1,1)
cText=replace(cText,”[/”&CovT&”]”,”</a>”,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,”<a href='”&codetext&”‘ target=_blank>”&codetext,1,1,1)
cText=replace(cText,”<a href='”&codetext&”‘ target=_blank>”&codetext&”[/”&CovT&”]”,”<a href=”&codetext&” target=_blank>”&codetext&”</a>”,1,1,1)
case “email”
cText=replace(cText,”[“&CovT&”]”,”<a href=mailto:”&text&”>”,1,1,1)
cText=replace(cText,”[/”&CovT&”]”,”</a>”,1,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,”代碼片斷如下:<TEXTAREA id=”&rid&” rows=15 style=’width:100%’ class=’bk’>”&codetext,1,1,1)
cText=replace(cText,”代碼片斷如下:<TEXTAREA id=”&rid&” rows=15 style=’width:100%’ class=’bk’>”&codetext&”{/html}”,”代碼片斷如下:<TEXTAREA id=”&rid&” rows=15 style=’width:100%’ class=’bk’>”&codetext&”</TEXTAREA><INPUT onclick=runEx(‘”&rid&”‘) type=button value=運(yùn)行此段代碼 name=Button1 class=’Tips_bo’> <INPUT onclick=JM_cc(‘”&rid&”‘) type=button value=復(fù)制到我的剪貼板 name=Button2 class=’Tips_bo’>”,1,1,1)
case “img”
cText=replace(cText,”[img]”&text,”<a href=”&chr(34)&”about:<img src=”&codetext&” border=0>”&chr(34)&” target=_blank><img src=”&codetext,1,1,1)
cText=replace(cText,”[/img]”,” vspace=2 hspace=2 border=0 alt=::點(diǎn)擊圖片在新窗口中打開::></a>”,1,1,1)
case “code”
cText=replace(cText,”[code]”&text,”以下內(nèi)容為程序代碼<hr noshade>”&codetext,1,1,1)
cText=replace(cText,”以下內(nèi)容為程序代碼<hr noshade>”&codetext&”[/code]”,”以下內(nèi)容為程序代碼<hr noshade>”&codetext&”<hr noshade>”,1,1,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,1)
case “swf”
cText=replace(cText,”[swf]”&text,”影片地址:<br>”&text&”<br><object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ codebase=’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0′ width=’500′ height=’500′><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=’500′ height=’500′>”,1,1,1)
cText=replace(cText,”<object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ codebase=’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0′ width=’500′ height=’500′><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=’500′ height=’500′>”&”[/swf]”,”<object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ codebase=’http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0′ width=’500′ height=’500′><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=’500′ height=’500′>”&”</embed></object>”,1,1,1)
end select
loop
Convert=cText
end function

贊(0)
分享到: 更多 (0)
網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)
久久久精品中文字幕麻豆发布| 思思久久99热只有频精品66| 四色在线精品免费观看| 日本h在线精品免费观看| 精品亚洲麻豆1区2区3区 | 中文字幕动漫精品专区| 日韩精品内射视频免费观看| 国产精品免费无遮挡无码永久视频 | 日韩精品一卡2卡3卡4卡新区乱码| 精品一区狼人国产在线| 婷婷射精av这里只有精品| 99re最新这里只有精品| 精品日产卡一卡二卡麻豆| 亚洲精品欧洲精品| 亚洲熟妇无码久久精品| 亚洲国产精品综合久久久 | 日本免费精品一区二区三区| 日韩夜夜高潮夜夜爽无码| 欧美日韩精品不卡在线观看| 久久精品日韩一区国产二区| 精品一区二区三区四区电影| 中文字幕一区二区三区日韩精品| 亚洲国产成人精品女人久久久 | 国产精品女同一区二区久久| www.精品在线| 国产成人精品免高潮在线观看 | 正在播放国产精品| 无码精品尤物一区二区三区| 精品久久久一二三区| 精品少妇人妻AV一区二区| 精品国产麻豆免费网站| 欧洲精品一卡2卡三卡4卡乱码| 老色鬼永久精品网站| 国产精品日韩一区二区三区| 国产精品一区二区无线| 日韩在线观看网站| 日韩精品一区二区三区中文版 | 色妞ww精品视频7777| 337p日本欧洲亚洲大胆精品555588| 亚洲区精品久久一区二区三区| 国产精品臀控福利在线观看 |