📄 guestbook.asp
字号:
<!--#include file="include/ms_setting.asp"-->
<!--#include file="guestbook_admin.asp"-->
<!--#include file="include/ubbcode.asp"-->
<!--#include file="include/ms_ubb.asp"-->
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
catTitle="网友留言"
dim ms_userID,ms_userName,userSign:userSign=0
if session(userVar)=userVal then
dim userInfo
userInfo=session("userInfo")
ms_userID=userInfo(0)
ms_userName=userInfo(1)
userSign=userInfo(2)
elseif session(adminVar)=adminVar then
dim adminInfo
adminInfo=session(adminVar&"Info")
ms_userID=adminInfo(8)
ms_userName=adminInfo(3)
userSign=3
else
ms_userID=0
userSign=0
ms_userName=""
end if
%>
<!--#include file="ms_start.asp"-->
<script language="JavaScript" src="include/wisdom.js"></script>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="mainMiddle_tdble"><tr>
<!--左栏开始-->
<td valign="top" class="mainMiddle_td_left">
<div class="groupblock">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">会员登录</span></td><td class="ltr"></td></tr></table>
<div class="lmc"><%Call publiclogonModule()%></div>
</div>
<div class="groupblock">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">留言模式</span></td><td class="ltr"></td></tr></table>
<div class="lmc"><div style="margin-left:3px;line-height:18px;"><%Call gbMode()%></div></div>
</div>
<div class="groupblock">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">站内搜索</span></td><td class="ltr"></td></tr></table>
<div class="lmc"><%Call searchInput("art")%></div>
</div>
<div class="groupblock">
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">留言须知</span></td><td class="ltr"></td></tr></table>
<div class="lmc" style="line-height:18px;">·尊重网上道德,遵守中华人民共和国的各项有关法律法规<br>
·承担一切因您的行为而直接或间接导致的民事或刑事法律责任<br>
·本站管理人员有权保留或删除其管辖留言中的任意内容<br>
·本站有权在网站内转载或引用您的留言<br>
·参与本留言即表明您已经阅读并接受上述条款<br></div>
</div>
</td>
<td class="mainMiddle_td_middle" onClick="switchCol(this)" title="关闭左栏"><img src="images/closeL.gif"></td>
<td width="*" valign="top" class="mainMiddle_td_right">
<%
Select Case Request.QueryString("action")
Case "maosin_delgb"
Call deletegb()
Case "maosin_editgb"
response.write("<table cellspacing=""0"" class=""naviTable""><tr><td class=""naviL""></td><td class=""naviM""><span class=""rtt"">当前位置:<a class=""classNavig"" href=""index.asp"">本站首页</a>→<a class=""classNavig"" href=""guestbook.asp"">留言管理</a>→<font color=#ff4444>编辑留言</font></span></td><td class=""naviR""></td></tr></table>")
response.write("<div style=""text-align:right;padding:5px;""><a href=guestbook.asp?action=maosin_writegb>·签写留言</a></a> <a href=guestbook.asp>·查看留言</a></div>")
Call editgb()
Case "maosin_writegb"
response.write("<table cellspacing=""0"" class=""naviTable""><tr><td class=""naviL""></td><td class=""naviM""><span class=""rtt"">当前位置:<a class=""classNavig"" href=""index.asp"">本站首页</a>→<a class=""classNavig"" href=""guestbook.asp"">网友留言</a>→<font color=#ff4444>发表留言</font></span></td><td class=""naviR""></td></tr></table>")
response.write("<div style=""text-align:right;padding:5px;"" class=""text""><a href=guestbook.asp?action=maosin_writegb>·签写留言</a></a> <a href=guestbook.asp>·查看留言</a></div>")
Call writegb()
Case "maosin_reply"
response.write("<table cellspacing=""0"" class=""naviTable""><tr><td class=""naviL""></td><td class=""naviM""><span class=""rtt"">当前位置:<a class=""classNavig"" href=""index.asp"">本站首页</a>→<a class=""classNavig"" href=""guestbook.asp"">网友留言</a>→<font color=#ff4444>回复留言</font></span></td><td class=""naviR""></td></tr></table>")
response.write("<div style=""text-align:right;padding:5px;""><a href=guestbook.asp?action=maosin_writegb>·签写留言</a> <a href=guestbook.asp>·查看留言</a></div>")
Call reply()
Case "maosin_editreply"
response.write("<table cellspacing=""0"" class=""naviTable""><tr><td class=""naviL""></td><td class=""naviM""><span class=""rtt"">当前位置:<a class=""classNavig"" href=""index.asp"">本站首页</a>→<a class=""classNavig"" href=""guestbook.asp"">网友留言</a>→<font color=#ff4444>编辑回复</font></span></td><td class=""naviR""></td></tr></table>")
response.write("<div style=""text-align:right;padding:5px;""><a href=guestbook.asp?action=maosin_writegb>·签写留言</a> <a href=guestbook.asp>·查看留言</a></div>")
Call editreply()
Case "maosin_delreply"
Call deletereply()
Case "maosin_pass"
Call passed()
Case Else
response.write("<table cellspacing=""0"" class=""naviTable""><tr><td class=""naviL""></td><td class=""naviM""><span class=""rtt"">当前位置:<a class=""classNavig"" href=""index.asp"">本站首页</a>→<a class=""classNavig"" href=""guestbook.asp"">网友留言</a>→<font color=#ff4444>查看留言</font></span></td><td class=""naviR""></td></tr></table>")
response.write("<div style=""text-align:right;padding:5px;""><a href=guestbook.asp?action=maosin_writegb>·签写留言</a></a> <a href=guestbook.asp>·查看留言</a></div>")
Call showgb()
End Select %>
<!--中间部分结束-->
</td></tr></table>
<!--#include file="ms_end.asp"-->
<%
Sub gbMode()
dim str1,str2,str3,str4
if guestbookOpen=0 then
str1="<font color=""#ff3300"">关闭模式</font>"
elseif guestbookOpen=1 then
str1="<font color=""#ff3300"">游客模式</font>"
elseif guestbookOpen=2 then
str1="<font color=""#ff3300"">用户模式</font>"
end if
if guestbookPass=0 then
str2="<font color=""#ff3300"">直接发表</font>"
elseif guestbookPass=1 then
str2="<font color=""#ff3300"">审核发表</font>"
elseif guestbookPass=2 then
str2="<font color=""#ff3300"">游客审核</font>"
end if
if reGuestbook=0 then
str3="<font color=""#ff3300"">管理员模式</font>"
elseif reGuestbook=1 then
str3="<font color=""#ff3300"">用户模式</font>"
end if
str4=conn.execute("select count(gb_id) from ms_gb where pass=0")(0)
response.write("<li style=""list-style-type: square;"">留言模式:"&str1&"</li>")
response.write("<li style=""list-style-type: square;"">审核模式:"&str2&"</li>")
response.write("<li style=""list-style-type: square;"">回复模式:"&str3&"</li>")
response.write("<li style=""list-style-type: square;"">待审留言:<font color=""#ff3300"">"&str4&"</font> 条</li>")
response.write("<div style=""text-align:center;margin-top:5px;""><a href=""guestbook.asp?action=maosin_write"">【签写留言】</a> <a href=""guestbook.asp"">【查看留言】</a></div>")
End Sub
'========================
'功 能:显示留言
'函数名:showgb()
'========================
Sub showgb()
Dim page,line,n,url,nexpage,qq,home,city,ip,username,gb_id,gb_content,gb_pic,gb_date,gb_qqh,gb_title,gb_pass,user_id,sql
Set gbrs=Server.CreateObject("ADODB.RecordSet")
if userSign=3 then
sql="select * from ms_gb order by gb_id desc"
else
sql="select * from ms_gb where pass=1 order by gb_id desc"
end if
gbrs.Open sql,connstr,1,1
'==================调用分页显示函数===================
n=guestbookPage '第页显示记录数
url="guestbook.asp?"
nextpage=pagetitle(gbrs,n,url,"条留言")'分页
line=0
DO While Not gbrs.Eof And line<gbrs.pagesize
qq=gbrs("gb_qq")
email=gbrs("gb_email")
home=gbrs("gb_home")
city=gbrs("gb_from")
ip=gbrs("gb_ip")
username=gbrs("gb_username")
gb_id=gbrs("gb_id")
gb_content=gbrs("gb_content")
gb_pic=gbrs("gb_face")
gb_date=gbrs("gb_date")
gb_qqh=gbrs("gb_qqh")
gb_title=gbrs("gb_title")
gb_pass=gbrs("pass")
user_id=gbrs("user_id")
'===================================查询相关的回复内容=============================
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="gb_listTable">
<tr>
<td width="90" height="22" valign="middle" align="center" class="listB"><%=gbrs.RecordCount-gbrs.AbsolutePosition+1%> 楼</td>
<td width="*" valign="middle" style="padding:3px;" class="listB">·<%=filterKeyWord(gb_title)%></td>
</tr>
<tr>
<td height="75" valign="top" align="center" class="br"><img src=images/face/<%=gb_pic%>.gif widht=75 height=75><br><span style="padding-top:4px;height:13px;filter:glow(Color=#F5680A,Strength=2);"><%=username%></span></td>
<td valign="top" width="*">
<table width="490" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
<tr>
<td height="23" valign="middle" width="340" style="padding-left:4px;border-bottom:1px dotted #aaaaaa;"><%=gbrs("gb_username")&"·发表于:"&gbrs("gb_date")%></td><td valign="middle" align="right" width="*" style="padding-left:4px;border-bottom:1px dotted #aaaaaa;"><%if username<>"" then response.write("<a href=""#""><img src=images/city.gif title=""["&username&"]来自 "&city&""" align=""absmiddle"" border=""0""></a> ") end if:if email<>"" then response.write("<a href=mailto:"&email&" title=""给["&username&"]写信"" target=""_blank""><img src=images/email.gif align=""absmiddle"" border=""0""></a> ") end if:if qq<>"" then response.write("<a href=""#""><img src=images/qq.gif title=""["&username&"]的"&qq&""" align=""absmiddle"" border=""0""></a> ") end if:if home<>"" then response.write("<a href="&home&" title=""去["&username&"]主页看看"" target=_blank><img src=images/web.gif align=""absmiddle"" border=""0""></a> ") end if:if ip<>"" then response.write("<a href=""#""><img src=images/ip.gif title=""["&username&"]的 "&showIP(ip)&""" align=""absmiddle"" border=""0""></a></td> ") end if%>
</tr>
<tr>
<td width="500" valign="top" colspan="2" style="word-break:break-all;padding:5px;">
<%if gb_qqh=1 then
if userSign=3 or session(adminVar)=adminVal or ms_userID=user_id then
Response.Write(filterKeyWord(ubbCode(gb_content,0,0,1,1))&"</td></tr><tr><td align=""right"" colspan=""2"" height=""20""><img src=""images/pen.gif"" align=""right""></td></tr><tr><td colspan=""2"">")
else
Response.Write("<font color=#ff0000>悄悄话,只有管理员才能查看!</font>"&"</td></tr><tr><td align=""right"" colspan=""2"" height=""20""><img src=""images/pen.gif"" align=""right""></td></tr><tr><td colspan=""2"">")
end if
else
Response.Write(filterKeyWord(ubbCode(gb_content,0,0,1,1))&"</td></tr><tr><td align=""right"" colspan=""2"" height=""20""><img src=""images/pen.gif"" align=""right""></td></tr><tr><td colspan=""2"">")
end if
if gbrs("isreply")=1 then
resql="select * from ms_gb_re where gb_id="&gb_id
Set rers=conn.execute(resql)
dim reStr:reStr=""
Do While Not rers.Eof
reStr=reStr&"<div style=""padding:4px;""><fieldset style=""color:#FF7810;padding:4px;"">"
reStr=reStr&"<legend height=""20"">"&reUserType(rers("user_type"))&"[<font color=""#ff0000"">"&rers("re_name")&"</font>]·回复 [ "&rers("re_date")&"] "
if userSign=3 or session(adminVar)=adminVal then
reStr=reStr&"<a href=""guestbook.asp?action=maosin_editreply&re_id="&rers("re_id")&"""><img src=""images/guestbook/editre.gif"" alt=""编辑回复"" border=""0"" align=""absmiddle""></a> <a href=""javascript:"" onclick=""{if(confirm('你真的确定删除些回复吗?')){window.location.href='guestbook.asp?action=maosin_delreply&re_id="&rers("re_id")&"';}return false;}"" ><img src=""images/guestbook/delere.gif"" alt=""删除回复"" border=""0"" align=""absmiddle""></a>"
end if
reStr=reStr&"</legend>"&filterKeyWord(ubbCode(rers("re_content"),0,0,1,1))
reStr=reStr&"</fieldset></div>"
rers.MoveNext
Loop
response.write(reStr)
rers.close
Set rers=nothing
end if
%></td>
</tr>
</table>
</td>
</tr>
<%
if (session(userVar)=userVal and reGuestbook=1) or (session(adminVar)=adminVal) or userSign=3 then
'if cint(session("usertype"))=3 then%>
<tr>
<td height="22" align="center" valign="middle" class="listT br"><img src="images/guestbook/admingb.gif" align="absmiddle" border="0"></td><td valign="middle" width="*" class="listT">
<a href=guestbook.asp?action=maosin_reply&gb_id=<%=gb_id%> title="回复留言"><img src="images/guestbook/reply.gif" border="0" align="absmiddle"></a>
<a href="guestbook.asp?action=maosin_writegb" title="签写留言"><img src="images/guestbook/write.gif" border="0" align="absmiddle"></a>
<%if userSign=3 or session(adminVar)=adminVal then
if gb_pass=0 then%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -