📄 admin_gbook.asp
字号:
<!--#include file="admin_chk.asp"-->
<%
If Not ChkAdmin("Gbook") Then
Call ArtErr("","")
End If
GuestPath="../images/gbook/guestbook/"
%>
<!--#include file=../Include/ubb_code.asp -->
<!--#include file = Include/NIncHeads.asp -->
<HTML><HEAD>
<TITLE></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
<script src="Include/Common.js" type="text/javascript"></script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</HEAD>
<center>
<script language="JavaScript" type="text/JavaScript">
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
</head>
<%
action=request("action")
'管理首页
if action="" then%>
<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
<tr>
<th height=25 align=center colspan="2">留言管理</th>
</tr>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan -->
<script Language="JavaScript" Type="text/javascript">
<!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.word.value == "")
{
alert("请在 关键字 域中输入值。");
theForm.word.focus();
return (false);
}
if (theForm.word.value.length < 1)
{
alert("在 关键字 域中,请至少输入 1 个字符。");
theForm.word.focus();
return (false);
}
if (theForm.word.value.length > 20)
{
alert("在 关键字 域中,请最多输入 20 个字符。");
theForm.word.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="<%=request.servervariables("URL")%>" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1"><tr>
<tr>
<td class="forumRow"><b>留言搜索:</b></td>
<td class="Forumrow">
<!--webbot bot="Validation" s-display-name="关键字" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="20" --><input type="text" name="word" size="20" maxlength="20">
<select size="1" name="zd">
<option value="Comments">内容</option>
<option value="UserName">作者</option>
</select> <input type="submit" value="搜索留言" name="B1">
</td>
</tr></form>
</table></td></tr>
<Tr>
<td align=center>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table" >
<form name=book action=admin_gbook.asp method=post>
<tr ><td width=5% height=25 align=center class="bg_tr" >选</td>
<td width=11% align=center class="bg_tr">姓名</td>
<td width=47% align=center class="bg_tr">内容(编辑与回复)</td>
<td width=17% align=center class="bg_tr">日期</td>
<td width=11% align=center class="bg_tr">状态</td>
<td width=9% align=center class="bg_tr">审核</td>
</tr>
<%
word=trim(request("word"))
zd=trim(request("zd"))
dim rs,msg_per_page
dim sql
msg_per_page = 15 '每页显示记录数
sql="select * from gbook where del=0 order by [top] desc, PostDate desc"
if word<>"" and zd<>"" then sql = "select * from gbook where "&zd&" like '%"&word&"%' and del=0 order by [top] desc, PostDate desc"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.cursorlocation = 3
rs.pagesize = msg_per_page '每页显示记录数
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=6 align=center height=50 class=tdbg>暂时没有留言</td></tr>"
end if
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount '总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'currentpage:当前页
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
dim i
dim k
'bbb=0
Do while not rs.eof and rowcount>0
title=titleb(rs("title"),30)
content=rs("Comments")
content=lleft(server.htmlencode(content),50)
replay=rs("replay")
UserName=rs("UserName")
%>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this) class="tdbg" height="25">
<%
if rs("top")="0" then
Response.write "<td align=center><input type='checkbox' value='"&rs("ID")&"' name=id>"
else
Response.write "<td><font color=red title='固顶信息不能直接删除,请先解除固顶属性再删除'>TOP</font>"
end if
Response.write "</td><td align=center>"&UserName&"</td><td><a href='admin_gbook.asp?action=replay&id="&rs("ID")&"'> "
response.write ""&title&"<br> <font color='#999999'>"&content&"</font>"
response.write "</a></td><td align=center>"&rs("Postdate")&"</td><td align=center>"
if Isnull(Replay) then
response.write "<font color=red>新留言</font>"
else
response.write "已回复"
end if
response.write "</td><td align=center>"
if rs("Online")="0" then response.write "<font color=red>隐藏</font>" end if
If rs("Online")="1" then response.write "公开" end if
if rs("Online")="2" then response.write "<font color=red>密信</font>" end if
response.write "</td></tr>"
rowcount=rowcount-1
rs.movenext
loop
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
<tr class="tdbg">
<td colspan=6 > <input type='checkbox' name=chkall onClick='CheckAll(this.form)'>
全选
<input type="submit" name="action" value="删除" onClick="{if(confirm('该操作不可恢复!\n\n确实删除选定的留言?')){this.document.Prodlist.submit();return true;}return false;}"> </td></tr>
</form>
</table></td></tr></table>
<%
call listPages()
Call AdminPageEnd()
end if
if request("action")="删除" then
delid=replace(request("id"),"'","")
call delfeedback()
end if
if request("action")="replay" then
id=request("id")
call detailfeedback()
end if
if request("action")="setup" then
call setup()
end if
%>
</td></tr>
</table>
<%
sub setup()
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from gbook_setup"
rs.open sql,conn,1,3
if request("save")="ok" then
rs("view")=request("view") '留言审核
rs("maxlength")=request("maxlength") '留言最大长度
rs("pages")=request("pages") '每页留言数
rs("html")=request("html") '是否屏蔽html
rs("mailyes")=request("mailyes") '是否必填邮箱
rs("huifutishi")=trim(request("huifutishi")) '回复提示
rs("huifucolor")=trim(request("huifucolor")) '回复颜色
rs("book_jianju")=request("book_jianju") '表格间距
if request("bad")<>"" then rs("bad")=request("bad") '脏话过滤
rs.update
Call ArtErr("<li>您提交的设置已保存!</li>","2")
else
%>
<%Call Heads_Site()%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form name=book action=admin_gbook.asp?action=setup method=post>
<tr>
<td bgcolor="#F8F8F8" align="center" class="bg_tr" height="25" colspan="2"><b>留言板选项</b></td>
</tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>留言必填Email</u></b> <br>留言时是否必须填写有效<font color="red">E-mail</font>地址</td>
<td width="62%" >是<input type=radio name=mailyes value="0" <%if rs("mailyes")="0" then%> checked<%end if%>> 否<input type=radio name=mailyes value="1" <%if rs("mailyes")="1" then%> checked<%end if%> > </td></tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>屏蔽html功能</u></b> <br>是否屏蔽用户留言中的<font color="red">html代码</font> </td>
<td >是<input type=radio name=html value="0" <%if rs("html")="0" then%> checked<%end if%>> 否<input type=radio name=html value="1" <%if rs("html")="1" then%> checked<%end if%> > </td></tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>留言审核开关</u></b><br> 留言是否需要审核</td>
<td >是<input type=radio name=view value="0" <%if rs("view")="0" then%> checked<%end if%>> 否<input type=radio name=view value="1" <%if rs("view")="1" then%> checked<%end if%> ></td></tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>留言内容长度</u></b> <br>留言内容的最多字符数,<font color="red">例如200</font> </td>
<td ><input type=text name=maxlength value="<%=rs("maxlength")%>" maxlength=3> </td></tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>每页留言条数</u></b> <br><font color="red">推荐10</font> </td>
<td ><input type=text name=pages value="<%=rs("pages")%>" maxlength=2> </td></tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>留言表格间距</u></b> <br>合适的间距可使版面更美观,<font color="red">推荐10 </font></td>
<td ><input type=text name=book_jianju value="<%=rs("book_jianju")%>" maxlength=2></td></tr>
<tr bgcolor="#F7F7F7" onMouseOut="this.style.backgroundColor='#F7F7F7'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
<td width=38% align=left ><b><u>管理员回复提示</u></b> <br><font color="red">例如:“客服回复”</font></td>
<td ><input type=text name=huifutishi value="<%=rs("huifutishi")%>" maxlength=10></td></tr>
<tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor='#FFFFFF'" onMouseOver="this.style.backgroundColor='#D7E3F3'">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -