% Dim finalKeysToHighLite:finalKeysToHighLite = replace(CheckDelimitedFormat(replace(replace(key&"",",","|"),"\","\\"),"|"),"|","|\b") Dim hPGDEscape,hPGDEs hPGDEscape = Array("+","?","*","{","}",":","^","$","=",".","<",">","/") for each hPGDEs in hPGDEscape finalKeysToHighLite = replace(finalKeysToHighLite,hPGDEs,"\"&hPGDEs) next hPGDEscape = Array("[","]","(",")") for each hPGDEs in hPGDEscape finalKeysToHighLite = replace(finalKeysToHighLite,hPGDEs,"") next Dim finalBadWordToBan:finalBadWordToBan = replace(CheckDelimitedFormat(replace(Application(dbName&"wordFilter")&"","/",""),"|"),"|","|\b") Dim NoSmile:NoSmile = request.cookies(dbName&"ASPplayground_forum_Speed")("NoSmile") Dim ImagePrefInCookies:ImagePrefInCookies = request.cookies(dbName&"ASPplayground_forum_Speed")("NoImage") Dim NoImage:NoImage = ImagePrefInCookies Dim NoImageRes Dim NoSigImage:NoSigImage = iff(ImagePrefInCookies&"" = "1" or Application(dbName&"NoIMGinSigs")&"" = "1","1","0") function vbPGDCode2(objRegExp, byVal sbody,NoImage,NoSmile,finalKeysToHighLite,finalBadWordToBan,regexpForumDir) objRegExp.ignorecase = true ' highlight code' if not(len(finalKeysToHighLite)=0) then objRegExp.pattern = "(\b"&finalKeysToHighLite&")" 'response.write objRegExp.pattern:response.end sbody = objRegExp.Replace(sbody,"$1") End if 'Remove Bad Words' if len(finalBadWordToBan)<>0 then objRegExp.pattern = "(?:\b"&finalBadWordToBan&")" sbody = objRegExp.Replace(sbody,"****") end if objRegExp.ignorecase = false 'grab code matches and submatches' Dim matchg(), oSubMatch, oMatches, iMatch, im, proceedWithCodeTagTransformation proceedWithCodeTagTransformation = false if instr(sbody,"[code]") then proceedWithCodeTagTransformation = true iMatch = 0 objRegExp.pattern = "\[(code)\].+?\[\/\1\]" Set oMatches = objRegExp.Execute (sbody) iMatch = oMatches.Count-1 Redim matchg(iMatch) For im = 0 to iMatch oSubMatch = oMatches(im) matchg(im) = oSubMatch sbody = replace(sbody,oSubMatch,chr(1)&im&chr(1),1,1,vbBinaryCompare) next Set oMatches = nothing end if 'General Replacing Mechnism' objRegExp.pattern = "\[(\/?(?:b|i|u|s|ol|ul|hr))\]" sbody = objRegExp.replace (sbody,"<$1>") 'align if instr(sbody,"[right]") or instr(sbody,"[center]") or instr(sbody,"[left]") then objRegExp.pattern = "\[(right|center|left)\]" sbody = objRegExp.replace (sbody,"
quote:") end if 'Font Tags Replace' Dim fontTagExists:fontTagExists = false if instr(sbody,"[size=") or instr(sbody,"[color=") then objRegExp.pattern = "\[(size|color)\=(.+?)\]" sbody = objRegExp.Replace(sbody,"") fontTagExists = true end if if instr(sbody,"[font=") then objRegExp.pattern = "\[font\=(\"\;|\')(.+?)\1\]" sbody = objRegExp.Replace(sbody,"") fontTagExists = true end if if fontTagExists then objRegExp.pattern = "\[\/(?:font|size|color)\]" sbody = objRegExp.Replace(sbody,"") end if Dim validURIChars:validURIChars = "\w\%\;\/\?\:\@\&\=\+\$\,\-\.\!\~\*\'\(\)\#" Dim validURIPrefix:validURIPrefix = "(?:ftp|https?)\:\/\/" 'Auto Linking' objRegExp.pattern = "\s(\w+\@\w+\.[a-zA-Z]{2,4})" sbody = objRegExp.Replace(sbody," $1") objRegExp.pattern = "\s("&validURIPrefix&"["&validURIChars&"]+)" sbody = objRegExp.Replace(sbody," $1") objRegExp.pattern = "\s([wW]{3}\.["&validURIChars&"]+)" sbody = objRegExp.Replace(sbody," $1") 'Link w/ w/o Name' if instr(sbody,"[link") or instr(sbody,"[url") then objRegExp.pattern = "\[(url|link)\=(\"\;|\')?("&validURIPrefix&".+?)\2\](.+?)\[\/\1\]" sbody = objRegExp.Replace(sbody,"$4") objRegExp.pattern = "\[(url|link)\=?\]("&validURIPrefix&".+?)\[\/\1\]" sbody = objRegExp.Replace(sbody,"$2") end if Dim imgStart, imgEnd : imgStart = "
") sbody = replace(sbody,"[/quote]","
"),"
",vbcrlf),1,1,vbBinaryCompare) next Erase matchg end if vbPGDCode2 = sbody end function function PGDCodeResolution(byVal objPGDCode, byVal Body, enablePGDCode) 'generally input the SQLOuted string here' body = replace(space(1)&body, vbcrlf, "
") if enablePGDCode = 1 then PGDCodeResolution = vbPGDCode2(objPGDCode,body,NoImage,NoSmile,finalKeysToHighLite,finalBadWordToBan,forumdir) else PGDCodeResolution = body end if end function %>