<!--#include file="../conn.asp"-->
<!--#include file="../inc/function.asp"-->

<%
dim dl,xl,wtlx,wtys,zs,wts,showfl,showuser,showxsf
dim showtime,showdjs,showzt,addpoint,showhd,openstyle
dl=request.QueryString("dl")
xl=request.QueryString("xl")
wtlx=int(request.QueryString("wtlx"))
wtys=request.QueryString("wtys")
zs=int(request.QueryString("zs"))
nrzs=int(request.QueryString("nrzs"))
wts=int(request.QueryString("wts"))
showfl=request.QueryString("showfl")
showuser=request.QueryString("showuser")
showtime=request.QueryString("showtime")
showdjs=request.QueryString("showdjs")
showzt=request.QueryString("showzt")
addpoint=request.QueryString("addpoint")
showhd=request.QueryString("showhd")
showxsf=request.QueryString("showxsf")
openstyle=request.QueryString("openstyle")
zt=request.QueryString("zt")
how=request.QueryString("how")
op=request.QueryString("op")

		dim rs,sql,i
		set rs=server.CreateObject("adodb.recordset")		
		if zt=2 then
		sql ="Select top " & wts & " * from kw_wt where zt=2 order by id desc"
		else
		sql ="Select top " & wts & " * from kw_wt where zt=1 order by id desc"
		end if
		   
rs.open sql,conn,1,1

if how="li" OR how="dd" OR how="dt" then
howBegin="<"&how&">"
howEnd="</"&how&">"
end if

	 	dim rs1,sql1,i1
dim str
  		if rs.eof and rs.bof then
str="document.write('蜆濬遜羶衄枑恀ㄐ');"
		response.End()
		end if
		
if op="home" then
        For i=1 to wts
           if rs("bt")="" then
           exit for
        end if
str=str&"document.write('"&howBegin&"<a href=""/ask/show/"&rs("wt_filename")&""" target="""&openstyle&""">["&leftstr(rs("bt"),zs)&"');"
          if checklen(rs("bt"))>zs and addpoint="true" then
str=str&"document.write('&nbsp;＃');"
          end if
		  if zt=2 then
str=str&"document.write('</a></li>');"
          else
		str=str&"document.write(']</a>"&howEnd&"');"
         end if		
	     if showhd="true" then
         str=str&"document.write('"&howBegin&"');"
		set rs1=server.CreateObject("adodb.recordset")
		sql1 ="Select * from kw_hd where hdques='"&rs("wt_filename")&"'"
        rs1.open sql1,conn,1,1
str=str&"document.write('"&leftstr(rs1("wtans"),nrzs)&howEnd&"');"
	    end if
rs.movenext
next
elseif op="zt" then
  For i=1 to wts
           if rs("bt")="" then
           exit for
        end if
str=str&"document.write('<ul>"&howBegin&"<a href=""/ask/show/"&rs("wt_filename")&""" target="""&openstyle&""">"&leftstr(rs("bt"),zs)&"');"
          if checklen(rs("bt"))>zs and addpoint="true" then
str=str&"document.write('&nbsp;＃');"
          end if
		  if zt=2 then
str=str&"document.write('</a></"&how&">');"
          else
		str=str&"document.write('</a>"&howEnd&"');"
         end if		
	     if showhd="true" then
         str=str&"document.write('"&howBegin&"');"
		set rs1=server.CreateObject("adodb.recordset")
		sql1 ="Select * from kw_hd where hdques='"&rs("wt_filename")&"'"
        rs1.open sql1,conn,1,1
str=str&"document.write('"&leftstr(rs1("wtans"),nrzs)&howEnd&"</ul>');"
	    end if
rs.movenext
Next
else
For i=1 to wts
           if rs("bt")="" then
           exit for
        end if
str=str&"document.write('<li class=""lista""><a href=""/ask/show/"&rs("wt_filename")&""" target="""&openstyle&""">"&leftstr(rs("bt"),zs)&"');"
          if checklen(rs("bt"))>zs and addpoint="true" then
str=str&"document.write('&nbsp;＃');"
          end if
		  if zt=2 then
str=str&"document.write('</a></li>');"
          else
		str=str&"document.write('</a>"&howEnd&"');"
         end if		
	     if showhd="true" then
         str=str&"document.write('<li class=""listb"">');"
		set rs1=server.CreateObject("adodb.recordset")
		sql1 ="Select * from kw_hd where hdques='"&rs("wt_filename")&"'"
        rs1.open sql1,conn,1,1
str=str&"document.write('"&leftstr(rs1("wtans"),nrzs)&"</li>');"
	    end if
rs.movenext
Next
end if
response.Write(str)
   rs.close
   set rs=nothing
   closedb
%>



