📄 update.asp
字号:
oldMinArticle=0
Set Rss=Dvbbs.Execute("Select UserID From [Dv_User] Where UserID>="&Request.Form("beginid"))
If Rss.Eof And Rss.Bof Then
body="<tr><td colspan=2 class=td1>已经到记录的最尾端,请结束更新!</td></tr>"
Exit Sub
End If
Rss.Close
SQL = "Select UserGroupID From Dv_UserGroups Where Not ParentGID In (0,3)"
Set Rss = Dvbbs.Execute(SQL)
SQL = Rss.GetString(,, "", ",", "")
Rss.close
Set Rss = Nothing
SQL = SQL & "1"
Set Rs=Dvbbs.Execute("Select * From Dv_UserGroups Where ParentGID=3 Order By MinArticle Desc")
Do While Not Rs.Eof
Dvbbs.Execute("Update [Dv_User] Set UserClass='"&Rs("UserTitle")&"',TitlePic='"&Rs("GroupPic")&"',UserGroupID="&Rs("UserGroupID")&" Where (Not UserGroupID In ("&SQL&")) And (UserID>="&Request.Form("beginid")&" And UserID<="&Request.Form("endid")&") And (UserPost<"&oldMinArticle&" And UserPost>="&Rs("MinArticle")&" )")
oldMinArticle=Rs("MinArticle")
Rs.MoveNext
Loop
Rs.Close
Set Rs=Nothing
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr>
<th style="text-align:center;" colspan=2>继续更新用户数据</th>
</tr>
<tr>
<td width="20%" class="td1" valign=top>更新用户等级</td>
<td width="80%" class="td1">执行本操作将按照<font color=red>当前论坛数据库</font>用户发贴数量和论坛的等级设置重新计算用户等级,本操作不影响等级为贵宾、版主、总版主的数据。</td>
</tr>
<tr>
<td width="20%" class="td1">开始用户ID</td>
<td width="80%" class="td1"><input type=text name="beginID" value="<%=request.form("endid")+1%>" size=10> 用户ID,可以填写您想从哪一个ID号开始进行修复</td>
</tr>
<tr>
<td width="20%" class="td1">结束用户ID</td>
<td width="80%" class="td1"><input type=text name="endID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" size=10> 将更新开始到结束ID之间的用户数据,之间的数值最好不要选择过大</td>
</tr>
<tr>
<td width="20%" class="td1"> </td>
<td width="80%" class="td1"><input type="submit" class="button" name="Submit" value="更新用户等级"></td>
</tr>
</form>
<%
end sub
'用户所有主题数
function UserTopicNum(userid)
dim topicnum
topicnum=0
usertopicnum=0
set tmprs=Dvbbs.Execute("select count(*) from dv_topic where not boardid in (444,777) and PostUserID="&userid)
TopicNum=tmprs(0)
if isnull(TopicNum) then TopicNum=0
UserTopicNum=UserTopicNum + TopicNum
set tmprs=nothing
end function
'用户所有回复数
Function UserReplyNum(userid)
dim replynum,i
replynum=0
userreplynum=0
For i=0 to ubound(AllPostTable)
set tmprs=Dvbbs.Execute("select count(announceid) from "&AllPostTable(i)&" where not boardid in (444,777) and ParentID>0 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,i
allnum=0
userallnum=0
For i=0 to ubound(AllPostTable)
set tmprs=Dvbbs.Execute("select count(announceid) from "&AllPostTable(i)&" where not boardid in (444,777) and PostUserID="&userid)
allnum=tmprs(0)
if isnull(allnum) then allnum=0
userallnum=userallnum+allnum
Next
Set tmprs=nothing
End function
function UserallTopicnum(userid)
dim allnum,i
allnum=0
UserallTopicnum=0
For i=0 to ubound(AllPostTable)
set tmprs=Dvbbs.Execute("select count(*) from Dv_Topic where not boardid in (444,777) and PostUserID="&userid)
allnum=tmprs(0)
if isnull(allnum) then allnum=0
UserallTopicnum=UserallTopicnum+allnum
Next
Set tmprs=nothing
End function
Sub fixbbs()
Dim killhtml,updatedate
updatedate=Request("updatedate")
killhtml=Request("killhtml")
If Not IsNumeric(request.form("beginid")) Then
body="<tr><td colspan=2 class=td1>错误的开始参数!</td></tr>"
Exit Sub
End If
If Not IsNumeric(request.form("endid")) Then
body="<tr><td colspan=2 class=td1>错误的结束参数!</td></tr>"
Exit Sub
End If
If CLng(request.form("beginid"))>clng(request.form("endid")) Then
body="<tr><td colspan=2 class=td1>开始ID应该比结束ID小!</td></tr>"
Exit Sub
End If
Dim C1, D1
C1 = clng(request.form("endid"))-clng(request.form("beginid"))
D1 = Clng(Request.Form("beginid"))
%>
</table>
<BR>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr><td colspan=2 class=td1>
下面开始更新论坛帖子资料,预计本次共有<%=C1%>个帖子需要更新
<table width="400" border="0" cellspacing="1" cellpadding="1">
<tr>
<td bgcolor=#000000>
<table width="400" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor=#ffffff height=9><img src="../skins/default/bar/bar3.gif" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>
</td></tr></table>
<span id=txt3 name=txt3 style="font-size:9pt;color:red;"></span>
<span id=txt2 name=txt2 style="font-size:9pt">0</span><span style="font-size:9pt">%</span></td></tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<%
Response.Flush
Dim TotalUseTable,Ers,SQL1
Dim vBody,isagree,re
Dim Maxid,Rs,Sql,i
Set Rs=Dvbbs.Execute("select Max(topicid) from dv_topic")
Maxid=Rs(0)
Set Rs=Nothing
If Maxid< CLng(request.form("beginid")) Then
body="<tr><td colspan=2 class=td1>已经到记录的最尾端,请结束更新!</td></tr>"
set rs=nothing
Exit Sub
End If
Sql = "SELECT Topicid, PostTable FROM Dv_Topic WHERE Topicid >= " & CLng(Request.Form("beginid")) & " AND Topicid <= " & CLng(Request.Form("endid")) & " ORDER BY TopicID"
Set Rs=Dvbbs.Execute(sql)
Set ERs=server.createobject("adodb.recordset")
Do While Not rs.eof
SQl1 ="select Body,isagree,Ubblist,topic,DateAndTime,Announceid from "&Rs(1)&" where Rootid="&CLng(Rs(0))&""
Ers.open SQL1,Conn,1,3
If Not(eRs.eof OR ers.BOF) Then
Do While Not ers.eof
vbody=eRs(0)
isagree=eRs(1)
If IsNull(isagree) Then isagree=""
If isagree <>"" Then
isagree=Replace(isagree,"[isubb]","")
Else
isagree=ers(1)
End If
If killhtml="1" Then
eRs(0)=vbody
End If
ers(1)= isagree&""
If IsDate(updatedate) And IsDate(ers(4)) Then
If updatedate > ers(4) Then
ers(2)=Ubblist(vbody)
Else
If killhtml="1" Then
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="<br>"
vbody=re.Replace(vbody,"[br]")
re.Pattern="<(.[^>]*)>"
vbody=re.Replace(vbody,"")
Set re=Nothing
End If
ers(2)=UbblistOLD(vbody)
End If
Else
ers(2)=UbblistOLD(vbody)
End If
ers.update
Response.Write "<script>txt3.innerHTML=""更新完编号为"&eRs(5)&"的帖子数据,"";</script>"
Response.Flush
eRs.movenext
Loop
End If
ERs.close
i = CLng(Rs(0)) - D1 + 1 '修正i为相对位置值 2005-12-3 Dv.Yz
'If (i mod 100) = 0 Then
Response.Write "<script>img2.width=" & Fix((i/C1) * 400) & ";" & VbCrLf
Response.Write "txt2.innerHTML=""更新完编号为"&Rs(0)&"的数据,正在更新下一个帖子数据," & FormatNumber(i/C1*100,4,-1) & """;" & VbCrLf
Response.Write "img2.title=""" & Rs(0) & "(" & i & ")"";</script>" & VbCrLf
Response.Flush
'End If
Rs.movenext
Loop
Set ers=nothing
set rs=nothing
Response.Write "<script>img2.width=400;txt3.innerHTML='';txt2.innerHTML=""100"";</script>"
%>
<form name=Fix action="update.asp?action=fix" method=post>
<tr>
<th style="text-align:center;" colspan=2>继续修复帖子(修复指定范围贴子UBB标签)</th>
</tr>
<tr>
<td width="20%" class="td1">开始的ID号</td>
<td width="80%" class="td1"><input type=text name="beginID" value="<%=request.form("endid")+1%>" size=5> 帖子主题ID,可以填写您想从哪一个ID号开始进行修复</td>
</tr>
<tr>
<td width="20%" class="td1">结束的ID号</td>
<td width="80%" class="td1"><input type=text name="EndID" value="<%=request.form("endid")+(request.form("endid")-request.form("beginid"))+1%>" size=5> 将更新开始到结束ID之间的帖子数据,之间的数值最好不要选择过大</td>
</tr>
<tr>
<td width="20%" class="td1">新老贴的标识日期</td>
<td width="80%" class="td1"><input type="text" name="updatedate" value="<%=updatedate%>">(格式:YYYY-M-D) 就是论坛升级到v7.0的日期,如果不填写,一律按老贴处理</td>
</tr>
<tr>
<td width="20%" class="td1">去掉贴子中的HTML标记</td>
<td width="80%" class="td1"><input type="radio" class="radio" name="killhtml" value="1"
<%
If killhtml="1" Then
%>
checked
<%
End If
%>
> 是
<input type="radio" class="radio" name="killhtml" value="0"
<%
If killhtml="0" Then
%>
checked
<%
End If
%>
> 否 <br>选是的话,贴子中的HTML标记将会自动被清除,有利于减少数据库的大小,但是会失去原来的HTML效果。</td>
</tr>
<tr>
<td width="20%" class="td1"> </td>
<td width="80%" class="td1"><input type="submit" class="button" name="Submit" value="修 正"></td>
</tr>
</form>
<%
End Sub
'清空在线用户 2004-10-11 Dv.Yz
Sub Delallonline()
Sql = "DELETE FROM Dv_Online"
Dvbbs.Execute(Sql)
Body = "<tr><td colspan=2 class=td1>清空在线用户数据成功,请 <a href=""ReloadForumCache.asp""><font color=""red"">更新服务器缓存</font> </a>。"
End Sub
'更新论坛收藏夹 2005-11-30 Dv.Yz
Sub Updatebm()
Dim bi,Rs,Sql
Set Rs = Dvbbs.Execute("SELECT Id, Url, UserName FROM Dv_BookMark ORDER BY Id")
If Not (Rs.Eof And Rs.Bof) Then
Sql = Rs.GetRows(-1)
Set Rs = Nothing
Dim Url, RootID, BoardID, Topic
Dim C1
C1 = Ubound(Sql,2) + 1
%>
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr><td colspan=2 class=td1>
下面开始更新收藏夹资料,预计本次共有<%=C1%>个收藏主题需要更新
<table width="400" border="0" cellspacing="1" cellpadding="1">
<tr>
<td bgcolor=#000000>
<table width="400" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor=#ffffff height=9><img src="../skins/default/bar/bar3.gif" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>
</td></tr></table>
<span id=txt3 name=txt3 style="font-size:9pt;color:red;"></span>
<span id=txt2 name=txt2 style="font-size:9pt">0</span><span style="font-size:9pt">%</span></td></tr>
</table>
<%
For bi = 0 To Ubound(Sql,2)
Set Rs = Dvbbs.Execute("SELECT UserName From Dv_User WHERE UserName = '" & Sql(2,bi) & "'")
If Rs.Eof And Rs.Bof Then
Dvbbs.Execute("DELETE FROM Dv_BookMark WHERE Id = " & Sql(0,bi))
Response.Write "<script>txt3.innerHTML=""删除完编号为" & Sql(0,bi) & "的收藏夹数据,"";</script>"
Response.Flush
Else
Set Rs = Nothing
RootID = Split(Split(Sql(1,bi),"&")(1),"=")(1)
If Isnumeric(RootID) Then
RootID = Clng(Rootid)
Else
RootID = 0
End If
Set Rs = Dvbbs.Execute("SELECT BoardID, TopicID, Title FROM Dv_Topic WHERE NOT BoardID IN (444,777) AND TopicID = " & RootID)
If Rs.Eof And Rs.Bof Then
Dvbbs.Execute("DELETE FROM Dv_BookMark WHERE Id = " & Sql(0,bi))
Response.Write "<script>txt3.innerHTML=""删除完编号为" & Sql(0,bi) & "的收藏夹数据,"";</script>"
Response.Flush
Else
Boardid = Rs(0)
RootID = Rs(1)
Topic = Rs(2)
Topic = Left(Dvbbs.checkStr(trim(topic)),100)
Url = "dispbbs.asp?boardid=" & Boardid & "&id=" & RootID
Dvbbs.Execute("UPDATE Dv_BookMark SET Url = '" & Url & "', Topic = '" & Topic & "' WHERE Id = " & Sql(0,bi))
Response.Write "<script>txt3.innerHTML=""更新完编号为" & Sql(0,bi) & "的收藏夹数据,"";</script>"
Response.Flush
End If
End If
Response.Write "<script>img2.width=" & Fix((bi/C1) * 400) & ";" & VbCrLf
Response.Write "txt2.innerHTML=""更新完编号为" & Sql(0,bi) & "的数据,正在更新下一个收藏夹数据," & FormatNumber(bi/C1*100,4,-1) & """;" & VbCrLf
Response.Write "img2.title=""" & Sql(2,bi) & "(" & bi & ")"";</script>" & VbCrLf
Response.Flush
Next
End If
Response.Write "<script>img2.width=400;txt3.innerHTML='更新完成!<a href=" & Request.ServerVariables("HTTP_REFERER") & "><<返回上一页</a>';txt2.innerHTML=""100"";</script>"
End Sub
Function cutStr(str,strlen)
Str=Dvbbs.Replacehtml(Str)
Dim l,t,c,i
l=Len(str)
t=0
For i=1 to l
c=Abs(Asc(Mid(str,i,1)))
If c>255 Then
t=t+2
Else
t=t+1
End If
If t>=strlen Then
cutStr=left(str,i)&"..."
Exit For
Else
cutStr=str
End If
Next
cutStr=Replace(cutStr,chr(10),"")
cutStr=Replace(cutStr,chr(13),"")
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -