<%
functionHtmlencode(byvalstrvalue)
'忽略錯誤
Onorresumenext
'定義變量
Dimstrnewvalue
ifstrvalue <>“”然後
strnewvalue =替換(strvalue,“ <”,“ <”)
strnewvalue =替換(strnewvalue,“>”,“”>“)
strnewvalue =替換(strnewvalue,“'”,“'”)
strnewvalue =替換(strnewvalue,“”“”,“”)
strnewvalue =替換(strnewvalue,vbcrlf,“ <br>”)
strnewvalue =替換(strnewvalue,“”,“”)
Endif
htmlencode = strnewvalue
'輸出錯誤
iferr.number> 0
wress.writeerr.Description
響應
Endif
最終功能
FunctionUbbcode(strvalue)
dimregexp
'strvalue = htmlencode(strvalue)
setRegexp = newregexp
Regexp.ignorecase = true
Regexp.global = true
ifstrvalue <>“”然後
REGEXP.PATTERN =“(/[img/管理
strvalue = regexp.Replace(strvalue,“ <ahref =”“ $ 2”“ target = _blank> <imgsrc =” $ 2“” $ 2“” border = 0alt = 0alt = 0alt =按此在新窗口瀏覽圖片on javascript =“” javascript:if(this.width> screet.width> screen.width-333)this.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-444455354000000width = 500height = 400ID = 400ID = shockw aveflash1> <paramname = movievalue =“” $ 2“”> <paramname = QualityValue = high> <EmbedSrc =“” $ 2“”質量= highpluginspage =“” ”)'target = _blank rel = nofollow> http://www.macromedia.com/shockwave/shockwave/download/index.cgi?p1_prod_version = shockwaveflash'type =“
REGEXP.PATTERN =“(/[zip/管理
strvalue = regexp.replace(strvalue,“ <br> <ahref =”“ $ 2”“>點擊下載該文件</a>”)
regexp.pattern =“(/[rar/rar/fircom)(
strvalue = regexp.replace(strvalue,“ <br> <ahref =”“ $ 2”“>點擊下載該文件</a>”)
'regexp.pattern =“(/[upload =(。[^/[]*)/])(。[^/[]*)(/[/[// upload/])
'strvalue = regexp.replace(strvalue,“ <br> <imgsrc =”“” $ 2.GIF“” border = 0> <ahref =“” $ 3“” $ 3“” target = _blank> _blank> </a>”)
'strvalue = regexp.replace(strvalue,“ <br> <imgsrc =”“ $ 2.gif”“ border = 0>此主題相關圖片如下:<br> <ahref =“” $ 3“” $ 3“” target = _blank> _blank> <imgsrc = “” $ 3“” border = 0alt =按此在新窗口瀏覽圖片onload =“” javaScript:if(this.width> screet.width-333)this.width = screet.width-333“”> </a>”)