📄 create_jsfiles.asp
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/function.asp" -->
<HTML><HEAD><TITLE>后台管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!-- #include file="admin_header.asp" -->
<table width="100%" border="0" cellspacing="2">
<tr>
<td width="20%" align="center" valign="top" class="tdbgleft"><!-- #include file="Admin_Left.asp" --></td>
<td class="b1" valign="top">
<%
if not isnull(cUserName) or cUserName<>"" then
if chkMaster(cUserName) then
Server.ScriptTimeOut=9999999
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set Rs=server.createobject("adodb.recordset")
dim msgtitle,sel
if Request("action")="soft" then
call soft_jsFiles()
call Sysmsg("操作完成","生成软件下载相关的JS文件完成!")
elseif Request("action")="article" then
call article_jsFiles()
call Sysmsg("操作完成","生成文章系统相关的JS文件完成!")
elseif Request("action")="other" then
sel=split(Trim(Request.Form("sel")),",")
msginfo=""
for ii = 0 to ubound(sel)
select case trim(sel(ii))
case "1"
call soft_navMenu()
case "2"
call soft_Search()
case "3"
call soft_category_html()
case "4"
call article_navMenu()
case "5"
call article_Search()
case "6"
call article_category_html()
end select
msginfo=msginfo
next
call Sysmsg("操作完成",msginfo)
else
call main()
end if
Set Rs=nothing
Set fso=nothing
else
msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>"
call Sysmsg(msgtitle,msginfo)
end if
else
msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp"">点此登录系统</a></li>"
call Sysmsg(msgtitle,msginfo)
end if
sub soft_navMenu()
HtmlContent=replace(soft_catemenu(),chr(13)&chr(10),"")
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/soft_menu.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
msginfo=msginfo&"<li>生成软件分类导航栏JS文件 完成!"
end sub
sub soft_Search()
HtmlContent=replace(Search_Soft(),chr(13)&chr(10),"")
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/soft_Search.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
msginfo=msginfo&"<li>生成软件搜索表单JS文件 完成!"
end sub
sub article_navMenu()
HtmlContent=replace(article_catemenu(),chr(13)&chr(10),"")
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/article_menu.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
msginfo=msginfo&"<li>生成文章分类导航栏JS文件 完成!"
end sub
sub article_Search()
HtmlContent=replace(Search_article(),chr(13)&chr(10),"")
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/article_Search.js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
msginfo=msginfo&"<li>生成文章搜索表单JS文件 完成!"
end sub
'生成软件下载排行等JS文件
sub soft_jsFiles()
Set CateRs=server.createobject("adodb.recordset")
sql="select * from SoftDown_Catalog"
CateRs.open sql,conn,1,1
if not(CateRs.eof and CateRs.bof) then
do while not CateRs.eof
SoftNum=cint(Trim(Request.Form("SoftNum")))
cutNum=cint(Trim(Request.Form("cutNum")))
if CateRs("Depth")=0 then
HtmlContent=replace(get_AllTop(CateRs("CatalogID"),SoftNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(get_AllTop(CateRs("CatalogID"),SoftNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Catalog_AllTop_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
if CateRs("Depth")=0 then
HtmlContent=replace(get_DayTop(CateRs("CatalogID"),SoftNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(get_DayTop(CateRs("CatalogID"),SoftNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Catalog_DayTop_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
if CateRs("Depth")=0 then
HtmlContent=replace(get_WeekTop(CateRs("CatalogID"),SoftNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(get_WeekTop(CateRs("CatalogID"),SoftNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Catalog_WeekTop_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
if CateRs("Depth")=0 then
HtmlContent=replace(get_MonthTop(CateRs("CatalogID"),SoftNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(get_MonthTop(CateRs("CatalogID"),SoftNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Catalog_MonthTop_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
CateRs.movenext
loop
end if
CateRs.close
Set CateRs=nothing
end sub
sub article_jsFiles()
Set CateRs=server.createobject("adodb.recordset")
sql="select * from info_Catalog"
CateRs.open sql,conn,1,1
if not(CateRs.eof and CateRs.bof) then
do while not CateRs.eof
articleNum=cint(Trim(Request.Form("articleNum")))
cutNum=cint(Trim(Request.Form("cutNum")))
'文章阅读排行
if CateRs("Depth")=0 then
HtmlContent=replace(article_top(CateRs("CatalogID"),articleNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(article_top(CateRs("CatalogID"),articleNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Article_Catalog_Top_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
'推荐文章
if CateRs("Depth")=0 then
HtmlContent=replace(article_hot(CateRs("CatalogID"),articleNum,cutNum,0,1),chr(13)&chr(10),"")
else
HtmlContent=replace(article_hot(CateRs("CatalogID"),articleNum,cutNum,0,0),chr(13)&chr(10),"")
end if
HtmlContent="document.write('"&HtmlContent&"');"
HtmlFileName=Server.MapPath("js/Article_Catalog_Hot_"&CateRs("CatalogID")&".js")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
CateRs.movenext
loop
end if
CateRs.close
Set CateRs=nothing
end sub
sub soft_category_html()
'读取默认模板
sql="select ID,Header,Footer,Normal_htm from SoftDown_Template where isActive=true"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "您没有添加模板,或者没有设置默认模板。"
response.end
else
HtmlTemplate=rs("Header")&rs("Normal_htm")&rs("Footer")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -