📄 guestbook_admin.asp
字号:
if isNumeric(gb_id)=false then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
if ispass="yes" then
sql="update ms_gb set pass=1 where gb_id="&gb_id
conn.execute(sql)
response.write("<script>alert('执行成功!');</script>")
response.redirect request.serverVariables("HTTP_REFERER")
elseif ispass="no" then
sql="update ms_gb set pass=0 where gb_id="&gb_id
conn.execute(sql)
response.write("<script>alert('执行成功!');</script>")
response.redirect request.serverVariables("HTTP_REFERER")
end if
end if
End Sub
'======================================
'功 能:编辑留言
'函数名:editgb()
'======================================
Sub editgb()
if session(adminVar)<>adminVal then
if guestbookOpen=0 then
showmsg "<font color=""#ff0000"">系统返回以下信息:</font><br>对不起,留言系统暂时关闭。","系统信息"
exit sub
elseif guestbookOpen=2 and session(userVar)<>userVal then
dim strMsg:strMsg="<font color=""#ff0000"">对不起,此留言功能需要[注册会员]才能使用</font><br>如果您已经注册了,登录再留言。<br>如果您还不是本站会员,请赶快注册吧!"
showLogonCode strMsg
exit sub
end if
end if
dim gb_id,sql
gb_id=request.querystring("gb_id")
if isNumeric(gb_id)=false then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>请输入一个正确的整型参数</li>","出错信息"
exit sub
end if
if request.form("gb")<>"" then
gb_username=trim(request.form("gb_username"))
gb_qq=trim(request.form("gb_qq"))
gb_email=request.form("gb_email")
gb_home=chkFormStr(request.form("gb_home"))
gb_from=chkFormStr(request.form("gb_from"))
gb_face=trim(chkFormStr(Request.form("gb_face")))
gb_title=trim(chkFormStr(filterHtml(Request.form("gb_title"))))
gb_content=Request.form("content")
gb_face=chkFormStr(Request.form("gb_face"))
if Request.form("gb_qqh")="" then
gb_qqh=0
else
gb_qqh=1
end if
dim errormsg
if chkIsAvaStr(gb_username)=false then
showmsg "<font color=""#ff0000"">系统返回信息:</font><br><br>用户名含有非法字符!","出错信息"
exit sub
end if
if trim(gb_username)="" then
errormsg=errormsg&"<li>请填上您的姓名!</li>"
end if
if trim(gb_title)="" then
errormsg=errormsg&"<li>请填写留言标题!</li>"
end if
if trim(gb_content)="" or len(trim(gb_content))<8then
errormsg=errormsg&"<li>留言内容不能为空或小于8个字符,请返回重填!</li>"
end if
if errormsg<>"" then
showmsg errormsg,"出错信息"
exit sub
end if
errormsg=""
if gb_qq<>"" then
if len(trim(gb_qq))>11 or not isNumeric(gb_qq) then
errormsg=errormsg&"<li>您填写的QQ号格式不正确或者位数不对,请返回重填!</li>"
end if
end if
if gb_email<>"" then
if IsValidEmail(gb_email)=false then
errormsg=errormsg&"<li>电子邮件填写不正确,请返回重填!</li>"
end if
end if
if gb_home<>"" then
if Lcase(left(gb_home,7))<>"http://" then
errormsg=errormsg&"<li>主页地址填写不正确,请返回重填!</li>"
end if
end if
if errormsg<>"" then
showmsg errormsg,"出错信息"
exit sub
end if
if ms_submit=0 then
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂盛系统返回提示信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
end if
sql="select * from ms_gb where gb_id="&CInt(gb_id)
set rs=server.createobject("adodb.recordset")
gb_email=chkFormStr(gb_email)
rs.open sql,connstr,1,3
if rs.eof and rs.bof then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>没有此留言,或者您的权限不足</li>","操作出错信息"
exit sub
end if
rs("gb_username")=gb_username
rs("gb_qq")=gb_qq
rs("gb_email")=gb_email
rs("gb_home")=gb_home
rs("gb_from")=gb_from
rs("gb_face")=gb_face
rs("gb_title")=gb_title
rs("gb_content")=htmlencode(gb_content)
rs("gb_qqh")=gb_qqh
rs.update
rs.close
set rs=nothing
response.redirect("guestbook.asp")
end if
if userSign=3 or session(adminVar)=adminVal then
sql="select * from ms_gb where gb_id="&CInt(gb_id)
elseif session(UserVar)=userVal then
sql="select * from ms_gb where gb_id="&CInt(gb_id)&" and user_id="&ms_userID&" and isreply=0"
else
strMsg="<font color=""#ff0000"">对不起,此留言功能需要[注册会员]才能使用</font><br>如果您已经注册了,登录再留言。<br>如果您还不是本站会员,请赶快注册吧!"
showLogonCode strMsg
exit sub
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,1
if rs.eof and rs.bof then
showmsg "<font color=""#ff0000"">系统返回如下信息:</font><br><br><li>没有此留言,或者您的权限不足</li>","操作出错信息"
exit sub
end if
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tableBC">
<form name="myform" method="post" action="" onKeyDown="javascript:if(event.keyCode==13 && event.ctrlKey){checkgb(this);}" onSubmit="return checkgb(this)">
<tr valign="middle">
<td height="25" colspan="3" class="tdT">>> 留言者个人信息</td>
</tr>
<tr class="tdBC">
<td width="85" height="25" align="right" valign="middle"><font color="#ff0000">*</font>您的姓名:</td>
<td width="330" valign="middle"> <input name="gb_username" type="text" id="gb_username" value="<%=rs("gb_username")%>" class="wenbenkang" size="20" <%if session(maosinUser)<>"" then%>value="<%=session(maosinUser)%>" readonly <%end if%> maxlength="12"> <input name="gb_id" type="hidden" value=<%=request.querystring("gb_id")%>>
最多10个字符</td>
<td width="*" rowspan="4" align="center" valign="middle"><img src="images/face/<%=rs("gb_face")%>.gif" name="imageface" width="75" height="75" id="imageface" onClick="javascript:window.open('face.htm')" alt="点击查看全部头像"></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">您的 QQ:</td>
<td valign="middle"> <input name="gb_qq" type="text" id="gb_qq" size="20" value="<%=rs("gb_qq")%>" class="wenbenkang" maxlength="12">
最多12个字符</td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">电子邮箱:</td>
<td valign="middle"> <input name="gb_email" type="text" id="gb_email" size="20" value="<%=rs("gb_email")%>" class="wenbenkang" maxlength="40">
最多40个字符</td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">个人主页:</td>
<td valign="middle"> <input name="gb_home" type="text" id="gb_home" size="20" value="<%=rs("gb_home")%>" class="wenbenkang" maxlength="50">
要包含<button style="padding:1px;background-color:#f8f8f8;border:1px outset #c2c2c2;cursor:hand;" onClick="gb_home.value='http://'">http://</button></td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle">来自那里:</td>
<td valign="middle"> <input name="gb_from" type="text" id="gb_from" value="<%=rs("gb_from")%>" size="20" class="wenbenkang" maxlength="20">
最多20个字符</td>
<td align="left" valign="middle">→<a href="face.htm">全部头像</a>:
<select name="gb_face" id="gb_face" onChange="changeimage();">
<script language="JavaScript">
for(var i=1;i<126;i++){
if(i==<%=rs("gb_face")%>){
window.document.write("<option value="+i+" selected>头像"+i+"</option>");}
else{
window.document.write("<option value="+i+" >头像"+i+"</option>");
}
}
</script>
</select></td>
</tr>
<tr valign="middle">
<td height="25" colspan="3" class="tdT">>> 留言信息</td>
</tr>
<tr class="tdBC">
<td height="25" align="right" valign="middle"><font color="#ff0000">*</font>留言主题:</td>
<td colspan="2" valign="middle"> <input name="gb_title" value="<%=rs("gb_title")%>" type="text" size="30" class="wenbenkang">
话题: <select name="topic">
<option value="[留言]" selected>[留言]</option>
<option value="[建议]">[建议]</option>
<option value="[链接]">[链接]</option>
<option value="[报错]">[报错]</option>
<option value="[讨论]">[讨论]</option>
<option value="[其它]">[其它]</option>
</select> 最多50个字符</td>
</tr>
<tr class="tdBC">
<td align="right" valign="top"><font color="#ff0000">*</font>留言内容:<br>支持UBB </td>
<td colspan="2" valign="top"><%=showUBB(1,0)%>
<textarea name="content" cols="78" rows="10" id="content" class="textkang" onKeyDown="contentlen(this)" onKeyUp="contentlen(this)" title="按[Ctrl+Enter]直接发送"><%=(rs("gb_content"))%></textarea></td>
</tr>
<tr class="tdBC" align="center" valign="middle">
<td height="25" colspan="3"><input name="gb_qqh" type="checkbox" id="gb_qqh" value="1" <%if rs("gb_qqh")=1 then%>checked<%end if%>>
<label for="gb_qqh">悄悄话</label>(<font color="#ff0000">管理员可见!</font>) </span style="color:#888888;">[最多字数:
<input type="text" value="300" id="maxlen" size="2" style="border-width:0;background:transparent;" disabled>
个字符 已用字数: <input type="text" value="0" id="useing" size="2" style="border-width:0;background:transparent;" disabled>
个字符 剩余字数: <input type="text" value="300" id="yis" size="2" style="border-width:0;background:transparent;" disabled>
个字符]</span></td>
</tr>
<tr align="center" valign="middle">
<td height="25" colspan="3" class="tdT"><input name="gb" type="submit" id="gb" value="修改留言" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'">
<input type="reset" name="Submit2" value="清除重写" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'"></td>
</tr>
</form>
</table>
<%rs.close
set rs=nothing
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -