UBB converted to HTML code

Source: Internet
Author: User

<%
function unhtml (s_string)
S_string=replace (s_string, "&", "&amp;")
' S_string=replace (s_string, "", "&nbsp;")
S_string=replace (s_string, "<", "&lt;")
Unhtml=replace (s_string, ">", "&gt;")
End Function
function Ubbimg (s_string)
S_string=replace (s_string, "[img]", "Ubbimg=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) & "<a href= '" &url& "' target= ' _blank ' >" &url& "</a > "&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) & "<a href= '" &url& "' target= ' _blank ' > ' &right (s_string, Str_len-end_pos)
Call Ubburl (s_string)
End If
End If
Ubburl=replace (s_string, "[/url]", "</a>")
End Function
function Unquot (s_string)
S_string=replace (S_STRING,CHR), Chr (&AMP;CHR (34))
Unquot=replace (S_STRING,CHR, Chr () &AMP;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
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.