DDR爱好者之家 Design By 杰米
<%
function loadtempletfile(byval path)
on error resume next
dim objstream
set objstream = server.createobject("adodb.stream")
with objstream
.type = 2
.mode = 3
.open
.loadfromfile server.mappath(path)
if err.number <> 0 then
err.clear
response.write("预加载的模板[" & path & "]不存在!")
response.end()
end if
.charset = "" & chrset & ""
.position = 2
loadtempletfile = .readtext
.close
end with
set objstream = nothing
end function
function movefiles(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) and fso.folderexists(server.mappath(dFolder)) then
fso.copyfolder server.mappath(sFolder),server.mappath(dFolder)
movefiles = true
else
movefiles = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
function renamefolder(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) then
fso.movefolder server.mappath(sFolder),server.mappath(dFolder)
renamefolder = true
else
renamefolder = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
function checkfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
checkfolder = true
else
checkfolder = false
end if
set fso = nothing
end function
function checkfile(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(sPATH)) then
checkfile = true
else
checkfile = false
end if
set fso = nothing
end function
function createdir(sPATH)
dim fso,pathArr,i,path_Level,pathTmp,cPATH
on error resume next
sPATH = replace(sPATH,"\","/")
set fso = server.createobject("scripting.filesystemobject")
pathArr = split(sPATH,"/")
path_Level = ubound(pathArr)
for i = 0 to path_Level
if i = 0 then pathTmp = pathArr(0) & "/" else pathTmp = pathTmp&pathArr(i) & "/"
cPATH = left(pathTmp,len(pathTmp)-1)
if not fso.folderexists(cPATH) then fso.createfolder(cPATH)
next
set fso = nothing
if err.number <> 0 then
err.clear
createdir = false
else
createdir = true
end if
end function
function delclassfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) 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 = nothing
set objRegEx = nothing
processcustomtag = scontent
end function
function X_processcustomtag(byval scontent)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = "(\[ncms:).+?(\])(.|\n)+?(\[\/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 = nothing
set objRegEx = nothing
X_processcustomtag = scontent
end function
function getattribute(byval strattribute,byval strtag)
dim objRegEx,matches
set objRegEx = new RegExp
objRegEx.pattern = lcase(strattribute)&"=""[0-9a-zA-Z]*"""
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(strtag)
if matches.count > 0 then
getattribute = split(matches(0).value,"""")(1)
else
getattribute = ""
end if
set matches = nothing
set objRegEx = nothing
end function
function getinnerhtml(byval strhtml)
dim objregex,matches,str
set objregex = new regexp
objregex.pattern = "(\])(.|\n)+?(\[\/ncms\])"
objregex.ignorecase = true
objregex.global = false
set matches = objregex.execute(strhtml)
if matches.count > 0 then
str = trim(matches.item(0).value)
end if
set matches = nothing
if len(str) > 8 then
getinnerhtml = mid(str,2,len(str) - 8)
end if
end function
function parsetag(byval strtag)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "news"
set objclass = new ncmsnewstag
if not isnumeric(getattribute("id",strtag)) then
response.write("标签[ncms:news]参数错误!参数[id]必须是数字!")
response.end()
end if
objclass.id = getattribute("id",strtag)
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:news]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:news]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.show = getattribute("show",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[ncms:news]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if getattribute("imgw",strtag) <> "" and not isnumeric(getattribute("imgw",strtag)) then
response.write("标签[ncms:news]参数错误!参数[imgw]必须是数字!")
response.end()
end if
objclass.imgw = getattribute("imgw",strtag)
if getattribute("imgh",strtag) <> "" and not isnumeric(getattribute("imgh",strtag)) then
response.write("标签[ncms:news]参数错误!参数[imgh]必须是数字!")
response.end()
end if
objclass.imgh = getattribute("imgh",strtag)
if getattribute("tgt",strtag) <> "" and getattribute("tgt",strtag) <> "blank" then
response.write("标签[ncms:news]参数错误!参数[tgt]必须是[<font color=""red"">blank</font>]!")
response.end()
end if
objclass.tgt = getattribute("tgt",strtag)
if getattribute("hit",strtag) <> "" and not isnumeric(getattribute("hit",strtag)) then
response.write("标签[ncms:free]参数错误!参数[hit]必须是数字!")
response.end()
end if
objclass.hit = getattribute("hit",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:news]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.newsshow(getattribute("ty",strtag),getattribute("col",strtag))
set objclass = nothing
case "free"
set objclass = new X_ncmsnewstag
if not isnumeric(getattribute("id",strtag)) then
response.write("标签[ncms:free]参数错误!参数[id]必须是数字!")
response.end()
end if
objclass.id = getattribute("id",strtag)
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:free]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:free]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.show = getattribute("show",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[ncms:free]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if getattribute("hit",strtag) <> "" and not isnumeric(getattribute("hit",strtag)) then
response.write("标签[ncms:free]参数错误!参数[hit]必须是数字!")
response.end()
end if
objclass.hit = getattribute("hit",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:free]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.newsshow(getattribute("ty",strtag),getattribute("col",strtag),getinnerhtml(strtag))
case "menu"
set objclass = new ncmsmenutag
parsetag = objclass.menushow(getattribute("show",strtag))
set objclass = nothing
case "info"
set objclass = new ncmsinfotag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:info]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:info]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
parsetag = objclass.infoshow()
set objclass = nothing
case "head"
set objclass = new ncmsheadtag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:head]参数错误!参数[num]必须是数字!")
response.end()
elseif getattribute("num",strtag) > 6 then
response.write("标签[ncms:head]参数错误!参数[num]在[1-6]之间!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:head]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
if getattribute("imgw",strtag) <> "" and not isnumeric(getattribute("imgw",strtag)) then
response.write("标签[ncms:head]参数错误!参数[imgw]必须是数字!")
response.end()
end if
objclass.imgw = getattribute("imgw",strtag)
if getattribute("imgh",strtag) <> "" and not isnumeric(getattribute("imgh",strtag)) then
response.write("标签[ncms:head]参数错误!参数[imgh]必须是数字!")
response.end()
end if
objclass.imgh = getattribute("imgh",strtag)
if getattribute("size",strtag) <> "" and not isnumeric(getattribute("size",strtag)) then
response.write("标签[ncms:head]参数错误!参数[size]必须是数字!")
response.end()
end if
objclass.size = getattribute("size",strtag)
parsetag = objclass.headshow(getattribute("ty",strtag))
set objclass = nothing
case "link"
set objclass = new ncmslinktag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:link]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:link]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.linkshow(getattribute("ty",strtag),getattribute("col",strtag))
set objclass = nothing
case else
response.write("标签[ncms:xxx]构造错误!")
response.end()
end select
end function
function parseclasstag(byval strtag,byval classid,byval indexid,byval pagestr)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "list"
set objclass = new ncmsclasstag
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:list]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.order = getattribute("order",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[news:list]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[news:list]参数错误!参数[col]必须是数字!")
response.end()
end if
parseclasstag = objclass.classshow(getattribute("ty",strtag),getattribute("col",strtag),classid,indexid,pagestr)
set objclass = nothing
case else
response.write("标签[news:xxxx]构造错误!")
response.end()
end select
end function
function parsenewstag(byval strtag,byval classid,byval newsid,byval keywords)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "relate"
set objclass = new ncmsrelatetag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[news:relate]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:relate]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[news:relate]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[news:relate]参数错误!参数[col]必须是数字!")
response.end()
end if
parsenewstag = objclass.relateshow(getattribute("col",strtag),classid,newsid,keywords)
set objclass = nothing
case "page"
set objclass = new ncmspagetag
parsenewstag = objclass.pageshow(getattribute("show",strtag),classid,newsid)
set objclass = nothing
case else
response.write("标签[news:xxxx]构造错误!")
response.end()
end select
end function
function getcurclasscount(classid)
dim rs,curclasscount
set rs = conn.execute("select count(*) from NCMS_news where classid in(" & classid & allchildclass(classid) & ")")
if instr(rs(0)/n_listnum,".") <> 0 then
curclasscount = fix(rs(0)/n_listnum) + 1
else
curclasscount = rs(0)/n_listnum
end if
rs.close:set rs = nothing
getcurclasscount = curclasscount
end function
class ncmsclasstag
public ty,len,order,lih
public function classshow(stype,scolumn,classid,indexid,pagestr)
dim TempHTM,xsql,rs,sql,databox,l,obox
TempHTM = "" & chr(10) & "<table cellpadding=""0"" cellspacing=""0"" width=""100%"" border=""0"">" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
if indexid = "" or indexid = 0 then
indexid = 1
end if
select case stype
case "text"
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,click,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,click,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td height=""" & lih & """ align=""left"" valign=""middle"">·<a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """ title=""" & rs("title") & """>" & gottopic(rs("title"),len) & "</a></td>" & chr(10)
TempHTM = TempHTM & "<td height=""" & lih & """ align=""center"" valign=""middle"">" & rs("click") & "</td>" & chr(10)
TempHTM = TempHTM & "<td height=""" & lih & """ align=""center"" valign=""middle"">" & rs("addtime") & "</td>" & chr(10)
if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
case "image"
if IsObjInstalled("persits.jpeg") = true and jpeg_gate = 0 then
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td><div id=""simg""><a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """><img height=""" & jpeg_height & """ src="/UploadFiles/2021-04-02/"> if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
if checkfile("" & site_root & "/" & site_upload & "/" & site_bimg & "/" & rs("bimg") & "") = true then
set obox = server.createobject("persits.jpeg")
obox.open server.mappath("" & site_root & "/" & site_upload & "/" & site_bimg & "/" & rs("bimg") & "")
obox.width = jpeg_width
obox.height = jpeg_height
obox.save server.mappath("" & site_root & "/" & site_upload & "/" & site_simg & "/" & rs("bimg") & "")
set obox = nothing
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
else
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td><div id=""simg""><a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """><img height=""" & jpeg_height & """ src="/UploadFiles/2021-04-02/"> if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
end if
case else
response.write("标签[news:list]参数[ty]错误!")
response.end()
end select
end function
end class
1234下一页阅读全文
function loadtempletfile(byval path)
on error resume next
dim objstream
set objstream = server.createobject("adodb.stream")
with objstream
.type = 2
.mode = 3
.open
.loadfromfile server.mappath(path)
if err.number <> 0 then
err.clear
response.write("预加载的模板[" & path & "]不存在!")
response.end()
end if
.charset = "" & chrset & ""
.position = 2
loadtempletfile = .readtext
.close
end with
set objstream = nothing
end function
function movefiles(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) and fso.folderexists(server.mappath(dFolder)) then
fso.copyfolder server.mappath(sFolder),server.mappath(dFolder)
movefiles = true
else
movefiles = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
function renamefolder(sFolder,dFolder)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sFolder)) then
fso.movefolder server.mappath(sFolder),server.mappath(dFolder)
renamefolder = true
else
renamefolder = false
set fso = nothing
call alertbox("系统没有找到指定的路径[" & sFolder & "]!",2)
end if
set fso = nothing
end function
function checkfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) then
checkfolder = true
else
checkfolder = false
end if
set fso = nothing
end function
function checkfile(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.fileexists(server.mappath(sPATH)) then
checkfile = true
else
checkfile = false
end if
set fso = nothing
end function
function createdir(sPATH)
dim fso,pathArr,i,path_Level,pathTmp,cPATH
on error resume next
sPATH = replace(sPATH,"\","/")
set fso = server.createobject("scripting.filesystemobject")
pathArr = split(sPATH,"/")
path_Level = ubound(pathArr)
for i = 0 to path_Level
if i = 0 then pathTmp = pathArr(0) & "/" else pathTmp = pathTmp&pathArr(i) & "/"
cPATH = left(pathTmp,len(pathTmp)-1)
if not fso.folderexists(cPATH) then fso.createfolder(cPATH)
next
set fso = nothing
if err.number <> 0 then
err.clear
createdir = false
else
createdir = true
end if
end function
function delclassfolder(sPATH)
on error resume next
dim fso
set fso = server.createobject("scripting.filesystemobject")
if fso.folderexists(server.mappath(sPATH)) 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 = nothing
set objRegEx = nothing
processcustomtag = scontent
end function
function X_processcustomtag(byval scontent)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = "(\[ncms:).+?(\])(.|\n)+?(\[\/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 = nothing
set objRegEx = nothing
X_processcustomtag = scontent
end function
function getattribute(byval strattribute,byval strtag)
dim objRegEx,matches
set objRegEx = new RegExp
objRegEx.pattern = lcase(strattribute)&"=""[0-9a-zA-Z]*"""
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(strtag)
if matches.count > 0 then
getattribute = split(matches(0).value,"""")(1)
else
getattribute = ""
end if
set matches = nothing
set objRegEx = nothing
end function
function getinnerhtml(byval strhtml)
dim objregex,matches,str
set objregex = new regexp
objregex.pattern = "(\])(.|\n)+?(\[\/ncms\])"
objregex.ignorecase = true
objregex.global = false
set matches = objregex.execute(strhtml)
if matches.count > 0 then
str = trim(matches.item(0).value)
end if
set matches = nothing
if len(str) > 8 then
getinnerhtml = mid(str,2,len(str) - 8)
end if
end function
function parsetag(byval strtag)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "news"
set objclass = new ncmsnewstag
if not isnumeric(getattribute("id",strtag)) then
response.write("标签[ncms:news]参数错误!参数[id]必须是数字!")
response.end()
end if
objclass.id = getattribute("id",strtag)
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:news]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:news]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.show = getattribute("show",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[ncms:news]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if getattribute("imgw",strtag) <> "" and not isnumeric(getattribute("imgw",strtag)) then
response.write("标签[ncms:news]参数错误!参数[imgw]必须是数字!")
response.end()
end if
objclass.imgw = getattribute("imgw",strtag)
if getattribute("imgh",strtag) <> "" and not isnumeric(getattribute("imgh",strtag)) then
response.write("标签[ncms:news]参数错误!参数[imgh]必须是数字!")
response.end()
end if
objclass.imgh = getattribute("imgh",strtag)
if getattribute("tgt",strtag) <> "" and getattribute("tgt",strtag) <> "blank" then
response.write("标签[ncms:news]参数错误!参数[tgt]必须是[<font color=""red"">blank</font>]!")
response.end()
end if
objclass.tgt = getattribute("tgt",strtag)
if getattribute("hit",strtag) <> "" and not isnumeric(getattribute("hit",strtag)) then
response.write("标签[ncms:free]参数错误!参数[hit]必须是数字!")
response.end()
end if
objclass.hit = getattribute("hit",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:news]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.newsshow(getattribute("ty",strtag),getattribute("col",strtag))
set objclass = nothing
case "free"
set objclass = new X_ncmsnewstag
if not isnumeric(getattribute("id",strtag)) then
response.write("标签[ncms:free]参数错误!参数[id]必须是数字!")
response.end()
end if
objclass.id = getattribute("id",strtag)
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:free]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:free]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.show = getattribute("show",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[ncms:free]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if getattribute("hit",strtag) <> "" and not isnumeric(getattribute("hit",strtag)) then
response.write("标签[ncms:free]参数错误!参数[hit]必须是数字!")
response.end()
end if
objclass.hit = getattribute("hit",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:free]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.newsshow(getattribute("ty",strtag),getattribute("col",strtag),getinnerhtml(strtag))
case "menu"
set objclass = new ncmsmenutag
parsetag = objclass.menushow(getattribute("show",strtag))
set objclass = nothing
case "info"
set objclass = new ncmsinfotag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:info]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:info]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
parsetag = objclass.infoshow()
set objclass = nothing
case "head"
set objclass = new ncmsheadtag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:head]参数错误!参数[num]必须是数字!")
response.end()
elseif getattribute("num",strtag) > 6 then
response.write("标签[ncms:head]参数错误!参数[num]在[1-6]之间!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:head]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
if getattribute("imgw",strtag) <> "" and not isnumeric(getattribute("imgw",strtag)) then
response.write("标签[ncms:head]参数错误!参数[imgw]必须是数字!")
response.end()
end if
objclass.imgw = getattribute("imgw",strtag)
if getattribute("imgh",strtag) <> "" and not isnumeric(getattribute("imgh",strtag)) then
response.write("标签[ncms:head]参数错误!参数[imgh]必须是数字!")
response.end()
end if
objclass.imgh = getattribute("imgh",strtag)
if getattribute("size",strtag) <> "" and not isnumeric(getattribute("size",strtag)) then
response.write("标签[ncms:head]参数错误!参数[size]必须是数字!")
response.end()
end if
objclass.size = getattribute("size",strtag)
parsetag = objclass.headshow(getattribute("ty",strtag))
set objclass = nothing
case "link"
set objclass = new ncmslinktag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:link]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[ncms:link]参数错误!参数[col]必须是数字!")
response.end()
end if
parsetag = objclass.linkshow(getattribute("ty",strtag),getattribute("col",strtag))
set objclass = nothing
case else
response.write("标签[ncms:xxx]构造错误!")
response.end()
end select
end function
function parseclasstag(byval strtag,byval classid,byval indexid,byval pagestr)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "list"
set objclass = new ncmsclasstag
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:list]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.order = getattribute("order",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[news:list]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[news:list]参数错误!参数[col]必须是数字!")
response.end()
end if
parseclasstag = objclass.classshow(getattribute("ty",strtag),getattribute("col",strtag),classid,indexid,pagestr)
set objclass = nothing
case else
response.write("标签[news:xxxx]构造错误!")
response.end()
end select
end function
function parsenewstag(byval strtag,byval classid,byval newsid,byval keywords)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "relate"
set objclass = new ncmsrelatetag
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[news:relate]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[news:relate]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[news:relate]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if not isnumeric(getattribute("col",strtag)) then
response.write("标签[news:relate]参数错误!参数[col]必须是数字!")
response.end()
end if
parsenewstag = objclass.relateshow(getattribute("col",strtag),classid,newsid,keywords)
set objclass = nothing
case "page"
set objclass = new ncmspagetag
parsenewstag = objclass.pageshow(getattribute("show",strtag),classid,newsid)
set objclass = nothing
case else
response.write("标签[news:xxxx]构造错误!")
response.end()
end select
end function
function getcurclasscount(classid)
dim rs,curclasscount
set rs = conn.execute("select count(*) from NCMS_news where classid in(" & classid & allchildclass(classid) & ")")
if instr(rs(0)/n_listnum,".") <> 0 then
curclasscount = fix(rs(0)/n_listnum) + 1
else
curclasscount = rs(0)/n_listnum
end if
rs.close:set rs = nothing
getcurclasscount = curclasscount
end function
class ncmsclasstag
public ty,len,order,lih
public function classshow(stype,scolumn,classid,indexid,pagestr)
dim TempHTM,xsql,rs,sql,databox,l,obox
TempHTM = "" & chr(10) & "<table cellpadding=""0"" cellspacing=""0"" width=""100%"" border=""0"">" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
if indexid = "" or indexid = 0 then
indexid = 1
end if
select case stype
case "text"
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,click,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,click,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td height=""" & lih & """ align=""left"" valign=""middle"">·<a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """ title=""" & rs("title") & """>" & gottopic(rs("title"),len) & "</a></td>" & chr(10)
TempHTM = TempHTM & "<td height=""" & lih & """ align=""center"" valign=""middle"">" & rs("click") & "</td>" & chr(10)
TempHTM = TempHTM & "<td height=""" & lih & """ align=""center"" valign=""middle"">" & rs("addtime") & "</td>" & chr(10)
if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
case "image"
if IsObjInstalled("persits.jpeg") = true and jpeg_gate = 0 then
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td><div id=""simg""><a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """><img height=""" & jpeg_height & """ src="/UploadFiles/2021-04-02/"> if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
if checkfile("" & site_root & "/" & site_upload & "/" & site_bimg & "/" & rs("bimg") & "") = true then
set obox = server.createobject("persits.jpeg")
obox.open server.mappath("" & site_root & "/" & site_upload & "/" & site_bimg & "/" & rs("bimg") & "")
obox.width = jpeg_width
obox.height = jpeg_height
obox.save server.mappath("" & site_root & "/" & site_upload & "/" & site_simg & "/" & rs("bimg") & "")
set obox = nothing
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
else
set rs = server.createobject("adodb.recordset")
if order = "desc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id desc"
elseif order = "asc" then
sql = "select classid,title,bimg,filename,addtime from NCMS_news where classid in(" & classid & allchildclass(classid) & ") and isimg=1 and created=1 and pagetype=0 order by id asc"
else
response.write("标签[news:list]参数[order]错误!")
response.end()
end if
rs.cursorlocation = 3
rs.open sql,conn,1,3
if rs.eof then
rs.close:set rs = nothing
TempHTM = "<li><font color=""red"">暂时没有新闻!</font></li>"
classshow = TempHTM
exit function
end if
rs.pagesize = n_listnum
rs.absolutepage = indexid
for l = 1 to rs.pagesize
if rs.eof then exit for
TempHTM = TempHTM & "<td><div id=""simg""><a href=""" & site_root & "/" & site_html & "/" & getclasspath(rs("classid")) & "/" & rs("filename") & site_extname & """><img height=""" & jpeg_height & """ src="/UploadFiles/2021-04-02/"> if l = rs.pagesize then
TempHTM = TempHTM & "</tr>" & chr(10)
else
if cint(l mod scolumn) = 0 then
TempHTM = TempHTM & "</tr>" & chr(10)
TempHTM = TempHTM & "<tr>" & chr(10)
end if
end if
rs.movenext
next
rs.close:set rs = nothing
TempHTM = TempHTM & "</table>" & chr(10)
classshow = TempHTM & pagestr
end if
case else
response.write("标签[news:list]参数[ty]错误!")
response.end()
end select
end function
end class
1234下一页阅读全文
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米
暂无评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
2024年11月24日
2024年11月24日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]