<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% '列表 Const ShowAll_num=10 Const NumPerPage=5 '每页列表个数,默认为20 Const footer=5 Const intro_len=280 '简介字数长度 id=CheckNum(Request.QueryString("id")) product_dir_id=id ConnectionDatabase if id>0 then title=conn.execute("select dir_name from product_dir where dir_id="&id)(0) else title="product List" end if %> <%=title%> - Liming Heavy Industry
<% 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 product_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 product where dir_id="&rs_dir("dir_id")&" order by post_date desc") while not rs.eof Response.Write("
  • ·"&rs("post_title")&"

    "&rs("post_date")&"
  • "&vbcrlf) rs.movenext wend set rs=nothing 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 product where "&where_dir)(0) set rs_dir=conn.execute("select dir_name,path_name,dir_description from product_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") dir_description=rs_dir("dir_description") end if set rs_dir=nothing %>

<%=dir_name%>

<%=dir_description%>

<% if num>0 then 'begin Response.Write(""&vbcrlf) 'end end if End Sub %>
<%ConnClose%>