<%
Functionhtmlencode (byvalstrvalue)
'忽略错误
OnerRorResumenext
'定义变量
DimStrnewValue
Ifstrvalue <> "" Тогда
strnewvalue = reply (strvalue, "<", "<")
strnewvalue = reply (strnewvalue, ">", ">")
strnewvalue = reply (strnewvalue, "" "," "")
strnewvalue = reply (strnewvalue, "" "" "," ")
strnewvalue = reply (strnewvalue, vbcrlf, "<br>")
strnewvalue = reply (strnewvalue, "", "")
Эндиф
Htmlencode = strnewValue
'输出错误
Iferr.number> 0then
Response.writeerr.description
Response.end
Эндиф
Конечная функция
FunctionUbBcode (strvalue)
DimRegexp
'strvalue = htmlencode (strvalue)
SetRegexp = newRegexp
Regexp.ignorecase = true
Regexp.global = true
Ifstrvalue <> "" Тогда
Regexp.pattern = "(/[img /^)(.=.^/***)(/b// img/])"
strvalue = regexp.replace (strvalue, "<ahref =" "$ 2" "target = _blank> <imgsrc =" "$ 2" "Border = 0alt = 按此在新窗口浏览图片 Onload =" "Javascript: if (this.width> screen.width-333) this.width = screen.width-333"> ")") ")")
Regexp.pattern = "(/[flash /^)(.=.^/**)(/// Flash/])"
strvalue = regexp.replace (strvalue, "<objectcodebase =" "http://download.macromedia.com/pub/sho ... h/swflash.cab#версия = 4,0,2,0 "" classid = clsid: d27cdb6e-ae6d-11cf-96b8-4445553540000width = 500height = 400id = shockw aveflash1> <paramname = movieValue = "" $ 2 ""> <paramname = QualityValue = High> <embedSrc = "" $ 2 "" Quality = highpluginspage = "" " ") 'target = _blank rel = nofollow> http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash" "type =" "appl ... 00height = 400> </amped> </object>")
Regexp.pattern = "(/[zip /^)(.tsulfuling
strvalue = regexp.replace (strvalue, "<br> <ahref =" "$ 2" "> 点击下载该文件 </a>")
Regexp.pattern = "(/[rar /^)(.=.^/***)(/b// rar/])"
strvalue = regexp.replace (strvalue, "<br> <ahref =" "$ 2" "> 点击下载该文件 </a>")
'Regexp.pattern = "(/[opload = (. [^/[]*)/]) (. [^/[]*) (/[// upload/])"
'strvalue = regexp.replace (strvalue, "<br> <imgsrc =" "$ 2.gif" "border = 0> <ahref =" "$ 3" "target = _blank> 点击查看或下载该文件 </a>")
'strvalue = regexp.replace (strvalue, "<br> <imgsrc =" "$ 2.gif" "border = 0> 此主题相关图片如下 : <br> <ahref =" "$ 3" "target = _blank> <imgsrc = "" $ 3 "" border = 0alt = 按此在新窗口浏览图片 onload = "" javascript: if (this.width> screen.width-333) this.width = screen.width-333 ""> </a> ")