📄 classboard.asp
字号:
<!--#INCLUDE FILE="conn.asp" -->
<!--#INCLUDE FILE="const.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<!--#INCLUDE FILE="email.asp" -->
<html><head>
<title><%=SchoolmateName%>——班级留言簿</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="txl.css" type="text/css" rel="stylesheet">
</head>
<body topmargin="0" leftmargin="0" bgcolor=<%=bodycolor%>>
<%
call isjoinclass(1)
bisystemadmin=issystemadmin(0)
if request("action")="save" then
dim content,title
call saveboard()
elseif request("action")="sign" then
call signboard()
elseif request("action")="edit" then
call editform()
elseif request("action")="modify" then
call modify()
elseif request("action")="confirm" then
call confirm()
elseif request("action")="delete" then
call delete()
else
dim rs,StrSQL,CurrentPage,maxpages,abgcolor
call main()
end if
sub main()
if isInteger(request("page")) then
currentpage=cint(request("page"))
else CurrentPage=1
end if
Set rs = Server.CreateObject("ADODB.Recordset")
StrSQL = "Select classboard.*,student.userid,student.realname,student.regdate,"&_
"student.point,student.maxim,student.image,student.isadmin,"&_
"student.bir_month,student.bir_day,student.email,student.oicq,"&_
"student.homepage from [classboard],[student] where "&_
"classboard.classid="&clsid&" and "&_
"classboard.name=student.userid order by classboard.id desc"
rs.open StrSQL,conn,1,1
rs.pagesize=PageSize
maxpages=cint(rs.pagecount)
if CurrentPage>maxpages and maxpages<>0 then
errmsg=errmsg+"<br>"+"<li>没有你所想要的页!</li>"
founderr=true
call error(errmsg)
else
%>
<br>
<table border="0" cellspacing="1" width="90%" bgcolor="<%=tablebordercolor%>" cellpadding="4" align=center>
<tr bgcolor=<%=tabletitlecolor%>>
<td align=center nowrap><img height="35" src="images/icon03.gif" width="35" align="absMiddle"> 班级留言簿</td>
</tr>
</table>
<br><br>
<table width=90% align=center><tr><td>
<a href="classboard.asp?action=sign"><img src=images/post.gif border=0></a>
</td></tr>
</table>
<%
if rs.eof or rs.bof then
call showemptypage()
else
call showclassboard()
call pagelink()
end if
end if
rs.close
set rs=nothing
call endconnection()
end sub
sub showemptypage()
%>
<table border="0" cellspacing="1" width="90%" cellpadding="4" align=center bgcolor="<%=tablebordercolor%>">
<tr bgcolor=<%=tablebodycolor2%>>
<td height="40" nowrap> 目前还没有留言!</td>
</tr>
</table>
<br><br>
<%
end sub
sub showclassboard()
%>
<script language="JavaScript" src="script/jsfun.js"></script>
<!--#INCLUDE FILE="script/popup.inc" -->
<table cellpadding=0 cellspacing=1 border=0 width="90%" align=center bgcolor=<%=tablebordercolor%>>
<%
rs.absolutepage=CurrentPage
total=0
do until rs.eof or total=PageSize
title=rs("title")
content=rs("content")
name=rs("realname")
maxim=rs("maxim")
mood=rs("mood")
m=rs("bir_month")
d=rs("bir_day")
cons=constellation(m,d)
if rs("isadmin")=3 then
namestyle="color:white;filter:glow(color=#FF33ff,strength=2)"
elseif rs("isadmin")=1 then
namestyle="color:white;filter:glow(color=#FF3333,strength=2)"
else
namestyle="color:white;filter:glow(color=#3333ff,strength=2)"
end if
total=total+1
if (total mod 2)=0 then
response.write "<tr bgcolor="&TablebodyColor1&">"
abgcolor=Tablebodycolor2
else
response.write "<tr bgcolor="&TablebodyColor2&">"
abgcolor=Tablebodycolor1
end if
%>
<td>
<table border="0" cellspacing="2" width="100%" cellpadding="4">
<tr><td width=27% valign=top><table cellspacing=8 border=0><tr><td nowrap><table style="<%=namestyle%>"><tr><td><br> <b><%=htmlencode(name)%></b><br><br></td></tr></table>
<%
if not isnull(rs("image")) and rs("image")<>"" then
response.write " <img src="&rs("image")&">"
else
response.write "<br><br>"
end if
response.write "<br><br>身份:"
if rs("isadmin")=3 then
response.write "系统管理员"
elseif rs("isadmin")=1 then
response.write "班级管理员"
else
response.write "班级成员"
end if
response.write "<br>注册:"&rs("regdate")
response.write "<br>积分:"&rs("point")
response.write "<br>星座:"&cons
response.write "<br>鉴定:"
if FromFlag=true then response.write ipsource(rs("ip")) else response.write "保密"
%>
</td></tr></table></td>
<td width=1><table cellpadding=0 cellspacing=0 width=1 border=0 bgcolor=<%=tablebordercolor%> height=100%><tr><td width=1></td></tr></table></td>
<td height=15><table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr><td valign=top><table cellspacing=0 cellpadding=0 border=0 width=100%><tr><td> </td>
<td align=right valign=top><a href=usersms.asp?action=new&touser=<%=htmlencode(rs("userid"))%> target=_blank onmouseout="kill()" onmouseover="popup('给<%=htmlencode(name)%>发短消息','<%=abgcolor%>')"><img border=0 src=images/message.gif align=absmiddle hspace=2>短信</a> <a href=friendlist.asp?action=addF&myFriend=<%=HTMLEncode(rs("userid"))%> target=_blank onmouseout="kill()" onmouseover="popup('把<%=htmlencode(name)%>加入好友列表','<%=abgcolor%>')"><img border=0 src=images/friend.gif align=absmiddle hspace=2>好友</a> <a href=profile.asp?action=showdetail&name=<%=HTMLEncode(rs("userid"))%> target=_blank onmouseout="kill()" onmouseover="popup('查看<%=htmlencode(name)%>的个人信息','<%=abgcolor%>')"><img border=0 src=images/profile1.gif align=absmiddle hspace=1>信息</a> <%if not isnull(rs("email")) and rs("email")<>"" then%><a href="mailto:<%=htmlencode(rs("email"))%>" onmouseout="kill()" onmouseover="popup('给<%=htmlencode(name)%>发电子邮件','<%=abgcolor%>')"><img src=images/email.gif border=0 hspace=2>邮件</a> <%end if
if not isnull(rs("oicq")) and rs("oicq")<>"" then%><a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=htmlencode(rs("oicq"))%>" onmouseout="kill()" onmouseover="popup('查看<%=htmlencode(name)%>的QQ资料','<%=abgcolor%>')"><img src=images/oicq.gif border=0 width=16 height=16 hspace=2>OICQ</a>
<%end if
if not isnull(rs("homepage")) and rs("homepage")<>"" then%>
<a href="<%=htmlencode(rs("homepage"))%>" onmouseout="kill()" onmouseover="popup('访问<%=htmlencode(name)%>的主页','<%=abgcolor%>')"><img src=images/homepage.gif border=0 align=absmiddle>主页</a><%end if%> <a href=classboard.asp?action=sign"epostno=<%=rs("id")%> onmouseout="kill()" onmouseover="popup('引用<%=htmlencode(name)%>的留言','<%=abgcolor%>')"><img border=0 src=images/replynow.gif align=absmiddle hspace=2>引用</a>
</td></table>
<hr width=100% size=1 color=#777777></td></tr><tr><td width=100% height=100%>
<table height=100% border=0 width=100% cellspacing=0 cellpadding=1 style="word-break:break-all"><tr><td><table height=100% width=100% border=0><tr><td valign=top >
<%if instr(mood,"face")>0 then response.write "<img src="&MoodURL&mood&" border=0 alt=发贴心情> "
response.write "<b>"&htmlencode(title)&"</b><br>"
%>
<%if ubbflag=true then
response.write ubbcode(content)
else
response.write htmlencode(content)
end if
%>
</td></tr></table></td></tr><tr><td valign=bottom>
<%if not isnull(rs("maxim")) and rs("maxim")<>"" then
response.write "<table align=right valign=bottom border=0 cellspacing=8 cellpadding=0 width='80%'><tr><td align=right vlign=bottom><p>------------------------<br>"& UBBCode(maxim)&"</td></tr></table>"
end if
%>
</td></tr></table></td></tr><tr><td valign=bottom>
<hr width=100% size=1 color=#777777>
<table cellspacing=0 cellpadding=0 border=0 width=100%><tr><td nowrap><img src=images/time.gif> 留言时间:<%=rs("AddDate")%> </td><td nowrap> <img src=images/ip.gif>
<%if IpFlag=false then response.write rs("ip") else response.write getip(rs("ip"))
%>
</td><td align=center nowrap>
<%if rs("userid")=membername or isclassadmin(0)=true or bisystemadmin =true then
response.write "<a href=classboard.asp?action=edit&id="&rs("id")&"><img src=images/edit1.gif border=0>编辑</a> <a href=classboard.asp?action=confirm&id="&rs("id")&"><img src=images/recycle.gif border=0 width=16 height=16>删除</a>"
end if
%>
</td></tr></table></td></tr>
</table></td></tr></table></td></tr>
<%rs.movenext
loop
end sub
sub PageLink()
'on error resume next
set rs=conn.execute("select count(id) from classboard where classID="&clsid)
totalrec=rs(0)
dim n,pi
if totalrec mod PageSize=0 then
n= totalrec \ PageSize
else
n= totalrec \ PageSize+1
end if
if currentpage-1 mod 10=0 then
p=(currentpage-1) \ 10
else
p=(currentpage-1) \ 10
end if
response.write "<table border=0 cellpadding=0 cellspacing=3 width=90% align=center >"&_
"<form method=post action=classboard.asp name=frmList2 >"&_
"<tr><td valign=middle nowrap>页次<strong>"& currentPage &"</strong>/<strong>"& n &"</strong> 每页<strong>"& PageSize &"</strong> 留言数<strong>"& totalrec &"</strong></td>"&_
"<td valign=middle align=right nowrap><p>分页:"
if p*10>0 then response.write "<a href=classboard.asp?page="&Cstr(p*10)&">[<<]</a> "
for ii=p*10+1 to P*10+10
if ii=currentPage then
response.write "<font color=gray>["+Cstr(ii)+"]</font> "
else
response.write "<a href=classboard.asp?page="&Cstr(ii)&">["&Cstr(ii)&"]</a> "
end if
if ii=n then exit for
'p=p+1
next
if ii<n then response.write "<a href=classboard.asp?page="&Cstr(ii)&">[>>]</a> "
response.write "转到:<input type=text name=Page size=2 maxlength=10 value='"& currentpage &"'><input type=submit value=Go></p>"&_
"</td></tr>"&_
"</form></table>"
if err.number<>0 then err.clear
end sub
rem ---------------------------------------------------------------------------------
sub signboard()
bisquotepost=false
if request("quotepostno")<>"" then
postno=clng(request("quotepostno"))
sql="select name,content,adddate,classid from [classboard] where id="&postno
set rs=conn.execute(sql)
if not rs.eof and clng(rs("classid"))=clsid then
content=reubbcode(rs("content"))
content = replace(content, ">", ">")
content = replace(content, "<", "<")
content = Replace(content, "</P><P>", CHR(10) & CHR(10))
content = Replace(content, "<BR>", CHR(10))
quotecontent="[quote][b]以下是引用[i]"&getrealname(rs("name"))&"在"&rs("adddate")&"[/i]的发言:[/b]"
quotecontent=quotecontent+chr(13)+content+chr(13)+"[/quote]"
bisquotepost=true
end if
end if
%>
<script language="JavaScript" src="script/jsfun.js"></script>
<script language="javascript">
function DoTitle(addTitle) {
var revisedTitle;
var currentTitle = document.frmgbk.title.value;
revisedTitle = currentTitle+addTitle;
document.frmgbk.title.value=revisedTitle;
document.frmgbk.title.focus();
return; }
</script>
<BR><BR>
<form style="MARGIN: 0px" name="frmgbk" action="classboard.asp?action=save" method="post"
onsubmit="return submitonce(this)">
<input type="hidden" name="name" value="<%=membername%>">
<input type="hidden" name="clsid"
value="<%=clsid%>">
<table border="0" cellspacing="1" width="<%=tablewidth%>" cellpadding="4"
bgcolor="<%=tablebordercolor%>" align="center">
<tr bgcolor="<%=tabletitlecolor%>">
<td height="20" align="center" colspan=2>
<img height="30" src="images/icon04.gif" width="30" align="absMiddle"> <b>签写班级留言</b></td>
<tr bgcolor="<%=tablebodycolor2%>">
<td height="13" width="30%"> <B>留 言 人</B></td><td>
<%=htmlencode(getrealname(membername))%></td>
</tr>
<tr bgcolor="<%=tablebodycolor2%>">
<td height="13" nowrap> <B>留言主题</B> <SELECT name=font onchange=DoTitle(this.options[this.selectedIndex].value)>
<OPTION selected value="">选择话题</OPTION> <OPTION value=[原创]>[原创]</OPTION>
<OPTION value=[转帖]>[转帖]</OPTION> <OPTION value=[灌水]>[灌水]</OPTION>
<OPTION value=[讨论]>[讨论]</OPTION> <OPTION value=[求助]>[求助]</OPTION>
<OPTION value=[推荐]>[推荐]</OPTION> <OPTION value=[公告]>[公告]</OPTION>
<OPTION value=[注意]>[注意]</OPTION> <OPTION value=[贴图]>[贴图]</OPTION>
<OPTION value=[建议]>[建议]</OPTION> <OPTION value=[下载]>[下载]</OPTION>
<OPTION value=[分享]>[分享]</OPTION></SELECT>
</td><td> <input size="51" name="title"> <FONT COLOR="red">*</FONT>不得超过 50 个汉字 </td>
</tr>
<tr bgcolor="<%=tablebodycolor2%>">
<td height="13"> <B>留言心情</B><br><li>将放在留言的前面
</td><td><table border=0 width=100%><tr><td>
<%for i=1 to 18%>
<input type="radio" value="face<%=i%>" name="mood" <%if i=1 then response.write "checked"%>><img src="<%=MoodURL%>face<%=i%>.gif" WIDTH="15" HEIGHT="15">
<%if i=9 then response.write "<br>"
next%>
</td></tr></table>
</td>
</tr>
<tr bgcolor="<%=tablebodycolor2%>">
<td> <B>留言内容</B><BR><br><li>HTML标签:<font color=brown>OFF</font><BR><li>UBB标签:<%if ubbflag=true then response.write "<font color=#003399>ON" else response.write "<font color=brown>OFF"%></font><BR><li>最大长度:<font color=brown><%=MaxBoardSize\1024%>KB</font>
</td>
<td> <textarea name="content" rows="10" cols="50"><%if bisquotepost=true then response.write quotecontent%></textarea></td>
</tr>
<tr bgcolor="<%=tabletitlecolor%>">
<td height="30" align="center" colspan=2><input
style="WIDTH: 90px; HEIGHT: 20px" type="submit" value="提交留言" name="submit">
<input style="WIDTH: 90px; HEIGHT: 20px" type="reset" value="清除重写"
name="reset"> </td>
</tr>
</table>
</form>
</body>
</html>
<%end sub
rem ================================================================
sub editform()
bbsid=request("id")
set rs=conn.execute("select * from [classboard] where id="&bbsid)
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>非法操作,该留言信息不存在"
call error(errmsg)
else
%>
<script language="JavaScript" src="script/jsfun.js"></script>
<table border="0" cellspacing="1" width="100%">
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -