?? admin_update.asp
字號:
dateandtime=Ers("dateandtime")
rootid=Ers("rootid")
topic=left(Ers("body"),20)
Announceid=ers("Announceid")
postuserid=ers("postuserid")
LastPost=username & "$" & Announceid & "$" & dateandtime & "$" & replace(topic,"$","") & "$$" & postuserid & "$" & rootid & "$" & ers("BoardID")
conn.execute("update topic set LastPost='"&replace(LastPost,"'","")&"' where topicid="&rs(0))
end if
rs.movenext
loop
set ers=nothing
set rs=nothing
%>
<form action="admin_update.asp?action=updat" method=post>
<tr>
<th align=left colspan=2 height=23>繼續(xù)修復(fù)帖子(修復(fù)指定范圍內(nèi)帖子的最后回復(fù)數(shù)據(jù))</th>
</tr>
<tr>
<td width="20%" class="forumrow">開始的ID號</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="<%=request.form("endid")+1%>" size=5> 帖子主題ID,可以填寫您想從哪一個ID號開始進(jìn)行修復(fù)</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束的ID號</td>
<td width="80%" class="forumrow"><input type=text name="EndID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" size=5> 將更新開始到結(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>
<%
end sub
'分論壇今日帖子
function todays(boardid)
tmprs=conn.execute("Select count(announceid) from "&NowUseBBS&" Where boardid="&boardid&" and locktopic<2 and datediff('d',dateandtime,Now())=0")
todays=tmprs(0)
set tmprs=nothing
if isnull(todays) then todays=0
end function
'全部論壇今日帖子
function alltodays()
tmprs=conn.execute("Select count(announceid) from "&NowUseBBS&" Where locktopic<2 and datediff('d',dateandtime,Now())=0")
alltodays=tmprs(0)
set tmprs=nothing
if isnull(alltodays) then alltodays=0
end function
'所有注冊用戶數(shù)量
function allusers()
tmprs=conn.execute("Select count(userid) from [user]")
allusers=tmprs(0)
set tmprs=nothing
if isnull(allusers) then allusers=0
end function
'最新注冊用戶
function newuser()
sql="Select top 1 username from [user] order by userid desc"
set tmprs=conn.execute(sql)
if tmprs.eof and tmprs.bof then
newuser="沒有會員"
else
newuser=tmprs("username")
end if
set tmprs=nothing
end function
'所有論壇帖子
function AnnounceNum()
dim AnnNum
AnnNum=0
AnnounceNum=0
For i=0 to ubound(AllPostTable)
tmprs=conn.execute("Select Count(announceID) from "&AllPostTable(i)&" where locktopic<2")
AnnNum=tmprs(0)
set tmprs=nothing
if isnull(AnnNum) then AnnNum=0
AnnounceNum=AnnounceNum + AnnNum
next
set tmprs=nothing
end function
'分論壇帖子
function BoardAnnounceNum(boardid)
dim BoardAnnNum
BoardAnnNum=0
BoardAnnounceNum=0
For i=0 to ubound(AllPostTable)
tmprs=conn.execute("Select Count(announceID) from "&AllPostTable(i)&" where boardid="&boardid&" and locktopic<2")
BoardAnnNum=tmprs(0)
set tmprs=nothing
if isnull(BoardAnnNum) then BoardAnnNum=0
BoardAnnounceNum=BoardAnnounceNum + BoardAnnNum
next
set tmprs=nothing
end function
'所有論壇主題
function TopicNum()
tmprs=conn.execute("Select Count(topicid) from topic where locktopic<2")
TopicNum=tmprs(0)
set tmprs=nothing
if isnull(TopicNum) then TopicNum=0
end function
'分論壇主題
function BoardTopicNum(boardid)
tmprs=conn.execute("Select Count(topicid) from topic where boardid="&boardid&" and locktopic<2")
BoardTopicNum=tmprs(0)
set tmprs=nothing
if isnull(BoardTopicNum) then BoardTopicNum=0
end function
'更新用戶發(fā)貼數(shù)
sub updateTopic()
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應(yīng)該比結(jié)束ID小!</td></tr>"
exit sub
end if
dim userTopic
sql="select userid from [user] where userid>="&request.form("beginid")&" and userid<="&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
userTopic=Userallnum(rs(0))
conn.execute("update [user] set article="&userTopic&" where userid="&rs(0))
rs.movenext
loop
set rs=nothing
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<th align=left colspan=2 height=23>繼續(xù)更新用戶數(shù)據(jù)</th>
</tr>
<tr>
<td width="20%" class="forumrow">重新計算用戶發(fā)貼</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當(dāng)前論壇數(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="<%=request.form("endid")+1%>" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進(jìn)行修復(fù)</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" 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>
<%
end sub
'更新用戶金錢/經(jīng)驗/魅力
sub updatemoney()
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應(yīng)該比結(jié)束ID小!</td></tr>"
exit sub
end if
dim userTopic,userReply,userWealth
dim userEP,userCP
sql="select logins,userid from [user] where userid>="&request.form("beginid")&" and userid<="&request.form("endid")
set rs=conn.execute(sql)
do while not rs.eof
userTopic=UserTopicNum(rs(1))
userreply=UserReplyNum(rs(1))
userwealth=rs(0)*Forum_user(4) + userTopic*Forum_user(1) + userreply*Forum_user(2)
userEP=rs(0)*Forum_user(9) + userTopic*Forum_user(6) + userreply*Forum_user(7)
userCP=rs(0)*Forum_user(14) + userTopic*Forum_user(11) + userreply*Forum_user(12)
if isnull(UserWealth) or not isnumeric(userwealth) then userwealth=0
if isnull(Userep) or not isnumeric(userep) then userep=0
if isnull(Usercp) or not isnumeric(usercp) then usercp=0
conn.execute("update [user] set userWealth="&userWealth&",userep="&userep&",usercp="&usercp&" where userid="&rs(1))
rs.movenext
loop
set rs=nothing
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<th align=left colspan=2 height=23>繼續(xù)更新用戶數(shù)據(jù)</th>
</tr>
<tr>
<td width="20%" class="forumrow" valign=top>更新用戶金錢/經(jīng)驗/魅力</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當(dāng)前論壇數(shù)據(jù)庫</font>用戶的發(fā)貼數(shù)量和論壇的相關(guān)設(shè)置重新計算用戶的金錢/經(jīng)驗/魅力,本操作也將重新計算貴賓、版主、總版主的數(shù)據(jù)<BR>注意:不推薦用戶進(jìn)行本操作,本操作在數(shù)據(jù)很多的時候請盡量不要使用,并且本操作對各個版面刪除帖子等所扣相應(yīng)分值不做運(yùn)算,只是按照發(fā)貼和總的論壇分值設(shè)置進(jìn)行運(yùn)算,請大家慎重操作,<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="<%=request.form("endid")+1%>" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進(jìn)行修復(fù)</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" 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>
<%
end sub
'更新用戶等級
sub updategrade()
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應(yīng)該比結(jié)束ID小!</td></tr>"
exit sub
end if
dim oldMinArticle
oldMinArticle=0
set rs=conn.execute("select * from usertitle order by MinArticle desc")
do while not rs.eof
conn.execute("update [user] set userclass='"&rs("usertitle")&"',titlepic='"&rs("titlepic")&"' where (userid>="&request.form("beginid")&" and userid<="&request.form("endid")&") and (article<"&oldMinArticle&" and article>="&rs("MinArticle")&" ) and usergroupid=4")
oldMinArticle=rs("MinArticle")
rs.movenext
loop
rs.close
set rs=nothing
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<th align=left colspan=2 height=23>繼續(xù)更新用戶數(shù)據(jù)</th>
</tr>
<tr>
<td width="20%" class="forumrow" valign=top>更新用戶等級</td>
<td width="80%" class="forumrow">執(zhí)行本操作將按照<font color=red>當(dāng)前論壇數(shù)據(jù)庫</font>用戶發(fā)貼數(shù)量和論壇的等級設(shè)置重新計算用戶等級,本操作不影響等級為貴賓、版主、總版主的數(shù)據(jù)。</td>
</tr>
<tr>
<td width="20%" class="forumrow">開始用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="beginID" value="<%=request.form("endid")+1%>" size=10> 用戶ID,可以填寫您想從哪一個ID號開始進(jìn)行修復(fù)</td>
</tr>
<tr>
<td width="20%" class="forumrow">結(jié)束用戶ID</td>
<td width="80%" class="forumrow"><input type=text name="endID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" 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 sub
'用戶所有主題數(shù)
function UserTopicNum(userid)
dim topicnum
topicnum=0
usertopicnum=0
set tmprs=conn.execute("select count(*) from topic where PostUserID="&userid&" and locktopic<2")
TopicNum=tmprs(0)
if isnull(TopicNum) then TopicNum=0
UserTopicNum=UserTopicNum + TopicNum
set tmprs=nothing
end function
'用戶所有回復(fù)數(shù)
function UserReplyNum(userid)
dim replynum
replynum=0
userreplynum=0
For i=0 to ubound(AllPostTable)
set tmprs=conn.execute("select count(announceid) from "&AllPostTable(i)&" where ParentID>0 and locktopic<2 and PostUserID="&userid)
replyNum=tmprs(0)
if isnull(replyNum) then replyNum=0
UserReplyNum=UserReplyNum + replynum
next
set tmprs=nothing
end function
'用戶所有帖子
function Userallnum(userid)
dim allnum
allnum=0
userallnum=0
For i=0 to ubound(AllPostTable)
set tmprs=conn.execute("select count(announceid) from "&AllPostTable(i)&" where locktopic<2 and PostUserID="&userid)
allnum=tmprs(0)
if isnull(allnum) then allnum=0
userallnum=userallnum+allnum
next
set tmprs=nothing
end function
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -