⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makeall.asp

📁 这次自已做的美工,可能很难看,但主要是为提高效率,这次全部生成了静态,只有一个链接查看最新文章的列表没有生成,因为我觉得没必要生成,浪费空间大小,那是一个很少用到的功能!这次去掉了很多功能,这个版本主
💻 ASP
字号:
<!--#include file="setep.asp"-->
<!--#include file="../fn/fso.asp"-->
<!--#include file="../fn/cut.asp"-->
<!--#include file="seeadmin.asp"-->
<%

call nadmin
%>
<html><head><title>批量生成HTML</title></head>
<body>

<%
dim dtime,filename1,i
i=0
'出现导航条
daoshow="   &nbsp;<a href=../../index.htm>首页</a>"
set dao=conn.execute("select * from art_type where sid=-1")
do while not dao.eof
daoshow=daoshow&" | <a href=../../artical/"&dao("id")&"/1.htm>"&dao("art_type")&"</a>"
dao.movenext
loop
dao.close
set dao=nothing
mobansql="select mobanfile from moban,moban1 where moban.id=moban1.sid"
set rsmoban=conn.execute(mobansql)

strsql="select top 100 * from art_file"
set rs=conn.execute(strsql)

do while not rs.eof
fenid=rs("type")
'出现分类最新
set fennew=conn.execute("select top 10 * from art_file where type="&fenid&" order by id desc")
do while not fennew.eof 
fennewshow=fennewshow&"<tr><td><a href="&fennew("filename")&" target=_blank>"&left(fennew("title"),14)&"</a></td></tr>"
fennew.movenext
loop
set fennew=nothing
'出现分类热门
set fentick=conn.execute("select top 10 * from art_file where type="&fenid&" order by tick desc")
do while not fentick.eof 
fentickshow=fentickshow&"<tr><td><a href="&fentick("filename")&" target=_blank>"&left(fentick("title"),14)&"</a></td></tr>"
fentick.movenext
loop
set fentick=nothing
'读取当前所以位置
xiaodaoshow="当前位置:<a href=../../index.htm>首页</a>"
set xiaodao=conn.execute("select art_type,sid from art_type where id="&fenid)
if xiaodao("sid")=-1 then
xiaodaoshow=xiaodaoshow&"--><a href=../../artical/"&fenid&"/1.htm>"&xiaodao("art_type")&"</a>-->显示文章内容"
else
set xiaodao=conn.execute("select art_type,id,sid from art_type where id in(select sid from art_type where id="&fenid&")")
xiaodaoshow=xiaodaoshow&"--><a href=../../artical/"&xiaodao("id")&"/1.htm>"&xiaodao("art_type")&"</a>"
set xiaodao1=conn.execute("select art_type,sid from art_type where id="&fenid)
xiaodaoshow=xiaodaoshow&"--><a href=../../artical/"&fenid&"/1.htm>"&xiaodao1("art_type")&"</a>-->显示文章内容"
xiaodao1.close
set xiaodao1=nothing
end if
xiaodao.close
set xiaodao=nothing
'读取完成
folename="../news/"&fenid
CreateFolder(folename)
'''''''''''''''''以下是为了出现上下页篇
accid=rs("id")
strnext="select *from art_file where id>"&accid
strlast="select *from art_file where id<"&accid&" order by id desc"
set rsnext=conn.execute(strnext)
set rslast=conn.execute(strlast)

    if rslast.eof then 
	 lasttext="没有,这是第一篇!"
	 else
	 lastfile=rslast("filename")
         fenid=rslast("type")
	 lasttitle=d_cut(rslast("title"),1000,1)
	 lasttitle1=D_cut(rslast("title"),40,0)
	 lasttext = " <a href=../"&fenid&"/"&lastfile&" title="&lasttitle&">"&lasttitle1&"</a>  "
	   end if 
	        if rsnext.eof then 
	 nexttext="没有,这是最后一篇!"
	 else
	 nextfile=rsnext("filename")
          nfenid=rsnext("type")
	 nexttitle=d_cut(rsnext("title"),1000,1)
	nexttitle1=D_cut(rsnext("title"),40,0)
	 nexttext=" <a href=../"&nfenid&"/"&nextfile&" title="&nexttitle&">"&nexttitle1&"</a>"
	   end if 

'这个fn/moban6.htm是模板所在的路径
okfile=fsow("../moban/"&rsmoban("mobanfile"))

dtime1=now()

file1=server.mappath( ""&folename&"" )

file2=file1&"\"&rs("filename")
filename1=rs("filename")


title=rs("title")
dtime=rs("arttime")
author=rs("author")
artical=rs("artical")
tick=rs("tick")
pid=rs("id")


okfile = replace(okfile,"title1",title)
okfile = replace(okfile,"author",author)
okfile = replace(okfile,"arttime",dtime)
okfile = replace(okfile,"tick",tick)
okfile = replace(okfile,"$id$",pid)
okfile = replace(okfile,"$上一篇内容$",lasttext)
okfile = replace(okfile,"$下一篇内容$",nexttext)
okfile = replace(okfile,"$k_logo$",k_logo)
okfile = replace(okfile,"$k_banner$",k_banner)
okfile = replace(okfile,"$chtime$",chtime)
okfile = replace(okfile,"$chaddr$",chaddr)
okfile = replace(okfile,"$chcopy$",chcopy)
okfile = replace(okfile,"$k_sg$",k_sg)
okfile = replace(okfile,"$k_meta$",k_meta)
okfile = replace(okfile,"$chcom$",chcom)
okfile = replace(okfile,"$chtel$",chtel)
okfile = replace(okfile,"$chyou$",chyou)
okfile = replace(okfile,"$chemail$",chemail)
okfile = replace(okfile,"$gouanggao$",k_wg)
okfile = replace(okfile,"$最新文章$",fennewshow)
okfile = replace(okfile,"$热门文章$",fentickshow)
okfile = replace(okfile,"$导航条$",daoshow)
okfile = replace(okfile,"$当前所在条$",xiaodaoshow)
fennewshow=""
fentickshow=""
set rsgb=conn.execute("select * from gbite")
do while not rsgb.eof
gbite=rsgb("gbite")
gaddr=rsgb("gaddr")
gaddr="<a href="&gaddr&" target=_blank>"&gbite&"</a>"
artical=replace(artical,gbite,gaddr)
rsgb.movenext
loop
rsgb.close
set rsgb=nothing
okfile = replace(okfile,"article",artical)
 Set fso = Server.CreateObject("Scripting.FileSystemObject")
  Set fout = fso.Createtextfile(file2,true)
 fout.writeline okfile
fout.close
i=i+1
%>
更新完成<%=I%> :  <%=filename1%>,单击<a href='<%=folename%>/<%=filename1%>' target="_blank">查看</a><br>
<%
 rs.movenext
    loop
%>
<%
''''添加到系统日志
set rsn=Server.CreateObject("ADODB.RECORDSET")
rsn.open "select *from sysdong",conn,1,3
rsn.addnew
rsn("koyee_user")=Session("admin")
rsn("koyee_dong")="更新所有文件"
rsn("arttime")=now()
rsn.update
rsn.close
set rsn=nothing
''''添加系统日志完毕
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -