最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ubb 转换成html代码
时间:2008-04-29 编辑:简简单单 来源:一聚教程网
<%
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]","")
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
%>
-
上一个: js控制框架页面表单
-
下一个: 初学者必看了几个js函数
相关文章
- python实现html代码转义转换的例子 12-18
- ubb转换成html 08-05
- HTML与UBB代码互相转换 07-19
- html转换成UBB代码 05-24
- ubb转换成html 代码 03-15
- ubb代码转化html代码 01-12