📄 admin_board.asp
字号:
conn.execute(sql)
sql="update topic set classid="&request("newclassid")&" where classid="&cstr(request("classid"))
conn.execute(sql)
%>
<script language=javascript>
alert( "版面总类修改成功!" );
location.href = "admin_board.asp"
</script>
<%end if%>
<%end sub%>
<%sub addboard()%>
<%set rs1 = server.CreateObject ("Adodb.recordset")
sql="select classname,classid from class where classid="&request("classid")
rs1.open sql,conn,1,1
%>
<%set rs = server.CreateObject ("Adodb.recordset")
sql="select boardid from board"
rs.open sql,conn,1,1
num=rs.recordcount
rs.close%>
<table width="95%" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center">
<form action="admin_board.asp?action=saveboard" method=POST name=addboard>
<tr bgcolor="#CCCCCC" align=center><td colspan="2"><b>在总类"<%=rs1("classname")%>"中增加子版面</b></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类名称:</td><td><input type=text name=boardname size=20></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类排序:</td><td><input type=text name=boardid size=5 value="<%=num*2%>"></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类说明:</td><td><textarea name="boardinfo" cols="40" rows="5"></textarea></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类斑竹:</td>
<td><select name=boardMaster>
<%
set rs = server.CreateObject ("Adodb.recordset")
sql = "select userid,username,userkey from users where userkey>=2 or userkey=3 order by userkey desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<option value="">还没有斑竹<option>
<%else%>
<%do while not rs.EOF%>
<option value="<%=rs("username")%>"><%=rs("username")%></option>
<%rs.MoveNext
loop
end if
rs.Close
set rs=nothing %>
</select><input type=hidden name=classid value=<%=request("classid")%>></td></tr>
<tr bgcolor=#eeeeee><td></td><td><input type="submit" name="Submit" value="确定"> <input type="Reset" name="Reset" value="重填"></td></tr>
</form></table>
<%end sub%>
<%sub saveboard()%>
<% dim boardid
set rs = server.CreateObject ("adodb.recordset")
sql="select boardid from board where boardid="+cstr(request("boardid"))
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
rs.close
set rs=nothing%>
<script language=javascript>
alert( "错误:子类序号有重复" );
location.href = "javascript:history.back()"
</script>
<%
exit sub
end if%>
<%if request("boardname")="" then%>
<script language=javascript>
alert( "错误:请输入类别名称!" );
location.href = "javascript:history.back()"
</script>
<%elseif request("boardinfo")="" then%>
<script language=javascript>
alert( "错误:请输入类别说明!" );
location.href = "javascript:history.back()"
</script>
<%else%>
<%
set rs = server.CreateObject ("adodb.recordset")
sql = "select * from board"
rs.Open sql,conn,1,3
rs.AddNew
rs("boardname") = Request("boardname")
rs("boardid") = Request("boardid")
rs("classid") = Request("classid")
rs("boardinfo") = Request("boardinfo")
rs("boardMaster") = Request("boardMaster")
rs("Addtime") = now()
rs("lastpostdate") = now()
rs("boardNum") = 0
rs("todayNum") = 0
rs.Update
rs.Close
set rs=nothing
%>
<script language=javascript>
alert( "恭喜:子类添加成功" );
location.href = "admin_board.asp"
</script>
<%end if%>
<%end sub%>
<%sub delboard()
set rs = server.CreateObject ("adodb.recordset")
sql = "delete from board where boardid="+Cstr(Request("boardid"))
conn.execute(sql)
sql = "delete from article where boardid="+cstr(Request("boardid"))
conn.execute(sql)
set rs=nothing
%>
<script language=javascript>
alert( "子类删除成功" );
location.href = "admin_board.asp"
</script>
<%end sub%>
<%sub editboard()%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from [board] where boardid="&request("boardid")
rs.open sql,conn,1,1
%>
<table width="95%" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center">
<form action="admin_board.asp?action=saveeditboard&classid=<%=request("classid")%>&boardid=<%=request("boardid")%>" method=POST name=editboard>
<tr bgcolor="#CCCCCC" align=center><td colspan="2"><b>修改子类</b></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类名称:</td><td><input type=text name=boardname size=20 value="<%=rs("boardname")%>"></td></tr>
<tr bgcolor="#eeeeee"><td align=right>所属总类:</td>
<td><select name=newclassid>
<%
set rs1 = server.CreateObject ("Adodb.recordset")
sql1 = "select classid,classname from class order by classid desc"
rs1.open sql1,conn,1,1
if rs1.eof and rs1.bof then
%>
<option value="">还没有总类<option>
<%else%>
<%do while not rs1.EOF%>
<option value="<%=rs1("classid")%>" <%if rs1("classid")=rs("classid") then%> selected<%end if%>><%=rs1("classname")%></option>
<%rs1.MoveNext
loop
end if
rs1.Close
set rs1=nothing
%>
</select></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类排序:</td><td><input type=text name=newboardid size=5 value="<%=request("boardid")%>"></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类说明:</td><td><textarea name="boardinfo" cols="40" rows="5"><%=rs("boardinfo")%></textarea></td></tr>
<tr bgcolor="#eeeeee"><td align=right>子类斑竹:</td>
<td><select name=boardMaster>
<%
set rs2 = server.CreateObject ("Adodb.recordset")
sql2 = "select userid,username,userkey from users where userkey>=2 order by userkey desc"
rs2.open sql2,conn,1,1
if rs2.eof and rs2.bof then
%>
<option value="">还没有斑竹<option>
<%else%>
<%do while not rs2.EOF%>
<option value="<%=rs2("username")%>" <%if rs2("username")=rs("boardmaster") then%> selected<%end if%>><%=rs2("username")%></option>
<%rs2.MoveNext
loop
end if
rs2.Close
set rs2=nothing
%>
</select></td></tr>
<tr bgcolor=#eeeeee><td></td><td><input type="submit" name="Submit" value="确定"> <input type="Reset" name="Reset" value="重填"></td></tr>
</form></table>
<%rs.Close
set rs=nothing
end sub%>
<%sub saveeditboard()%>
<%if request("boardname")="" then%>
<script language=javascript>
alert( "错误:请输入类别名称!" );
location.href = "javascript:history.back()"
</script>
<%elseif request("boardinfo")="" then%>
<script language=javascript>
alert( "错误:请输入类别说明!" );
location.href = "javascript:history.back()"
</script>
<%else%>
<% dim newboardid,newclassid
if request("newboardid")=request("boardid") and request("newclassid")=request("classid") then
sql="update board set boardname='"&request("boardname")&"',boardinfo='"&request("boardinfo")&"',boardmaster='"&request("boardmaster")&"' where boardid="&cstr(request("boardid"))
conn.execute(sql)
%>
<script language=javascript>
alert( "恭喜:子类修改成功" );
location.href = "admin_board.asp"
</script>
<%elseif request("newboardid")=request("boardid") and request("newclassid")<>request("classid") then
sql="update board set classid='"&request("newclassid")&"',boardname='"&request("boardname")&"',boardinfo='"&request("boardinfo")&"',boardmaster='"&request("boardmaster")&"' where boardid="&cstr(request("boardid"))
conn.execute(sql)
sql="update article set classid='"&request("newclassid")&"' where boardid="&cstr(request("boardid"))
conn.execute(sql)
%>
<script language=javascript>
alert( "恭喜:子类修改成功" );
location.href = "admin_board.asp"
</script>
<%elseif request("newboardid")<>request("boardid") and request("newclassid")=request("classid") then
set rs = server.CreateObject ("Adodb.recordset")
sql="select * from board where boardid="&cstr(request("newboardid"))
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
%>
<script language=javascript>
alert( "子类序号重复" );
location.href = "javascript:history.back()"
</script>
<%else
sql="update board set boardid="&request("newboardid")&",boardname='"&request("boardname")&"',boardinfo='"&request("boardinfo")&"',boardmaster='"&request("boardmaster")&"' where boardid="&cstr(request("boardid"))
conn.execute(sql)
sql="update article set boardid="&request("newboardid")&" where boardid="&cstr(request("boardid"))
conn.execute(sql)
%>
<script language=javascript>
alert( "恭喜:子类修改成功" );
location.href = "admin_board.asp"
</script>
<%end if%>
<%elseif request("newboardid")<>request("boardid") and request("newclassid")<>request("classid") then
set rs = server.CreateObject ("Adodb.recordset")
sql="select * from board where boardid="&cstr(request("newboardid"))
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
%>
<script language=javascript>
alert( "子类序号重复" );
location.href = "javascript:history.back()"
</script>
<%else
sql="update board set classid="&request("newclassid")&",boardid="&request("newboardid")&",boardname='"&request("boardname")&"',boardinfo='"&request("boardinfo")&"',boardmaster='"&request("boardmaster")&"' where boardid="&cstr(request("boardid"))
conn.execute(sql)
sql="update article set boardid="&request("newboardid")&",classid="&request("newclassid")&" where boardid="&cstr(request("boardid"))
conn.execute(sql)
%>
<script language=javascript>
alert( "恭喜:子类修改成功" );
location.href = "admin_board.asp"
</script>
<%end if%>
<%end if%>
<%end if%>
<%end sub%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -