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

📄 bbsinfo.asp

📁 1. 硬件环境:MS WINDOWS NT PACK 4 OR LATER /WIN2000 WITH IIS 4.0 OR LATER /WIN9X+PWS 2. 数 据 库:Access2000
💻 ASP
字号:
<!-- #include file="setup.asp" -->
<%
validate "Login.asp",5
if Request.ServerVariables("request_method")="POST" then
Select Case Request.Form("Submit")
	Case "建 立"
		BbsName=Trim(Request.Form("BbsName"))
		BbsShow=Trim(Request.Form("BbsShow"))
		BbsMan=Trim(Request.Form("BbsMan"))
		BbsPsd=Trim(Request.Form("BbsPsd"))
		BbsInfo=Trim(Request.Form("BbsInfo"))
		Emessage=""
		if BbsName="" Then Emessage=Emessage&"论坛名称不能为空!\n"
		if BbsMan="" Then Emessage=Emessage&"请输入版主的用户号码!\n"
		if Emessage <> "" Then Error 2,Emessage,""
		Sql = "insert into BbsInfo (BbsName,BbsMan,BbsInfo,BbsShow,BbsPsd) values ('"&BbsName&"','"&BbsMan&"','"&BbsInfo&"',"&BbsShow&",'"&BbsPsd&"')"
		Conn.Execute(Sql)
	Case "提 交"	
		for each nums in request.form("BbsId")
		if Len(trim(request.form("BbsInfo"&nums))) > 240 Then Error 2,"论坛简介不得大于120个汉字或240个英文字符!",""
		if trim(request.form("BbsPx"&nums)) = "" Then Error 2,"请输入论坛序号!",""
		if trim(request.form("BbsName"&nums)) = "" Then Error 2,"请输入论坛名称!",""
		Conn.Execute("Update BbsInfo Set BbsName='"&Trim(request.form("BbsName"&nums))&"',BbsInfo='"&Trim(request.form("BbsInfo"&nums))&"',BbsMan='"&trim(request.form("BbsMan"&nums))&"',BbsPsd='"&trim(request.form("BbsPsd"&nums))&"',BbsPx="&trim(request.form("BbsPx"&nums))&" where BbsId="&nums)
		next
	Case "显 示"	
		for each nums in request.form("BbsId")
		conn.execute("update BbsInfo set BbsShow=False where BbsId="&nums)
		next
	Case "隐 藏"	
		for each nums in request.form("BbsId")
		conn.execute("update BbsInfo set BbsShow=true where BbsId="&nums)
		next
	Case "删 除"	
		for each nums in request.form("BbsId")
		conn.execute("update BbsInfo set DelThis=true where BbsId="&nums)
		next
	Case "确定删除"
		TimeLimit=Request.Form("TimeLimit")
		BbsId=Request.Form("BbsId")
		Good=Request.Form("Good") 
		If Good="No" Then Dl="and InIndex=False and GoodTop = False"
		if BbsId = "AllBbs" Then
		conn.execute("delete from Forum where DateDiff('d',LastTime,Now) > "&TimeLimit&" "&Dl&" ")
		Else
		conn.execute("delete from Forum where BbsId="&BbsId&" and DateDiff('d',LastTime,Now) > "&TimeLimit&" "&Dl&" ")
		End if
	Case "确定"	
		conn.execute("delete from ReForum where DateDiff('d',PostTime,Now) > "&Request.Form("TimeLimit2"))
	Case "合 并"
		BbsId1=Request.Form("BbsId1")
		BbsId2=Request.Form("BbsId2")
		conn.BeginTrans
		conn.execute("update Forum set BbsId="&BbsId2&" where BbsId="&BbsId1)
		conn.execute("delete from BbsInfo where BbsId="&BbsId1)
		if conn.Errors.Count> 0 then
			Error 2,"执行过程中有错误发生,请待网络恢复正常再重试!",""
			conn.RollbackTrans
			response.End 
		else
			conn.CommitTrans
		end if
End Select
Application(registered&"BbsMenu")=""
response.redirect "?Menu="&Request.QueryString("menu")
Conn.Close
Set Conn = Nothing
Response.End
End if


Menu=Server.HTMLEncode(Trim(Request.QueryString("menu")))
if Menu <> "AddBbs" and Menu <> "BbsList" and Menu <> "BbsMan" Then Error 1,"非法信息登陆!\n您的IP已被记录!",""
Call Top
Call table()
Response.Write("<style><!--	TABLE{BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:1px}TD{BORDER-RIGHT:0px;BORDER-TOP:0px}--></style><br>")
Select Case Menu
Case "AddBbs"%>
	<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
	<tr><td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none"> 
	<b>&nbsp;■ 建立论坛资料</b></td>
	</tr></table>
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"> 提示:将论坛隐藏的话。就只有管理员可以登陆。其他用户将无法访问!</TD>
	</TR><TR><TD  height=13 ><table width="100%" border="0">
	<form name="form1" method="post">
	<tr><td> 
		<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="228">
		<tr> 
		<td width="20%" rowspan="5">    </td>
		<td height="30">  论坛名称 <input name="BbsName" id="BbsName" size="21" maxlength="100"> &nbsp; </td>
		</tr>
		<tr> 
		<td height="30">  是否隐藏 Yes 
		<input type="radio" value="True" name="BbsShow">&nbsp; No <input type="radio" value="False" checked name="BbsShow"></td></tr><tr>
		<td height="30">  版主号码
		<input name=BbsMan id="BbsMan" size="30" maxlength="140" ONKEYPRESS="if ((event.keyCode <48) || (event.keyCode > 57)) event.returnValue = false;">多版主添加请用&quot;,&quot;分隔</td>
		</tr>
		<tr> 
		<td height="28">   访问密码 
		<input name="BbsPsd" id="BbsPsd" size="14" maxlength="18">如果此论坛为公开论坛,此项请不要填写 </td>
		</tr>
		<tr><td height="69" valign="top">  论坛介绍 
		<textarea name="BbsInfo" cols="50" rows="5" id="BbsInfo"></textarea></td>
		</tr>
		<tr> 
		<td height="29" colspan="2"> <p align="center"> 
		<input type="submit" value="建 立" name="Submit">
		</td>
		</tr>
		</table>
	</td></tr>
	</form></table></TD></TR></TABLE>
<%Case "BbsList"%>
	<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
	<tr><td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none"> 
	<b>&nbsp;■ 论坛列表</b></td>
	</tr></table>
	
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"> 以下是您所有论坛的列表:(注:每个版块可以设置多个版主,用","隔开。)</TD>
	</TR>
    </table>


	<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width="100%" border=1 style="border-collapse: collapse" height="24" bgColor="#ecf5ff">
    <form name="form1" method="post"><TR  height=25> 
    <TD width=8% align=middle> <p align="center">选择</TD>
    <TD align=middle width="17%"> <div align="center">论坛名称</div></TD>
    <TD align=middle width="31%"> <div align="center">论坛简介</div></TD>
    <TD align=middle width=12%> <div align="center">版主</div></TD>
    <TD align=middle width=11%><div align="center">论坛密码</div></TD>
    <TD align=middle width=11%><div align="center">论坛状态</div></TD>
    <TD align=left width=10%> <p align="center">排序</TD>
  	</TR>
	</TABLE>
<%
Sql="Select BbsId,BbsName,BbsInfo,BbsMan,BbsPsd,BbsShow,BbsPx From BbsInfo where DelThis=False Order by BbsPx"
Set Rs = Conn.Execute(Sql)
do while not Rs.Eof%>
	<TABLE borderColor=a4b6d7 cellSpacing=0 cellPadding=0 width="100%" border=1 style="border-collapse: collapse" height="24">
	<TR  height=25> 
	<TD width=8% align=middle> <p align="center">
	<input name="BbsId" type="checkbox" value="<%= Rs("BbsId") %>"></TD>
	<TD align=middle width="17%"> <div align="center">
	<input name="BbsName<%= Rs("BbsId") %>" type="text" id="BbsName" size="10" maxlength="100" value="<%= Rs("BbsName") %>">
	</div></TD>
	<TD align=middle width="31%"> <div align="center">
	<textarea name="BbsInfo<%= Rs("BbsId") %>"><%= Rs("BbsInfo") %></textarea>
	</div></TD><TD align=middle width=12%> <div align="center">
	<input name="BbsMan<%= Rs("BbsId") %>" type="text"  size="7" maxlength="150" value="<%= Rs("BbsMan") %>">
	</div></TD>
	<TD align=middle width=11%><div align="center">
	<input name="BbsPsd<%= Rs("BbsId") %>" type="text"  size="7" maxlength="150" value="<%= Rs("BbsPsd") %>">
	</div></TD>
	<TD align=middle width=11%><div align="center">
	<% if Rs("BbsShow")=True Then
	Response.write "隐 藏" 
	Else
	Response.write "显 示" 
	End if
	%></div></TD>
	<TD align=left width=10%> <p align="center"> 
	<input name="BbsPx<%= Rs("BbsId") %>" type="text" size="3" maxlength="3" value="<%= Rs("BbsPx") %>">
	</TD>
	</TR>
	</TABLE>
	<%Rs.Movenext
	loop
	Rs.Close
	Set Rs = Nothing
	%>
	<br>
	<center>
	<input type="submit" name="Submit" value="提 交">&nbsp;
	<input type="submit" name="Submit" value="隐 藏">&nbsp;
	<input type="submit" name="Submit" value="显 示">&nbsp;
	<input type="submit" name="Submit" value="删 除">&nbsp;
	</center></form>
<%Case "BbsMan"%>
	<table borderColor="#a4b6d7" cellSpacing="0" cellPadding="0" width="100%" border="1" style="border-left: 0px none; border-top: 0px none; border-bottom: 1px none; border-collapse:collapse">
	<tr><td height="25" background=images/title_sub.gif style="border-right: 0px none; border-top: 0px none"> 
	<b>&nbsp;■ 论坛数据管理</b> 注意:在此删除的资料将被直接清楚而不再进入回收站。</td>
	</tr></table>
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<form method="post"><TR> 
	<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"> 批量删除主题:</TD>
	</TR>
    </table>

	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" ><center>删除
	<select name="BbsId">
	<option value="AllBbs">所有论坛</option>
	<%
	Sql="Select BbsId,BbsName,BbsMan,BbsInfo,BbsPsd,BbsPx,BbsShow,DelThis,AllTitle,AllRe From BbsInfo"
	Set Rs = Conn.Execute(Sql)
	Do While not Rs.Eof
	ResPonse.Write "<option value="&Rs("BbsId")&">"&Rs("BbsName")&"</option>"
	Rs.Movenext
	Loop
	Rs.Close
	Set Rs = Nothing
	%>
	</select>
	<select name=TimeLimit>
	<option >30</option>
	<option >60</option>
	<option >90</option>
	</select> 天没有用户回复的主题 
	<input type="checkbox" value="No" name="Good" checked>精华帖子和在首页显示的帖子除外
	<input type="submit" name="submit" value="确定删除">
	</center>
	</TD>
	</TR>
    </table>
	
	
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"> 批量删除回帖:
	</TD>
	</TR>
    </table>
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" ><center>
	删除 <select name=TimeLimit2>
	<option value="30">30</option>
	<option value="60">60</option>
	<option value="90">90</option>
	</select> 天以前的回帖  <input type="submit" name="submit" value="确定">
	</center>
	</TD>
	</TR>
    </table>
	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" >&nbsp;<img src="images/2.gif" width="60" height="9"> 合并论坛数据:
	</TD>
	</TR>
    </table>

	<TABLE borderColor=#a4b6d7 cellSpacing=0 cellPadding=3 width=100% border=1 style="border-collapse: collapse">
	<TR> 
	<TD  height=12 width="75%" ><center>
	将&nbsp;<select name="BbsId1">
	<%	Sql="Select BbsId,BbsName,BbsMan,BbsInfo,BbsPsd,BbsPx,BbsShow,DelThis,AllTitle,AllRe From BbsInfo"
	Set Rs = Conn.Execute(Sql)

	Do While not Rs.Eof
	ResPonse.Write "<option value="&Rs("BbsId")&">"&Rs("BbsName")&"</option>"
	Rs.Movenext
	Loop
	Rs.Close
	Set Rs = Nothing
	%>
	</select>
	合并到
	<select name="BbsId2">
	<%	
	Sql="Select BbsId,BbsName,BbsMan,BbsInfo,BbsPsd,BbsPx,BbsShow,DelThis,AllTitle,AllRe From BbsInfo"
	Set Rs = Conn.Execute(Sql)
	Do While not Rs.Eof
	ResPonse.Write "<option value="&Rs("BbsId")&">"&Rs("BbsName")&"</option>"
	Rs.Movenext
	Loop
	Rs.Close
	Set Rs = Nothing
	%>
	</select>
	<INPUT type=submit value="合 并" name=submit>
	</center>
	</TD>
	</TR></form>
    </table>
<%
End Select
Htmlend%>

⌨️ 快捷键说明

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