www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/makehtml_err.asp
<!--#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"> <meta copy="WWW.2KY.CN 共享世纪"> <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""><font color=""#000000"">"&TTNN&"</font></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""><font color=""#000000"">|"&TTNN&"|</font></a><br>" rs.MoveNext loop end if rs.close end if ''########读取本类top10 rs.open "select * from info where tid="&ttid&" order by hits desc",conn,1,1 if rs.eof then Txtop="<xoYu_CMS_CODE:NEWS:NEWS_TOP>·还没有文章</xoYu_CMS_CODE:NEWS:NEWS_TOP>" else do while not rs.eof if len(rs("Title"))>toplen then titley=left(rs("Title"),toplen)&"..." else titley=rs("Title") 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&"·<a title="""&rs("Title")&""" href=""../Html/"&filetop&"-1.Html"">"&xoyuTitle(titley)&"</a><br>" else Txtop=Txtop&"·<a title="""&rs("Title")&""" href=""../Html/shownews.asp?id="&rs("id")&""">"&xoyuTitle(titley)&"</a><br>" end if if h>=topshu then exit do rs.movenext loop h=0 end if Txtop="<xoYu_CMS_CODE:NEWS:NEWS_TOP>"&Txtop&"</xoYu_CMS_CODE:NEWS:NEWS_TOP>" rs.close search=search&"<xoYu_CMS_CODE:NEWS:SEARCH_FORM><form method=""post"" action=""../search.asp"">" search=search&"<input name=""k"" size=""15"" style=""border: 1px dotted #42A5F7; "">" search=search&"<br>" search=search&"<select name=""kt"">" search=search&"<option value=""../search.asp?type=title&k="""">按照标题搜索</option>" search=search&"<option value=""../search.asp?type=info&k="""">按照内容搜索</option>" search=search&"</select><br>" search=search&"<input name=""Submit"" src=""../images/d_search.gif"" type=""image"" value=""Submit"" align=""absmiddle"" border=""0""></xoYu_CMS_CODE:NEWS:SEARCH_FORM>" reply=reply&"<xoYu_CMS_CODE:NEWS:REPLY_FORM><FORM name=""myform"" action=""../replydo.asp"" method=""post""><INPUT type=""hidden"" value="""&id&""" name=""infoid"">" reply=reply&"您的大名:<INPUT size=""16"" name=""username""> <a target=""_blank"" href=""../reg.asp"">(点击这里注册)</a><BR></TD></TR>" reply=reply&"<TR><TD align=""left""><TEXTAREA name=""content"" onfocus=""this.value=''"" rows=""6"" cols=""70"">这里填写您的评论:)</TEXTAREA></TD></FORM></TR>" reply=reply&"<TR><TD align=""left"">友情提醒:评论请限制在100字以内,有长篇大论欢迎到论坛发表:)<INPUT onclick=""this.disabled=true; document.myform.submit();"" type=""submit"" value=""发表评论"" name=""submit""></xoYu_CMS_CODE:NEWS:REPLY_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="·还没有相关的评论!" 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 rcontent="<xoYu_CMS_CODE:NEWS:REPLY_NEWS>"&rcontent&"</xoYu_CMS_CODE:NEWS:REPLY_NEWS>" rs.close if se<>"" then '#######读取相关文章 rs.open "select id,title,date,dj from info where se='"&se&"' and se<>'' and id<>"&id&" order by date desc",conn,1,1 if rs.eof then xlist="·还没有相关文章" else do while not rs.eof g=g+1 titlez=rs("Title") 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"">"&xoyuTitle(titlez)&"</a></li>" else xlist=xlist&"<li type=""circle""><a href=""shownews.asp?id="&rs("id")&""">"&xoyuTitle(titlez)&"</a></li>" end if if g>=lelationshu then exit do rs.movenext loop g=0 end if xlist="<xoYu_CMS_CODE:NEWS:ABOUT_NEWS>"&xlist&"</xoYu_CMS_CODE:NEWS:ABOUT_NEWS>" else xlist="·还没有相关文章" end if set rs=nothing set rsm=nothing conn.close set conn=nothing '-------新闻内部连接开始 Function UrlName(Content) UrlContent=Content if UrlContent<>"" then set rsUrl=conn.execute("select website,Url from link order by ID Desc") while not rsUrl.eof UrlContent=replace(UrlContent,rsUrl("website"),"<xoYu_CMS_CODE:NEWS:IN_LINK><a href="&rsUrl("url")&" target=_blank>"&rsUrl("website")&"</a></xoYu_CMS_CODE:NEWS_IN_LINK>") rsUrl.movenext wend rsUrl.close set rsUrl=nothing end if UrlName=UrlContent End Function '-------新闻内部连接结束 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 infos=split(info,"[Page]") ip=ubound(infos) for k=0 to ip infop=infos(k)&"<xoYu_CMS_CODE:NEWS:REPLY_HITS><img border=""0"" src=""../count_news.asp?id="&id&""" width=""1"" height=""1""></xoYu_CMS_CODE:NEWS:REPLY_HITS>" infop="<xoYu_CMS_CODE:NEWS:NEWS_INFO>"&infop&"</xoYu_CMS_CODE:NEWS:NEWS_INFO>" 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,"[WEBTITLE]",WEBtitle) pencat=replace(pencat,"[xoYu_USER]",user) pencat=replace(pencat,"[xoYu_WRITER]",form_user) pencat=replace(pencat,"[xoYu_FORM]",form_url) pencat=replace(pencat,"[xoYu_HITS]",hits) pencat=replace(pencat,"[xoYu_DATE]",datetime) pencat=replace(pencat,"[xoYu_PAGE]",pl) 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>