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

📄 editpost.asp

📁 BBS论坛的开发和设计
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin/BBSConfig.asp"-->
<!--#include file="INC/online.asp"-->
<!--#include file="INC/ShowMsg.asp"-->
<!--#include file="INC/header.asp"-->
<!--#include file="INC/Board_Config.asp"-->
<%
'****************************************************************
'*  joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'*  版权所有: JoinBoard V2.3
'*
'*  程序制作: 友盟工作室
'*           
'*  主页地址: http://joinboard.com    友盟论坛
'*
'*  论坛地址: http://bbs.joinboard.com/、http://youmeng.com
'*	                 
'****************************************************************
'*  Powered by: JoinBoard V2.3
'* Copyright 2003-2004.  - All Rights Reserved.
'*  JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
postID = trim(request.QueryString("postID"))
if Not(IsNumeric(postID)) or postID = "0" then
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
	response.End()
else
	set rs = Conn.ExeCute("select JBB_thread.thread_title,JBB_thread.pollid,JBB_thread.Board_ID,JBB_post.threadID,JBB_post.posttitle,JBB_post.postcontent,JBB_post.user_id,JBB_post.icons,JBB_post.showsignature,JBB_post.noUBB from JBB_thread left JOIN JBB_post on(JBB_post.threadID=JBB_thread.threadID) where JBB_post.postID="&postID)
	if Not rs.eof then
		threadID = rs("threadID")
		posttitle = rs("posttitle")
		postcontent = rs("postcontent")
		postuserid = trim(rs("user_id"))
		pollid= trim(rs("pollid"))
		icon = rs("icons")
		if rs("noUBB") then noUBB = true
		if rs("showsignature") then showsignature=true
		BoardID = rs("Board_ID")
		Board_info BoardID
		Board_Config = Application(JBBMasterCookies&"Board_Config"&BoardID)
		title = Board_Config(2)
		if Board_Config(6)=true then styleid = Board_Config(5)
	else
		set rs = Nothing
		response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
		response.End()			
	End if
	set rs = Nothing
End if
%>
<!--#include file="INC/style.asp"-->
<!--#include file = "INC/CODE.ASP"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="joinboard,forum,bbs,youmeng,友盟论坛">
<title><%=BBS_Config(0)&" - "& Board_Config(2) &" - 编辑贴子"%></title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function validate(theform) {
	if (theform.title.value=="" ) {
		alert("标题不可为空.");
		theform.title.focus();
		return false; }
	if (theform.txtcontent.value=="" ) {
		alert("内容不可为空.");
		theform.txtcontent.focus();
		return false; }
	if (theform.title.value.length > 50) {
		alert("标题不可超过50字节,当前为"+ theform.title.value.length +"字节");
		theform.title.focus();
		return false;}
	if (theform.txtcontent.value.length><%=Board_Config(23)%>) {
   		alert("内容不可超过<%=Board_Config(23)%>字节,当前为"+ theform.txtcontent.value.length +"字节");
    	theform.txtcontent.focus();
    	return (false); }
	else { return true; }
}

function insertstr(str)
{document.myform.txtcontent.value=document.myform.txtcontent.value+str;}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<%
Call onlineuser()
call top()

response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""path-table"">"
response.Write "<tr><td>"
response.Write "<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href="""&BBSHomeUrl&""">"& BBS_Config(0) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href=""board.asp?BoardID="& BoardID &""">"& Board_Config(2) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;编辑贴子"
response.Write "</td></tr></table>"

if Board_Config(17) = True or Board_Config(18) = True then
	if usergroup <= 4 then 
		enter = true
	End if 
else
	enter = true
End if
'-----------------------------------------------
if usergroup = 1 then
	editpost = true
elseif usergroup = 2 then
	set rs = Conn.ExeCute("select Mod_edit_post from JBB_Mod where Mod_nameID="&userid &" and Mod_stop=0 and Mod_edit_post=yes")
	if Not rs.eof then
		editpost = true
	End if
	set rs = nothing
elseif usergroup = 3 then	
	set rs = Conn.ExeCute("select Mod_edit_post from JBB_Mod where Mod_nameID="&userid &" and Mod_edit_post=yes and Mod_stop=0 and Mod_BoardID="&BoardID)
	if Not rs.eof then
		editpost = true
	End if
	set rs = nothing
End if
'response.Write(usergroup)
'------------------------------------------------
if user_group(11)=True and userid=postuserid then editpost = true
'------------------------------------------------
'response.Write(userid&"<br>"&postuserid)
if editpost <> true or enter <> true then
	loginform "对不起,您不可以编辑此主题或者您还没有登录,点击 <a href=""javascript:history.back()"">这里</a> 返回<br>"
	Call Bottom()
	response.End()
End if
'-----------------------------------------
action = Trim(Request.QueryString("action"))
select case action
	Case "saveedit"
		Call saveedit()
	Case else
		Call edit()
End select
'----------------------------------
Sub edit()	
%>
<br>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  <form name="myform" method="post" action="?action=saveedit&postID=<%=postID%>" onSubmit="return validate(this)">
	<%
	if postuserid <> userid then
	%>
	<tr class="table-dark"> 
      <td height="28" colspan="2"><font color="#FF0000">以下操作将记录入论坛日志,请输入编辑此贴子的理由: 
        </font>
<input name="editR" type="text" id="editR" size="30">
        <font color="#FF0000">*</font></td>
    </tr>
	<%
	End if
	%>
    <tr> 
      <td height="28" colspan="2"  class="table-title"> 
        <div align="center">编辑贴子:<%=posttitle%></div></td>
    </tr>
    <tr> 
      <td width="24%" class="table-dark"> 
        <div align="right">图标:</div></td>
      <td width="76%" class="table-dark"> 
        <input type="radio" value="0" name="icon" <% if icon=0 then response.Write("checked") end if %>>
        No&nbsp; <input type="radio" value="1" name="icon" <% if icon=1 then response.Write("checked")%>> 
        <img src="images/posticon/icon1.gif" width="15" height="15">&nbsp; <input type="radio" value="2" name="icon" <% if icon=2 then response.Write("checked")%>> 
        <img src="images/posticon/icon2.gif" width="15" height="15">&nbsp; <input type="radio" value="3" name="icon" <% if icon=3 then response.Write("checked")%>> 
        <img src="images/posticon/icon3.gif" width="15" height="15">&nbsp; <input type="radio" value="4" name="icon" <% if icon=4 then response.Write("checked")%>> 
        <img src="images/posticon/icon4.gif">&nbsp; <input type="radio" value="5" name="icon" <% if icon=5 then response.Write("checked")%>> 
        <img src="images/posticon/icon5.gif">&nbsp; <input type="radio" value="6" name="icon" <% if icon=6 then response.Write("checked")%>> 
        <img src="images/posticon/icon6.gif">&nbsp; <input type="radio" value="7" name="icon" <% if icon=7 then response.Write("checked")%>> 
        <img src="images/posticon/icon7.gif">&nbsp; <br> <input type="radio" value="8" name="icon" <% if icon=8 then response.Write("checked")%>> 
        <img src="images/posticon/icon8.gif">&nbsp; <input type="radio" value="9" name="icon" <% if icon=9 then response.Write("checked")%>> 
        <img src="images/posticon/icon9.gif">&nbsp; <input type="radio" value="10" name="icon" <% if icon=10 then response.Write("checked")%>> 
        <img src="images/posticon/icon10.gif">&nbsp; <input type="radio" value="11" name="icon" <% if icon=11 then response.Write("checked")%>> 
        <img src="images/posticon/icon11.gif">&nbsp; <input type="radio" value="12" name="icon" <% if icon=12 then response.Write("checked")%>> 
        <img src="images/posticon/icon12.gif">&nbsp; <input type="radio" value="13" name="icon" <% if icon=13 then response.Write("checked")%>> 
        <img src="images/posticon/icon13.gif">&nbsp; <input type="radio" value="14" name="icon" <% if icon=14 then response.Write("checked")%>> 
        <img src="images/posticon/icon14.gif">&nbsp; <input type="radio" value="15" name="icon" <% if icon=15 then response.Write("checked")%>> 
        <img src="images/posticon/icon15.gif">&nbsp; </td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">标题:</div></td>
      <td class="table-dark"> 
        <input name="title" type="text" class="input2" id="title" value="<%=posttitle%>" size="53" maxlength="50"></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">功能按钮:</div></td>
      <td class="table-dark"> 
        <!--#include file = "INC/UBB.INC"--></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">上传文件:</div></td>
      <td class="table-dark"> 
        <iframe name="ad" frameborder=0 width=100% height=24 scrolling=no src="up.asp?Folder=<%=BoardID%>&uptype=Board&bgcolor=<%=replace(table_dark_color,"#","")%>"></iframe>
        最大:<%=UploadFileSize%>字节&nbsp;&nbsp;支持类型:<%=UploadFileType%> </td>
    </tr>
    <tr> 
      <td valign="top" class="table-dark"> 
        <div align="right"><br>
          内容: </div></td>
      <td class="table-dark"> 
        <textarea name="txtcontent" cols="60" rows="12" class="input2" id="txtcontent"><%=postcontent%></textarea> 
      </td>
    </tr>
    <tr class="table-dark"> 
      <td> <div align="right">表情符号:</div></td>
      <td> <!--#include file = "INC/emot.asp"--></td>
    </tr>
    <tr> 
      <td class="table-dark"> 
        <div align="right">选项:</div></td>
      <td class="table-dark"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="5"> <input name="showsignature" type="checkbox" id="showsignature2" value="1" <%if showsignature=true then response.Write("checked")%>> 
            </td>
            <td width="120">使用我的个性签名&nbsp;</td>
            <td width="5"> <input name="UBB" type="checkbox" id="UBB2" value="1" <%if noUBB<>true then response.write"checked"%>> 
            </td>
            <td>使用UBB代码 </td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td height="28" colspan="2" class="table-dark"> 
        <div align="center"> 
          <input type="submit" name="Submit" value="  提 交  ">
          &nbsp; 
          <input type="reset" name="Submit2" value="重置">
        </div></td>
    </tr>
  </form>
</table>
<br>
<%
End Sub
'--------------------------------------
Sub saveedit()
	if postuserid <> userid then
		if trim(request.Form("editR")) = "" then
			ShowMsg "请输入编辑理由,点击 <a href=""javascript:history.back()"">这里</a> 返回"
			Call Bottom()
			response.End
		else
			editR = "理由:"&replace(trim(request.Form("editR")),"'","''")
		End if
	end if
	icons = Trim(Request.Form("icon"))
	title = replace(Trim(Request.Form("title")),"'","''")
	content = replace(rTrim(Request.Form("txtcontent")),"'","''")
	title = replace(title,"<script","<script&nbsp;")
	content = replace(content,"<script","<script&nbsp;")
	rating = Trim(Request.Form("rating"))
		if Not(IsNumeric(rating)) then rating = 0
	showsignature = Trim(Request.Form("showsignature"))
		if showsignature = "" then showsignature = 0 else showsignature = 1 End if	
	if trim(request.Form("UBB")) = "1" then
		noUBB = 0
	else
		noUBB = 1
	end if
	if icons = "" or title = "" or content = "" then
		ShowMsg "贴子标题和内容均不可为空,请点击 <a href=""javascript:history.back()"">这里</a> 返回"
		Call Bottom()		
		response.end
	End if
	posttitle = replace(posttitle,"'","''")
	postcontent = replace(postcontent,"'","''")
	'--------------------------------------------------------------
	Conn.ExeCute("update JBB_post set posttitle='"& title &"',postcontent='"& content &"',showsignature="& showsignature &",icons="& icons &",editpost=1,edittime='"& now() &"',editusername='"& username &"',noUBB="& noUBB &" where postid="&postid)
	Conn.ExeCute("insert into JBB_log(userid,username,reason,logC,logtime,logIP,oldcontent) values("& userid &",'"& username &"','" & editR &"','编辑贴子:"& posttitle &"','"& Now() &"','"& userip &"','"& postcontent &"')")
	ShowMsg "贴子成功编辑,正在转向到主题,如果您不想等待,请点击<a href=""showthread.asp?threadid="& threadid &""">这里</a><br>如果您想转到主题列表,请点击<a href=""Board.asp?BoardId="&BoardID&""">这里</a>"
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='2; URL=showthread.asp?threadid="& threadid &"'>")
End Sub
'--------------------------------------
Call Bottom()
%>

⌨️ 快捷键说明

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