ubb转换html,ubb 转换成html代码

function unhtml(s_string)

s_string=replace(s_string,"&","&")

's_string=replace(s_string," "," ")

s_string=replace(s_string,"

unhtml=replace(s_string,">",">")

end function

function ubbimg(s_string)

s_string=replace(s_string,"[img]","

img%5D%22,%22")

end function

function ubb_url(s_string)

str_len=len(s_string)

start_pos=instr(s_string,"[url]")

if start_pos>0 then

end_pos=instr(start_pos,s_string,"[/url]")

if end_pos>0 then

url=mid(s_string,start_pos+5,end_pos-start_pos-5)

s_string=left(s_string,start_pos-1)&""&url&""&right(s_string,str_len-end_pos-5)

call ubb_url(s_string)

end if

end if

ubb_url=s_string

end function

function ubburl(s_string)

s_string=ubb_url(s_string)

str_len=len(s_string)

start_pos=instr(s_string,"[url=")

if start_pos>0 then

end_pos=instr(start_pos,s_string,"]")

end_pos2=instr(start_pos,s_string,"[/url]")

if end_pos>0 and end_pos2>end_pos then

url=mid(s_string,start_pos+5,end_pos-start_pos-5)

s_string=left(s_string,start_pos-1)&""&right(s_string,str_len-end_pos)

call ubburl(s_string)

end if

end if

ubburl=replace(s_string,"[/url]","")

end function

function unquot(s_string)

s_string=replace(s_string,chr(34),chr(34)&chr(34))

unquot=replace(s_string,chr(39),chr(39)&chr(39))

end function

function fbdwords(s_string,s_fbdwords)

a_string=split(s_fbdwords," ")

n=ubound(a_string)

for i=0 to n

if trim(a_string(i))<>"" then

s_string=replace(s_string,trim(a_string(i)),"*")

end if

next

fbdwords=s_string

end function

function existswords(s_string,s_fbdwords)

isexist=false

a_string=split(s_fbdwords," ")

n=ubound(a_string)

for i=0 to n

if trim(a_string(i))<>"" and instr(s_string,a_string(i))>0 then

isexist=true

exit for

end if

next

existswords=isexist

end function

%>

本文链接:

阅读(442) | 评论(0) | 转发(0) |

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值