www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/makehtml.asp
<%@language=vbscript codepage=936 %> <% '强制浏览器重新访问服务器下载页面,而不是从缓存读取页面 Response.Buffer = True Response.Expires = -1 Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" %> <!--#include file="check.asp"--> <!--#include file="mdb_path_info.asp"--> <!--#include file="config.asp"--> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>批量生成HTML</title> <style> body{font-size:9pt;line-height:140%} </style> </head> <body> <% '========================================== ' ' 晓宇听幽新闻文章管理系统 2004 ' ' 主页地址:http://www.xoYu.com ' '========================================== '程序名称:晓宇听幽新闻文章管理系统 '英文名称:xoYu News 2004 Professional '程序创建时间:2003-7-10 '程序完成时间:2003-9-11 '最后修改时间:2003-10-10 '========================================== set rs=server.createobject("adodb.recordset") set rsm=server.createobject("adodb.recordset") id=request("id") rs.open "select * from info where id="&request("id"),conn,1,1 if not rs.eof then ttid=rs("tid") id=rs("id") se=rs("se") if instr(rs("Title"),"<font")>0 then title=rs("Title")&"</font>" else title=rs("Title") end if user=rs("user") form_user=rs("form_user") form_url=rs("form_url") info=rs("info") hits=rs("hits") datetime=year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date")) fileming=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) end if rs.close rs.open "select * from info where id="&request("id"),conn,1,1 MbName=rs("MbName") rs.close rsm.open "select * from mb where id="&mbname,conn,1,1 pencat=rsm("MbContent") rsm.close if link="1" then f=0 rs.open "select * from specialx where tj=1 order by id desc",conn,1,1 smax=rs.recordcount do while not rs.eof spname=rs("specialGJ") nbid=rs("id") spename="<a target=""_blank"" href=""../Special/List_"&nbid&"_1.Html""><font color=""#6699FF"">"&spname&"</font></a>" info=replace(info,""&spname&"",""&spename&"") if f>=smax then exit do rs.movenext loop rs.close end if if form_user<>"" then else form_user="未知" end if if form_url<>"" then else form_url="未知" end if '################ 读取标题 等.. 开始 ################ rs.open "select * from infotype where id="&ttid,conn,1,1 topshu=rs("topshu") toplen=rs("toplen") ts=rs("ts") TN=split(rs("tname"),"|") TI=split(rs("ts"), ",") for i = 0 to ubound(TN)-1 if i=ubound(TN)-2 and ubound(TN)>1 then TTY_id=TI(i) TTY_name=TN(i) end if all_type_top_id=TI(i) all_type_name=TN(i) thistype=thistype & " -> <a href=""../list/list_"&TI(i)&"_1.Html"">"&TN(i)&"</a>" thistitle=thistitle & " - "&TN(i)&"" ttype=TN(i) next rs.close ''########读取同级分类 rs.open "select * from infotype where tn="&ttid&" order by id",conn,1,1 if NOT rs.EOF then TTY="NO" Tname=all_type_name do while NOT rs.EOF TTNN=split(rs("tname"),"|")(rs("tj")-1) txlist=txlist&"|<a href=""../list/list_"&rs("id")&"_1.Html""><span style=""color:#000;"">"&TTNN&"</span></a>|<br />" rs.MoveNext loop end if rs.close if TTY_id<>"" and TTY<>"NO" then rs.open "select * from infotype where tn="&TTY_id&" order by id",conn,1,1 if NOT rs.EOF then Tname=TTY_name do while NOT rs.EOF TTNN=split(rs("tname"),"|")(rs("tj")-1) txlist=txlist&" |<a href=""../list/list_"&rs("id")&"_1.Html""><span style=""color:#000;"">"&TTNN&"</span></a>|<br />" rs.MoveNext loop end if rs.close end if ''########读取本类top10 topshu=30 rs.open "select * from info where tid="&ttid&" order by hits desc",conn,1,1 if rs.eof then Txtop="·还没有文章" else do while not rs.eof if instr(rs("Title"),"<font")>0 then toplen1=toplen+20 if len(rs("Title"))>toplen1 then titley=left(rs("Title"),toplen1)&"</font>"&"..." else titley=rs("Title")&"</font>" end if else if len(rs("Title"))>toplen then titley=left(rs("Title"),toplen)&"..." else titley=rs("Title") end if end if h=h+1 filetop=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) if rs("dj")=6 then Txtop=Txtop&"<li><a title="""&rs("Title")&""" href=""../Html/"&filetop&"-1.Html"">"&titley&"</a></li>" end if if h>=topshu then exit do rs.movenext loop h=0 end if rs.close search=search&"<form method=""post"" action=""../search.asp"">" search=search&"<input name=""k"" size=""20"" style=""border: 1px solid #cccccc; "">" search=search&"<br>" search=search&"<select name=""type"">" search=search&"<option value=""title"">按照标题搜索</option>" search=search&"<option value=""info"">按照内容搜索</option>" search=search&"</select> " search=search&"<input name=""Submit"" src=""../images/d_search.gif"" type=""image"" value=""Submit"" align=""absmiddle"" border=""0""></form>" reply=reply&"<form action=""../replydo.asp"" method=""post"" name=""myform"" id=""myform""><input type=""hidden"" value="""&id&""" name=""infoid"">" reply=reply&"用户名:<input name=""username"" type=""text"" id=""username"" size=""10"" class=""nb"" />(<a href=""../reg.asp"" target=""_blank""><u>新注册</u></a>) 密码:<input name=""password"" type=""password"" id=""password"" size=""10"" class=""nb"" /><input name=""nomember"" type=""checkbox"" id=""nomember"" value=""1"" disabled=""disabled"" /> 匿名评论 <input type=""submit"" onclick=""document.myform.submit();"" value=""提交评论"" name=""Submit"" style=""width:60;height:20;font-size:9pt"" />" reply=reply&"<br />评论内容:不能超过100字,请自觉遵守互联网相关政策法规。" reply=reply&"<textarea name=""content"" class=""content"" onfocus=""this.value=''"">请注册后填写您的评论!</textarea><br /></form>" ''########读取相关评论 rs.open "select * from Reply where InfoId="&id&" and check='1' order by date desc",conn,1,1 rmax=rs.recordcount if rs.eof then rcontent="<li>还没有相关的评论!</li>" else do while not rs.eof x=x+1 rcontent=rcontent&"<p>"&rs("username")&":<br> "&rs("content")&"</p>" if x>=rmax then exit do rs.movenext loop x=0 end if rs.close if se<>"" then '#######读取相关文章 '来自动力3.52的程序段 dim strKey,arrKey,i key=se strKey=mid(se,2,len(se)-2) if instr(strkey,"|")>1 then arrKey=split(strKey,"|") strKey="((se like '%|" & arrKey(0) & "|%')" for i=1 to ubound(arrKey) strKey=strKey & " or (se like '%|" & arrKey(i) & "|%')" next strKey=strKey & ")" else strKey="(se like '%|" & strKey & "|%')" end if '------------------------- rs.open "select id,title,date,dj from info where " & strKey & " and se<>'' and id<>"&id&" order by date desc",conn,1,1 if rs.eof then xlist="<li>还没有相关文章</li>" else do while not rs.eof g=g+1 if instr(rs("Title"),"<font")>0 then titlez=rs("Title")&"</font>" else titlez=rs("Title") end if filexg=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) if rs("dj")=6 then xlist=xlist&"<li type=""circle""><a href="""&filexg&"-1.Html"">"&titlez&"</a></li>" else xlist=xlist&"<li type=""circle""><a href=""shownews.asp?id="&rs("id")&""">"&titlez&"</a></li>" end if if g>=lelationshu then exit do rs.movenext loop g=0 end if else xlist="<li>还没有相关文章</li>" end if set rs=nothing set rsm=nothing conn.close set conn=nothing infos=split(info,"[page]") ip=ubound(infos) for k=0 to ip pl=pl&"<a href=""../Html/"&fileming&"-"&k+1&".Html"">"&k+1&"</a> " next pl=pl&"页 → 共 "&k&" 页" infos=split(info,"[page]") ip=ubound(infos) for k=0 to ip infop=infos(k)&"<img border=""0"" src=""../down_info.asp?id="&id&""" width=""1"" height=""1"">" pencat=replace(pencat,"[xoYu_TYPE]",thistype) pencat=replace(pencat,"[xoYu_NAME]",ttype) pencat=replace(pencat,"[xoYu_TITLE]",thistitle) pencat=replace(pencat,"[xoYu_BJlist]",txlist) pencat=replace(pencat,"[xoYu_BJtop]",Txtop) pencat=replace(pencat,"[xoYu_ALIST]",xlist) pencat=replace(pencat,"[xoYu_SEARCH]",search) pencat=replace(pencat,"[xoYu_ID]",id) pencat=replace(pencat,"[TITLE]",title) pencat=replace(pencat,"[xoYu_USER]",user) pencat=replace(pencat,"[xoYu_WRITER]",form_user) pencat=replace(pencat,"[xoYu_FORM]",form_url) pencat=replace(pencat,"$id$",id) pencat=replace(pencat,"[xoYu_DATE]",datetime) pencat=replace(pencat,"[xoYu_PAGE]",pl) pencat=replace(pencat,"[KEY]",Key) pencat=replace(pencat,"[xoYu_content]",infop) pencat=replace(pencat,"[xoYu_RCONTENT]",rcontent) pencat=replace(pencat,"[xoYu_REPLY]",reply) Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fout = fso.CreateTextFile(server.mappath("../Html/"&fileming&"-"&k+1&".Html")) fout.Write pencat fout.close pencat=replace(pencat,""&infop&"","[xoYu_content]") next '************** 生成HTML页 结束 *************** if request("type")="page" then%><font color="#FF0000">生成文章内容页完成</font><script LANGUAGE="JavaScript"> <!-- setTimeout('window.close();', 500); // --> </script> <%end if%> </body></html>