📄 b_edit.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
'=========================================================
' File: b_edit.asp
' Date: 2006-04-06
' Script Written by Leibo
'=========================================================
' Copyright (C) 2002,2008 Mathren.com. All rights reserved.
' Web: http://www.hrbyydz.com
' Email: qa_90@hotmail.com
'=========================================================
dim canedit,postid,replyid
dim title,content,old_user
if not founduser then
errmsg=errmsg+"<br>"+"<li>您没有<a href=login.asp target=_blank>登录</a>。"
founderr=true
end if
if request("id")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("id")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
postID=request("id")
end if
if request("replyID")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("replyID")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
replyID=request("replyID")
end if
if founderr then
call head()
call head_var("错误信息",Request.ServerVariables("HTTP_REFERER"))
call txl_error()
else
stats="修改帖子"
call head()
call head_var("班级论坛","b_index.asp")
call main()
if founderr then call txl_error()
end if
call foot()
sub main()
set rs=conn.execute("select * from topic where TopicID="&postID)
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br>"+"<li>没有找到相应的帖子。"
Founderr=true
exit sub
end if
sql="select b.postuser,b.title,b.content,b.addtime,u.usergroupID from bbs b,[user] u where b.postuserid=u.userid and b.bbsID="&replyID
set rs=conn.execute(sql)
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br>"+"<li>没有找到相应的帖子。"
Founderr=true
exit sub
else
title=rs("title")
content=rs("content")
old_user=rs("postuser")
if rs("postuser")=membername then
if Cint(GroupSetting(13))=1 then
Errmsg=Errmsg+"<br>"+"<li>您没有在本论坛编辑自己帖子的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
founderr=true
exit sub
CanEdit=False
else
CanEdit=True
end if
else
if (master or supermaster) and Cint(GroupSetting(28))=0 then
CanEdit=True
else
CanEdit=False
end if
if UserGroupID<3 and UserGroupID=rs("UserGroupID") then
Errmsg=Errmsg+"<br>"+"<li>同等级用户不能修改。"
Founderr=true
exit sub
elseif UserGroupID<3 and UserGroupID>rs("UserGroupID") then
Errmsg=Errmsg+"<br>"+"<li>不能修改等级比您高的用户的帖子。"
Founderr=true
exit sub
end if
if not CanEdit then
Errmsg=Errmsg+"<br>"+"<li>您没有足够的权限编辑本帖子,请和管理员联系。"
Founderr=true
exit sub
end if
end if
end if
set rs=nothing
if content<>"" then
content=replace(content,"<br>",chr(13))
content=replace(content," ","")
content=content+chr(13)
end if
%>
<script src="inc/ubbcode.js"></script>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<form action="b_SaveEdit.asp?id=<%=postid%>&replyID=<%=replyID%>" method=POST onSubmit=submitonce(this) name=frmAnnounce>
<tr>
<td bgcolor=<%=txl_body(10)%>><br>
<table cellpadding=3 cellspacing=1 align=center class=tableBorder1 width=<%=txl_body(19)%>>
<tr>
<th height=25 align=left colspan=2> 修改帖子</th>
</tr>
<tr>
<td width=20% class=tablebody2><b>用户名</b></td>
<td width=80% class=tablebody2><input name=realname value=<%=htmlencode(old_user)%>> <font color=#ce0000><b>*</b></font><a href=register.asp>您没有注册?</a></td>
</tr>
<tr>
<td width=20% class=tablebody1><b>密 码</b></td>
<td width=80% class=tablebody1><input name=password type=password value=<%=htmlencode(memberword)%>><font color=#ce0000> <b>*</b></font><a href=lostpass.asp>忘记密码?</a></td>
</tr>
<tr>
<td width=20% class=tablebody2><b>主题标题</b>
<SELECT name=font onchange=DoTitle(this.options[this.selectedIndex].value)>
<OPTION selected value="">选择话题</OPTION> <OPTION value=[原创]>[原创]</OPTION>
<OPTION value=[转帖]>[转帖]</OPTION> <OPTION value=[灌水]>[灌水]</OPTION>
<OPTION value=[讨论]>[讨论]</OPTION> <OPTION value=[求助]>[求助]</OPTION>
<OPTION value=[推荐]>[推荐]</OPTION> <OPTION value=[公告]>[公告]</OPTION>
<OPTION value=[注意]>[注意]</OPTION> <OPTION value=[贴图]>[贴图]</OPTION>
<OPTION value=[建议]>[建议]</OPTION> <OPTION value=[下载]>[下载]</OPTION>
<OPTION value=[分享]>[分享]</OPTION></SELECT>
</td>
<td width=80% class=tablebody2><input name=subject size=60 maxlength=80 value=<%=htmlencode(title)%> > <font color=#ce0000><strong>*</strong></font>不得超过 25 个汉字或50个英文字符</td>
</tr>
<tr>
<td width=20% valign=top class=tablebody1><b>当前心情</b><br><li>将放在帖子的前面</td>
<td width=80% class=tablebody1>
<%for i=0 to txl_PostFaceNum%>
<input type="radio" value="<%=txl_PostFace(i)%>" name="Expression" <%if i=0 then response.write "checked"%>><img src="<%=txl_info(8)&txl_PostFace(i)%>" >
<%if i>0 and ((i+1) mod 9=0) then response.write "<br>"%>
<%next%>
</td>
</tr>
<tr>
<td width=20% valign=top class=tablebody1>
<b>内容</b><br>
<li>HTML标签:
<li>UBB标签:
<li>贴图标签:
<li>多媒体标签:
<li>表情字符转换:
<li>上传图片:
<li>最多<BR><BR>
</td>
<td width=80% class=tablebody1>
<%if Cint(txl_set(19))=0 then%><!--#include file="inc/getubb.asp"--><%end if%>
<textarea class=smallarea cols=95 name=Content rows=12 wrap=VIRTUAL onkeydown=ctlent()>
<%=server.htmlencode(content)%>
</textarea>
</td>
</tr>
<tr>
<td class=tablebody1 valign=top colspan=2 style="table-layout:fixed; word-break:break-all"><b>点击表情图即可在帖子中加入相应的表情</B><br>
<%
dim ii
for i=0 to 12
if len(i)=1 then ii="0" & i else ii=i
response.write "<img src="""&txl_info(9)&txl_emot(i)&""" border=0 onclick=""insertsmilie('[em"&ii&"]')"" style=""CURSOR: hand""> "
next
%>
</td>
</tr>
<tr>
<td valign=top class=tablebody1><b>选项</b></td>
<td valign=middle class=tablebody1><input type=checkbox name=signflag value=yes checked>是否显示您的签名?<br>
<input type=checkbox name=emailflag value=yes>有回复时使用邮件通知您?</font>
<BR><BR></td>
</tr>
<tr>
<td align=center class=tablebody2 height=30 colspan=2><input type=submit name=Submit value="发 表">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -