📄 forum2.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="../inc/func2.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/pagebar.asp"-->
<%
if session("isAdminLoged")<>"logined" then
Response.Write FSOFileRead("../html/admin_login.txt")
Response.End
End if
%>
<!--*************** ?????? *************
** File: error.html V1.0 2005.05.05
** 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/admincss.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>
</head>
<body onload="translate()">
<script language="javascript" type="text/javascript" src="../html/admin_header4.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 forumStr1,forumStr2,forumStr3,forumStr4,forumStr5,tempStr2,tempStr4
forumStr1="<br><br><table border='1' cellspacing='0' cellpadding='3' bordercolor='#C0C0C0' style='border-collapse:collapse;' align=center width=660><tr><td align=center width=280><strong>标题</strong></td><td align=center width=90><strong>发表时间</strog></td><td align=center width=40><strong>作者</strog></td><td align=center width=40><strong>点击</strog></td><td align=center width=40><strong>回复</strog></td><td align=center width=120><strong>操作</strong></td></tr>"
forumStr2="<tr><td><font color=red>[置顶]</font><a href=../forum.asp?action=read&id=theId target=_blank>theTitle</a></td><td align=center>theTime</td><td align=center>theName</td><td align=center>theHits</td><td align=center>theReply</td><td align=center><a href=forum2.asp?action=reply&id=theId>回复</a> <a href=forum2.asp?action=setontop&id=theId>设为置顶</a> <a href=forum2.asp?action=deletetopic&id=theId>删除</a></td></tr>"
forumStr3="<tr><td colspan=6>本主题的所有回复:theReply 篇</td></tr>"
forumStr4="<tr><td><a href=../forum.asp?action=read&id=theId target=_blank>theTitle</a></td><td align=center>theTime</td><td align=center colspan=3>theName</td><td align=center><a href=forum2.asp?action=delete&id=theId>删除此回复</a></td></tr>"
forumStr5="</table>"
Select Case GetSafeStr(request.querystring("action"))
Case "list"
Response.Write "<div id='content1' style='text-align:left;'><h4>留言及其回复管理</h4>"
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 "还没有留言!"
response.end
else
RS.pagesize = 10
RS.absolutepage = curpage
End if
for i = 0 to RS.pagesize-1
response.write forumStr1
tempStr2=forumStr2
tempStr2=replace(tempStr2,"theId",rs("id"))
if rs("ontop")=False then
tempStr2=replace(tempStr2,"<font color=red>[置顶]</font>","")
end if
if rs("ontop")=True then
tempStr2=replace(tempStr2,"设为置顶","取消置顶")
tempStr2=replace(tempStr2,"setontop","cancelontop")
end if
tempStr2=replace(tempStr2,"theTitle",rs("title"))
'tempStr2=replace(tempStr2,"theSay",rs("say"))
tempStr2=replace(tempStr2,"theTime",rs("time"))
tempStr2=replace(tempStr2,"theName",rs("name"))
tempStr2=replace(tempStr2,"theHits",rs("hits"))
tempStr2=replace(tempStr2,"theReply",rs("reply"))
response.write tempStr2
if rs("reply")>0 then
Dim rs2
Dim sql2
Set rs2 = Server.CreateObject( "ADODB.Recordset" )
sql2="select * from forum where cupid="&rs("id")
rs2.open sql2,conn,1,1
response.write replace(forumStr3,"theReply",rs("reply"))
do while not rs2.EOF
tempStr4=forumStr4
tempStr4=replace(tempStr4,"theId",rs2("id"))
tempStr4=replace(tempStr4,"theTitle",rs2("title"))
'tempStr4=replace(tempStr4,"theSay",rs2("say"))
tempStr4=replace(tempStr4,"theTime",rs2("time"))
tempStr4=replace(tempStr4,"theName",rs2("name"))
response.write tempStr4
rs2.movenext
loop
end if
response.write forumStr5
rs.movenext
if RS.eof then
i = i + 1
exit for
End If
next
dim pagebar
pagebar= ExportPageInfo(Rs, curpage, i, "forum2.asp?action=list"&"&")
response.write "<p style='text-align:center;'>" & pagebar &"<br>"
Call DBConnEnd()
Case "setontop"
Call DBConnBegin()
Conn.Execute("update forum set ontop=true where id="&request.querystring("id"))
Call DBConnEnd()
Response.Write "<div id='content1' style='text-align:left;'><h4>操作成功</h4>"
response.write "<p align=center>操作成功,3秒后自动返回留言列表页!<script>window.setTimeout(""location.href='forum2.asp?action=list'"",3000);</script></p>"
Case "cancelontop"
Call DBConnBegin()
Conn.Execute("update forum set ontop=False where id="&request.querystring("id"))
Call DBConnEnd()
Response.Write "<div id='content1' style='text-align:left;'><h4>操作成功</h4>"
response.write "<p align=center>操作成功,3秒后自动返回留言列表页!<script>window.setTimeout(""location.href='forum2.asp?action=list'"",3000);</script></p>"
Case "deletetopic"
Call DBConnBegin()
sql="select cupid from forum where id="&request.querystring("id")
rs.open sql,conn,3,3
if rs("cupid")>0 then
Conn.Execute("update forum set reply=reply-1 where id="&rs("cupid"))
end if
Conn.Execute("delete from forum where id="&request.querystring("id")&" or cupid="&request.querystring("id"))
Call DBConnEnd()
Response.Write "<div id='content1' style='text-align:left;'><h4>操作成功</h4>"
response.write "<p align=center>操作成功,3秒后自动返回留言列表页!<script>window.setTimeout(""location.href='forum2.asp?action=list'"",3000);</script></p>"
Case "reply"
Call DBConnBegin()
if request.querystring("id")="" then
GoError "请点击页面链接进入,不要试图破坏本系统。"
response.end
end if
Response.Write "<div id='content1' style='text-align:left;'><h4>管理员发表回复</h4>"
sql="select * from forum where id="&request.querystring("id")
rs.open sql,conn,1,1
Dim newtopicstr,NeirongTemp
newtopicstr="<center><br><form action='forum2.asp?action=save' method='post' name='myform'><input type=hidden name=d_savepathfilename><input type=hidden name=cupid value=theCupid><table width=490 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> </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></center>"
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("ontop")=True
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='forum2.asp?action=list'"",3000);</script></p>"
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 + -