📄 adminfenlei.asp
字号:
<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 addforum1()
l_title=chktopic(trim(request.form("l_title")))
l_num=chktopic(request.form("l_num"))
l_content=chktopic(request.form("l_content"))
l_access=chktopic(request.form("l_access"))
s_id1=chktopic(request("s_id1"))
l_banzhu=chktopic(request("l_banzhu"))
if l_title="" or l_num="" then
errormsg="<li>错误:标题或者序号不能为空"
call error(errormsg)
response.end
end if
s_face=""
sqlchk="select l_num from lanmu where l_num="&l_num&""
set rschk=conn.Execute (sqlchk)
if not (rschk.eof and rschk.bof) then
errormsg="<li>错误:建立失败!排序序号已经存在"
call error(errormsg)
response.end
else
'判别版主身份
if l_banzhu<>"" then
if right(l_banzhu,1)<>"," then errormsg=errormsg&"<li>请在斑竹用户名后面加“,”"
l_banzhu1=split(l_banzhu,",")
for i=0 to (ubound(l_banzhu1)-1)
sql="select grade from user where username='"&l_banzhu1(i)&"'"
set rs=conn.execute(sql)
if rs.eof then errormsg=errormsg&"<li>您要添加的斑竹<B>"&l_banzhu1(i)&"</b>不存在"
next
set rs=nothing
end if
if errormsg<>"" then
call error(errormsg)
response.end
end if
if l_banzhu<>"" then
l_banzhu1=split(l_banzhu,",")
for i=0 to (ubound(l_banzhu1)-1)
sql="select grade from user where username='"&l_banzhu1(i)&"'"
set rs=conn.execute(sql)
if int(rs("grade"))>2 then conn.execute("update user set grade='2' where username='"&l_banzhu1(i)&"'")
next
end if
strSql = "insert into lanmu (l_title,s_id, l_num, l_content, l_access,s_face,l_banzhu,f_id) Values ('"
strSql = StrSQl & l_title & "', "
strSql = StrSQl & s_id1 & ", '"
strSql = StrSQl & l_num & "', '"
strSql = StrSQl & l_content & "', '"
strSql = StrSQl & l_access & "', '"
strSql = StrSQl & s_face & "', '"
strSql = StrSQl & l_banzhu & "', "
strSql = StrSQl & chktopic(request.form("f_id")) & ")"
conn.Execute (strsql)
succmsg="<li>论坛已经建立"
call succ(succmsg)
response.end
end if
end sub
sub editforum()
sqlch="select * from lanmu where l_id="&chktopic(Request.QueryString("l_id"))&""
set rs_lanmu=conn.Execute (sqlch)
%>
<table border=1 borderColor=<%=tdc2%> cellPadding=3 cellSpacing=1 width=100% style="border-collapse: collapse" align=center >
<form method="POST" action="?action=editforum1&l_id=<%=Request.QueryString("l_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="l_title" size="20" value="<%=rs_lanmu("l_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="s_face" size="20" value="<%=rs_lanmu("s_face")%>">(在首页显示)
</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"><%=rs_lanmu("l_content")%></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">
<option value=<%=rs_lanmu("f_id")%> selected>
<%
sql_fen = "select f_title from fenlei where f_id="&rs_lanmu("f_id")&""
set rs_fen =conn.Execute (sql_fen)
if not rs_fen.eof then
response.write(rs_fen("f_title"))
end if
set rs_fen=nothing
%>
</option>
<%sql = "select f_id,f_title from fenlei"
set rs_fenlei=conn.execute(sql)
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=<%=rs_lanmu("l_access")%> selected><%=rs_lanmu("l_access")%></option>
<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" value="<%=rs_lanmu("l_banzhu")%>"> (多位版主请用","分开,注意最后一个用户必须加","如填入"飞越,"多用户格式为"飞越,疾风,")
</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_password" size="20" value="<%=rs_lanmu("l_password")%>">(若不加密,请留空)
</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=<%=rs_lanmu("l_num")%>> </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 bdtj2 from stycss where s_id="&rs_lanmu("s_id")&""
set rs=conn.execute(sql)
if not rs.eof then
bdtj2=rs("bdtj2")
end if
set rs=nothing%>
<option value=<%=rs_lanmu("s_id")%> ><%=bdtj2%></option>
<%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>
<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 editforum1()
l_title=chktopic(trim(request.form("l_title")))
l_num=chktopic(request.form("l_num"))
l_content=chktopic(request.form("l_content"))
l_access=chktopic(request.form("l_access"))
s_id1=chktopic(request("s_id1"))
l_banzhu=chktopic(request("l_banzhu"))
f_id=chktopic(request.form("f_id"))
s_face=chktopic(request.form("s_face"))
l_password=chktopic(request.form("l_password"))
if l_title="" or l_num="" then
errormsg="<li>错误:标题或者序号不能为空"
call error(errormsg)
response.end
end if
'判别版主身份
if l_banzhu<>"" then
if right(l_banzhu,1)<>"," then errormsg=errormsg&"<li>请在斑竹用户名后面加“,”"
l_banzhu1=split(l_banzhu,",")
for i=0 to (ubound(l_banzhu1)-1)
sql="select grade from user where username='"&l_banzhu1(i)&"'"
set rs=conn.execute(sql)
if rs.eof then errormsg=errormsg&"<li>您要添加的斑竹<B>"&l_banzhu1(i)&"</b>不存在"
next
set rs=nothing
end if
if errormsg<>"" then
call error(errormsg)
response.end
end if
sqlch="select l_banzhu from lanmu where l_id="&chktopic(Request.QueryString("l_id"))&""
set rs=conn.Execute (sqlch)
if not rs.eof then l_oldbanzhu=rs("l_banzhu")
set rs=nothing
if l_oldbanzhu<>"" then
l_oldbanzhu1=split(l_oldbanzhu,",")
isother=0
for i=0 to (ubound(l_oldbanzhu1)-1)
sqlch="select l_banzhu from lanmu where l_id<>"&chktopic(Request.QueryString("l_id"))&""
set rs=conn.Execute (sqlch)
do while not rs.eof
l_otherbanzhu=rs("l_banzhu")
if instr(l_otherbanzhu,l_oldbanzhu1(i))>0 then
isother=1
exit do
end if
rs.movenext
loop
if isother<>1 then
sql1="select grade from user where username='"&l_oldbanzhu1(i)&"'"
set rs1=conn.execute(sql1)
if not rs1.eof then
if int(rs1("grade"))>1 then
conn.execute("update user set grade='"&gradenum&"' where username='"&l_oldbanzhu1(i)&"'")
end if
end if
end if
next
set rs=nothing
set rs1=nothing
end if
if l_banzhu<>"" then
l_banzhu1=split(l_banzhu,",")
for i=0 to (ubound(l_banzhu1)-1)
sql="select grade from user where username='"&l_banzhu1(i)&"'"
set rs=conn.execute(sql)
if int(rs("grade"))>2 then conn.execute("update user set grade='2' where username='"&l_banzhu1(i)&"'")
next
end if
sqlch="Update lanmu set l_banzhu='"&l_banzhu&"',s_id="&s_id1&",l_password='"&l_password&"', s_face='"&s_face&"',f_id="&f_id&",l_content='"&l_content&"',l_access='"&l_access&"',l_title='"&l_title&"',l_num="&l_num&" where l_id="&chktopic(Request.QueryString("l_id"))&""
conn.Execute (sqlch)
succmsg="<li>论坛已经更新"
call succ(succmsg)
response.end
end sub
sub delforum()
if Request.QueryString("l_id")="" then
errormsg="<li>错误:参数错误"
call error(errormsg)
response.end
end if
sqldel="DELETE * from lanmu where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel)
sqldel1="DELETE * from topic where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel1)
sqldel2="DELETE * from reply where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel2)
succmsg="<li>论坛已经删除"
call succ(succmsg)
response.end
end sub
sub delforum1()
if Request.QueryString("l_id")="" then
errormsg="<li>错误:参数错误"
call error(errormsg)
response.end
end if
sqldel="update lanmu set l_topiccount=0,l_count=0 where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel)
sqldel1="DELETE * from topic where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel1)
sqldel2="DELETE * from reply where l_id="&chktopic(request("l_id"))&""
conn.Execute (sqldel2)
succmsg="<li>论坛已经清空完毕"
call succ(succmsg)
response.end
end sub
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -