<!--#include file="Inc.asp"-->
<!--#include file="ydzq1.asp"-->
<%call head()
Call saycarda("精华*新帖*热门")
%>
<!--#INCLUDE file="sy1.asp"-->
<%
dim tpye
tpye= Request.QueryString("tpye")
if tpye="" then tpye=3
  if tpye = 1 then
    Response.write "<a href=""e_list.asp?saytk="&saytk&"&amp;sid="&sid&""">精华</a>"
    Response.write "|新帖"
    Response.write "|<a href=""e_list.asp?tpye=2&amp;saytk="&saytk&"&amp;sid="&sid&""">热门</a>"
  elseif tpye = 2 then
    Response.write "<a href=""e_list.asp?saytk="&saytk&"&amp;sid="&sid&""">精华</a>"
    Response.write "|<a href=""e_list.asp?tpye=1&amp;saytk="&saytk&"&amp;sid="&sid&""">新帖</a>"
    Response.write "|热门"
  else
    Response.write "精华"
    Response.write "|<a href=""e_list.asp?tpye=1&amp;saytk="&saytk&"&amp;sid="&sid&""">新帖</a>"
    Response.write "|<a href=""e_list.asp?tpye=2&amp;saytk="&saytk&"&amp;sid="&sid&""">热门</a>"
end If
    Response.write "|<a href=""sellft.asp?saytk="&saytk&"&amp;sid="&sid&""">发帖</a>"
    Response.write "<br/>----------<br/>"&chr(13)
set rs=Server.CreateObject("ADODB.Recordset")
'普通帖
if tpye = 1 then
  rs.Open "select * from sell where yc=0 order by id desc",conn,1,1
elseif tpye=2 then
  rs.Open "select * from sell where yc=0 order by rc desc",conn,1,1
else
  rs.Open "select * from sell where jj=1 and yc=0 order by id desc",conn,1,1
end if
If Not rs.eof	Then
	Dim PageSize,i
	PageSize=10					
	Dim Count,page,pagecount,gopage			
	gopage="e_list.asp?saytk="&saytk&"&amp;sid="&sid&"&amp;tpye="&tpye&"&amp;"
	Count=rs.recordcount	
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1		
	pagecount=(count+pagesize-1)\pagesize	
        if page>pagecount then page=pagecount
	rs.move(pagesize*(page-1))
	For i=1 To PageSize     						
	If rs.eof Then Exit For	
response.write ""&i+(page-1)*PageSize&"."
    if rs("num")=1 then response.write("[顶]")
    if rs("num")=20 then response.write("[固]")
    if rs("jj")="1" then response.write("[精]")
    if rs("st")="1" then response.write("[锁]")
    if rs("lx")="2" then response.write("[投]")
    if rs("lx")="4" then response.write("[隐]")
        dim nowtx
        if rs("fs")=1 then
        nowtx="综合"
        elseif rs("fs")=2 then 
        nowtx="经验"
        elseif rs("fs")=3 then 
        nowtx="分享"
        elseif rs("fs")=4 then
        nowtx="提问"
        else 
        nowtx="综合"
        end if
response.write "<a href='topic.asp?tid="&rs("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
dim reCount
reCount=conn.execute("Select count(ID) from [relist] where tid="&rs("id"))(0)
response.write ubb(rs("name"))&"</a><br/>["
response.write ubb(rs("fname"))&"/"&nowtx&"/"&ubb(rs("rc"))&"/"
if reCount<=0 then
response.write reCount
else
response.write "<a href=""relist.asp?tid="&rs("id")&"&amp;bbsid="&rs("bbsid")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&reCount&"</a>"
end if
response.write"]<br/>"
rs.moveNext
 	Next
	'response.write "<br/>"&chr(13)
	if page-pagecount<0 then response.write "<a href="""&gopage&"page="&page+1&""">下一页</a>"&chr(13)
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上一页</a>"&chr(13)

response.write "<br/>("&page&"/"&pagecount&")共"&count&"贴"
	if pagecount>1 then response.write "<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""2""/><a href="""&gopage&"page=$(page)"">页</a>"

response.write "<br/>"
Else
response.write "暂时没有帖子！<br/>"
end if
Response.write "------------"
conn.close
set conn=nothing
%>
<!--#include file="fanhui.asp"-->
<%call headsay()%>