<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Const ShowAll_num=13 Const NumPerPage=30 '20 Const footer=5 id=CheckNum(Request.QueryString("id")) ConnectionDatabase if id>0 then title=conn.execute("select dir_name from news_dir where dir_id="&id)(0) else title="News List" end if %> <%=title%> - Liming Heavy Industry (Shanghai)
Home > <%=title%>
<% if id<=0 then call ShowAll else call ShowOne(id,ShowOne_num) end if Sub ShowAll dim rs_dir,rs set rs_dir=conn.execute("select dir_id,dir_name,path_name from news_dir order by dir_id") while not rs_dir.eof Response.Write("

"&rs_dir("dir_name")&"

"&vbcrlf) Response.Write("
    "&vbcrlf) set rs=conn.execute("select top "&ShowAll_num&" file_name,post_title,post_date from news where dir_id="&rs_dir("dir_id")&" order by post_date desc") while not rs.eof if len(rs("post_title"))>75 then title=left(rs("post_title"),75) else title=rs("post_title") end if Response.Write("
  • ·"&title&"

    "&rs("post_date")&"
  • "&vbcrlf) rs.movenext wend set rs=nothing Response.Write("
  • "&vbcrlf) Response.Write("
"&vbcrlf) rs_dir.movenext wend set rs_dir=nothing End Sub Sub ShowOne(the_dir_id,the_num) dim where_dir,rs,rs_dir where_dir="dir_id="&the_dir_id num=conn.execute("select count(post_id) from news where "&where_dir)(0) pagenum=(num-1)\NumPerPage+1 if pagenum<1 then pagenum=1 page=Request.QueryString("page") if page-1<=0 then page=1 if page-pagenum>0 then page=pagenum num_now=NumPerPage if page-pagenum=0 then num_now=num-NumPerPage*(pagenum-1) if num>0 then 'begin set rs_dir=conn.execute("select dir_name,path_name from news_dir where dir_id="&the_dir_id) if not rs_dir.eof then path_name=rs_dir("path_name") dir_name=rs_dir("dir_name") end if set rs_dir=nothing Response.Write("

"&dir_name&"

"&vbcrlf) Response.Write("
    "&vbcrlf) set rs=conn.execute("select * from (select top "&num_now&" * from news where (post_id >= (select min(post_id) from (select top "&NumPerPage*Page&" post_id from news where "&where_dir&" order by post_date desc) as temp)) and "&where_dir&" order by post_date) order by post_date desc") while not rs.eof if len(rs("post_title"))>75 then title=left(rs("post_title"),75) else title=rs("post_title") end if Response.Write("
  • ·"&title&"

    "&rs("post_date")&"
  • "&vbcrlf) rs.movenext wend set rs=nothing Response.Write("
"&vbcrlf) 'end end if %>
<%if page=1 then Response.Write("First") else Response.Write("First ") end if%>   <% for i=page-footer to page+footer if i<1 then i=1 if i-page=0 then Response.Write("["&i&"] ") else Response.Write("["&i&"] ") end if if i=pagenum then i=page+footer+1 next %>   <%if page=pagenum then Response.Write("Last") else Response.Write("Last") end if%>   Page <%=page%>/<%=pagenum%>   <%=num%> News in Total
<% End Sub %>