?? admin_update.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<title><%=Forum_info(0)%>--管理頁面</title>
<link rel="stylesheet" href="forum_admin.css" type="text/css">
<meta NAME=GENERATOR Content="Microsoft FrontPage 3.0" CHARSET=GB2312>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
<%
Server.ScriptTimeout=9999999
dim admin_flag
admin_flag="14,28"
if not master or instr(session("flag"),"14")=0 or instr(session("flag"),"28")=0 then
Errmsg=Errmsg+"<br>"+"<li>本頁面為管理員專用,請<a href=admin_index.asp target=_top>登陸</a>后進入。<br><li>您沒有管理本頁面的權(quán)限。"
call dvbbs_error()
else
dim tmprs
dim body
call main()
conn.close
set conn=nothing
end if
sub main()
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<tr>
<th align=left colspan=2 height=23>論壇數(shù)據(jù)處理</th>
</tr>
<tr>
<td width="20%" class="forumrow">注意事項</td>
<td width="80%" class="forumrow">下面有的操作可能將非常消耗服務器資源,而且更新時間很長,請仔細確認每一步操作后執(zhí)行。</td>
</tr>
<%
if request("action")="updat" then
if request("submit")="更新論壇數(shù)據(jù)" then
call updateboard()
elseif request("submit")="修 復" then
call fixtopic()
else
call updateall()
end if
if founderr then
response.write errmsg
else
response.write body
end if
elseif request("action")="delboard" then
if isnumeric(request("boardid")) then
conn.execute("update topic set locktopic=2 where boardid="&request("boardid"))
for i=0 to ubound(AllPostTable)
conn.execute("update "&AllPostTable(i)&" set locktopic=2 where boardid="&request("boardid"))
next
end if
response.write "<tr><td align=left colspan=2 height=23 class=forumrow>清空論壇數(shù)據(jù)成功,請返回更新帖子數(shù)據(jù)!</td></tr>"
elseif request("action")="updateuser" then
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<th align=left colspan=2 height=23>更新用戶數(shù)據(jù)</th>
</tr>
<tr>
<td width="20%" class="forumrow">重新計算用戶發(fā)貼</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當前論壇數(shù)據(jù)庫</font>發(fā)貼重新計算所有用戶發(fā)表帖子數(shù)量。</td>
</tr>
<tr>
<td width="20%" class="forumrow">開始用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="1" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進行修復</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="100" size=10> 將更新開始到結(jié)束ID之間的用戶數(shù)據(jù),之間的數(shù)值最好不要選擇過大</td>
</tr>
<tr>
<td width="20%" class="forumrow"></td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="重新計算用戶發(fā)貼"></td>
</tr>
</form>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<td width="20%" class="forumrow" valign=top>更新用戶等級</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當前論壇數(shù)據(jù)庫</font>用戶發(fā)貼數(shù)量和論壇的等級設置重新計算用戶等級,本操作不影響等級為貴賓、版主、總版主的數(shù)據(jù)。</td>
</tr>
<tr>
<td width="20%" class="forumrow">開始用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="1" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進行修復</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="100" size=10> 將更新開始到結(jié)束ID之間的用戶數(shù)據(jù),之間的數(shù)值最好不要選擇過大</td>
</tr>
<tr>
<td width="20%" class="forumrow"></td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="更新用戶等級"></td>
</tr>
</form>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<td width="20%" class="forumrow" valign=top>更新用戶金錢/經(jīng)驗/魅力</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當前論壇數(shù)據(jù)庫</font>用戶的發(fā)貼數(shù)量和論壇的相關(guān)設置重新計算用戶的金錢/經(jīng)驗/魅力,本操作也將重新計算貴賓、版主、總版主的數(shù)據(jù)<BR>注意:不推薦用戶進行本操作,本操作在數(shù)據(jù)很多的時候請盡量不要使用,并且本操作對各個版面刪除帖子等所扣相應分值不做運算,只是按照發(fā)貼和總的論壇分值設置進行運算,請大家慎重操作,<font color=red>而且本項操作將重置用戶因為獎勵、懲罰等原因管理員對用戶分值的修改。</font></td>
</tr>
<tr>
<td width="20%" class="forumrow">開始用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="1" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進行修復</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="100" size=10> 將更新開始到結(jié)束ID之間的用戶數(shù)據(jù),之間的數(shù)值最好不要選擇過大</td>
</tr>
<tr>
<td width="20%" class="forumrow"></td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="更新用戶金錢/經(jīng)驗/魅力"></td>
</tr>
</FORM>
<%
elseif request("action")="updateuserinfo" then
if request("submit")="重新計算用戶發(fā)貼" then
call updateTopic()
elseif request("submit")="更新用戶等級" then
call updategrade()
else
call updatemoney()
end if
if founderr then
response.write errmsg
else
response.write body
end if
else
%>
<tr>
<th align=left colspan=2 height=23>更新論壇數(shù)據(jù)</th>
</tr>
<form action="admin_update.asp?action=updat" method=post>
<tr>
<td width="20%" class="forumrow">更新分論壇數(shù)據(jù)</td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="更新論壇數(shù)據(jù)"><BR><BR>這里將重新計算每個論壇的帖子主題和回復數(shù),今日帖子,最后回復信息等,建議每隔一段時間運行一次。</td>
</tr>
<tr>
<td width="20%" class="forumrow">更新總論壇數(shù)據(jù)</td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="更新論壇總數(shù)據(jù)"><BR><BR>這里將重新計算整個論壇的帖子主題和回復數(shù),今日帖子,最后加入用戶等,建議每隔一段時間運行一次。</td>
</tr>
<tr>
<th align=left colspan=2 height=23>修復帖子(修復指定范圍內(nèi)帖子的最后回復數(shù)據(jù))</th>
</tr>
<tr>
<td width="20%" class="forumrow">開始的ID號</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="1" size=10> 帖子主題ID,可以填寫您想從哪一個ID號開始進行修復</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束的ID號</td>
<td width="80%" class="forumrow"><input type=text name="EndID" value="1000" size=10> 將更新開始到結(jié)束ID之間的帖子數(shù)據(jù),之間的數(shù)值最好不要選擇過大</td>
</tr>
<tr>
<td width="20%" class="forumrow"></td>
<td width="80%" class="forumrow"><input type="submit" name="Submit" value="修 復"></td>
</tr>
</form>
<%
end if
%>
</table><BR><BR>
<%
end sub
sub updateboard()
'先按照所有版面ID得出帖子數(shù),然后計算各個有下屬論壇的帖子總和
dim allarticle
dim alltopic
dim alltoday
dim allboard
dim trs,Esql,ars
dim Maxid
dim LastTopic,LastRootid,LastPostTime,LastPostUser
dim LastPost,uploadpic_n,Lastpostuserid,Lastid
dim ParentStr
set rs=server.createobject("adodb.recordset")
if isnumeric(request("boardid")) and request("boardid")<>"" then
sql="select boardid,boardtype from board where boardid="&request("boardid")
else
sql="select boardid,boardtype from board"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
Errmsg=Errmsg+"<tr><td align=left colspan=2 height=23 class=forumrow>還沒有論壇版面,請到論壇管理添加!</td></tr>"
founderr=true
exit sub
else
do while not rs.eof
allarticle=BoardAnnounceNum(rs("BoardID"))
alltopic=BoardTopicNum(rs("BoardID"))
sql="select top 1 T.title,b.Announceid,b.dateandtime,b.username,b.postuserid,b.rootid from "&NowUseBBS&" b inner join Topic T on b.rootid=T.TopicID where b.boardid="&rs("boardid")&" and b.locktopic<2 order by b.Announceid desc"
set trs=conn.execute(sql)
if not(trs.eof and trs.bof) then
Lasttopic=replace(left(trs(0),15),"$","")
LastRootid=trs(1)
LastPostTime=trs(2)
LastPostUser=trs(3)
LastPostUserid=trs(4)
Lastid=trs(5)
else
LastTopic="無"
LastRootid=0
LastPostTime=now()
LastPostUser="無"
LastPostUserid=0
Lastid=0
end if
trs.close
set trs=nothing
LastPost=LastPostUser & "$" & LastRootid & "$" & LastPostTime & "$" & LastTopic & "$" & uploadpic_n & "$" & LastPostUserID & "$" & LastID & "$" & rs("BoardID")
Esql="update board set lastbbsnum="&allarticle&",lasttopicnum="&alltopic&",TodayNum="&todays(rs("boardid"))&",LastPost='"&replace(LastPost,"'","")&"' where boardid="&rs("boardid")
conn.execute(Esql)
rs.movenext
loop
'更新有下屬論壇的版面數(shù)據(jù)
dim LastPostinfo,LastAnnID
LastAnnID=0
if isnumeric(request("boardid")) and request("boardid")<>"" then
set trs=conn.execute("select boardid,ParentStr from board where boardid="&request("boardid")&" and child>0")
else
set trs=conn.execute("select boardid,ParentStr from board where child>0")
end if
do while not trs.eof
if trs(1)="0" then
'ParentStr=trs(0) & ","
ParentStr=trs(0)
else
ParentStr=trs(1) & "," & trs(0)
end if
'帖子總數(shù),主題總數(shù),今日貼總數(shù),下屬版面數(shù)
set ars=conn.execute("select sum(lastbbsnum),sum(lasttopicnum),sum(todaynum),count(*) from board where ParentStr like '%"&ParentStr&"%'")
allarticle=ars(0)
alltopic=ars(1)
alltoday=ars(2)
allboard=ars(3)
if isnull(allarticle) then allarticle=0
if isnull(alltopic) then alltopic=0
if isnull(alltoday) then alltoday=0
if isnull(allboard) then allboard=0
set ars=conn.execute("select LastPost from board where ParentStr like '%"&ParentStr&"%'")
do while not ars.eof
LastPostinfo=split(ars(0),"$")
if isnumeric(LastPostInfo(1)) and isnumeric(LastAnnID) then
if clng(LastPostInfo(1))>clng(LastAnnID) then
LastPost=ars(0)
else
LastPost="$0$"&Now()&"$$$$$"
end if
else
LastPost="$0$"&Now()&"$$$$$"
end if
LastAnnID=LastPostinfo(1)
ars.movenext
loop
conn.execute("update board set lastbbsnum=lastbbsnum+"&allarticle&",lasttopicnum=lasttopicnum+"&alltopic&",TodayNum=todaynum+"&alltoday&",child="&allboard&",LastPost='"&checkStr(LastPost)&"' where boardid="&trs(0))
'response.write AllBoard & "<br>"
trs.movenext
loop
end if
if isnumeric(request("boardid")) and request("boardid")<>"" then
sql="select boardtype,lastbbsnum,lasttopicnum,todaynum from board where boardid="&request("boardid")
else
sql="select boardtype,lastbbsnum,lasttopicnum,todaynum from board"
end if
set rs=conn.execute(sql)
do while not rs.eof
body=body & "<tr><td colspan=2 class=forumrow>更新論壇數(shù)據(jù)成功,"&rs("boardtype")&"共有"&rs("lastbbsnum")&"篇貼子,"&rs("lasttopicnum")&"篇主題,今日有"&rs("todaynum")&"篇帖子。</td></tr>"
rs.movenext
loop
set rs=nothing
set trs=nothing
set ars=nothing
end sub
sub updateall()
sql="update config set TopicNum="&topicnum()&",BbsNum="&announcenum()&",TodayNum="&alltodays()&",UserNum="&allusers()&",lastUser='"&newuser()&"'"
conn.execute(sql)
body="<tr><td colspan=2 class=forumrow>更新總論壇數(shù)據(jù)成功,全部論壇共有"&announcenum()&"篇貼子,"&topicnum()&"篇主題,今日有"&alltodays()&"篇帖子,有"&allusers()&"用戶,最新加入為"&newuser()&"。</td></tr>"
end sub
sub fixtopic()
if not isnumeric(request.form("beginid")) then
body="<tr><td colspan=2 class=forumrow>錯誤的開始參數(shù)!</td></tr>"
exit sub
end if
if not isnumeric(request.form("endid")) then
body="<tr><td colspan=2 class=forumrow>錯誤的結(jié)束參數(shù)!</td></tr>"
exit sub
end if
if clng(request.form("beginid"))>clng(request.form("endid")) then
body="<tr><td colspan=2 class=forumrow>開始ID應該比結(jié)束ID小!</td></tr>"
exit sub
end if
dim TotalUseTable,Ers
dim username,dateandtime,rootid,announceid,postuserid,lastpost,topic
set rs=server.createobject("adodb.recordset")
sql="select topicid,PostTable from topic where topicid>="&request.form("beginid")&" and topicid<="&request.form("endid")
set rs=conn.execute(sql)
if rs.eof and rs.bof then
body="<tr><td colspan=2 class=forumrow>已經(jīng)到記錄的最尾端,請結(jié)束更新!</td></tr>"
exit sub
end if
do while not rs.eof
sql="select top 1 username,dateandtime,topic,Announceid,PostUserID,rootid,body,boardid from "&rs(1)&" where rootid="&rs(0)&" and locktopic<2 order by Announceid desc"
set ers=conn.execute(sql)
if not (ers.eof and ers.bof) then
username=Ers("username")
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -