ATH)) then
fso.deletefolder(server.mappath(sPATH))
end if
set fso = nothing
end function
function delnewsfile(sPATH,filename)
on error resume next
dim fso,tempArr,cPATH,ePATH,i:i = 0
set fso = server.createobject("scripting.filesystemobject")
sPATH = sPATH & filename & site_extname
if fso.fileexists(server.mappath(sPATH)) then
fso.deletefile(server.mappath(sPATH))
while(i <> -1)
i = i + 1
ePATH = replace(sPATH,filename & ".",filename & "_" & i + 1 & ".")
if fso.fileexists(server.mappath(ePATH)) then
fso.deletefile(server.mappath(ePATH))
else
i = -1
end if
wend
end if
end function
class stringclass
public function getstr(strhtml)
dim PatrnStr
PatrnStr="<.*?>"
dim objRegEx
set objRegEx = new RegExp
objRegEx.pattern = PatrnStr
objRegEx.ignorecase = true
objRegEx.global = true
getstr = objRegEx.replace(strhtml,"")
set objRegEx = nothing
end function
public function replacestr(patrn,mstr,replstr)
dim objRegEx
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
replacestr = objRegEx.replace(mstr,replstr)
set objRegEx = nothing
end function
public function classcustomtag(byval patrn,byval mstr,byval classid,byval indexid,byval pagestr)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(mstr)
for each match in matches
mstr = replace(mstr,match.value,parseclasstag(match.value,classid,indexid,pagestr))
next
set matches = nothing
set objRegEx = nothing
classcustomtag = mstr
end function
public function newscustomtag(byval patrn,byval mstr,byval classid,byval newsid,byval keywords)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(mstr)
for each match in matches
mstr = replace(mstr,match.value,parsenewstag(match.value,classid,newsid,keywords))
next
set matches = nothing
set objRegEx = nothing
newscustomtag = mstr
end function
end class
function processcustomtag(byval scontent)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = "{ncms:[^<>]+?\/}"
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(scontent)
for each match in matches
scontent = replace(scontent,match.value,parsetag(match.value))
next
set matches = nothin