
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='../default.asp';")
	response.write("</script>")
	response.end
end if
%>
<!--#include file="top.asp"-->

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center"  bgcolor="#C0E6FA" >
  <tr>
    <td>
      <table border="0" width="98%" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td width="98"  valign="center" height=40><a href="writenew.asp"><img src="images/postnew.gif" width="72" height="21" border="0"></a></td>
    <td width="98"  valign="center"  ><a href="index.asp"><img src="images/votenew.gif" width="72" height="21" border="0"></a></td>
          <td width="98"  valign="center" ><a href="smallpaper.asp" ><img src="images/xzb.gif" width="72" height="21" border="0"></a></td>
          <% If oabusyuserlevel = "最高管理员" Then
%>
 <td width="98"  valign="center" ><a href="admin_index.asp?action=tz" ><img src="images/guanli.gif" width="72" height="21" border="0"></a></td>


     <%end if%>
          <td align="right"  valign="center" >
            <%
response.write "<b>版主:</b> "
response.write "管理员"
%>
          </td>
  </tr>
</table>
      <table width="98%" border="0" cellspacing="1" cellpadding="0" bgcolor="#205E7B" align="center">
        <tr bgcolor="#f0f0f0"> 
          <td width="80%">
		  <table width="98%" border="0" cellspacing="0" cellpadding="0">
  <tr>
                <td width="10%" height=30>&nbsp;公告：</td>
	            <td width="90%">&nbsp;<MARQUEE onmouseover="if (document.all!=null){this.stop()}" 
      onmouseout="if (document.all!=null){this.start()}" scrollAmount=4 
      scrollDelay=150><%

sql="select top 3 * from smallpager order by id desc"
Set rs= Server.CreateObject("ADODB.RecordSet") 
rs.Open sql, Conn, 1, 2
if rs.eof then
response.write"暂时没有论坛公告"
else
do while not rs.eof
name="  "&rs("user_name")&"说:"
title=rs("s_title")&" &nbsp;&nbsp; "
response.write name&title
rs.movenext
loop
rs.close
set rs=nothing
end if %></MARQUEE></td>
  </tr>
</table></td>
          <td width="13%"> 
            <select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}" >
              <option value=index.asp>显示所有的主题</option>
              <option value=index.asp?show=jinghua>精华主题</option>
              <option value=index.asp?show=2>锁定的主题</option>
			  <option value=index.asp?show=1>昨天以来的主题</option>
              <option value=index.asp?show=5>五天以来的主题</option>
              <option value=index.asp?show=10>十天以来的主题</option>
              <option value=index.asp?show=30>一个月以来的主题</option>
              <option value=index.asp?show=90>三个月以来的主题</option>
              <option value=index.asp?show=180>半年以来的主题</option>
              <option value=index.asp?show=365>一年以来的主题</option>
              
            </select>
          </td>
          <td width="9%"> 
            <select onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}" name="select" >
              <option selected>排列帖子</option>
              <option value=index.asp>更新时间</option>
              <option value=index.asp?type=fwrite>发表时间</option>
              <option value=index.asp?type=hits>浏览次数</option>
              <option value=index.asp?type=reply>回复次数</option>
              <option value=index.asp?type=writer>作者</option>
            </select>
          </td>
        </tr>
      </table>
      <table border="0" width="98%" cellspacing="1" cellpadding="0"  bgcolor="#205E7B" align="center" >
        <tr> 
          <td colspan="2" align="center" height="25"><b><font color="#FFFFFF">帖 子 主 题</font></b></td>
          <td align="center" width="84"><b><font color="#FFFFFF">作 者</font></b></td>
          <td align="center" width="69"><b><font color="#FFFFFF">回复/阅读</font></b></td>
          <td align="center" width="196" ><b><font color="#FFFFFF">最后回复时间/回复人</font></b></td>
        </tr>
		<%
sql="select * from ly where rt=0 order by gd desc,tt desc"
if request("type")="writer" then
sql="select * from ly where rt=0 order by  gd desc,user_name desc"
elseif request("type")="hits" then
sql="select * from ly  where rt=0 order by  gd desc,hits desc"
elseif request("type")="fwrite" then
sql="select * from ly where rt=0 order by  gd desc,id desc"
elseif request("type")="reply" then
sql="select * from ly  where rt=0 order by gd desc, hf desc"
elseif request("show")="jinghua" then
sql="select * from ly where jh=1 and rt=0 order by  gd desc,tt desc"
elseif request("show")="1" then
sql="select * from ly where tt>Now()-1 and rt=0  order by gd desc, tt desc"
elseif request("show")="2" then
sql="select * from ly where jh=2 and rt=0 order by gd desc, tt desc"
elseif request("show")="5" then
sql="select * from ly where tt>Now()-5 and rt=0 order by gd desc, tt desc"
elseif request("show")="30" then
sql="select * from ly where tt>Now()-30 and rt=0  order by gd desc, tt desc"
elseif request("show")="90" then
sql="select * from ly where tt>Now()-90  and rt=0 order by gd desc, tt desc"
elseif request("show")="180" then
sql="select * from ly where tt>Now()-180  and rt=0 order by gd desc, tt desc"
elseif request("show")="365" then
sql="select * from ly where tt>Now()-365  and rt=0 order by gd desc, tt desc"
end if
set rs= Server.CreateObject("ADODB.RecordSet") 

rs.Open sql, Conn, 1, 2
page=Request("page")
  if page=0 then
     page=1
  end if
RecordCount = 0 
  do while not rs.Eof
    RecordCount = RecordCount +1
    rs.MoveNext 
  loop
  if not RecordCount=0 then
     rs.MoveFirst
  end if
  pageCount=RecordCount/25
  pageCount=int(pageCount)
  if (RecordCount mod 25)>0 then
     PageCount=PageCount +1
  end if 
if pagecount=0 then pagecount=1
if page>pagecount then page=pagecount

do while pos<(page-1)*25                                 
pos=pos+1                                 
rs.moveNext                                 
loop
x=0
do while x<25 and not rs.eof%>
        <tr bgcolor="#FFFFFF"> 
          <td align="center"  width="30"> 
      <%if rs("gd")=1 then
	  response.write"<img src=""images/istop.gif"" alt=""固顶帖子""> "
	elseif rs("jh")=1 then
      response.write"<img src=""images/isbest.gif"" alt=""精华帖子""> "
      elseif rs("jh")=0 and rs("hits")<50 then
      response.write"<img src=""images/folder.gif"" alt=""普通帖子"">"
      elseif rs("jh")=0 and rs("hits")>=50 then
      response.write"<img src=""images/hotfolder.gif"" alt=""热门帖子"">"
      elseif rs("jh")=2 then
	  response.write"<img src=""images/lockfolder.gif"" alt=""锁定帖子""> "
      end if%>
          </td>
          <td height="30" width="*" onMouseOver="this.bgColor = '#f0f0f0'" onMouseOut="this.bgColor = '#DAEDF5'" bgcolor="#DAEDF5" > 
            <img src="images/nofollow.gif" vspace="2"><a href="show.asp?id=<%=rs("id")%>"><%=rs("title")%></a> 
          </td>
          <td align="center" bgcolor="#92C8E2" width="84"> 
            <% if rs("bl")=1 then %>
            <%=rs("user_name")%> 
            <%else%>
            <%=rs("user_name")%> 
            <%end if%>
          </td>
          <td align="center" width="69" bgcolor="#DAEDF5"> <%=rs("hf")%>/<%=rs("hits")%></td>
          <td bgcolor="#92C8E2" width="195">&nbsp;&nbsp;<%=rs("tt")%>|<%=rs("hfren")%></td>
          
        </tr>
        <%x=x+1                                
  rs.movenext                                
loop
rs.close
set rs=nothing
%>
      </table>
      <table width="98%" border="0" align="center" cellspacing="0" cellpadding="3" bgcolor="#205E7B">
        <form method=post action=index.asp>
          <tr> 
            <td width="52%" class=td1>页次： 
              <%if page="" then
              response.write"1" 
              else
               response.write  page
                end if%>
              / <%=pageCount%> 页 主题数：<%=RecordCount%></td>
            <td width="48%" align="right" class=td1> 
              <%if page=1 then
              response.write"首页" 
              else
               response.write"<a href=index.asp class=a1>首页</a> "
                end if%>
              <%if page=1 then %>
              上一页
              <%else%>
              <a href="index.asp?page=<%=page-1%>" class=a1>上一页</a> 
              <%end if%>
              <% y=1%>
              <%do while y<pagecount+1%>
              <a href="index.asp?page=<%=y%>" class=a1><%=y%></a> 
              <%                                                 
y=y+1                                    
loop%>
              <%if cint(page)=pagecount then %>
             下一页
              <%else%>
              <a href="index.asp?page=<%=page+1%>" class="a1">下一页</a> 
              <%end if%>
              转到: 
<INPUT onmouseover="this.style.backgroundColor = '#E5F0FF'" style="BORDER-RIGHT: #b4b4b4 1px double; BORDER-TOP: #b4b4b4 1px double; BORDER-LEFT: #b4b4b4 1px double; COLOR: #8888aa; BORDER-BOTTOM: #b4b4b4 1px double; BACKGROUND-COLOR: #ffffff" onmouseout="this.style.backgroundColor = ''" maxLength=3 size=3 name=page value="<%=page%>">
              页 
              <input onMouseOver="this.style.backgroundColor='#FFC864'" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #f3f3f3" onMouseOut="this.style.backgroundColor='#f3f3f3'" type=submit value=GO name=submit>
            </td>
          </tr>
        </form>
      </table>
	  <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <FORM action=search.asp method=post>
	        <td> 快速搜索： 
              <INPUT onmouseover="this.style.backgroundColor = '#E5F0FF'" title='关键词' style="BORDER-RIGHT: #b4b4b4 1px double; BORDER-TOP: #b4b4b4 1px double; BORDER-LEFT: #b4b4b4 1px double; COLOR: #ff90cd; BORDER-BOTTOM: #b4b4b4 1px double; BACKGROUND-COLOR: #ffffff" onmouseout="this.style.backgroundColor = ''" name=keyword>
		 <INPUT onmouseover="this.style.backgroundColor='#64B3D9'" style="BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: 0px solid; COLOR: #000000; BORDER-BOTTOM: 0px solid; BACKGROUND-COLOR: #64B3D9" onmouseout="this.style.backgroundColor='#64B3D9'" type=submit value=给我搜>
	</td>
	</form>
        </tr>
      </table>
      
 
      <table cellspacing=1 cellpadding=3 width="98%" bgcolor="#205E7B" align="center">
        <tr> 
    <td ><font color="#FFFFFF">　-=&gt; <b>BBS图例</b></font></td>
  </tr>
  <tr> 
    <td colspan=2 bgcolor="#FFFFFF"> 
      <table cellspacing=4 cellpadding=0 width="92%" align=center border=0 bgcolor="#FFFFFF">
        <tr> 
          <td><img src="images/folder.gif"> 普通帖子</td>
          <td><img src="images/hotfolder.gif"> 热门帖子</td>
          <td><img src="images/lockfolder.gif"> 锁定的帖子</td>
          <td><img src="images/istop.gif"> 固顶帖子 </td>
          <td><img src="images/isbest.gif"> 精华帖子 </td>

        </tr>
      </table>
    </td>
  </tr>
</table>
      <br>
    </td>
  </tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#64B3D9">
  <tr> 
    <td align="center" height="30"class=td1 width="96%"> 
      <%=Request.Cookies("homename")%>
    </td>
    
  </tr>
</table>
</body>
</html>
