📄 adminfenlei.asp
字号:
<!--#include file="Connections.asp" -->
<!--#include file="adminaccess.asp" -->
<body <%=background%>>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<tr align="center">
<td <%=hColor%> class=tdc1 height=22 width=100%>
<a href="?">论坛管理</a> | <a href="?action=add">新建论坛分类</a></td>
</tr></table>
<% select case chktopic(request("action"))
case "add"
call add()
case "add1"
call add1()
case "edit"
call edit()
case "edit1"
call edit1()
case "del"
call del()
case "addforum"
call addforum()
case "addforum1"
call addforum1()
case "editforum"
call editforum()
case "editforum1"
call editforum1()
case "delforum"
call delforum()
case "delforum1"
call delforum1()
case else
call fenlei()
end select
sub fenlei()
sql_fenlei = "select f_id,f_title,f_num from fenlei order by f_num"
set rs_fenlei=conn.execute(sql_fenlei)
%>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<% do while not rs_fenlei.Eof %>
<tr>
<td align="right" width="20%" <%=tColor%> class=tdc1>
<p align="left"> <b><%=rs_fenlei("f_num")%></b> 分类名称:<%=rs_fenlei("f_title")%> |
<a href="?action=edit&f_id=<%=rs_fenlei("f_id")%>">修改分类信息</a> | <a href="?action=del&f_id=<%=rs_fenlei("f_id")%>" onclick="{if(confirm('一定要删除该分类吗?建议你不要删除分类,同时属于此分类的论坛也将删除,否则可能会造成比较严重的后果,确定删除吗?')){return true;}return false;}">删除分类</a>
| <a href="?action=addforum">新增论坛</a></td>
</tr>
<%
sql_lanmu= "select l_id,l_title,l_num,l_content from lanmu where f_id="&rs_fenlei("f_id")&" order by l_num"
set rs_lanmu=conn.Execute (sql_lanmu)
do while not rs_lanmu.Eof %>
<tr>
<td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc><hr class=tdc2></td>
</tr>
<tr>
<td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>
<p align="left"> <b><%=rs_lanmu("l_num")%></b>论坛名称:<%=rs_lanmu("l_title")%> |
<a href="?action=editforum&l_id=<%=rs_lanmu("l_id")%>">修改论坛信息</a> |
<a href="?action=delforum&l_id=<%=rs_lanmu("l_id")%>" onclick="{if(confirm('一定要删除该论坛吗?建议你不要随意删除论坛,否则可能会造成比较严重的后果,确定删除吗?')){return true;}return false;}">删除论坛</a> |
<a href="?action=delforum1&l_id=<%=rs_lanmu("l_id")%>" onclick="{if(confirm('一定要清空该论坛吗??')){return true;}return false;}">清空论坛数据</a> |
</td>
</tr>
<tr>
<td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>
<p align="left"><B>论坛简介:</b><%=rs_lanmu("l_content")%></td>
</tr>
<%
rs_lanmu.MoveNext
Loop
set rs_lanmu=nothing
rs_fenlei.MoveNext
Loop
set rs_fenlei=nothing
%>
</table>
<% end sub
sub add()
sqlch="select f_num from fenlei order by f_num desc"
set rsch=conn.Execute (sqlch)
if not rsch.eof then
f_num=rsch("f_num")
else
f_num=0
end if
set rsch=nothing
%>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<form method="POST" action="?action=add1">
<tr>
<td align="right" width="100%" <%=tColor%> class=tdc colspan="2">
<p align="center">添加论坛新分类</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>新分类名称:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="f_title" size="20">
</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>分类排序序号:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="f_num" size="3" value="<%=f_num+1%>"> </td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>
<p align="left"> </td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input type="submit" value="提交" name="B1" class=bdtj> <input type="reset" value="重置" name="B2" class=bdtj> </td>
</tr> </form></table>
<% end sub
sub add1()
f_title=chktopic(trim(request.form("f_title")))
f_num=chktopic(request.form("f_num"))
if f_title="" or f_num="" then
errormsg="<li>错误:分类标题或者序号不能为空"
call error(errormsg)
response.end
end if
sqlchk="select f_num from fenlei where f_num="&f_num&""
set rschk=conn.Execute (sqlchk)
if not (rschk.eof and rschk.bof) then
errormsg="<li>建立失败!排序序号已经存在"
call error(errormsg)
response.end
else
strSql = "insert into fenlei (f_title, f_num) Values ('"
strSql = StrSQl & f_title & "', "
strSql = StrSQl & f_num & ")"
conn.Execute (strsql)
succmsg="<li>分类已经建立"
call succ(succmsg)
response.end
end if
end sub
sub edit()
sqledit="select f_id,f_title,f_num from fenlei where f_id="&chktopic(Request.QueryString("f_id"))&""
set rsedit=conn.Execute (sqledit)
if not rsedit.eof then
%>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<form method="POST" action="?action=edit1&f_id=<%=Request.QueryString("f_id")%>">
<tr>
<td align="right" width="100%" <%=tColor%> class=tdc colspan="2">
<p align="center">更新论坛分类</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>分类名称:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="f_title" size="20" value=<%=rsedit("f_title")%>>
</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>分类排序序号:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="f_num" size="3"value=<%=rsedit("f_num")%>> </td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>
<p align="left"> </td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input type="submit" value="提交" name="B1" class=bdtj> <input type="reset" value="重置" name="B2" class=bdtj> </td>
</tr> </form></table>
<% else
errormsg="<li>参数错误,分类已经删除"
call error(errormsg)
response.end
end if
set rsedit=nothing
end sub
sub edit1()
f_title=chktopic(trim(request.form("f_title")))
f_num=chktopic(request.form("f_num"))
if f_title="" or f_num="" then
errormsg="<li>错误:分类标题或者序号不能为空"
call error(errormsg)
response.end
end if
sqlch="Update fenlei set f_title='"&f_title&"',f_num='"&f_num&"' where f_id="&chktopic(Request.QueryString("f_id"))&""
conn.Execute (sqlch)
succmsg="<li>分类已经更新"
call succ(succmsg)
response.end
end sub
sub del()
if Request.QueryString("f_id")="" then
errormsg="<li>错误:参数错误"
call error(errormsg)
response.end
end if
sql="select l_id from lanmu where f_id="&chktopic(Request.QueryString("f_id"))&""
set rs=conn.execute(sql)
do while not rs.eof
sqldel="DELETE * from lanmu where l_id="&rs("l_id")&""
conn.Execute (sqldel)
sqldel1="DELETE * from topic where l_id="&rs("l_id")&""
conn.Execute (sqldel1)
sqldel2="DELETE * from reply where l_id="&rs("l_id")&""
conn.Execute (sqldel2)
rs.movenext
loop
sqldel="DELETE * from fenlei where f_id="&chktopic(Request.QueryString("f_id"))&""
conn.Execute (sqldel)
succmsg="<li>分类已经删除"
call succ(succmsg)
response.end
end sub
sub addforum()
sqlch="select l_num from lanmu order by l_num desc"
set rsch=conn.Execute (sqlch)
if not rsch.eof then
l_num=rsch("l_num")
else
l_num=0
end if
set rsch=nothing
%>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<form method="POST" action="?action=addforum1">
<tr>
<td align="right" width="100%" class=tdc colspan="2" <%=tColor%>>
<p align="center">添加新论坛</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>新论坛名称:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="l_title" size="20">
</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>新论坛简介:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<textarea rows="3" name="l_content" cols="40"></textarea></td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>新论坛类型:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<select size="1" name="f_id"><% sqledit="select f_id,f_title from fenlei "
set rs_fenlei=conn.Execute (sqledit)
do while not rs_fenlei.Eof %>
<option value=<%=rs_fenlei("f_id")%>><%=rs_fenlei("f_title")%></option>
<%rs_fenlei.MoveNext
Loop
set rs_fenlei=nothing%> </select></td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>论坛权限:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<select size="1" name="l_access">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>("0"表示允许所有人浏览,"1"表示只允许会员浏览,"2"表示只允许斑竹以上浏览,"3"表示此论坛是属于只读论坛,不接受新帖和回复帖,"4"表示此论坛为认证论坛,只有认证会员才可以看)</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>论坛版主:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="l_banzhu" size="20"> (多位版主请用","分开,注意最后一个用户必须加","如填入"飞越,"多用户格式为"飞越,疾风,")
</td>
</tr>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>分类排序序号:</td>
<td align="left" width="70%" bgcolor=<%=tColor2%> class=tdc>
<input name="l_num" size="3" value="<%=l_num+1%>" > </td>
</tr>
<tr>
<td width="30%" align="right" bgcolor=<%=tColor2%> class=tdc>论坛样式:</td>
<td bgcolor=<%=tColor2%> class=tdc width="70%"> <select name="s_id1">
<%sql="select s_id,bdtj2 from stycss"
set rs=conn.execute(sql)
do while not rs.eof
%>
<option value=<%=rs("s_id")%> ><%=rs("bdtj2")%></option>
<%rs.movenext
loop
set rs=nothing%>
</select>
<tr>
<td align="right" width="30%" bgcolor=<%=tColor2%> class=tdc>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -