<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/config.asp"-->
<!--#include file="../conn/nosql.asp"-->
<!--#include file="../conn/page.asp"-->
<%
if isChkInteger(request("classid")) then
classid=request("classid")
else
Response.Redirect ("../index.asp")
end if
if nosql(request("bbsname"))="" then
Response.Redirect ("../index.asp")
else
bbsname=nosql(request("bbsname"))
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员论坛-<%=webname%></title>
<link href="../css.css" REL="stylesheet" TYPE="text/css">
<style type="text/css">
<!--
body {
	background-image: url();
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #FFFFFF}
.style10 {color: #FF3300;
	font-weight: bold;
}
-->
</style>

<SCRIPT language=javascript>
//--检测登陆-->

	   function DoLogin() {

	      var UsernameGet = trim(document.loginForm.UsernameGet.value);
		  var PasswordGet = trim(document.loginForm.PasswordGet.value);
		  var Verifycode = trim(document.loginForm.Verifycode.value);

          if(UsernameGet == "") {
		    alert("请输入会员登录名！");
			document.loginForm.UsernameGet.focus();
		    return false;
		  } 
		  if(PasswordGet == "") {
		    alert("请输入您的会员密码！");
			document.loginForm.PasswordGet.focus();
		    return false;
		  } 
		  if(Verifycode == "") {
		    alert("请输入您的登录验证码！");
			document.loginForm.Verifycode.focus();
		    return false;
		  }  
		  
		  
		 }

           function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//-->
</SCRIPT>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body >
<!--#include file="top.asp"-->
<table width="100" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" valign="top"><!--#include file="../left.asp"--></td>
    <td width="5" valign="top"><span class="style10"> </span></td>
    <td valign="top"><table width="575" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="23" background="../images/bj_575_0.gif"><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="23"><img src="../images/bj_575_4.gif" width="9" height="23"></td>
              <td><img src="../images/bj_575_sstz.gif" width="69" height="23" border="0"></td>
              <td><a href="bbs_add.asp?id=<%=nosql(request("id"))%>"><img src="../images/bj_575_fbtz.gif" width="69" height="23" border="0"></a></td>
              <td><a href="index.asp"><img src="../images/bj_575_ltsy.gif" width="69" height="23" border="0"></a></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td background="../images/bj_575_1.gif"><table width="90%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table cellspacing="0" cellpadding="0" width="570" border="0" class="a2" bgcolor="#FFFFFF" align="center">
                <tr bgcolor="#CCCCCC" height="1">
                  <td height="1" colspan="4"></td>
                </tr>
                <tr bgcolor="efefef" class="a1">
                  <td height="25" bgcolor="efefef">&nbsp;<strong>主题</strong></td>
                  <td width="20%" bgcolor="efefef"><div align="center"><strong>时间</strong></div></td>
                  <td width="18%" align="center"><strong>作者</strong></td>
                  <td width="10%" align="center"><strong>浏览回复</strong></td>
                </tr>
                <tr background="/img/bj_x.gif" height="1">
                  <td height="1" colspan="4" bgcolor="cccccc"></td>
                </tr>
                <tr  height="1">
                  <td height="10" colspan="4" bgcolor="ffffff"></td>
                </tr>
                <%

'使用置顶道具后过期还原

conn.execute "update snsn_bbs set gd=0 where replyid=0 and gd=1 and datediff(d,gddate,getdate())>0"

'end 使用置顶道具后过期还原

if request("lx")=1 then
if classid=0 then
sql="select * from snsn_bbs where title like '%"&nosql(request("bbsname"))&"%' and replyid=0 order by gd desc,ldate desc,id desc"
else
sql="select * from snsn_bbs where title like '%"&nosql(request("bbsname"))&"%' and replyid=0 and bbsclass="&classid&" order by gd desc,ldate desc,id desc"
end if
else
if classid=0 then
sql="select * from snsn_bbs where body like '%"&nosql(request("bbsname"))&"%' and replyid=0 order by gd desc,ldate desc,id desc"
else
sql="select * from snsn_bbs where body like '%"&nosql(request("bbsname"))&"%' and replyid=0 and bbsclass="&classid&" order by gd desc,ldate desc,id desc"
end if
end if
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof then
          response.Write"<div align='center'>暂无任何信息</div>"
           else
lastdate=rs("ldate")
shicha=DateDiff("n",lastdate,date) 
        rs.PageSize =20 '每页记录条数
		iCount=rs.RecordCount '记录总数
		iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    	per_page=rs.PageSize
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	For i=1 To x %>
                <tr onMouseOver='JavaScript:this.style.backgroundColor="#FCFBF3"' onMouseOut='JavaScript:this.style.backgroundColor=""'>
                  <td height="23">&nbsp;<span class="365ye"><img src=img/Mood/<%=rs("faceimg")%>.gif width="20" height="20"></span> <a class="text" href="view.asp?id=<%=rs("id")%>"><%=left(rs("title"),38)%></a>
                      <%if shicha<=1 then %>
                      <img src=img/new.gif>
                      <%end if%>
                      <%if rs("hits")>=50 then%>
                      <img src=img/icon4.gif>
                      <%end if%>
                      <%if rs("reply")>=10 then%>
                      <img src=img/icon3.gif>
                      <%end if%>
                      <%if rs("gd")>0 then%>
                      <font color=red>顶</font>
                      <%end if%></td>
                  <td height="23"><div align="center"><%=FormatDate(rs("wdate"),2)%></div></td>
                  <td align="center"><%set rs3=conn.execute("select * from [snsn_user] where username='"&rs("username")&"'")
									if rs3.eof or rs3.bof then
response.write "<a href=#>"
else%>
                      <a href="javascript:;" onClick="showmenuie5(<%=rs3("url")%>,<%=rs3("id")%>,'<%=rs3("username")%>')" >
                      <%end if%>
                      <%=rs("username")%></a></td>
                  <td align="center"><font color="#000000"><%=rs("hits")%> </font>/<font color="#FF0000"> <%=rs("reply")%></font></td>
                </tr>
                <tr background="img/xbj3.gif" height="1">
                  <td height="1" background="/img/bj_x.gif" colspan="4"></td>
                </tr>
                <%RS.MoveNext
                  next
			     end if %>
                <tr class="a4">
                  <td colspan = "4">&nbsp;</td>
                </tr>
              </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" height="5">
                  <tr>
                    <td height="10"></td>
                  </tr>
              </table></td>
          </tr>
        </table>
          <br>
          <table width=100%>
            <tr>
              <td><div align="center">新帖 <img src=img/new.gif> 点击超过50<img src=img/icon4.gif> 回复超过10<img src=img/icon3.gif></div></td>
            </tr>
            <tr>
              <td><%
					call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>",per_page)
				  %></td>
            </tr>
          </table>          <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <%usno=conn.execute("Select count(ltime)from online where name<>''")(0)                                                                                      
                            lineno=conn.execute("Select count(ltime)from online")(0)                                                                      
							set count1=server.CreateObject("adodb.recordset")
							count1.open"select * from online order by ltime desc",conn,3,3
							online=count1.recordcount
if  zonline<online then
    conn.execute("update snsn_config set online="&online&",onlinedate=getdate()")
	tmprs=conn.execute("Select online,onlinedate From snsn_config")
	zonline=tmprs(0)
	zonlinedate=tmprs(1)
end if
%>
              <td>在线人数(总计:<%=online%>人&nbsp;&nbsp;游客:<%=lineno-usno%>人&nbsp;&nbsp;用户:<%=usno%>人) &nbsp;目前最高在线：<%=zonline%>人&nbsp;发生于：<%=zonlinedate%>&nbsp;&nbsp;<br>
      在线列表:<br>
      <%
							set count1=server.CreateObject("adodb.recordset")
							count1.open"select * from online order by ltime desc",conn,3,3
if not count1.eof then	
			response.write "<table>"
			do while not count1.eof
			iiii=0
			response.write "<tr>"
			do while not count1.eof and iiii<6
			iiii=iiii+1
			response.write "<td width=120>"
%>
      <%if count1("name")<>"" then
							set dhsa=server.CreateObject("adodb.recordset")
							dhsa.open"select username,name,url,id from snsn_user where username='"&count1("name")&"'",conn,3,3
							%>
      <img src="img/messages1.gif" width="12" height="11"> <a href="javascript:;" onclick="showmenuie5(<%=dhsa("url")%>,<%=dhsa("id")%>,'<%=dhsa("username")%>')" ><font color="#FF3300"><%=dhsa("name")%></font></a>
      <%else%>
      <img src="img/messages2.gif" width="12" height="11"> 游客
      <%end if%>
      <%count1.movenext	
	loop
	response.write "</tr>"
	loop
	response.write "</table>"
	end if%></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td><img src="../images/bj_575_2.gif" width="575" height="7"></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="100" height="5" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="90%" height="10"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table><!--#include file="../end.asp"-->
</body>
</html>