www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/special_makelist.asp
<%Admin="InfoMake"%> <!--#include file="check.asp"--> <!--#include file="mdb_path_info.asp"--> <!--#include file="top.asp"--> <% set rs=server.createobject("adodb.recordset") set rList_info=server.CreateObject("ADODB.RecordSet") set rList_yl=server.CreateObject("ADODB.RecordSet") set rsm=server.createobject("adodb.recordset") sid=request("sid") currentPage=cint(request("page")) MaxPerPage=cint(request("MaxPerPage")) rs.open "select * from specialx where id="&sid,conn,1,1 MbName=rs("MbName") imageshu=rs("imageshu") imagelen=rs("imagelen") imagewid=rs("imagewid") Imagevshu=rs("Imagevshu") imagevlen=rs("imagevlen") imagevwid=rs("imagevwid") newshuset=rs("newshuset") topshu=rs("topshu") toplen=rs("toplen") chalen=rs("chalen") TypePic="<img border=""0"" src="""&rs("TypePic")&""">" TypePicmore="<img border=""0"" src="""&rs("TypePicmore")&""">" rs.close rsm.open "select * from mb where id="&mbname,conn,1,1 pencat=rsm("MbContent") rsm.close newshu=10 '每个分类显示最新文章数 search=search&"<form method=""post"" action=""../search.asp"">" search=search&"<input name=""k"" size=""25"" 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"">" '################ 读取标题 等.. 开始 ################ rs.open "select * from specialx where id="&sid,conn,1,1 if not rs.eof then ts=rs("ts") TN=split(rs("sname"),"|") 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=""../special/List_"&TI(i)&"_1.Html"" class=""biginfodh"">"&TN(i)&"</a>" thistitle=thistitle & " "&TN(i)&"" next end if rs.close sql="select * from specialx where ts like '"&ts&"%'" rs.open sql,conn,1,1 if not rs.eof then do while not rs.eof sqqq=sqqq& ""&rs("id")&", " rs.MoveNext loop end if rs.close ''########读取下级分类 rs.open "select * from specialx where tn="&sid&" order by id",conn,1,1 if NOT rs.EOF then TTY="NO" sname=all_type_name do while NOT rs.EOF TTNN=split(rs("sname"),"|")(rs("tj")-1) TXlist=TXlist&" |<a href=""../special/List_"&rs("id")&"_1.Html"">"&TTNN&"</a>|<br />" rs.MoveNext loop end if rs.close if TTY_id<>"" and TTY<>"NO" then rs.open "select * from specialx where tn="&TTY_id&" order by id",conn,1,1 if NOT rs.EOF then sname=TTY_name do while NOT rs.EOF TTNN=split(rs("sname"),"|")(rs("tj")-1) TXlist=TXlist&" |<a href=""../special/List_"&rs("id")&"_1.Html"">"&TTNN&"</a>|<br>" rs.MoveNext loop end if rs.close end if '读取文章分类列表 sql="select * from specialx where tn="&sid&" order by id" rs.open sql,conn,1,1 if NOT rs.EOF then allshu=rs.recordcount Dim list_1(20) Dim list_2(20) Dim list_3(20) do while NOT rs.EOF ii=ii+1 list_1(ii)="<a href=""List_"&rs("id")&"_1.Html"">"&split(rs("sname"),"|")(rs("tj")-1)&"</b>" list_2(ii)="<a href=""List_"&rs("id")&"_1.Html"">"&TypePicmore&"</a>" i=0 sqqq_yl="" sql_yl="select * from specialx where ts like '"&rs("ts")&"%'" rList_yl.open sql_yl,conn,1,1 if not rList_yl.eof then do while not rList_yl.eof sqqq_yl=sqqq_yl& " or sid="&rList_yl("id")&"" rList_yl.MoveNext loop end if rList_yl.close rList_info.open "select id,title,date,dj from info where sid="&rs("id")&""&sqqq_yl&" order by id desc",conn,1,1 if NOT rList_info.EOF then do while not rList_info.eof fileming=year(rList_info("date"))&month(rList_info("date"))&day(rList_info("date"))&hour(rList_info("date"))&minute(rList_info("date"))&second(rList_info("date")) titlex=rList_info("Title") if rList_info("dj")=6 then list_3(ii)=list_3(ii)&"<li><a title="""&rList_info("Title")&""" target=""_blank"" href=""../Html/"&fileming&"-1.Html"">"&titlex&"</a></li>" end if i=i+1 if i>=newshu then exit do rList_info.movenext loop end if rList_info.close rs.MoveNext loop end if 'if allshu="" then 'lxty="暂无内容!" 'else 'lxty=lxty&"<table border=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%"" >" ' if allshu<=2 then ' shu=1 ' else ' if allshu>2 then ' if allshu/2-int(allshu/2)>0 then ' shu=allshu/2+1 ' else ' shu=allshu/2 ' end if ' end if ' end if ' for a=1 to shu ' lxty=lxty&"<tr>" ' for i=1 to 2 ' aa=aa+1 ' lxty=lxty&"<td width=""286"">"&list_1(""&aa&"")&"</td>" ' if i=1 then ' lxty=lxty&"<td width=""5""></td>" ' end if ' next ' lxty=lxty&"</tr><tr><td width=""286"" height=""1"" bgcolor=""#93bb00""></td><td width=""5"" height=""1""></td>" ' lxty=lxty&"<td width=""286"" height=""1"" bgcolor=""#93bb00""></td></tr><tr>" ' for i=1 to 2 ' aaa=aaa+1 ' lxty=lxty&"<td width=""286"" valign=""top"">"&list_3(""&aaa&"")&"<p align=""right"">"&list_2(""&aaa&"")&"</p></td>" ' if i=1 then ' lxty=lxty&"<td width=""5""></td>" ' end if ' next ' lxty=lxty&"</tr>" ' next ' lxty=lxty&"</table>" 'end if if allshu="" then lxtyv="暂无内容!" else lxtyv=lxtyv&"<div class=""1class"">" for s=1 to allshu lxtyv=lxtyv&"<ul>" ss=ss+1 lxtyv=lxtyv&"<div class=""left-t""><img src=""../images/b.gif"" width=""8"" height=""10"" /> <h5>"&list_1(""&ss&"")&"</h5></div>" sss=sss+1 lxtyv=lxtyv&"<li>"&list_3(""&sss&"")&"</li>" lxtyv=lxtyv&"<li class=""more"">"&list_2(""&sss&"")&"</li></ul>" next lxtyv=lxtyv&"</div>" end if rs.close '########读取本类排行榜 sql="select * from info where sid in("&sqqq&") order by hits desc" rs.open sql,conn,1,1 if rs.eof then Txtop="·还没有文章" else do while not rs.eof filetop=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) titley=rs("Title") h=h+1 if rs("dj")=6 then Txtop=Txtop&"<li><a title="""&rs("Title")&""" target=""_blank"" 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 '读取分类文章图片 ' i=0 ' sql="select * from info where tid in("&sqqq&") and pic<>'' order by date desc" ' rs.open sql,conn,1,1 ' if rs.eof then ' image="还没有图片文章" ' else ' do while not rs.eof ' fileimg=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) ' noid=noid&" and id<>"&rs("id")&"" ' i=i+1 ' image=image&"<a target=""_blank"" href=""../Html/"&fileimg&"-1.html"">" ' image=image&"<img src="""&rs("pic")&""" width=""120"" height=""100"" class=""4pic"" title="""&rs("title")&""" /></a>" ' if i>=imageshu then exit do ' rs.movenext ' loop ' end if ' rs.close '读取专题文章图片 p=0 sql="select * from info where sid in("&sqqq&") and pic<>'' order by date desc" rs.open sql,conn,1,1 if rs.eof then image="还没有图片文章" else do while not rs.eof fileimg=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) noid=noid&" and id<>"&rs("id")&"" p=p+1 image=image&"<a target=""_blank"" href=""../Html/"&fileimg&"-1.html"">" image=image&"<img src="""&rs("pic")&""" width=""120"" height=""100"" class=""4pic"" title="""&rs("title")&""" /></a>" if p>=imageshu then exit do rs.movenext loop end if rs.close '读取文章列表 sql="select * from info where sid in("&sqqq&") order by date desc" rs.open sql,conn,1,1 if rs.eof then lb=lb&"<tr><td width=""100%"" colspan=""3"">对不起! 没有相关文章</td></tr>" mpage=1 allshu=0 else rs.pagesize=MaxPerPage '得到每页数 mpage=rs.pagecount '得到总页数 rs.move (currentPage-1)*MaxPerPage allshu=rs.recordcount h=0 do while not rs.eof h=h+1 titlez=rs("Title") fileming1=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date")) lb=lb&"<li> " lb=lb&"<a href=""../Html/"&fileming1&"-1.html"" title="""&year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date"))&"日更新"">"&titlez&"</a>" lb=lb&" " lb=lb&"<span class=""grey""> - 点"&rs("hits")&"次</li></span>" '修改MaxPerPage为25 if h>=25 then exit do rs.movenext loop end if rs.close set rs=nothing set rsm=nothing set rList_yl=nothing set rList_info=nothing conn.close set conn=nothing '#########读取页次 fpage=fpage&"页次:<b>"¤tPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 文章数<b>"&allshu&"</b>" pageno=currentPage if cint(pageno)>1 then fpage=fpage&" <a href=../list/list_"&tid&"_1.html title=""首页"">" end if fpage=fpage&" 首页</a> " if cint(pageno)>1 then fpage=fpage&"<a href=../list/list_"&tid&"_"&pageno-1&".html title=""上页"">" end if fpage=fpage&"上页</a>" pp=cint(pageno)-2 if pp<1 then pp=1 end if fpage=fpage&" " if cint(pageno)< mpage then fpage=fpage&"<a href=../list/list_"&tid&"_"&pageno+1&".html title=""下页"">" end if fpage=fpage&"下页</a> " if cint(pageno)< mpage then fpage=fpage&"<a href=../list/list_"&tid&"_"&mpage&".html title=""末页"">" end if fpage=fpage&"末页</a>" fpage=fpage&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">" fpage=fpage&"到<select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">" for i=1 to mpage selected="" if currentpage=i then selected=" selected" end if fpage=fpage&"<option value=../list/list_"&tid&"_"&i&".html"&selected&">"&i&"</option>" next fpage=fpage&"</select>页" '################ 读取完成 ################ pencat=replace(pencat,"[TITLE]",thistitle) pencat=replace(pencat,"[xoYu_NAME]",tname) pencat=replace(pencat,"[xoYu_BJlist]",txlist) pencat=replace(pencat,"[xoYu_BJTOP]",Txtop) pencat=replace(pencat,"[xoYu_IMAGE]",image) pencat=replace(pencat,"[xoYu_PIC]",imagev) pencat=replace(pencat,"[xoYu_LIST]",lxty) pencat=replace(pencat,"[xoYu_DANHANG]",lxtyv) pencat=replace(pencat,"[xoYu_TYPEPIC]",TypePic) pencat=replace(pencat,"[xoYu_SEARCH]",search) pencat=replace(pencat,"[xoYu_LB]",lb) pencat=replace(pencat,"[xoYu_PAGE]",fpage) pencat=replace(pencat,"[xoYu_TXT]",typetxt) pencat=replace(pencat,"[xoYu_TYPE]",thistype) Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fout = fso.CreateTextFile(server.mappath("../special/List_"&sid&"_"¤tPage&".Html")) fout.Write pencat fout.close Set fout = nothing Set fso = nothing '************** 生成HTML页 结束 *************** %>