<!--#INCLUDE FILE="setup.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<!--#INCLUDE FILE="include/ubbcode.asp" -->
<%response.buffer=true

locat="班级心声"

if membername="" Then
  	ErrMsg=ErrMsg+"<br>"+"<li>您还没有<a href=login.asp>登录</a>。"
	Call top(1,1)
	Call Error("Information",ErrMsg)
Else
	Dim ClsID,Degree,ClassName
	ClsID=Request("ClassID")
	joinstatus=chkjoinclass(ClsID)
	if joinstatus<>"" Then
		Call top(1,1)
		Call Error("Exclamation",joinstatus)
	Else
		Dim Abgcolor
		Call top(2,1)
		Call main()
	End if
End if


Sub main()

dim sql,rs
dim totalrecords
dim currentpage,totalpages
dim i
dim pagesize

pagesize=Cint(IntVar(8))

sql = "Select B.id,B.name,B.title,B.content,B.signtime,B.ip,B.mood,S.realname,S.regdate,S.point,"&_
	"S.maxim,S.imageid,S.birthday,S.email,S.oicq,S.homepage,S.locked from classboard B inner join student S on "&_
	" B.name=S.userid where B.classid="&ClsID&" order by B.id desc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,Conn,1,1
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
function copyText(obj) {var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.select();rng.execCommand('Copy');}
//-->
</SCRIPT>
<br><a name=top></a><br>
<table width=100% align=center><tr><td>      
<a href="ManageBoard.asp?ClassID=<%=ClsID%>&Action=Sign"><img src="images/button3.gif" border=0 height=28></a>
</td></tr>
</table>
<%
if rs.eof or rs.bof Then
%>
<table border=0 cellspacing=1 width=100% cellpadding=4 align=center Class=TableBorder>
<tr Class=LightTableBody>
<td height=60 nowrap>&nbsp;&nbsp;目前还没有留言噢:(</td>
</tr>
</table><BR>
<%
Else

Dim name,userclass,namestyle 

totalrecords=rs.recordcount
rs.pagesize=PageSize
totalpages=rs.pagecount

currentPage=Request("page")
if currentpage="" or not isnumeric(currentpage) Then
	currentpage=1
ElseIf Cint(currentpage)>totalpages Then
	currentpage=totalpages
End if

currentpage=Cint(currentpage)
rs.absolutepage=CurrentPage

for i=1 to PageSize

name=rs(7)


tmpsql="Select degree from joinclass where classid="&ClsID&" and userid='"&rs(1)&"'"
Set tmprs=Conn.Execute(tmpsql)

if tmprs.bof and tmprs.eof Then
	if BoolVar(9)=false and rs("locked")>1 then
		namestyle="color:white;filter:glow(color=#FF77ff,strength=2)"
		userclass=9
	else
		namestyle="color:white;filter:glow(color=#777777,strength=2)"
		userclass=0
	end if
Else
	userclass=tmprs(0)
	if userclass>6 Then
		namestyle="color:white;filter:glow(color=#FF7777,strength=2)"
	elseif userclass>1 Then
		namestyle="color:white;filter:glow(color=#33dd33,strength=2)"
	Else
		namestyle="color:white;filter:glow(color=#7777ff,strength=2)"
	End if
End if

Set tmprs=Nothing

if (i mod 2)=0 Then 
	bgcolor=LightTBColor
	abgcolor=DarkTBColor
Else
	bgcolor=DarkTBColor
	abgcolor=LightTBColor
End if

Response.Write "<a name="&rs(0)&"></a>"&_
	"<table cellpadding=0 cellspacing=1 border=0 width=""100%"" align=center Class=TableBorder>"&_
	"<tr bgcolor="&bgColor&">"
	'<!--left start-->
response.write "<td width=27% valign=top background=images/LeftBG.gif>"&_
	"<table cellspacing=8 border=0 align=center width=""90%"" style=""word-break:break-all"">"&_
	"<tr><td>"&_
	"<table cellspacing=0 cellpadding=0 width=100% border=0>"&_
		"<tr><td><table style="&namestyle&" border=0 height=30 valign=middle cellspacing=0 cellpadding=0><tr><td><B>"&name&"</B></td></tr></table></td>"&_
		"<td align=right>"&constellation(rs(12),true)&"</td></tr>"&_
	"</table>"

if rs(11)<>0 Then
	Response.Write "<a href=""Profile.asp?Action=showdetail&Name="&rs(1)&""" target=_blank  title=""查看"&name&"的个人信息""><img src=""face/image"&rs(11)&".gif"" border=0></a>"
Else
	Response.Write "<br><br>"
End if
Response.Write "<br><br>身份："
If userclass=0 Then
	Response.Write "已退出本班"
Elseif userclass=9 Then
	Response.Write "系统管理员"
Else
	Response.Write Grade(userclass,False)
End if
Response.Write "<br>积分："&rs(9)&"<br>注册："&rs(8)
if BoolVar(5)=True Then Response.Write "<br>鉴定："&ipsource(rs(5))
response.write "</td></tr></table>"&_
	"</td>"
'<!--left end-->
'<!--right start-->
response.write "<td height=""100%"">"&_
	"<table width=100% height=100% border=0 cellspacing=1 cellpadding=0 align=center>"&_
	"<tr><td valign=top>"
	'<!--top start-->
response.write "<table width=100% cellspacing=1 cellpadding=0 border=0>"&_
	"<tr><td align=right valign=top nowrap>"&_
	"<a href=""UserSMS.asp?Action=new&touser="&rs(1)&""" target=_blank title=""给"&name&"发短消息"">"&_
	"<img border=0 src=""images/message.gif"" align=absmiddle hspace=2>短信</a>&nbsp;&nbsp;"&_
	"<a href=""Friendlist.asp?Action=addF&myFriend="&rs(1)&""" target=_blank title=""把"&name&"加入好友列表"">"&_
	"<img border=0 src=""images/friend.gif"" align=absmiddle hspace=2>好友</a>&nbsp;&nbsp;"&_
	"<a href=""Profile.asp?Action=showdetail&Name="&rs(1)&""" target=_blank  title=""查看"&name&"的个人信息"">"&_
	"<img border=0 src=""images/profile1.gif"" align=absmiddle hspace=1>信息</a>&nbsp;&nbsp;"
if rs(13)<>"" Then
	response.write "<a href=""mailto:"&rs(13)&""" title=""给"&name&"发电子邮件"">"&_
	"<img src=""images/email.gif"" border=0  hspace=2>邮件</a>&nbsp;&nbsp;"
End if
if rs(14)<>"" Then
	response.write "<a href=""http://search.tencent.com/cgi-bin/friend/user_show_info?ln="&rs(14)&""" title=""查看"&name&"的QQ["&rs(14)&"]资料""><img src=""images/oicq.gif"" border=0 width=15 height=15 hspace=2>QQ</a>&nbsp;&nbsp;"
End if
if rs(15)<>"" Then
	response.write "<a href="""&rs(15)&""" title=""访问"&name&"的主页"">"&_
	"<img src=""images/homepage.gif"" border=0 align=absmiddle>主页</a>&nbsp;&nbsp;"
End if
response.write "</td></tr></table>"&_
"<hr width=98% size=1 color=#777777>"&_
"</td></tr>"
'<!--top end-->
'<!--body start-->
response.write "<tr><td width=100% height=""100%"">"&_
	"<table height=100% width=95% border=0 style=""word-break:break-all"" align=center>"&_
	"<tr><td valign=top>"
if rs(6)<>0 Then
	Response.Write "<img src=""mood/face"&rs(6)&".gif"" border=0 alt=发贴心情>&nbsp;"
end if
Response.Write ""&htmlencode(rs(2))&"<br>"
if BoolVar(4)=True Then 
	Response.Write "<span id=yu"&rs(0)&">"&ubbcode(rs(3))&"</span>"
Else 
	Response.Write "<span id=yu"&rs(0)&">"&htmlencode(rs(3))&"</span>"
End if
response.write "</td></tr></table>"&_
	"</td></tr>"
'<!--body end-->
'<!--maxim start-->
response.write "<tr><td height=100% valign=bottom>"
if rs(10)<>"" Then
	Response.Write "<table align=center valign=bottom border=0 cellspacing=8 cellpadding=0  width=""95%"">"&_
	"<tr><td align=right vlign=bottom><p>--------------------------------<br>"& UBBCode(rs(10))&"</td></tr></table>"
End if
response.write "</td></tr>"
'<!--maxim end-->
response.write "</table>"
'<!--right end-->
response.write "</td></tr>"&_
	"<tr bgcolor="&bgcolor&" height=30>"
'<!--bottom start-->
Response.Write "<td background=images/LeftBG.gif>&nbsp;"&OnlineStatus(rs(1))
if cdate(Request.cookies("fytxl")("logintime"))<rs(4) Then
	Response.Write "<img src=images/postnew.gif hspace=2 alt=新留言>"&rs(4)
Else
	Response.Write "<img src=images/postold.gif hspace=2 alt=旧留言>"&rs(4)
End if
response.write "</td>"&_
	"<td><table width=""100%"">"&_
	"<tr><td><img src=""images/ip.gif"" hspace=2 alt=发贴IP>"&getip(rs(5))&"</td>"&_
	"<td align=right>&nbsp;"
if rs(1)=membername or Degree>1 or sysadmin Then
	Response.Write "<a href=""ManageBoard.asp?ClassID="&ClsID&"&Action=Edit&ID="&rs(0)&"&Page="&CurrentPage&""">"&_
		"<img src=""images/edit1.gif"" border=0>编辑</a>&nbsp;&nbsp;"&_
		"<a onclick=""javascript:return confirm('您确认要删除这个留言吗?')"" href=""ManageBoard.asp?ClassID="&ClsID&"&Action=Delete&ID="&rs(0)&"&Page="&CurrentPage&""">"&_
		"<img src=""images/recycle1.gif"" border=0>删除</a>&nbsp;&nbsp;"
End if
response.write "<a href=""javascript:copyText(document.all.yu"&rs(0)&")"">"&_
	"<img border=0 src=""images/copy.gif"" align=absmiddle hspace=1>复制</a>&nbsp;&nbsp;"&_
	"<a href=""ManageBoard.asp?ClassID="&ClsID&"&Action=Sign&QuotePostNo="&rs(0)&""" title=""引用"&name&"的留言"">"&_
	"<img border=0 src=""images/replynow.gif"" align=absmiddle hspace=1>引用</a>&nbsp;&nbsp;"&_
	"</td></table>"&_
	"</td></tr></table>"
'<!--bottom end-->

response.flush

rs.movenext
if currentpage=totalpages then
	if rs.eof then exit for
end if

next

'start page(s) link
Dim p,ii

p=(currentpage-1) \ 8

Response.Write "<table border=0 cellpadding=0 cellspacing=3 width=100% align=center >"&_
	"<form method=post action=ClassBoard.asp?ClassID="&ClsID&" name=frmList2 >"&_
	"<tr><td valign=middle nowrap><a href=#top><img src=images/gotop.gif border=0>顶端</a>&nbsp;&nbsp;页次：<strong>"& currentPage &"</strong>/<strong>"& totalpages &"</strong>  留言：<strong>"& totalrecords &"</strong></td>"&_
	"<td valign=middle align=right nowrap><p>分页："
if currentpage=1 then 
	Response.Write "<font face=webdings color=gray>9</font> "
else
	Response.Write "<a href=""?ClassID="&ClsID&"&Page=1"" title=首页><font face=webdings>9</font></a> "
end if
if p*8>0 Then 
	Response.Write "<a href=""?ClassID="&ClsID&"&Page="&Cstr(p*8)&""" title=上八页><font face=webdings>7</font></a> "
end if
for ii=p*8+1 to P*8+8
	   if ii=currentPage Then
		  Response.Write "<font color=gray><B>"&ii&"</B></font> "
	   Else
		  Response.Write "<a href=""?ClassID="&ClsID&"&page="&ii&"""><B>"&ii&"</B></a> "
	   End if
	if ii=totalpages Then Exit for
next
if ii<totalpages Then 
	Response.Write "<a href=""?ClassID="&ClsID&"&Page="&ii&""" title=下八页><font face=webdings>8</font></a> "
end if
if currentpage=totalpages then 
	Response.Write "<font face=webdings color=gray>"&chr(58)&"</font> "   
else
	Response.Write "<a href=""?ClassID="&ClsID&"&Page="&totalpages&""" title=尾页><font face=webdings>"&chr(58)&"</font></a>  "   

end if

Response.Write "转到:<input type=text style=""height:17;width:20"" name=Page size=1 maxlength=2 value='"& currentpage &"'><input type=image src=images/go1.gif align=absmiddle hspace=2></p>"&_     
			"</td></tr>"&_
			"</form></table>"

'end page(s) link

End if

rs.close
Set rs=Nothing

End Sub



Function OnlineStatus(UserName)
	Dim ors
	Set ors=Conn.Execute("Select userid from online where userid='"&username&"'")
	if ors.eof and ors.bof Then
		OnlineStatus="<img src=images/isoff.gif alt=离线! height=17 hspace=4>"
	Else
		OnlineStatus="<img src=images/ison.gif alt=在线！快来找我吧! height=17 hspace=4>"
	End if
	ors.close
	Set ors=Nothing
End Function


%>
<!--#INCLUDE FILE="include/grade.asp" -->
<!--#INCLUDE FILE="include/constellation.asp" -->
<!--#INCLUDE FILE="include/checkupip.asp" -->
<%Call footer()%>







