⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editpost.asp

📁 教师评估系统
💻 ASP
字号:
<!-- #include file="Cls.asp" -->
<%
top "编辑帖子",true
ChkUser
ThreadID=ChkNumeric(Request("ThreadID"))
PostID=ChkNumeric(Request("PostID"))
Category=HTMLEncode(Request("Category"))

sql="select ForumID,PostsTableName,Topic,Category,Tags from [WxThreads] where id="&ThreadID&""
Rs.Open sql,Conn,1
if Rs.Eof then Error 5,"<li>该主题不存在</li>"
ForumID=Rs(0)
PostsTableName=Rs(1)
Topic=Rs(2)
Category=Rs(3)
Tags=ReplaceText(Rs(4),"<[^>]*>|\'|\&|\?|\/|\\","")
Rs.close

ForumData=GetForumData(ForumID)
Moderated=ForumData(3)
%>
<!-- #include file="inc/ForumPermissions.asp" -->
<%if PermissionsEdit=0 then Error 0,""

sql="select * from [WxPosts"&PostsTableName&"] where id="&PostID&""
Set Rs=Conn.Execute(sql)
if Rs.Eof or Rs.bof then Error 5,"<li>该帖子不存在</li>"
if LCase(Rs("UserName"))<>LCase(CookieUserName) and PermissionsManage=0 then Error 0,""
Subject=ReplaceText(""&Rs("Subject")&"","<[^>]*>","")
content=Rs("content")
IsTopic=Rs("IsTopic")
Subject2=Rs("Subject")
Rs.close

if Request.ServerVariables("Request_method") = "POST" then
color=HTMLEncode(Request.Form("color"))
Subject=HTMLEncode(Request.Form("Subject"))
if color<>Empty Then Subject="<font color="&color&">"&Subject&"</font>"
Tags=ReplaceText(Request.Form("Tags"),"<[^>]*>|\'|\&|\?|\/|\\","")

Content=ContentEncode(Request.Form("Content"))
if Request.Form("DisableYBBCode")<>1 then Content=YbbEncode(Content)

if Cache("BannedText")<>empty then
filtrate=split(Cache("BannedText"),"|")
for i = 0 to UBound(filtrate)
Subject=ReplaceText(Subject,""&filtrate(i)&"",string(len(filtrate(i)),"*"))
next
end if

if Content=Empty then Message=Message&"<li>请填写内容</li>"
if len(Tags)>200 then Message=Message&"<li>标签不能大于200字符</li>"
if Cache("DisplayEditNotes") then content=""&content&"<p>[此帖子已被 "&CookieUserName&" 在 "&now()&" 编辑过]"

if Message<>"" then Error 3,Message
sql="select * from [WxPosts"&PostsTableName&"] where id="&PostID&""
Rs.Open sql,Conn,1,3
if Rs("IsTopic")=1 then Conn.Execute("update [WxThreads] set Topic='"&Subject&"',Tags='"&Tags&"',Category='"&Category&"' where id="&Rs("ThreadID")&"")
Rs("Subject")=Subject
Rs("content")=content
Rs.update
Rs.close

if Request.Form("UpFileID")<>"" then
UpFileID=split(Request.Form("UpFileID"),",")
for i = 0 to UBound(UpFileID)-1
Conn.Execute("update [WxUpFiles] set Category='"&Category&"',Description='"&Subject&"' where id="&int(UpFileID(i))&" and UserName='"&CookieUserName&"'")
next
end if

Log("修改帖子成功,主题ID:"&ThreadID&",帖子ID:"&PostID&"")
Succ "修改帖子","<li><a href=Threads.asp?Tid="&ThreadID&">返回主题</a></li><li><a href=Forums.asp?Fid="&ForumID&">返回版块</a></li>","Forums.asp?Fid="&ForumID

end if%>
<div class="nav dt"><img alt="" src="Images/Forum_nav.gif" />&nbsp; <%=ClubTree%> → <%ForumTree(ForumData(0))%><%=ForumTreeList%> <a href=Forums.asp?Fid=<%=ForumID%>><%=ForumData(2)%></a> → <a href="Threads.asp?Tid=<%=ThreadID%>"><%=Topic%></a> → 编辑帖子</div>
<form method="post" name="form" onsubmit="return CheckForm(this);">
<input type="hidden" name="content" value='<%=server.htmlencode(content)%>' />
<input type="hidden" name="UpFileID" />
<script type="text/javascript" src="Inc/Category.js"></script>
<div class="tb dt">
<div id="tt">编辑帖子</div>
<div class="tc b cb">
<div class="fl r w2 i"><b>文章标题</b><%if IsTopic=1 then%> (<a onclick="ChangeCategory('#');return false;" href="#">添加类别</a>)<%end if%></div>
<div class="fl i"><%if IsTopic=1 then%>
<select name="Category"><option value="" selected="selected">类别</option>
<%
if ForumData(4)<>empty then
filtrate=split(ForumData(4),"|")
for i = 0 to UBound(filtrate)
Response.write "<option value='"&filtrate(i)&"'>["&filtrate(i)&"]</option>"
next
end if
Response.write "<option value='"&Category&"' selected=""selected"">"&Category&"</option>"
%>
</select>
<%end if%>
<input name="Subject" maxlength="30" size="60" value="<%=Subject%>">
<%if BestRole=1 or instr("|"&ForumData(3)&"|","|"&CookieUserName) Then%>
&nbsp;
<select name="color">
<%if Instr(Subject2,"<font color")>0 then scolor=Mid(Subject2,Instr(Subject2,"<font color="),6)%>
<option value="<%=scolor%>">默认颜色</option>
<option style="color:FF0000" value="FF0000">大红</option>
<option style="color:CC00FF" value="CC00FF">紫红</option>
<option style="color:FF7700" value="FF7700">橙红</option>
<option style="color:DDBB00" value="EEBB00">金黄</option>
<option style="color:BB8800" value="BB8800">咖啡</option>
<option style="color:999900" value="999900">橄榄</option>
<option style="color:00AA00" value="00AA00">深绿</option>
<option style="color:00BBAA" value="00BBAA">青绿</option>
<option style="color:00AAEE" value="00AAEE">天蓝</option>
<option style="color:7700FF" value="8800FF">紫蓝</option>
<option style="color:888888" value="888888">灰色</option>
</select>
<%end if%></div>
</div>
<div class="tc b cb">
<div class="fl r w2 c"><b>文章内容</b><br /><br />
<input type="checkbox" id="DisableYBBCode" name="DisableYBBCode" value="1"><label for="DisableYBBCode"> 禁用YBB代码</label>
</div>
<div class="fl c">
<%WxEditor"full","content","550px","200px"%>
</div>
</div>
<%if Cache("UploadObj")<>empty and PermissionsAttachment=1 then
if Cache("MaxUp2") then
MaxUp2=Conn.Execute("select MaxUp2 from [WxRoles] where id="&Conn.Execute("select UserRoleID from [WxUsers] where Username='"&CookieUserName&"'")(0)&"")(0)
else
MaxUp2=int(Cache("MaxFileSize"))
end if
%>
<div class="tc b cb" id="UpFiles" style="display:none;">
<div class="fl r i w2">已上传附件</div>
<div class="fl i"><span id="UpFile"></span></div>
</div>
<div class="tc b cb">
<div class="fl r i w2">增加附件(限制:<%=CheckSize(int(Maxup2))%>)<br />支持类型:<%=Cache("UploadExt")%></div>
<div class="fl i"><%
MinUpPermission=Cache("MinUpPermission")
PostCount=Conn.Execute("select Count(ID) from [WxPosts"&PostsTableName&"] Where UserName='"&CookieUserName&"' and PostTime>"&SqlNowString&"-30")(0)
if PostCount>=int(Cache("MinUpPermission")) Then%>
<iframe src="PostUpFile.asp" frameborder="0" style="height:24px;width:450px" scrolling="No"></iframe><%else%><span class="blue">您本月的发帖没有达到要求,再发 <span class="red"><%=MinUpPermission-PostCount%></span> 帖才能获上传权限</span><%end if%></div>
</div>
<%end if%>
<div class="tc b cb">
<div class="fl r w2 i"><img alt="标签" src="Images/tag.gif"><b>标签</b><br />多关键字请用空格分隔</div>
<div class="fl i"><input maxlength="200" size="60" name="Tags" value="<%=Tags%>" /></div>
</div>
<div class="tc cb ac"><input type="submit" id="submit" name="EditSubmit" value="编 辑 帖 子" /></div>
</div></form>
<%HtmlEnd%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -