<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Const ShowAll_num=10 Const NumPerPage=6 '每页列表个数,默认为20 Const footer=5 Const intro_len=200 '简介字数长度 const faq_num=5 id=CheckNum(Request.QueryString("id")) ConnectionDatabase if id>0 then where_dir="dir_id="&id title=conn.execute("select dir_name from product_dir where dir_id="&id)(0) else where_dir="dir_id>0" title="Centro de Productos" end if %> <%=title%> - Liming Heavy Industry

<%=title%>

    <% num=conn.execute("select count(post_id) from product where "&where_dir)(0) pagenum=(num-1)\NumPerPage+1 page=CheckNum(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) set rs=conn.execute("select * from (select top "&num_now&" * from product where (post_order <= (select max(post_order) from (select top "&NumPerPage*Page&" post_order from product where "&where_dir&" order by post_order) as temp)) and "&where_dir&" order by post_order desc) order by post_order") while not rs.eof path_name=conn.execute("select path_name from product_dir where dir_id="&rs("dir_id"))(0) call ShowList rs.movenext wend set rs=nothing %> <%Sub ShowList%>
  • "><%=rs("post_title")%>

    <%=GetIntro(rs("post_text"))%>

    »">Más detalle ...

  • <%End Sub%>
    <%if page<=1 then%> La primera <%else%> La primera <%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%> El extremo <%else%> El extremo <%end if%>  
<% Function GetIntro(the_text) dim regEx,temp_text temp_text=the_text Set regEx=New RegExp regEx.Global=True regEx.IgnoreCase=True regEx.Pattern="<[a-z/\?][^'"">]*(('[^']*'|""[^""]*"")[^'"">]*)*>" temp_text=regEx.Replace(temp_text,"") temp_text=left(temp_text,intro_len) regEx.Pattern="\s+\S*$" temp_text=regEx.Replace(temp_text,"") GetIntro=trim(temp_text)&" ..." End Function %> <%ConnClose%>