<!--#include file="function.asp"-->
<!--#include file="config.asp"-->
<%set conn=server.createobject("adodb.connection")
conn.open"provider=microsoft.jet.oledb.4.0;data source="&server.mappath(dbPath&"/"&dbname)
set rs=server.createobject("adodb.recordset")
set rs1=server.createobject("adodb.recordset")
set rs2=server.createobject("adodb.recordset")
set rs3=server.createobject("adodb.recordset")
if request("lei")<>"" then 
if request("lei")<>"xin" and request("lei")<>"tui" and request("lei")<>"weijie" and request("lei")<>"jie" and request("lei")<>"gaofen" and request("lei")<>"re" and request("lei")<>"tou" and request("lei")<>"shang" then
lei=""
else
lei=request("lei")
end if
end if
if CInt(request("n"))="0" or CInt(request("n"))="" then
n=20
else
n=CInt(request("n"))
end if
if request("t")="0" or request("t")="" then
t1=50
else
t1=CInt(request("t"))
end if
if request("c")<>"" then
c=CInt(request("c"))
end if
if request("nc")<>"" then
nc=CInt(request("nc"))
end if
%>
<%
if lei="" or lei="xin" then
if nc<>"" then
rs.open"select top "&n&" * from question where fenleiid="&nc&" order by sendtime desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where shuxing="&c&" order by sendtime desc",conn,1,1
else
rs.open"select top "&n&" * from question order by sendtime desc",conn,1,1
end if
elseif lei="tui" then
if nc<>"" then
rs.open"select top "&n&" * from question where tui=1 and fenleiid="&nc&" order by sendtime desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where tui=1 and shuxing="&c&" order by sendtime desc",conn,1,1
else
rs.open"select top "&n&" * from question where tui=1 order by sendtime desc",conn,1,1
end if
elseif lei="weijie" then
if nc<>"" then
rs.open"select top "&n&" * from question where jie<>1 and jie<>3 and fenleiid="&nc&" order by sendtime desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where jie<>1 and jie<>3 and shuxing="&c&" order by sendtime desc",conn,1,1
else
rs.open"select top "&n&" * from question where jie<>1 and jie<>3 order by sendtime desc",conn,1,1
end if
elseif lei="jie" then
if nc<>"" then
rs.open"select top "&n&" * from question where jie=1 and fenleiid="&nc&" order by sendtime desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where jie=1 and shuxing="&c&" order by sendtime desc",conn,1,1
else
rs.open"select top "&n&" * from question where jie=1 order by sendtime desc",conn,1,1
end if
elseif lei="tou" then
if nc<>"" then
rs.open"select top "&n&" * from question where jie=4 and fenleiid="&nc&" order by sendtime desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where jie=4 and shuxing="&c&" order by sendtime desc",conn,1,1
else
rs.open"select top "&n&" * from question where jie=4 order by sendtime desc",conn,1,1
end if
elseif lei="gaofen" then
if nc<>"" then
rs.open"select top "&n&" * from question where shang<>0 and fenleiid="&nc&" order by shang desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where shang<>0 and shuxing="&c&" order by shang desc",conn,1,1
else
rs.open"select top "&n&" * from question where shang<>0 and order by shang desc",conn,1,1
end if
elseif lei="re" then
if nc<>"" then
rs.open"select top "&n&" * from question where and fenleiid="&nc&" order by views desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where shuxing="&c&" order by views desc",conn,1,1
else
rs.open"select top "&n&" * from question order by views desc",conn,1,1
end if
elseif lei="shang" then
if nc<>"" then
rs.open"select top "&n&" * from question where and fenleiid="&nc&" order by shang desc",conn,1,1
elseif c<>"" then
rs.open"select top "&n&" * from question where shuxing="&c&" order by shang desc",conn,1,1
else
rs.open"select top "&n&" * from question order by shang desc",conn,1,1
end if
end if
%>
<%if rs.eof then%>
 document.write('暂时没有问题!');
<%rs.close
else
while not rs.eof		
		nian=year(rs("sendtime"))
		yue=Month(rs("sendtime"))
		ri=day(rs("sendtime"))
		%>
document.write('·');
 <%if rs("shang")>"0" then %>document.write('<img src=<%=weburl%>img/icn_ps.gif alt=悬赏<%=rs("shang")%>分 width=12 height=11 align=absmiddle></span>'); <%end if%>document.write('<a href=<%=weburl%>showquestion.asp?id=<%=rs("id")%> target=_blank>');<%if len(rs("title"))>t1 then%>document.write('<%=left(rs("title"),t1)&"..."%>');<%else%>document.write('<%=rs("title")%>');<%end if%>document.write('</a>');<%if c<>"" then%>document.write(' [<a href=<%=weburl%>assort1.asp?id=<%=rs("fenleiid")%>&topic=<%=rs("topic")%>><%=rs("topic")%></a>]');<%end if%> 
<%if rs("jie")=0 then %>document.write('<img src=<%=weburl%>img/icn_time.gif  alt=待解决问题>');<%elseif rs("jie")=1 or rs("jie")=3 then%>document.write('<img src=<%=weburl%>img/icn_ok.gif  alt =已解决问题>');<%elseif rs("jie")=2 then%>document.write('<img src=<%=weburl%>img/icn_cancel.gif  alt =问题已关闭>');<%elseif rs("jie")=4 then%>document.write('<img src=<%=weburl%>img/icn_vote.gif  alt =投票中问题>');<%end if%>
<%if ti=1 then%>
document.write('<%=nian%>-<%=yue%>-<%=ri%>
<%end if%>
document.write('<br>');
<%rs.movenext
	wend	
		rs.close
end if
%>