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

📄 adminright3.asp

📁 本程序蓝本为6kbbs 默认前台管理员的帐号是:woodcoal
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  <tr>
    <td class=td1 width="100%" height="28" background="pic/titlebg.gif">
	<span style="font-weight: 400">
	<font color="#000000">&nbsp;添加帖子数据表:</font></span></td>
  </tr>
  <tr>
    <td class=td2 width="100%" bgcolor="#F4F6FC" height="40">
	<span style="font-weight: 400"><font color="#000000">&nbsp;数据表名称:bbs </font>
	</span> <input name="table" size="5"><span style="font-weight: 400"><font color="#000000"> 
    (只填数字)
    </font></span>
    <input type="submit" value="   确  认  添  加   " name="B1"></td>
  </tr>
</table></form>
<%case"updatetable"
usedtable=application(prefix&"usedtable")
using=checknum(request.form("using"))
usetable=using&"-"&usedtable
conn.execute("update config set usetable='"&usetable&"'")
call send("设定默认表成功。")
application(prefix&"autotable")=using
%>
<%case"addtable"
canadd=true
table=checknum(request.form("table"))
usedtable=application(prefix&"usedtable")
usedtable1=split(usedtable,"|")
for i=1 to ubound(usedtable1)
if table=int(usedtable1(i)) then
canadd=false
call send("·该表名已经被使用了<br>·<a href='javascript:history.go(-1)'><font color=#ffffff>返回重新填写</font></a>")
exit for
end if
next
if canadd=true then
sql="create table bbs"&table&" (bbsid int IDENTITY (1, 1) NOT NULL CONSTRAINT PrimaryKey PRIMARY KEY,id int default 0,bid int Default 0,userid int Default 0,content text,bd int Default 0,edittime datetime,type int Default 0,ip varchar(20))"
conn.execute(sql)
conn.execute("create index id on bbs"&table&" (id)")
conn.execute("create index bid on bbs"&table&" (bid)")
conn.execute("create index userid on bbs"&table&" (userid)")
conn.execute("create index bd on bbs"&table&" (bd)")
tablestr="|"&table
conn.execute("update config set usetable=usetable&'"&tablestr&"'")
application(prefix&"usedtable")=usedtable&tablestr
call send("已经成功添加帖子数据表 bbs"&table&" 。")
end if
%>
<%case"deltable"
totable=checknum(request.querystring("totable"))
autotable=checknum(application(prefix&"autotable"))
if totable=autotable then
call send("该表是默认使用的表,不能删除。")
else
conn.execute("delete*from Topic where totable="&totable&"")
conn.execute("drop table [bbs"&totable&"]")
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
if int(usedtable(i))<>totable then
tablestr=tablestr&"|"&usedtable(i)
end if
next
application(prefix&"usedtable")=tablestr
tablestr=autotable&"-"&tablestr
conn.execute("update config set usetable='"&tablestr&"'")
call send("已经成功的删除帖子数据表 bbs"&totable&" 。")
end if
%>
<%case"recycle"
dim str1,str2,topictype,pagesetup,count,totalpage,color,pagecount,value,ii,iii
topictype=checknum(request.querystring("topictype"))
totable=checknum(request.querystring("totable"))
if totable="" then totable=checknum(application(prefix&"autotable"))
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
color="#0466CC"
str1="<font color=#0466CC>话题</font>"
str2="<font color=#0466CC>回帖</font>"

if int(usedtable(i))=totable then
color="red"
if topictype=1 or topictype="" then
str1="<font color=red>话题</font>"
elseif topictype=2 then
str2="<font color=red>回帖</font>"
end if
end if

tablestr=tablestr&"·<a href=?action=recycle&totable="&usedtable(i)&"><b><font color="&color&">数据表 "&usedtable(i)&"</font></b></a> [<a href=?action=recycle&totable="&usedtable(i)&"&topictype=1>"&str1&"</a>][<a href=?action=recycle&totable="&usedtable(i)&"&topictype=2>"&str2&"</a>] "
next
response.write"<script language='javascript'>function Check(){var Name=document.form.topage.value;document.location='?action=recycle&topage='+Name+'&totable="&totable&"';}</script>"
%><SCRIPT language=JavaScript>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</SCRIPT><SCRIPT src="inc/menu.js"></SCRIPT>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#F4F6FC" bordercolor="#cad6eb" height="32">
  <tr>
    <td width="100%">&nbsp; <%=tablestr%></td>
  </tr>
</table>
<br>
<form method="POST" action="adminright3.asp?action=delbbsgg&totable=<%=totable%>&topictype=<%=topictype%>">
<table class=td1 border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#F4F6FC" height="28" bordercolor="#cad6eb">
  <tr>
    <td width="5%" align="center"><span style="font-weight: 400">
	<font color="#000000">选择</font></span></td>
    <td width="55%" align="center"><span style="font-weight: 400">
	<font color="#000000">主题</font></span></td>
    <td width="15%" align="center"><span style="font-weight: 400">
	<font color="#000000">作者</font></span></td>
    <td width="25%" align="center"><span style="font-weight: 400">
	<font color="#000000">发表时间</font></span></td>
  </tr>
</table>
<%
if topictype=1 or topictype="" then
sql="select * from bbs"&totable&" where type=3 and bid=0"
elseif topictype=2 then
sql="select * from bbs"&totable&" where type=3 and bid<>0"
end if
set rs = server.createobject("adodb.recordset")
pagesetup=checknum(application(prefix&"topiclistpage"))
rs.Open sql,conn,1
TotalPage=0
Count=rs.recordcount
if not rs.eof then
If Count/pagesetup > (Count\pagesetup) then
TotalPage=(Count\pagesetup)+1
else TotalPage=(Count\pagesetup)
End If
pagecount= 0
rs.moveFirst
if Request.QueryString("ToPage")<>"" and isnumeric(Request.QueryString("ToPage")) then PageCount = cint(Request.QueryString("ToPage"))
if PageCount <=0 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
rs.move (PageCount-1) * pagesetup
i=1
do while not rs.eof
content=rs("content")
content=split(content,"|")
if topictype=1 or topictype="" then
value=rs("id")
elseif topictype=2 then
value=rs("bbsid")
end if
%>
<table border="0" cellpadding="0" cellspacing="0" style='border-collapse: collapse; border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1' width="100%" height="28">
  <tr>
    <td width="5%" align="center">
    <input type="checkbox" name="delbbsid" value="<%=value%>"></td>
    <td width="55%">&nbsp; <a href=# onclick=openscript('paper.asp?action=showdelbbs&bd=<%=rs("bd")%>&bbsid=<%=rs("bbsid")%>&totable=<%=totable%>')><%=lefttrue(kbbs(content(4)),40)%></a></td>
    <td width="15%" align="center"><%=kbbs(content(2))%></td>
    <td width="25%" align="center"><%=kbbs(content(5))%></td>
  </tr>
</table>
<%
i=i+1
if i>pagesetup then exit do
rs.movenext
loop
end if
rs.Close
set rs=nothing%>

<table class=td1 border="1" bordercolor="#cad6eb" cellpadding="0" cellspacing="0" style='border-collapse: collapse; ' width="100%" height="32" bgcolor="#F4F6FC">
  <tr>
    <td width="100%" bgcolor="#F4F6FC">
    &nbsp;<input onclick=CheckAll(this.form) type="checkbox"  name=chkall value="ON"><span style="font-weight: 400"><font color="#000000">全 选</font></span><font color="#346AE4">&nbsp;&nbsp;&nbsp;
	</font>
<INPUT type=submit value=" 删除所选 " name=action onclick="{if(confirm('确定删除你所选择的帖子吗?')){return true;}return false;}"> <INPUT type=submit value=" 还原所选 " name=action onclick="{if(confirm('确定还原你所选择的帖子吗?')){return true;}return false;}"></td>
  </tr>
</table>
</form>
<%
response.write"<TABLE bgcolor=#F4F6FC cellSpacing=0 cellPadding=0 width='100%' border=1 style='border-collapse:collapse;' bordercolor=#cad6eb><TBODY><TR height=25><TD height=2><TABLE cellSpacing=0 cellPadding=3 width='100%' border=0 style='border-collapse: collapse; border-left-width:0; border-top-width:0; border-bottom-width:0'><TBODY><TR><TD><b><font color='#000000'><img border='0' src='../pic/fl.gif'> 本回收站共有</font><font color='red'> "&TotalPage&" </font><font color='#000000'>页,<font color='red'> "&count&" </font>张帖子,每页有<font color='red'> "&pagesetup&" </font> 张帖子 >> ["
ii=PageCount-5
iii=PageCount+5
if ii < 1 then
ii=1
end if
if iii > TotalPage then
iii=TotalPage
end if
if PageCount > 6 then
Response.Write " <a href=?topage=1&bd="&bd&"&totable="&totable&"&action=recycle><font color=yellow>1</font></a> ... "
end if
for i=ii to iii
If i<>PageCount then
Response.Write " <a href=?topage="& i &"&bd="&bd&"&totable="&totable&"&action=recycle><font color=yellow>" & i & "</font></a> "
else
Response.Write " <font color=red><b>"&i&"</b></font> "
end if
next
if TotalPage > PageCount+5 then
Response.Write " ... <a href=?topage="&TotalPage&"&bd="&bd&"&totable="&totable&"&action=recycle><font color=yellow>"&TotalPage&"</font></a>"
end if
response.write" ]</font></b></TD><form name=form method='POST' action=javascript:Check()><TD height=2 align='right'><font color='#FFFFFF'>页码:<input style=FONT-SIZE:9pt maxLength='6' size='6' name='topage' value='"&PageCount&"'><input style=FONT-SIZE:9pt value='GO!' type='submit'></font></TD></form></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>"
%>

<%case"delbbsgg"
dim delidsql,delbidsql,delbbsid,baction,sql1,sql2
topictype=checknum(request.querystring("topictype"))
totable=checknum(request.querystring("totable"))
if totable="" then totable=checknum(application(prefix&"autotable"))

delbbsid=replace(","&request.form("delbbsid"),"'","")
delbbsid=split(delbbsid,",")

baction=replace(request.form("action"),"'","")

'============================================================================================
if baction=" 删除所选 " then

''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=1 or topictype="" then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"id="&delbbsid(i)&" or "
delbidsql=delbidsql&"bid="&delbbsid(i)&" or "
next
delidsql=delidsql&"id="&delbbsid(ubound(delbbsid))
delbidsql=delbidsql&"bid="&delbbsid(ubound(delbbsid))
if delidsql="id=" then delidsql="id=-1"
if delbidsql="bid=" then delbidsql="bid=-1"

sql1="delete*from topic where type=3 and ("&delidsql&")"
sql2="delete*from bbs"&totable&" where (type=3 and ("&delidsql&")) or ("&delbidsql&")"
conn.execute(sql1)
conn.execute(sql2)
end if
'''''''''''''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''''''''''''
if topictype=2 then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"bbsid="&delbbsid(i)&" or "
next
delidsql=delidsql&"bbsid="&delbbsid(ubound(delbbsid))
if delidsql="bbsid=" then delidsql="bbsid=-1"

sql1="delete*from bbs"&totable&" where type=3 and ("&delidsql&")"
conn.execute(sql1)
end if
''''''''''''''''''''''''''''''''''''
response.redirect "adminright3.asp?action=recycle&topictype="&topictype&""
end if
'=================================================================================================

'=================================================================================================

if baction=" 还原所选 " then
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=1 or topictype="" then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"id="&delbbsid(i)&" or "
next
delidsql=delidsql&"id="&delbbsid(ubound(delbbsid))
if delidsql="id=" then delidsql="id=-1"

sql1="update topic set type=0 where ("&delidsql&")"
sql2="update bbs"&totable&" set type=0 where ("&delidsql&")"
conn.execute(sql1)
conn.execute(sql2)
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=2 then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"bbsid="&delbbsid(i)&" or "
next
delidsql=delidsql&"bbsid="&delbbsid(ubound(delbbsid))
if delidsql="bbsid=" then delidsql="bbsid=-1"
sql1="update bbs"&totable&" set type=0 where ("&delidsql&")"
conn.execute(sql1)
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
response.redirect "adminright3.asp?action=recycle&topictype="&topictype&""

end if
'===========================

%>
<%end select
%></td>
  </tr>
</table>
</div>
<%call admindown%>

⌨️ 快捷键说明

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