<%
If request("PageNo")="" then
PageNo=1
Else
PageNo=int(request("PageNo"))
End If
if request("search")<>"" then
select case request("select")
case "title"
sql="SELECT * from body where title like '%"&request("keyword")&"%' order by top,lasttime desc"
case "writer"
sql="SELECT * from body where writer like '%"&request("keyword")&"%' order by top,lasttime desc"
end select
else
sql="SELECT * from body order by top,lasttime desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if not(rs.eof and rs.bof) then
rs.Pagesize=20
rs.absolutepage=PageNo
x = 0
For x = 1 to rs.Pagesize
if x mod 2 then
tr_color="#EBEBEB"
else
tr_color="#ffffff"
end if
If rs.eof then
Exit For
Else%>
<%
if rs("top")= true then
response.write ""
else
today=date
lasttime=rs("lasttime")
if lasttime <= today then
response.write ""
elseif( lasttime > today ) then
if cint(rs("recount"))=0 then
response.write ""
else
response.write ""
end if
end if
end if
%>