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

📄 forum.asp

📁 数值计算方法网络课件系统是浙江大学过程装备与控制工程专业2001级本科生毕业设计成果。本系统采用ASP+ACCESS架构
💻 ASP
字号:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/pagebar.asp"-->
<!--*************** 留言板页面 *************
** File: admin/index.asp V1.0 2005.05.08
** Author: wwxbei
*******************************************-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312" xmlns:mml="http://www.w3.org/1998/Math/MathML">
<head>
<title>数值计算方法网络课件-试题显示页面</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta http-equiv="content-language" content="gb2312" />
<meta content="all" name="robots" />
<link rel="stylesheet" href="style/examcss.css" type="text/css" />
<object id="mathplayer" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987">
</object><?import namespace="mml" implementation="#mathplayer"?>
<script type="text/javascript" src="inc/ASCIIMathML.js"></script>
<script type="text/javascript" src="inc/ASCIIMathMLdisplay.js"></script>
<script>mathcolor="Black"</script>
</head>
<body onload="translate()">
<script language="javascript" type="text/javascript" src="html/header8.js"></script>
<div id="bodyer">


<script language="javascript">
<!--
function checkform(form){
if (form.d_title.value=="")
{
  alert("标题不能为空!");
  form.d_title.focus();
  return(false);
}
if (form.author.value=="")
{
  alert("请输入您的网上大名!");
  form.author.focus();
  return(false);
}
if (eWebEditor2.getHTML()=="")	//getHTML()为eWebEditor自带的接口函数,功能为取编辑区的内容
{
	alert("请输入您要说的话!");
	return(false);
}
}
//-->
</script>


<%
Dim tablestring1,tablestring2,TitleTemp,readstring1,readstring2,NeirongTemp,newtopicstr
tablestring1="<table align=center border=1 cellspacing=""1"" cellpadding=""0"" bordercolor=#ACf4e7><tr height=30><td width=""40"" align=center>状态<td width=""300"" align=center>主题<td width=""80"" align=center>作者</a><td width=""40"" align=center>回复<td width=""40"" align=center>人气<td width=""80"" align=center>回复人<td width=""100"" align=center>最后更新</td></tr></table>"
tablestring2="<table align=center border=1 cellspacing=""1"" cellpadding=""0"" bordercolor=#ACf4e7><tr><td width=""40"" height=30 align=center><img src=images/status.gif alt=开放主题><td width=""300""><font color=red>[置顶]</a><a href=""forum.asp?action=read&id=topic_id"" target=_blank>title</a><td width=""80"" align=center>author<td width=""40"" align=center>reply<td width=""40"" align=center>hits<td width=""80"" align=center>replyer<td width=""100"" align=center>replytime</td></tr></table>"
readstring1="<center><table border=0 width=680><tr><td height=45 width=400 align=left>帖子主题:thetopic<td width=280 align=center><a href=forum.asp?action=newtopic>发表新话题</a></td></tr></table></center>"
readstring2="<center><table border=1 cellSpacing=2 cellPadding=2 bordercolor=#ACf4e7><tr><td width=150 align=center valign=top>作者:author<br>发表时间:<br>theTime</td><td width=570><table width=""100%"" border=0 cellspacing=""2"" cellpadding=""2""><tr><td align=left><a href=""forum.asp?action=reply&id=topic_id""><IMG SRC=""images/reply_a.gif"" ALT=""回复这个帖子"" border=""0""></a><td align=right><B>第 floornum 楼</B></td></tr><tr><td colspan=2 height=30 align=left><font color=#9932CC>title</font></tr><tr><td colspan=2 align=left>neirong</tr></table></td></tr></table></center>"
newtopicstr="<table border=1 cellSpacing=2 cellPadding=2 bordercolor=#ACf4e7 align=center><tr><td width=650 align=center><form action='forum.asp?action=save' method='post' name='myform'><input type=hidden name=d_savepathfilename><input type=hidden name=cupid value=theCupid><table width=600 border=0 align=center cellspacing='0' cellpadding='0'><tr><td height='35' width=70 align=center>标题:</td><td align=left><input type='text' name='d_title' value='topicStr' size='50'></td></tr><tr><td height='35' align=center>作者:</td><td align=left><input type='text' name='author' value='theAuthor' size='20'></td></tr><tr><td height='35' align=center>内容:</td><td>&nbsp</td></tr><tr><td colspan=2 align='center'><textarea name='d_say' style='display:none;'>theContent</textarea><iframe ID='eWebEditor2' SRC='ewebeditor/ewebeditor.asp?id=d_say&style=s_light' frameborder='0' scrolling='no' width='550' HEIGHT='350'></iframe></td></tr></table><p><input type=submit NAME='SUBMIT' VALUE='. 确 定 发 表 .' onclick='return checkform(this.form)'><input type=reset name=btnReset value=' 重 填 '></p></form></td></tr></table>"
%>
<%
function chknull(para)
if isNUll(para) then 
chknull="&nbsp"
else
chknull=para
end if
end function
%>

<%
Select Case GetSafeStr(request.querystring("action"))
	Case "list"
	Response.Write "<div id='content1' style='text-align:left;'><h4>留言列表</h4>"
	Response.Write "<p><a href=forum.asp?action=newtopic>发表新话题</a></p>"
	response.write tablestring1
	dim curpage,i
	if Request.QueryString("page")="" then
	curpage=1
	else 
	curpage=Request.QueryString("page")
	end if
	Call DBConnBegin()
  sql="SELECT * FROM forum where cupid=0 ORDER BY ontop,ID DESC"
  rs.open sql,conn,1,1
	if rs.bof and rs.eof then
		response.write "<br><br><font color=#FF0000><li>对不起,还无任何留言!<br><a href=""forum.asp?action=newtopic"">请你给本站留下一言半语吧!</a></li></font>"
  else
		RS.pagesize = 10
	RS.absolutepage = curpage 
	for i = 0 to RS.pagesize-1
			TitleTemp=TableString2
			if rs("ontop")=true then
				TitleTemp=replace(TitleTemp,"status.gif","ontop.gif")
				TitleTemp=replace(TitleTemp,"开放主题","置顶主题")
			else
				TitleTemp=replace(TitleTemp,"[置顶]","")
			end if
			TitleTemp=replace(TitleTemp,"title",chknull(rs("title")))
			TitleTemp=replace(TitleTemp,"topic_id",chknull(rs("id")))
			TitleTemp=replace(TitleTemp,"author",chknull(rs("name")))
			TitleTemp=replace(TitleTemp,"hits",chknull(rs("hits")))
			TitleTemp=replace(TitleTemp,"replytime",chknull(rs("replytime")))
			TitleTemp=replace(TitleTemp,"replyer",chknull(rs("replyer")))
			TitleTemp=replace(TitleTemp,"reply",chknull(rs("reply")))
			TitleTemp=replace(TitleTemp,"datetime",chknull(rs("replytime")))
			response.write TitleTemp
		rs.movenext
		if RS.eof then
			i = i + 1
			exit for
		End If
		next
		dim pagebar
	pagebar= ExportPageInfo(Rs, curpage, i, "forum.asp?action=list"&"&")
		response.write "<p style='text-align:center;'>" & pagebar &"<br>"
		end if
		Call DBConnEnd()

	Case "read"
		Call DBConnBegin()
		if request.querystring("id")="" or request.querystring("id")=0 then
			GoError "请点击页面链接进入,不要试图破坏本系统。"
			response.end
		end if
		Sql="update forum set hits=hits+1 where id="&request.querystring("id")
		conn.execute(Sql)
		sql="select * from forum where id="&request.querystring("id")&" or cupid="&request.querystring("id")&" order by cupid asc,ontop asc,id asc"
		rs.open sql,conn,1,1
		Response.Write "<div id='content1' style='text-align:left;'><h4>阅读留言</h4>"
		readstring1=replace(readstring1,"thetopic",chknull(rs("title")))
		response.write readstring1
		Dim num
		num=0
		do while not rs.EOF
		num=num+1
		NeirongTemp=readstring2
		NeirongTemp=replace(NeirongTemp,"floornum",num)
		NeirongTemp=replace(NeirongTemp,"topic_id",request.querystring("id"))
		NeirongTemp=replace(NeirongTemp,"author",chknull(rs("name")))
		NeirongTemp=replace(NeirongTemp,"theTime",chknull(rs("time")))
		NeirongTemp=replace(NeirongTemp,"title",chknull(rs("title")))
		NeirongTemp=replace(NeirongTemp,"neirong",chknull(rs("say")))
		response.write NeirongTemp
		rs.movenext
		loop
		Call DBConnEnd()

	Case "newtopic"
		Response.Write "<div id='content1' style='text-align:left;'><h4>撰写新留言</h4>"
		Response.Write "<p><a href=forum.asp?action=newtopic>发表新话题</a></p>"
		NeirongTemp=newtopicstr
		NeirongTemp=replace(NeirongTemp,"theAuthor","")
		NeirongTemp=replace(NeirongTemp,"topicStr","")
		NeirongTemp=replace(NeirongTemp,"theContent","")
		NeirongTemp=replace(NeirongTemp,"theCupid","0")
		response.write NeirongTemp
	Case "reply"
		Call DBConnBegin()
		if request.querystring("id")="" then
			GoError "请点击页面链接进入,不要试图破坏本系统。"
			response.end
		end if
		sql="select * from forum where id="&request.querystring("id")
		rs.open sql,conn,1,1
		Response.Write "<div id='content1' style='text-align:left;'><h4>发表回复</h4>"
		readstring1=replace(readstring1,"thetopic",chknull(rs("title")))
		response.write readstring1
		NeirongTemp=newtopicstr
		NeirongTemp=replace(NeirongTemp,"theAuthor","")
		NeirongTemp=replace(NeirongTemp,"topicStr","Re:"&rs("title"))
		NeirongTemp=replace(NeirongTemp,"theContent","")
		NeirongTemp=replace(NeirongTemp,"theCupid",rs("id"))
		response.write NeirongTemp
		Call DBConnEnd()
	Case "save"
		Dim j
		Dim sContent
		sContent = ""
		For j = 1 To Request.Form("d_say").Count
		sContent = sContent & Request.Form("d_say")(j)
		Next
		Dim sSavePathFileName
		sSavePathFileName = GetSafeStr(Request.Form("d_savepathfilename"))
		Call DBConnBegin()
		sql="Select * from forum where title is null"
		rs.open sql,conn,1,3
		rs.addnew
		rs("name")=Request.Form("author")
		rs("title")=Request.Form("d_title")
		rs("cupid")=Request.Form("cupid")
		rs("say")=sContent
		rs("hits")=0
		rs.update
		Conn.Execute("update forum set reply=reply+1,replyer='"&Request.Form("author")&"',replytime='"&NOW()&"' where id="&Request.Form("cupid"))
		Call DBConnEnd()
		Response.Write "<div id='content1' style='text-align:left;'><h4>发表成功</h4>"
		response.write "<p align=center>发表成功,3秒后自动返回留言列表页!<script>window.setTimeout(""location.href='forum.asp?action=list'"",3000);</script></p>"
	
	Case ""
		GoError "请点击页面链接进入,不要试图破坏本系统。"
		Response.End
End Select
%>
<p/>
</div>
</div>


<script language="javascript" type="text/javascript" src="html/footer.js"></script>
</body>
</html>

⌨️ 快捷键说明

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