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

📄 copytopic.asp

📁 这个论坛也不错.适合做毕业设计的
💻 ASP
字号:
<!--#INCLUDE FILE="config.asp" -->
<%
Function ChkString(string)
	 if string = "" then string = " "
	 ChkString = Replace(string, "'", "''")
End Function

Function ChkUser(strName, StrPasswd)
strSql ="SELECT Member_id, M_Name, M_Password from Members where M_Name = '" & strName & "' and M_Password = '" & StrPasswd &"'"
set rs_chk = my_conn.Execute (StrSql)
if rs_chk.BOF or rs_chk.EOF then
  ChkUser = 0
else
  if cint(rs_chk("Member_ID"))= cint(Request.Form("Author")) then
    ChkUser = 1
  else
    strsql = "SELECT Admin.Admin_Name, Admin.Forum_ID from Admin where Admin.Forum_ID = "&Request.form("forum_id")
    set rsAdmin = my_conn.Execute (strsql)
    if not(rsAdmin.eof or rsAdmin.bof) then
      do until rsAdmin.eof
        if rsAdmin("Admin_Name")=strName then ChkUser=1
        rsAdmin.movenext
      loop
    end if
  end If
end if
strsql = "select SFAdmin_Name, SFAdmin_Password from SFAdmin"
set rs_chk = my_conn.Execute (strSQL)
if strName=rs_chk("SFAdmin_Name") and strpasswd=rs_chk("SFAdmin_Password") then ChkUser =1
rs_chk.close	
set rs_chk = nothing
set rsAdmin = nothing
End Function

if (Request.QueryString("type")="move") then
 tstr="移动"
else
 tstr="复制"
end if
%>
<!--#INCLUDE FILE="top.asp" -->
<br><table width=<%=TableWidth%> border =0 align="center" class="sft"><tr><td><a href="index.asp">论坛首页</a> &gt 论坛管理
</table>

<%
if Request.QueryString("mode") = "doit" then
	set my_conn= Server.CreateObject("ADODB.Connection")
	my_Conn.Open ConnString
	
	mlev = cint(ChkUser(Request.Form("user"), Request.Form("pass"))) 
	if mlev > 0 then
	%><table align="center" bgcolor=<%=TableColor%> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
  <tr><td bgcolor=<%=CellColor1%> align="center"><%
	
		if IsNumeric(Request.Form("to")) then
		forumid = cint(Request.Form("to"))
		end if
		strSQL = "select Forum_id, T_Subject, T_Message, T_Originator, T_Replies, T_Status, T_Sig From topics Where topic_id = " & cint(Request.form("topic_id"))
		set rs = my_conn.Execute (strSQL)
		replynum = rs("T_Replies")
		sigstr = rs("T_Sig") & "<br><br><i>*本贴于"&now()&"由"&Request.Form("user")&tstr&"到此</i>"
		strSQL = "insert into topics(Forum_id, T_Subject, T_Message, T_Originator, T_Replies, T_Status, T_Sig) values("&forumid&",'"&rs("T_Subject")&"','"&rs("T_Message")&"',"&rs("T_Originator")&","&rs("T_Replies")&","&rs("T_Status")&",'"&sigstr&"')"
		my_conn.Execute (strSQL)
		if Request.Form("type") = "move" then
		  strSQL = "delete * From topics Where topic_id = " & cint(Request.form("topic_id"))
		  my_conn.Execute (strSQL)
		  strSQL = "select F_Count FROM forum where Forum_ID = " & cint(Request.form("forum_id"))
		  set rs = my_conn.Execute (strSQL)
		  strSQL = "update forum set  F_Count = " & rs("F_Count")  - 1 - cint(replynum) &  " where Forum_ID = " & cint(Request.form("forum_id"))
		  my_conn.Execute (strSQL)
		strSQL = "select top 1 T_Last_Post, T_Subject, T_Last_Member, Topic_ID from topics where forum_id = " & cint(Request.form("forum_id")) & " order by T_Last_Post DESC"
		set rs = my_conn.Execute (strSQL)
		strSQL = "Update Forum set F_Last_Post = #" & rs("T_Last_Post") & "#, F_Last_Reply = '" & rs("T_Subject") &"', F_Last_Member = '" & rs("T_Last_Member") &"', F_Last_ID = " & rs("Topic_ID") & " where forum_id = " & Request.Form("Forum_id")
		my_conn.Execute (strSQL)
		else
		  strSQL = "select P_Count from totals"
		  set rs = my_conn.Execute (strSQL)
		  strSQl ="Update totals set totals.P_Count="& rs("P_Count") + 1 + cint(replynum)
		  my_conn.Execute (strSQL)
		end if
		strSQL = "select F_Count FROM forum where Forum_ID = " & forumid
		set rs = my_conn.Execute (strSQL)
		strSQL = "update forum set  F_Count = " & rs("F_Count")  +1 + cint(replynum) &  " where Forum_ID = " & forumid
		my_conn.Execute (strSQL)
		
		Response.Write "<P align=center>主题已被"&tstr&"</p>"%><script language=javascript>
setTimeout("location.replace('forum.asp?forum_id=<%=Request.Form("forum_id")%>&forum_title=<%=Request.Form("forum_title")%>')",500)
</script><%
		

	Else
		Response.Write "<P align=center>不允许"&tstr&"主题!<br><br>"
		Response.Write "<a href=""Javascript: onClick= history.go(-1) "">退回上一步</a></p>"
	End if
	my_conn.Close
	set my_Conn = nothing
	%>
	</td>
  </tr>
</table>
<%
else 

%>	
<center></center>
<div align="center"><center>
<form action="copytopic.asp?mode=doit" method=post>
<input type=hidden name="topic_id" value="<%=Request.QueryString("topic_id") %>">
<input type=hidden name="forum_id" value="<%=Request.QueryString("forum_id") %>">
<input name="forum_title" type="hidden" value="<%=Request.QueryString("forum_title") %>">
<input type=hidden name="type" value="<%=Request.QueryString("type") %>">

<table align="center"  bgcolor=<%=TableColor%> border="0" width=360 cellspacing="1" cellpadding="3" class="sft">
<tr><td bgcolor="<% =HeadColor %>" colspan=2 class="sfh"><%=tstr%>主题 : <%=Request.QueryString("topic_title") %></td></tr>                
                <TR>
                    <TD bgcolor="<% =CellColor1 %>" width="30%" align="right">用户名</td>
                    <TD bgcolor="<% =CellColor1 %>" width="70%"><input type=text name="user" size=20 value="<%=Request.Cookies("User")("Name")%>" class="box">
                         </td>
                <TR>
                    <TD bgcolor="<% =CellColor1 %>" align="right">密码</td>
                    <TD bgcolor="<% =CellColor1 %>"><input type=password name="pass" size=20 value="<%=Request.Cookies("User")("Pword")%>" class="box">
                        </td>
                <tr> <TD bgcolor="<% =CellColor1 %>" align="right"><%=tstr%>到</td>
                <TD bgcolor="<% =CellColor1 %>">
                    <select name="to" size="1" class="box">

<%
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
strsql = "select Forum.Forum_ID, Forum.F_Name from Forum"
set rs = my_conn.Execute (strsql)
if rs.eof or rs.bof then
		%><OPTION VALUE="0">无任何论坛
		<%
	 else
		do until rs.Eof
                        %><OPTION VALUE="<%=rs("Forum_id")%>"><%=rs("F_Name")%>
                        <%rs.movenext
		loop
end if
%>
</select>
</td><TR><TD bgcolor="<% =CellColor1 %>" colspan=2 align=center><Input type=submit value="确定" class="btn"></td>
</TD></TR></TABLE></form>
<% end if %>

⌨️ 快捷键说明

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