📄 syscode_guest.asp
字号:
<td colspan="2"> </td>
</tr>
<tr class="tdbg_leftall">
<td align="center">E-mail</td>
<td>
<input type="text" name="GuestEmail" maxlength="30" size="20" value="<%=WriteEmail%>">
</td>
<td rowspan="4">
<input type="hidden" name="GuestImages" value="01">
<img name=showimages src="<%=GuestPath%><%=WriteImages%>.gif" width="80" height="90" border="0" onClick=window.open("guestselect.asp?action=guestimages","face","width=480,height=400,resizable=1,scrollbars=1") title=点击选择头像 style="cursor:hand">
</td>
<td colspan="2" rowspan="4">
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">Oicq:</td>
<td>
<input type="text" name="GuestOicq" maxlength="15" size="20" value="<%=WriteOicq%>">
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">Icq:</td>
<td>
<input type="text" name="GuestIcq" maxlength="15" size="20" value="<%=WriteIcq%>">
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">Msn:</td>
<td>
<input type="text" name="GuestMsn" maxlength="40" size="20" value="<%=WriteMsn%>">
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">个人主页:</td>
<td colspan="4">
<input type="text" name="GuestHomepage" maxlength="80" size="37" value="<%=WriteHomepage%>">
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center"></td>
<td colspan="4"> </td>
</tr>
<%else%>
<tr class="tdbg_leftall">
<td align="center">选择头像:</td>
<td>
<input type="hidden" name="GuestName" value="<%=WriteName%>">
<input type="hidden" name="reg" value="1">
<input type="hidden" name="GuestImages" value="<%=WriteImages%>">
<img name=showimages src="<%=GuestPath%><%=WriteImages%>.gif" width="80" height="90" border="0" onClick=window.open("guestselect.asp?action=guestimages","face","width=480,height=400,resizable=1,scrollbars=1") title=点击选择头像 style="cursor:hand">
<select name="Image" size="1" onChange="changeimage();" >
<%
for i=1 to 9
response.write "<option value='0"&i&"'>0"&i&"</option>"
next
for i=10 to 23
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<%end if%>
<tr class="tdbg_leftall">
<td align="center">留言主题:</td>
<td colspan="4">
<input type="text" name="GuestTitle" size="37" maxlength="28" value="<%=WriteTitle%>">
<font color=red>*</font>
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">现在心情:</td>
<td colspan="4">
<%
for i=1 to 20
response.write "<input type=""radio"" name=""GuestFace"" value="&i&""
if i=clng(WriteFace) then response.write " checked"
response.write " style=""BORDER:0px;width:19;"">"
response.write "<img src="""&GuestPath&"face"&i&".gif"" width=""19"" height=""19"">"& vbcrlf
if i mod 10 =0 then response.write "<br>"
next
%>
</td>
</tr>
<tr class="tdbg_leftall">
<td align="center">Ubb标签:</td>
<td colspan="4">
<% call showubb()%>
</td>
</tr>
<tr class="tdbg_leftall">
<td valign="middle" align="center">留言内容: <br>
</td>
<td colspan="4" valign="top">
<textarea name="GuestContent" cols="59" rows="6" onkeydown=gbcount(this.form.GuestContent,this.form.total,this.form.used,this.form.remain); onkeyup=gbcount(this.form.GuestContent,this.form.total,this.form.used,this.form.remain);><%=WriteContent%></textarea>
</td>
</tr>
<tr class="tdbg_leftall">
<td valign="middle" align="center"></td>
<td colspan="4" valign="top">
最多字数:<INPUT disabled maxLength=4 name=total size=3 value=500>
已用字数:<INPUT disabled maxLength=4 name=used size=3 value=0>
剩余字数:<INPUT disabled maxLength=4 name=remain size=3 value=500>
</td>
</tr>
<tr class="tdbg_leftall">
<td valign="middle" align="center">是否隐藏:</td>
<td colspan="4" valign="top">
<input type="radio" name="GuestIsPrivate" value="no" checked style="BORDER:0px;">
正常
<input type="radio" name="GuestIsPrivate" value="yes" style="BORDER:0px;">
隐藏 <font color=#009900>*</font> 选择隐藏后,此留言只有管理员和留言者才可以看到。</td>
</tr>
<tr class="tdbg_leftall">
<td colspan="5" align="center" height="40">
<input type="hidden" name="saveedit" value="<%=SaveEdit%>">
<input type="hidden" name="saveeditid" value="<%=SaveEditId%>">
<input type="submit" name="Submit1" value=" 发 表" >
<input type="button" name="Submit2" value=" 预 览 " onclick=guestpreview()>
<input type="reset" name="Submit3" value=" 重 填 " >
</td>
</tr>
</form>
<form name=preview action="GuestPreview.asp" method=post target=GuestPreview>
<input type=hidden name=title value=><input type=hidden name=content value=>
</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
'=================================================
'过程名: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 rsGuest("GuestName")=LoginName and rsGuest("GuestIsPassed")=False 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
'=================================================
'过程名: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 rs("GuestName")<>LoginName or rs("GuestIsPassed")=True then
call Guest_info("<li>您没有使用此功能的权限!</li>")
else
do while not rs.eof
rs.delete
rs.update
rs.movenext
loop
rs.close
set rs=nothing
call Guest_info("<li>删除留言成功!</li>")
end if
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 "<a href="&strFileName&"?action=reply&guestid="&rsGuest("GuestId")&">"
response.write "<img src="&GuestPath&"reply.gif width=45 height=16 border=0 alt=回复这条留言></a>" & vbcrlf
if rsGuest("GuestName")=LoginName and rsGuest("GuestIsPassed")=False 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
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
response.write "</td>"
response.write "</tr></table>"
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -