⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classboard.asp

📁 酷虎网同学录V1.0
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#INCLUDE FILE="setup.asp" -->
<!--#INCLUDE FILE="char.asp" -->
<!--#INCLUDE FILE="ubbcode.asp" -->
<!--#INCLUDE FILE="checkuser.asp" -->
<!--#INCLUDE FILE="theme.asp" -->
<!--#INCLUDE FILE="email.asp" -->
<%
locat="班级心声"

if membername="" then
  	errmsg=errmsg+"<br>"+"<li>您还没有<a href=login.asp>登录</a>。"
	call top(1,1)
	call error("Information",errmsg)
else
	joinstatus=chkjoinclass(clsid)
	if joinstatus<>"" then
		call top(1,1)
		call error("Exclamation",joinstatus)
	else
		select case request("action")
		case "save"
			dim content,title
			act="发表留言"
			call top(2,1)
			call saveboard()
		case "sign"
			act="发表留言"
			call top(2,1)
			call signboard()
		case "edit"
			act="编辑留言"
			call top(2,1)
			call editform()
		case "modify"
			act="编辑留言"
			call top(2,1)
			call modify()
		case "confirm"
			act="删除留言"
			call top(2,1)
			call confirm()
		case "delete"
			act="删除留言"
			call top(2,1)
			call delete()
		case else
			dim rs,StrSQL,CurrentPage,totalpages,abgcolor
			call top(2,1)
			call main()
		end select
	end if
end if


sub main()

Set rs = Server.CreateObject("ADODB.Recordset")
StrSQL = "select b.*,s.userid,s.realname,s.regdate,s.point,s.maxim,s.image,"&_
		 "s.birthday,s.email,s.oicq,s.homepage,s.msn from classboard b inner "&_
		 "join student s on b.name=s.userid where b.classid="&clsid&_
		 " order by b.id desc"

rs.open StrSQL,conn,1,1
rs.pagesize=PageSize
totalpages=rs.pagecount

currentPage=request("page")
if currentpage="" then currentpage=1
if not isInteger(currentpage) then
	currentpage=1
elseif Cint(currentpage)>totalpages then
	currentpage=totalpages
end if
currentpage=Cint(currentpage)



%>
<br><a name=top></a>
<br>
<table width=100% align=center><tr><td>      
<a href="classboard.asp?action=sign"><img src="images/button3.gif" border=0></a>
</td></tr>
</table>
<% 
if rs.eof or rs.bof then
	call showemptypage()
else
	call showclassboard()
	call pagelink()
end if



rs.close
set rs=nothing
end sub

sub showemptypage()
response.write "<table border=0 cellspacing=1 width=100% cellpadding=4 align=center bgcolor="&tablebordercolor&">"&_
            "<tr bgcolor="&tablebodycolor2&">"&_
			"<td height=40 nowrap>&nbsp;&nbsp;目前还没有留言!</td>"&_
			"</tr>"&_
			"</table><br><br>"
end sub


sub showclassboard()

dim name,userclass,mood,namestyle 

%>
<!--#INCLUDE FILE="script/popup.inc" -->
<SCRIPT LANGUAGE="JavaScript">
<!--
function copyText(obj) {var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.select();rng.execCommand('Copy');}

//-->
</SCRIPT>

<%
rs.absolutepage=CurrentPage
total=0

while (not rs.eof and not total=PageSize)

name=htmlencode(rs("realname"))
mood=rs("mood")

if sysadmin then
	namestyle="color:white;filter:glow(color=#FF33ff,strength=1)"
	userclass=9
end if

tmpsql="select degree from [joinclass] where classid="&clsid&" and userid='"&rs("userid")&"'"
set tmprs=conn.execute(tmpsql)

if tmprs.eof then
	if sysadmin=false then
		namestyle="color:white;filter:glow(color=#777777,strength=1)"
		userclass=0
	end if
else
	userclass=tmprs(0)
	if userclass>1 then
		namestyle="color:white;filter:glow(color=#FF3333,strength=1)"
	elseif userclass=1 then
		namestyle="color:white;filter:glow(color=#3333ff,strength=1)"
	end if
end if

set tmprs=nothing

total=total+1

if (total mod 2)=0 then 
	bgcolor=Tablebodycolor1
	abgcolor=Tablebodycolor2
else
	bgcolor=Tablebodycolor2
	abgcolor=Tablebodycolor1
end if

response.write "<table cellpadding=0 cellspacing=1 border=0 width=""100%"" align=center bgcolor="&tablebordercolor&">"
response.write "<tr bgcolor="&bgColor&">"

birth=constellation(rs("birthday"))
%>
<!--left start-->
<td width=27% valign=top>
<table cellspacing=8 border=0 align=center width=90%>
	<tr><td nowrap>
	<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><%=birth%></td></tr>
	</table>
<%

if not isnull(rs("image")) and rs("image")<>"" then
	response.write "<a href=profile.asp?action=showdetail&name="&HTMLEncode(rs("userid"))&" target=_blank  onmouseout=kill() onmouseover=popup('查看"&name&"的个人信息','"&abgcolor&"')><img src="&rs("image")&" border=0></a>"
else
	response.write "<br><br>"
end if

response.write "<br><br>身份:"

select case userclass
case 9 
	response.write "系统管理员" 
case 8 
	response.write "班长" 
case 7
	response.write "副班长"
case 6 
	response.write "学习委员"
case 5 
	response.write "宣传委员"
case 4 
	response.write "文娱委员"
case 3 
	response.write "生活委员"
case 2 
	response.write "体育委员"
case 1 
	response.write "班级成员"
case 0 
	response.write "已退出本班"
end select

response.write "<br>积分:"&rs("point")&"<br>注册:"&rs("regdate")
if FromFlag=true then response.write "<br>鉴定:"&ipsource(rs("ip"))
%>

</td></tr></table>
</td>
<!--left end-->
<!--right start-->
<td height=100%>
<table width=100% height=100% border=0 cellspacing=1 cellpadding=0 align=center>
	<tr><td valign=top>
	<!--top start-->
	<table cellspacing=1 cellpadding=0 border=0 width=100%><tr>
<td align=right valign=top nowrap><a href=usersms.asp?action=new&touser=<%=htmlencode(rs("userid"))%> target=_blank onmouseout="kill()" onmouseover="popup('给<%=name%>发短消息','<%=abgcolor%>')"><img border=0 src=images/message.gif align=absmiddle hspace=2>短信</a>&nbsp;&nbsp;<a href=friendlist.asp?action=addF&myFriend=<%=HTMLEncode(rs("userid"))%>  target=_blank onmouseout="kill()" onmouseover="popup('把<%=name%>加入好友列表','<%=abgcolor%>')"><img border=0 src=images/friend.gif align=absmiddle hspace=2>好友</a>&nbsp;&nbsp;<a href=profile.asp?action=showdetail&name=<%=HTMLEncode(rs("userid"))%>  target=_blank  onmouseout="kill()" onmouseover="popup('查看<%=name%>的个人信息','<%=abgcolor%>')"><img border=0 src=images/profile1.gif align=absmiddle hspace=1>信息</a>&nbsp;&nbsp;<%if not isnull(rs("email")) and rs("email")<>"" then%><a href="mailto:<%=htmlencode(rs("email"))%>"  onmouseout="kill()" onmouseover="popup('给<%=name%>发电子邮件','<%=abgcolor%>')"><img src=images/email.gif border=0  hspace=2>邮件</a>&nbsp;&nbsp;<%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('查看<%=name%>的QQ[<%=htmlencode(rs("oicq"))%>]资料','<%=abgcolor%>')"><img src=images/oicq.gif border=0 width=15 height=15 hspace=2>QQ</a>&nbsp;&nbsp;
<%end if
if not isnull(rs("homepage")) and rs("homepage")<>"" then%><a href="<%=htmlencode(rs("homepage"))%>"  onmouseout="kill()" onmouseover="popup('访问<%=name%>的主页','<%=abgcolor%>')"><img src=images/homepage.gif border=0 align=absmiddle>主页</a>&nbsp;&nbsp;<%end if%><%if not isnull(rs("msn")) and rs("msn")<>"" then%><a href="#"  onmouseout="kill()" onmouseover="popup('<%=name%>的MSN:<%=htmlencode(rs("msn"))%>','<%=abgcolor%>')"><img src=images/msn.gif border=0 align=absmiddle hspace=2 width=15>MSN</a>&nbsp;&nbsp;<%end if%>

</td></tr></table>

<hr width=98% size=1 color=#777777>
</td></tr>
<!--top end-->
<!--body start-->
<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 instr(mood,"face")>0 then response.write "<img src=mood/"&mood&" border=0 alt=发贴心情>&nbsp;"
response.write ""&htmlencode(rs("title"))&"<br>"

if ubbflag=true then 
	response.write "<span id=yu"&rs("id")&">"&ubbcode(rs("content"))&"</span>"
else 
	response.write "<span id=yu"&rs("id")&">"&htmlencode(rs("content"))&"</span>"
end if

%>
</td></tr></table>
</td></tr>
<!--body end-->
<!--maxim start-->
<tr><td valign=bottom height=100%>
<%
if not isnull(rs("maxim")) and rs("maxim")<>"" 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("maxim"))&"</td></tr></table>"
end if
%>

</td></tr>
<!--maxim end-->
</table>

<!--right end-->
</td></tr>

<%response.write "<tr bgcolor="&bgcolor&" height=30>"
%>

<!--bottom start-->
<%
response.write "<td>&nbsp;"&isonline(rs("userid"))

if cdate(request.cookies("fengyue")("logintime"))<rs("signtime") then
	response.write "<img src=images/postnew.gif hspace=2 alt=新留言>"&rs("signtime")
else
	response.write "<img src=images/postold.gif hspace=2 alt=旧留言>"&rs("signtime")
end if
%>
</td>

<td><table width=100%><tr><td><img src=images/ip.gif  hspace=2 alt=发贴IP>
<%response.write getip(rs("ip"))%></td><td align=right>&nbsp;
<%if rs("userid")=membername or isclassadmin(0)<>0 or sysadmin then
response.write "<a href=classboard.asp?action=edit&id="&rs("id")&"&page="&CurrentPage&"><img src=images/edit1.gif border=0>编辑</a>"&_
"&nbsp;&nbsp;<a href=classboard.asp?action=confirm&id="&rs("id")&"&page="&CurrentPage&"><img src=images/recycle1.gif border=0>删除</a>"
end if
%>&nbsp;&nbsp;<a href=javascript:copyText(document.all.yu<%=rs("id")%>);><img border=0 src=images/copy.gif align=absmiddle hspace=1>复制</a>&nbsp;&nbsp;<a href=classboard.asp?action=sign&quotepostno=<%=rs("id")%> onmouseout="kill()" onmouseover="popup('引用<%=name%>的留言','<%=abgcolor%>')"><img border=0 src=images/replynow.gif align=absmiddle hspace=1>引用</a>&nbsp;&nbsp;</td></table></td>

</tr>
<!--bottom end-->

</table>




<%rs.movenext
wend

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=100% align=center >"&_
					"<form method=post action=classboard.asp name=frmList2 >"&_
					"<tr><td valign=middle nowrap><a href=#top><img src=images/gotop.gif border=0>顶端</a>&nbsp;&nbsp;页次<strong>"& currentPage &"</strong>/<strong>"& n &"</strong>  留言数<strong>"& totalrec &"</strong></td>"&_
					"<td valign=middle align=right nowrap><p>分页:"

	if p*10>0 then response.write "<a href=?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=?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=?page="&Cstr(ii)&">[>>]</a>   "

		response.write "转到:<input type=text name=Page size=1 maxlength=2  value='"& currentpage &"'>&nbsp;<input type=submit value=Go class=novdn></p>"&_     
					"</td></tr>"&_
					"</form></table>"

		if err.number<>0 then err.clear
	end sub 
	
rem ---------------------------------------------------------------------------------	
	
sub signboard()
dim advmode

bisquotepost=false
'response.write request("quotepostno")

if request("quotepostno")<>"" then
postno=clng(request("quotepostno"))
sql="select name,content,signtime,classid from [classboard] where id="&postno
set rs=conn.execute(sql)
if not rs.eof and rs("classid")=clng(clsid) then
content=reubbcode(rs("content"))
	 	content = replace(content, "&gt;", ">")
  		content = replace(content, "&lt;", "<")
   		content = Replace(content, "</P><P>", CHR(10) & CHR(10))
   		content = Replace(content, "<BR>", CHR(10))
quotecontent="[quote][b]以下是引用[i]"&getrealname(rs("name"))&"在"&rs("signtime")&"[/i]的发言:[/b]"
quotecontent=quotecontent+chr(13)+content+chr(13)+"[/quote]"
bisquotepost=true
end if
end if

if request("mode")="advanced" then
	advmode=true
elseif request("mode")="typical" then
	advmode=false
else
	advmode=signmodeflag
end if
%>
<BR><BR>
        <form style="MARGIN: 0px" name="frmgbk" action="classboard.asp?action=save" method="post"
        onsubmit="return submitonce(this)">
		  <input type="hidden" name="clsid"
          value="<%=clsid%>">
		  <table border="0" cellspacing="1" width="95%" cellpadding="4"
          bgcolor="<%=tablebordercolor%>" align="center">
            <tr bgcolor="<%=tabletitlecolor%>">
              <th height="20" align="center" colspan=2>
			  <b>发表留言</b>&nbsp;&nbsp;<%if advmode=false then%><A HREF="classboard.asp?action=sign&mode=advanced<%if bisquotepost=true then response.write "&quotepostno="&postno%>" title="当前为简洁模式,按此切换到高级发贴模式">[高级模式]</A><%else%><A HREF="classboard.asp?action=sign&mode=typical<%if bisquotepost=true then response.write "&quotepostno="&postno%>" title="当前为高级模式,按此切换到简洁发贴模式">[简洁模式]</A><%end if%></th>

            <tr  bgcolor="<%=tablebodycolor2%>">
              <td height="13" width="30%">&nbsp;<B>留 言 人</B></td><td> 
              &nbsp;&nbsp;<%=htmlencode(getrealname(membername))%></td>
            </tr>
            <tr bgcolor="<%=tablebodycolor2%>">
              <td height="13" nowrap>&nbsp;<B>留言主题</B>&nbsp;<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>&nbsp;&nbsp;<input size="30" name="title" maxlength=20>&nbsp;<FONT COLOR="red">*</FONT>不得超过10个汉字 </td>
            </tr>
 <tr bgcolor="<%=tablebodycolor2%>">
              <td height="13">&nbsp;<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="mood/face<%=i%>.gif" WIDTH="15" HEIGHT="15">
<%if i=9 then response.write "<br>"
next%>
</td></tr></table>
              </td>
            </tr>
            <tr bgcolor="<%=tablebodycolor2%>">
              <td>&nbsp;<B>留言内容</B><BR>&nbsp;<a href=javascript:checklength()>[检测留言长度]</a><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%>KB</font><BR><BR><a href="javascript:openScript('help.asp?about=ubb',670,500)"  style="cursor:help"><IMG SRC="IMAGES/help.gif" WIDTH="42" HEIGHT="17" BORDER=0 ALT="查看UBB代码使用说明"></a>
              </td>
              <td><table border=0><%if advmode=true then%><!--#INCLUDE FILE="ubbtools.asp" --><%end if%><tr><td>&nbsp;&nbsp;<textarea name="content" rows="10" cols="50" title="可以使用Ctrl+Enter直接提交留言" onkeydown="ctlent()"><%if bisquotepost=true then response.write quotecontent%></textarea></tr></table></td>
            </tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -