www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/makelist.asp

    <%Admin="InfoMake"%>
<%
'强制浏览器重新访问服务器下载页面,而不是从缓存读取页面
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"-->
<%
'==========================================
'
'  晓宇听幽新闻文章管理系统 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 rs_info=server.CreateObject("ADODB.RecordSet")
set rs_yl=server.CreateObject("ADODB.RecordSet")
set rsm=server.createobject("adodb.recordset")
tid=request("tid")
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))
rs.open "select * from infotype where id="&tid,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=newshuset '每个分类显示最新文章数

search=search&"<form method=""post"" action=""../search.asp"">"
search=search&"<td height=""25"" nowrap><p align=""center"">"          
search=search&"<input name=""k"" size=""25"" style=""border: 1px dotted #42A5F7; "">"
search=search&"<p align=""center"">"
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><p align=""center"">"
search=search&"<input name=""Submit"" src=""../images/d_search.gif"" type=""image"" value=""Submit"" align=""absmiddle"" border=""0""></td></form>"     

'################ 读取标题 等.. 开始 ################
  rs.open "select * from infotype where id="&tid,conn,1,1
  if not rs.eof then
    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""  class=""biginfodh"">"&TN(i)&"</a>"
             thistitle=thistitle & "  "&TN(i)&""
          next
  end if
  rs.close

sql="select * from infotype 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 infotype where tn="&tid&" 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"">"&TTNN&"</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"">"&TTNN&"</a>|<br />"
rs.MoveNext
loop
end if
rs.close
end if
'读取文章分类列表
sql="select * from infotype where tn="&tid&" 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("tname"),"|")(rs("tj")-1)&"</a>"
list_2(ii)="<a href=""List_"&rs("id")&"_1.html"">"&TypePicmore&"</a>"
                  i=0
                  sqqq_yl=""
                  sql_yl="select * from infotype where ts like '"&rs("ts")&"%'"
                  rs_yl.open sql_yl,conn,1,1
                  if not rs_yl.eof then
                  do while not rs_yl.eof
                  sqqq_yl=sqqq_yl& " or tid="&rs_yl("id")&""
                  rs_yl.MoveNext
                  loop
                  end if
                  rs_yl.close
                           rs_info.open "select id,title,date,dj from info where tid="&rs("id")&""&sqqq_yl&" order by id desc",conn,1,1
                           if NOT rs_info.EOF then
                           do while not rs_info.eof
                           fileming=year(rs_info("date"))&month(rs_info("date"))&day(rs_info("date"))&hour(rs_info("date"))&minute(rs_info("date"))&second(rs_info("date"))
                           titlex=rs_info("Title")
                           if rs_info("dj")=6 then
                            list_3(ii)=list_3(ii)&"<li><a title="""&rs_info("Title")&""" target=""_blank"" href=""../Html/"&fileming&"-1.html"">"&titlex&"</a></li>"
                           end if
                           i=i+1
                           if i>=newshu then exit do
                           rs_info.movenext
                           loop
                           end if
                           rs_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"" />&nbsp;<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 tid 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>=12 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")&""" border=""0"" 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 tid in("&sqqq&") and pic<>'' order by date desc"
'       rs.open sql,conn,1,1
'       if rs.eof then
'       imagev="还没有图片文章"
'       else
'       do while not rs.eof
'       fileimgv=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
'       if rs("dj")=6 then
'       imagev=imagev&"<a target=""_blank"" href=""../Html/"&fileimgv&"-1.html"">"
'       else
'       imagev=imagev&"<a target=""_blank"" href=""../Html/shownews.asp?id="&rs("id")&""">"
'       end if
'       imagev=imagev&"<img  src="""&rs("pic")&""" border=""0"" width="""&imagevlen&""" height="""&imagevwid&"""><br>"&rs("title")&"</a><br><img alt=""about:blank"" width=""0"" height=""1""><br>"
'       if p>=imagevshu then exit do
'       rs.movenext
'       loop
'       end if
'       rs.close
'读取文章列表
               
sql="select * from info where tid 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>&nbsp;"
  lb=lb&"<a href=""../Html/"&fileming1&"-1.html"" title="""&year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date"))&"日更新"">"&titlez&"</a>"
  lb=lb&"&nbsp;"
  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 rs_yl=nothing
set rs_info=nothing
conn.close
set conn=nothing


'#########读取页次
fpage=fpage&"页次:<b>"&currentPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 文章数<b>"&allshu&"</b>"
pageno=currentPage
if cint(pageno)>1 then
fpage=fpage&"&nbsp;<a href=../list/list_"&tid&"_1.html title=""首页"">"
end if
fpage=fpage&"&nbsp;首页</a>&nbsp;"
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&"&nbsp;"
if cint(pageno)< mpage then
fpage=fpage&"<a href=../list/list_"&tid&"_"&pageno+1&".html title=""下页"">"
end if
fpage=fpage&"下页</a>&nbsp;"
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("../list/list_"&tid&"_"&currentPage&".html"))
fout.Write pencat
fout.close
Set fout =nothing
Set fso =nothing
'************** 生成HTML页 结束 ***************
%>