📄 ad_guest.asp
字号:
end sub
'=================================================
'过程名:ReplyGuest()
'作 用:回复留言
'参 数:无
'=================================================
sub ReplyGuest()
dim ReplyId
ReplyId=request("guestid")
if ReplyId="" then
call Guest_info("<li>请指定要回复的留言ID!</li>")
exit sub
else
ReplyId=clng(ReplyId)
sqlGuest="select * from Guest where GuestId=" & ReplyId
end if
set rsGuest=server.createobject("adodb.recordset")
rsGuest.open sqlGuest,conn,1,1
if rsGuest.bof and rsGuest.eof then
response.write "<br><li>没有任何留言</li>"
exit sub
else
WriteTitle="Re: "&rsGuest("GuestTitle")
call ShowGuestList()
end if
rsGuest.close
set rsGuest=nothing
call WriteGuest()
end sub
'=================================================
'过程名:EditGuest()
'作 用:编辑留言
'参 数:无
'=================================================
sub EditGuest()
dim EditId
EditId=request("guestid")
if EditId="" then
call Guest_info("<li>请指定要编辑的留言ID!</li>")
exit sub
else
EditId=clng(EditId)
sqlGuest="select * from Guest where GuestId=" & EditId
end if
set rsGuest=server.createobject("adodb.recordset")
rsGuest.open sqlGuest,conn,1,1
if rsGuest.bof and rsGuest.eof then
response.write "<br><li>找不到您指定的留言!</li>"
exit sub
end if
if Purview_ModifyGuest=True then
WriteName=rsGuest("GuestName")
WriteType=rsGuest("GuestType")
WriteSex=rsGuest("GuestSex")
WriteEmail=rsGuest("GuestEmail")
WriteOicq=rsGuest("GuestOicq")
WriteIcq=rsGuest("GuestIcq")
WriteMsn=rsGuest("GuestMsn")
WriteHomepage=rsGuest("GuestHomepage")
WriteFace=rsGuest("GuestFace")
WriteImages=rsGuest("GuestImages")
WriteTitle=rsGuest("GuestTitle")
WriteContent=rsGuest("GuestContent")
SaveEdit=1
SaveEditId=EditId
call ShowGuestList()
call WriteGuest()
else
call Guest_info("<li>您没有编辑留言的权限!</li>")
end if
rsGuest.close
set rsGuest=nothing
end sub
'=================================================
'过程名:AdimReplyGuest()
'作 用:站长回复留言
'参 数:无
'=================================================
sub AdimReplyGuest()
dim AdminReplyId
if Purview_ReplyGuest=False then
call Guest_info("<li>您没有回复留言的权限!</li>")
else
AdminReplyId=request("guestid")
if AdminReplyId="" then
call Guest_info("<li>请指定要回复的留言ID!</li>")
exit sub
else
AdminReplyId=clng(AdminReplyId)
sqlGuest="select * from Guest where GuestId=" & AdminReplyId
end if
set rsGuest=server.createobject("adodb.recordset")
rsGuest.open sqlGuest,conn,1,1
if rsGuest.bof and rsGuest.eof then
response.write "<br><li>找不到您指定的留言!</li>"
exit sub
else
AdminReplyContent=rsGuest("GuestReply")
call ShowGuestList()
end if
rsGuest.close
set rsGuest=nothing
call WriteAdimReplyGuest()
end if
end sub
'=================================================
'过程名:WriteAdimReplyGuest()
'作 用:填写站长回复留言
'参 数:无
'=================================================
sub WriteAdimReplyGuest()
%>
<script language=JavaScript>
function check(thisform)
{
if(thisform.GuestContent.value==""){
alert("留言内容不能为空!")
thisform.GuestContent.focus()
return(false)
}
if(thisform.GuestContent.value.length>800){
alert("留言内容不能超过800字符!")
thisform.GuestContent.focus()
return(false)
}
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" cellpadding="1" cellspacing="0" class="border">
<tr class="title">
<td colspan="3"> <font color=green><%=PageTitle%></font></td>
</tr>
<tr class="tdbg_leftall">
<td colspan="3" align="center" height="10"></td>
</tr>
<form name="formwrite" method="post" action="<%=strFileName%>?action=saveadminreply" onSubmit="return check(formwrite)">
<tr class="tdbg_leftall">
<td align="center">Ubb标签:</td>
<td colspan="2">
<%call ShowUbb()%>
</td>
</tr>
<tr class="tdbg_leftall">
<td width="18%" valign="middle" align="center">留言内容: </td>
<td colspan="2" valign="top">
<textarea name="GuestContent" cols="59" rows="6" ><%=AdminReplyContent%></textarea>
</td>
</tr>
<tr class="tdbg_leftall">
<td colspan="3" align="center" height="40"><input name="guestid" type="hidden" value="<%=request("guestid")%>">
<input type="submit" name="Submit1" value=" 发 表" >
<input type="reset" name="Submit2" value=" 重 填 " >
</td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="15" align="center" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13" class="tdbg_left2"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
'=================================================
'过程名:ShowGuestbutton()
'作 用:显示留言功能按钮
'参 数:无
'=================================================
sub ShowGuestButton()
response.write "<table width=100% border=0 cellpadding=0 cellspacing=3><tr>"
response.write "<td>"
if UserHomepage="" or isnull(UserHomepage) then
response.write "<img src="&GuestPath&"nourl.gif width=45 height=16 alt="&UserGuestName&"没有留下主页地址 border=0>" & vbcrlf
else
response.write "<a href="&UserHomepage&" target=""_blank"">"
response.write "<img src="&GuestPath&"url.gif width=45 height=16 alt="&UserHomepage&" border=0></a>" & vbcrlf
end if
if UserOicq="" or isnull(UserOicq) then
response.write "<img src="&GuestPath&"nooicq.gif width=45 height=16 alt="&UserGuestName&"没有留下QQ号码 border=0>" & vbcrlf
else
response.write "<a href=http://search.tencent.com/cgi-bin/friend/user_show_info?ln="&UserOicq&" target=""_blank"">"
response.write "<img src="&GuestPath&"oicq.gif width=45 height=16 alt="&UserOicq&" border=0 ></a>" & vbcrlf
end if
if UserEmail="" or isnull(UserEmail) then
response.write "<img src="&GuestPath&"noemail.gif width=45 height=16 alt="&UserGuestName&"没有留下Email地址 border=0>" & vbcrlf
else
response.write "<a href=mailto:"&UserEmail&">"
response.write "<img src="&GuestPath&"email.gif width=45 height=16 border=0 alt="&UserEmail&"></a>" & vbcrlf
end if
response.write "<img src="&GuestPath&"other.gif width=45 height=16 border=0 onMouseOut=toolTip() onMouseOver=""toolTip(' Icq:" & UserIcq & "<br> Msn:" & UserMsn & "<br> I P:" &rsGuest("GuestIP")&"')"">" & vbcrlf
response.write " </td><td width=1 bgcolor=#B4C9E7></td><td> "
if Purview_ModifyGuest=True then
response.write "<a href="&strFileName&"?action=edit&guestid="&rsGuest("GuestId")&">"
response.write "<img src="&GuestPath&"edit.gif width=45 height=16 border=0 alt=编辑这条留言></a>" & vbcrlf
end if
if Purview_ReplyGuest=True then
response.write "<a href="&strFileName&"?action=adminreply&guestid="&rsGuest("GuestId")&">"
response.write "<img src="&GuestPath&"adminreply.gif width=45 height=16 alt=管理员回复这条留言 border=0></a>" & vbcrlf
end if
if Purview_DelGuest=True then
response.write "<a href="&strFileName&"?action=del&guestid="&rsGuest("GuestId")&" onClick=""return confirm('确定要删除此留言吗?');"">"
response.write "<img src="&GuestPath&"del.gif width=45 height=16 alt=删除这条留言 border=0></a>" & vbcrlf
end if
if Purview_CheckGuest=True then
if rsGuest("GuestIsPassed")=False then
response.write "<a href="&strFileName&"?action=pass&guestid="&rsGuest("GuestId")&">"
response.write "<img src="&GuestPath&"pass.gif width=45 height=16 alt=审核通过这条留言 border=0 ></a>" & vbcrlf
else
response.write "<a href="&strFileName&"?action=nopass&guestid="&rsGuest("GuestId")&">"
response.write "<img src="&GuestPath&"nopass.gif width=45 height=16 alt=取消这条留言审核 border=0></a>" & vbcrlf
end if
end if
response.write " <input name=guestid type=checkbox id=guestid value="&rsGuest("GuestID")&" style=BORDER:0px;>"
response.write "</td>" & vbcrlf
response.write "</tr></table>"
end sub
'=================================================
'过程名:DelGuest()
'作 用:删除留言
'参 数:无
'=================================================
sub DelGuest()
dim delid
delid=trim(Request("guestid"))
if delid="" then
call Guest_info("<li>请指定要删除的留言ID!</li>")
exit sub
end if
if instr(delid,",")>0 then
delid=replace(delid," ","")
sql="Select * from Guest where GuestID in (" & delid & ")"
else
delid=clng(delid)
sql="select * from Guest where GuestID=" & delid
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,3
if rs.bof and rs.eof then
response.write "<br><li>找不到您指定的留言!</li>"
exit sub
end if
if Purview_DelGuest=False then
call Guest_info("<li>您没有删除留言的权限!</li>")
else
do while not rs.eof
rs.delete
rs.update
rs.movenext
loop
rs.close
set rs=nothing
response.redirect ComeUrl
end if
end sub
'=================================================
'过程名:PassGuest()
'作 用:审核留言
'参 数:无
'=================================================
sub PassGuest()
dim passid
if Purview_CheckGuest=False then
call Guest_info("<li>您没有审核留言的权限!</li>")
else
passid=trim(Request("guestid"))
if passid="" then
call Guest_info("<li>请指定要审核的留言ID!</li>")
exit sub
end if
if instr(passid,",")>0 then
passid=replace(passid," ","")
sql="Select * from Guest where GuestID in (" & passid & ")"
else
passid=clng(passid)
sql="select * from Guest where GuestID=" & passid
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,3
do while not rs.eof
if Action="pass" then
rs("GuestIsPassed")=True
else
rs("GuestIsPassed")=False
end if
rs.update
rs.movenext
loop
rs.close
set rs=nothing
response.redirect ComeUrl
end if
end sub
'=================================================
'过程名:SaveAdminReplyGuest()
'作 用:保存站长回复留言
'参 数:无
'=================================================
sub SaveAdminReplyGuest()
dim GuestReply,SaveAdminReplyId
dim sqlMaxId,rsMaxId,MaxId
if Purview_ReplyGuest=False then
call Guest_info("<li>您没有回复留言的权限!</li>")
else
GuestReply=request("GuestContent")
SaveAdminReplyId=request("guestid")
if SaveAdminReplyId="" then
call Guest_info("<li>请指定要回复的留言ID!</li>")
exit sub
end if
sqlMaxId="select max(GuestMaxId) as MaxId from Guest"
set rsMaxId=conn.execute(sqlMaxId)
MaxId=rsMaxId("MaxId")
if MaxId="" or isnull(MaxId) then MaxId=0
set rsGuest=server.createobject("adodb.recordset")
sql="select * from Guest where GuestId="&SaveAdminReplyId
rsGuest.open sql,conn,3,3
if rsGuest.bof and rsGuest.eof then
response.write "<br><li>找不到您指定的留言!</li>"
exit sub
else
rsGuest("GuestMaxId")=MaxId+1
rsGuest("GuestReply")=GuestReply
rsGuest("GuestReplyAdmin")=session("AdminName")
rsGuest("GuestReplyDatetime")=now()
rsGuest.update
end if
rsGuest.close
set rsGuest=nothing
end if
call Guest_info("<li>您的回复留言已经发送成功!</li>")
end sub
'=================================================
'过程名:ShowGuestBottom()
'作 用:显示留言底部管理功能
'参 数:无
'=================================================
sub ShowGuestBottom()
dim strTemp
if TotalPut>0 then
strTemp= "<table align='center'><tr><td>"
strTemp= strTemp & "<input type=""submit"" name=""SubmitType"" value=""待审留言""> "
strTemp= strTemp & " 多项操作:"
if Purview_DelGuest=True then
strTemp= strTemp & "<input type=""submit"" name=""SubmitType"" value=""删除留言"" onClick=""return confirm('确定要删除选中的留言吗?');""> "
end if
if Purview_CheckGuest=True then
strTemp= strTemp & "<input type=""submit"" name=""SubmitType"" value=""通过审核""> "
strTemp= strTemp & "<input type=""submit"" name=""SubmitType"" value=""取消审核""> "
end if
strTemp= strTemp & "<input name=""chkAll"" type=""checkbox"" id=""chkAll"" onclick=CheckAll(this.form) value=""checkbox"" style=""BORDER:0px;"">选中本页显示的所有留言"
strTemp= strTemp & "</td></tr></table>"
response.write strTemp
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -