<% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' e-Article v 2.1 ACCESS/SQL ' ' Copyright(C) 2003 www.xfok.com. All Rights Reserved. ' ' http://www.xfok.com ' ' ACCESS版本免费,商业使用请购买SQL版(免费版未经授权用于商业将追究法律责任) ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If isInt(ClassID)=False Then Response.Redirect "Index.Asp" If NClassID<>"" Then If isInt(NClassID)=False Then Response.Redirect "Index.Asp" End If Dim TitleColor If IsEmpty(ClassID)=False Or IsEmpty(NClassID)=False Then GetCurrentTemplate '//输出页头 Head_Body() '主体 Dim ListLoop,ID,Title Dim arrResult,RsCount Page=Request.QueryString("Page") If isInt(Page)=False Then Page=1 Else Page=CLng(Page) End If Html=LoadTemplate("list") If InStr(Html,"{classnav}")<>0 Then Html=Replace(Html,"{classnav}",ClassNav) If InStr(Html,"{top_hotlist}")<>0 Then Html=Replace(Html,"{top_hotlist}",Top_List("top_hotlist")) If InStr(Html,"{top_recommendlist}")<>0 Then Html=Replace(Html,"{top_recommendlist}",Top_List("recommendlist")) If isSQL=0 Then If NClassID="" Then SQL="SELECT ID,Title,Author,AddDate,Hits,Remark,TitleColor FROM "& TableArticle &" WHERE ClassID="&ClassID&" ORDER BY ID DESC" Else SQL="SELECT ID,Title,Author,AddDate,Hits,Remark,TitleColor FROM "& TableArticle &" WHERE ClassID="&ClassID&" AND NClassID="&NClassID&" ORDER BY ID DESC" End If Else If NClassID="" Then SQL="SELECT Count(ID) FROM "& TableArticle &" WHERE ClassID="&ClassID Set RsCount=Conn.Execute(SQL) ArticleCount=RsCount(0) Set RsCount=Nothing SQL="EA_List "&ClassID&",0,"&Page&","&PageSize&","&TableArticle Else SQL="SELECT Count(ID) FROM "& TableArticle &" WHERE ClassID="&ClassID&" AND NClassID="&NClassID Set RsCount=Conn.Execute(SQL) ArticleCount=RsCount(0) Set RsCount=Nothing SQL="EA_List "&ClassID&","&NClassID&","&Page&","&PageSize&","&TableArticle End If End If Set Rs=Server.CreateObject("Adodb.RecordSet") Rs.CursorLocation=3 Rs.Open SQL,Conn,1 If Not (Rs.Bof And Rs.Eof) Then If isSQL=0 Then ArticleCount=Rs.RecordCount Rs.MoveFirst If Page > 1 Then Rs.Move(Page-1) * CLng(PageSize) End If If ArticleCount Mod CInt(PageSize)=0 Then PageCount= ArticleCount \ CInt(PageSize) Else PageCount= ArticleCount \ CInt(PageSize)+1 End If If Page > PageCount Then Page = PageCount arrResult=Rs.GetRows(PageSize) Rs.Close Set Rs=Nothing For i=0 To UBound(arrResult,2) ID=arrResult(0,i) Title=CutStr(arrResult(1,i),45) TitleColor=arrResult(6,i) If TitleColor<>"" Then Title=""&Title&"" ListLoop=ListLoop&LoadTemplate("List_Loop") ListLoop=Replace(ListLoop,"{title}",Title) ListLoop=Replace(ListLoop,"{id}",ID) ListLoop=Replace(ListLoop,"{author}",arrResult(2,i)) ListLoop=Replace(ListLoop,"{dateandtime}",Month(arrResult(3,i))&"-"&Day(arrResult(3,i))) ListLoop=Replace(ListLoop,"{hits}",arrResult(4,i)) ListLoop=Replace(ListLoop,"{remark}",arrResult(5,i)) Next Else Rs.Close Set Rs=Nothing ListLoop=LoadTemplate("list_loop_nodata") End If If NClassID="" Then Html=Replace(Html,"{showpage}",ShowPage(PageCount,ArticleCount,Page,PageSize,"?ClassID="&ClassID&"&")) Else Html=Replace(Html,"{showpage}",ShowPage(PageCount,ArticleCount,Page,PageSize,"?ClassID="&ClassID&"&NClassID="&NClassID&"&")) End If Html=Replace(Html,"{list_loop}",ListLoop) Html=Replace(Html,"{class}",strClass) Function ClassNav() Dim Result SQL="Select ID,NClass From "&TableNClass&" Where ParentID="&ClassID&" Order By Orders" Set Rs=Conn.Execute(SQL) If Not Rs.EOF Then Do Until Rs.EOF Result=Result&" "&Rs(1)&"
" Rs.MoveNext Loop Else Result=Result&" 无子分类" End If ClassNav=Result End Function '//输出页面 WriteTitle(strClass) Response.Write Html '//输出页尾 Bottom() %>