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

📄 adminright2.asp

📁 本程序蓝本为6kbbs 默认前台管理员的帐号是:woodcoal
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="bbs.asp"-->
<%
dim action,strt,i,bad,b,id,paper,ggtitle,ggok,content,contentok,content2,rs1,sql,bdlist2,grade
dim name,url,picurl,readme,rs2
sub bdlist()
set bdlist2=conn.execute("select * from bdinfo where followid<>0 order by followid,orders desc,id")
response.write"<select size=1 name=bd style='font-size: 9pt'><option value=0>请选择版面</option>"
do while not bdlist2.eof
response.write"<option value="&bdlist2("id")&">"&split(bdlist2("bdinfo"),"|")(0)&"</option>"
bdlist2.movenext
Loop
response.write"</select>"
set bdlist2=nothing
end sub

function checkbad(str)
if isnull(str) then exit function 
bad=split(application(prefix&"badcontent"), "|")
for b=0 to ubound(bad)
str=Replace(str,bad(b),string(len(bad(b)),"*")) 
next
checkbad=str
end function

action=request.querystring("action")
select case action
case"editgg","editggok" strt="公告修改"
case"bdinfo" strt="论坛版面设置"
case"addfl","addflsave" strt="添加分类"
case"delfl","delflok" strt="删除分类"
case"addbd","addbdsave" strt="添加版面"
case"delbd","delbdok" strt="删除版面"
case"adminbd","addbdadmin","delbdadmin" strt="版主设置"
case"allbd","addallbd","delallbd" strt="超级版主设置"
case"admiin","addadmin","deladmin" strt="管理员设置"
end select

sub send(str)
response.write"<div align=center><table class=td1 border=1 cellpadding=0 cellspacing=0 style='border-collapse: collapse' bordercolor=#cad6eb width=100% height=50><tr><td width=100% ><p style='margin:5px;line-height:150%'><font color= red>"&str&"</font></p></td></tr></table></div>"
end sub
%>
<body topmargin="0" leftmargin="0">

<%call admintop%>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="90%" bordercolor="#cad6eb">
  <tr>
    <td class=td1 width="90%" height="28" background="pic/titlebg.gif" align="center">
	<span style="font-weight: 400"><font color="#000000">&nbsp; <%=strt%></font></span></td>
  </tr>
</table>
</div>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="90%">
  <tr>
    <td width="100%" valign="top" height="475">
<%
select case action
case"editgg"
id=checknum(request.querystring("id"))
set rs=conn.execute("select*from paper where id="&id&"")
paper=rs("paper")
paper=split(paper,"|")
function hell(str)
dim re
Set re=new RegExp
re.IgnoreCase=true
re.Global=True
str = replace(str, ">", "&gt;")
str = replace(str, "<", "&lt;")
set re=Nothing
hell=str
end function
%>
<SCRIPT src=../inc/ybbcode.js></script>
<SCRIPT>function openwin()
{
document.form1.topic.value=document.topic.ggtitle.value;
document.form1.content.value=document.topic.content.value;
var popupWin = window.open('../paper.asp?action=preview', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes');
document.form1.submit()
}

</SCRIPT>

<form method="POST" action="adminright2.asp?action=editggok&id=<%=id%>" name="topic">
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#cad6eb">
      <tr>
 <td width="30%" class=td2>
 <p style="line-height: 120%; margin: 4"><span style="font-weight: 400">
	<font color="#000000">公告标题:</font></span></td>
 <td width="70%">
 <p style="line-height: 120%; margin: 4">
 <input type="text" name="ggtitle" size="80" value="<%=hell(paper(0))%>"></td>
      </tr>
      <tr>
         <td valign="top">
        <p style="line-height: 120%; margin: 4">公告内容:<%call tie%></td>
        <td> <p style="margin: 4"><%call adminqian%><p style="margin:4px">      
<textarea rows="9" name="content" cols="60" style="font-family: 宋体; font-size: 9pt" onkeydown=presskey(); onkeyup=gbcount(this.form.content,this.form.total,this.form.used,this.form.remain);><%=hell(paper(3))%></textarea>
 
 <p style="line-height: 150%; margin: 5">
      <SCRIPT>

function presskey(eventobject)
{
   if(event.ctrlKey && window.event.keyCode==13){this.document.topic.submit();}else{return false}
   }
</SCRIPT>
</p><br></td>
</tr>
      <tr>
 <td colspan="2" align="center" height="40" bgcolor="#F4F6FC">
 <input class=submit type=submit value=OK_!发送 name=B1>&nbsp;&nbsp;&nbsp; <input class=submit type=button value="预  览!" onclick=openwin()>&nbsp;&nbsp;&nbsp; <input class=submit type=reset value=NO_!重写 name=B2>&nbsp; [ 按 Alt+Enter 直接发送 ]</td>
      </tr>
      </table>
</div>
</form>
<form name=form1 action=../paper.asp?action=preview method=post target=showgg>
<input type=hidden name=topic value=><input type=hidden name=content value=>
</form>
<%case"editggok"
id=checknum(request.querystring("id"))
ggtitle=Replace(Request.Form("ggtitle"),"'","")
ggtitle=replace(ggtitle,"|","│")
ggok=Replace(ggtitle," ","")

content=checkbad(Request.Form("content"))
content=replace(content,"|","│")
content=replace(content,"'","''")
contentok=Replace(content," ","")

if ggok="" or contentok="" then
call send("<b>对不起!公告修改失败,可能存在以下问题。</b><br>·请填写完整公告标题和公告内容。<br>·<a href='javascript:history.go(-1)'>返回重新填写</a>")
else
content2=ggtitle&"|"&lgname&"|"&now()+timeset/24&"|"&content
conn.execute("update [paper] set paper='"&content2&"' where id="&id&"")
call send("公告修改成功。")
end if
%>
<%case"bdinfo"
%>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#cad6eb">
  <tr class=td2>
    <td width="40%" bgcolor="#F4F6FC" height="28">
    <p style="line-height: 150%; margin: 4"><font color="#000000">
	<span style="font-weight: 400">当前论坛已有的分类信息:</span></font></td>
    <td width="60%" bgcolor="#F4F6FC">
    <p style="line-height: 150%; margin: 4"><font color="#000000">
	<span style="font-weight: 400">当前论坛已有的版面信息:</span></font></td>
  </tr>
<%
set rs=conn.execute("select * from bdinfo where followid=0 order by orders desc,id")
do while not rs.eof
response.write"<tr><td valign=top><p style='line-height: 150%; margin: 4'>分类 ID:<b>"&rs("id")&"</b><br>分类名称:"&rs("bdinfo")&"&nbsp; <a href=adminright1.asp?action=editfl&flid="&rs("id")&">[ 编辑 ]</a>&nbsp; <a href=adminright1.asp?action=upfl&flid="&rs("id")&">[ 置前 ]</a></td><td valign=top><p style='line-height: 150%; margin: 4'>"
set rs1=conn.execute("select * from bdinfo where followid="&rs("id")&" order by orders desc,id")
do while not rs1.eof
response.write"版面 ID:<b>"&rs1("id")&"</b>&nbsp; &nbsp; 版面名称:"&split(rs1("bdinfo"),"|")(0)&"&nbsp; <a href=adminright1.asp?action=editbd&bd="&rs1("id")&">[ 编辑 ]</a>&nbsp; <a href=adminright1.asp?action=upbd&bd="&rs1("id")&">[ 置前 ]</a>"
if rs1("type")=3 then response.write"&nbsp; <a href=adminright1.asp?action=pass&bd="&rs1("id")&">[ 认证 ]</a>"
response.write"<br>"
rs1.movenext
loop
set rs1=nothing
response.write"</td></tr>"
rs.movenext
loop
set rs=nothing
%>
</table>
</div>
<div align="center">
<table border="1" bordercolor="#cad6eb" cellpadding="0" style="border-collapse: collapse" width="100%">
  <tr>
    <td width="100%" background="pic/titlebg.gif" height="28">&nbsp;<img src="../pic/fl.gif" border="0"> <a href="adminright2.asp?action=addfl">添加分类</a>&nbsp;&nbsp;
	<img src="../pic/fl.gif" border="0"> <a href="adminright2.asp?action=delfl">
	删除分类</a>&nbsp; <img src="../pic/fl.gif" border="0"> <a href="adminright2.asp?action=addbd">添加版面</a>&nbsp;
    <img src="../pic/fl.gif" border="0"> <a href="adminright2.asp?action=delbd">
		删除版面</a></td>
  </tr>
  </table>
</div>
<%
case"addfl"
%>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#cad6eb" width="100%">
<form method="POST" action="adminright2.asp?action=addflsave"><tr>
    <td width="35%">
    <p style="margin: 8">请输入分类的 ID:<br>不能与已有的分类 ID 重复,不能填 <b>0</b></td>
    <td width="65%">&nbsp;<input type="text" name="flid" size="9"></td>
  </tr>
<tr>
  <td width="35%">
    <p style="margin: 8">选择分类状态<br>0为默认方式,1简便方式,2为隐藏方式 </td>
    <td width="65%">&nbsp;<input type="text" name="flpcid" size="9"></td>
  </tr>

  <tr>
    <td>
    <p style="margin: 8">请输入分类的名称:<br>支持 HTML</td>
    <td>&nbsp;<input type="text" name="flname" size="46"></td>
  </tr>  <tr>
    <td colspan="2" bgcolor="#F4F6FC" align="center" height="35">
    <input type="submit" value="     确  认  添  加     " name="B1"></td>
  </tr></form>
</table>
</div>
<%
case"delfl"
%>
<div align="center">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#cad6eb" width="100%">
<form method="POST" action="adminright2.asp?action=delflok"><tr>
    <td width="35%">
    <p style="margin: 8; line-height:150%">请输入要删除的分类的 ID:<br>
    <font color="#FF0000">注意:该操作将删除该分类下的版面和帖子。</font></td>
    <td width="65%">&nbsp;<input type="text" name="flid" size="9"></td>
  </tr>
 <tr>
    <td colspan="2" bgcolor="#F4F6FC" align="center" height="35">
    <input type="submit" value="     确  认  删  除     " name="B1" onclick="{if(confirm('确定删除此分类吗?这样将删除该分类下的版面和帖子。')){return true;}return false;}"></td>
  </tr></form>
</table>
</div>
<%
application(prefix&"allthebbs")=""
case"delflok"
flid=checknum(request.form("flid"))
conn.execute("delete*from bdinfo where (id="&flid&" and followid=0) or followid="&flid&"")
conn.execute("delete*from topic where bd="&flid&"")
conn.execute("delete*from paper where bd="&flid&"")

dim usedtable
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
conn.execute("delete*from bbs"&i&" where bd="&flid&"")
next
response.redirect"adminright2.asp?action=bdinfo"
%>
<%
application(prefix&"allthebbs")=""
case"addbd"
if  conn.execute("select * from bdinfo where  followid=0").eof then
call send("·对不起,分类 ID:论坛尚无分类,请先:<br>·<a href='adminright2.asp?action=addfl'><font color=#ffffff>添加分类</font></a>")
response.end
end if
%>
<form method="POST" action="adminright2.asp?action=addbdsave">

  <div align="center">

  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#cad6eb" width="100%">
 <tr>
   <td width="25%">
   <p style="line-height: 150%; margin: 5">版面 ID:<br>不能与已有的版面 ID 重复,不能填 <b>0</b></td>
   <td width="75%">&nbsp;<input type="text" name="bd" size="25"></td>
 </tr>
 <tr>
   <td>
   <p style="line-height: 150%; margin: 5">论坛名称:<br>支持HTML</td>
   <td>&nbsp;<input type="text" name="bdname" size="25"></td>
 </tr>
 <tr>
   <td>
   <p style="line-height: 150%; margin: 5">论坛LOGO:<br>可以不填</td>
   <td>&nbsp;<input type="text" name="picurl" size="49"></td>
 </tr>
 <tr>
   <td valign="top">
   <p style="line-height: 150%; margin: 5">论坛介绍:</td>
   <td>
   <p style="margin: 4">
   <textarea rows="4" name="bdinfo" cols="58" style="font-size: 9pt; font-family: 宋体"></textarea></td>
 </tr>
 <tr>
   <td>
   <p style="line-height: 150%; margin: 5">属于分类:</td>
   <td>&nbsp;<%set rs=conn.execute("select * from bdinfo where followid=0 order by orders desc,id")%><select size="1" name="followid" style="font-size: 9pt">
<%do while not rs.eof%><option value="<%=rs("id")%>"><%=rs("bdinfo")%></option><%
rs.movenext
Loop
rs.Close
set rs=nothing
%>
</select></td>
 </tr>
 <tr>
   <td valign="top">
   <p style="line-height: 150%; margin: 5">论坛类型:</td>
   <td>
   <p style="MARGIN: 4px">
   <input type="radio" CHECKED value="0" name="bbstype">普通论坛(用户和游客可以自由的进入该类型论坛,·推荐·) </p>
   <p style="MARGIN: 4px"><input type="radio" value="1" name="bbstype">会员论坛(只有注册用户才能进入该类型论坛)</p>
   <p style="MARGIN: 4px"><input type="radio" value="2" name="bbstype">锁定论坛(会员和游客只能浏览帖子,不能对该论坛的帖子回复等)</p>
   <p style="MARGIN: 4px"><input type="radio" value="3" name="bbstype">认证论坛(只有版主认证的注册用户才能进入该类型论坛)</p>
   <p style="MARGIN: 4px"><input type="radio" value="4" name="bbstype">VIP论坛(只有vip用户方能进入--版主甚至管理员如非vip也不能进入)</td>
 </tr>
 <tr>
   <td colspan="2" bgcolor="#F4F6FC" align="center" height="35">
    <input type="submit" value="     确  认  添  加     " name="B1"></td>
 </tr>
 </table></div>
</form>
<%
application(prefix&"allthebbs")=""
case"addbdsave"
dim bd,bdname,bdinfo,followid,bbstype
bd=checknum(request.form("bd"))
bdname=Replace(Request.Form("bdname"),"|","│")
picurl=Replace(Request.Form("picurl"),"|","│")
bdinfo=Replace(Request.Form("bdinfo"),"|","│")
followid=checknum(request.form("followid"))
bbstype=checknum(request.form("bbstype"))
if bd="" or bd<=0 or bdname="" or bdinfo="" then
call send("·请填写完整必填的资料<br>·<a href='javascript:history.go(-1)'>返回重新填写</a>")

⌨️ 快捷键说明

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