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

📄 admin_update.asp

📁 动网论坛源代码
💻 ASP
📖 第 1 页 / 共 3 页
字号:
'更新用户金钱/经验/魅力
sub updatemoney()
if not isnumeric(request.form("beginid")) then
	body="<tr><td colspan=2 class=forumrow>错误的开始参数!</td></tr>"
	exit sub
end if
if not isnumeric(request.form("endid")) then
	body="<tr><td colspan=2 class=forumrow>错误的结束参数!</td></tr>"
	exit sub
end if
if clng(request.form("beginid"))>clng(request.form("endid")) then
	body="<tr><td colspan=2 class=forumrow>开始ID应该比结束ID小!</td></tr>"
	exit sub
end if
dim userTopic,userReply,userWealth
dim userEP,userCP

Dim C1
C1=clng(request.form("endid"))-clng(request.form("beginid"))
%>
</table>
&nbsp;<BR>
<table cellpadding="0" cellspacing="0" border="0" width="95%" class="tableBorder" align=center>
<tr><td colspan=2 class=forumrow>
下面开始更新论坛用户资料,预计本次共有<%=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=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="95%" class="tableBorder" align=center>
<%
Response.Flush
sql="select userlogins,userid,userpost,usertopic,username from [Dv_user] where userid>="&request.form("beginid")&" and userid<="&request.form("endid")
set rs=Dvbbs.Execute(sql)
'shinzeal加入自动提示完成
if rs.eof and rs.bof then
	body="<tr><td colspan=2 class=forumrow>已经到记录的最尾端,请结束更新!</td></tr>"
	exit sub
end if
do while not rs.eof
	'userTopic=UserTopicNum(rs(1))
	'userreply=UserReplyNum(rs(1))
	userwealth=rs(0)*Dvbbs.Forum_user(4) + rs("usertopic")*Dvbbs.Forum_user(1) + (rs("userpost")-rs("usertopic"))*Dvbbs.Forum_user(2)
	userEP=rs(0)*Dvbbs.Forum_user(9) + rs("usertopic")*Dvbbs.Forum_user(6) + (rs("userpost")-rs("usertopic"))*Dvbbs.Forum_user(7)
	userCP=rs(0)*Dvbbs.Forum_user(14) + rs("usertopic")*Dvbbs.Forum_user(11) + (rs("userpost")-rs("usertopic"))*Dvbbs.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
	Dvbbs.Execute("update [Dv_user] set userWealth="&userWealth&",userep="&userep&",usercp="&usercp&" where userid="&rs(1))
	i=i+1
	'If (i mod 100) = 0 Then
		Response.Write "<script>img2.width=" & Fix((i/C1) * 400) & ";" & VbCrLf
		Response.Write "txt2.innerHTML=""更新完"&rs(4)&"的数据,正在更新下一个用户数据," & FormatNumber(i/C1*100,4,-1) & """;" & VbCrLf
		Response.Write "img2.title=""" & Rs(4) & "(" & i & ")"";</script>" & VbCrLf
		Response.Flush
	'End If
rs.movenext
loop
set rs=nothing
Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
%>
<FORM METHOD=POST ACTION="?action=updateuserinfo">
<tr> 
<th align=left colspan=2 height=23>继续更新用户数据</th>
</tr>
<tr>
<td width="20%" class="forumrow" valign=top>更新用户金钱/经验/魅力</td>
<td width="80%" class="forumrow">执行本操作将按照<font color=red>当前论坛数据库</font>用户的发贴数量和论坛的相关设置重新计算用户的金钱/经验/魅力,本操作也将重新计算贵宾、版主、总版主的数据<BR>注意:不推荐用户进行本操作,本操作在数据很多的时候请尽量不要使用,并且本操作对各个版面删除帖子等所扣相应分值不做运算,只是按照发贴和总的论坛分值设置进行运算,请大家慎重操作,<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>&nbsp;用户ID,可以填写您想从哪一个ID号开始进行修复</td>
</tr>
<tr>
<td width="20%" class="forumrow">结束用户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>&nbsp;将更新开始到结束ID之间的用户数据,之间的数值最好不要选择过大</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

'更新用户等级
sub updategrade()
if not isnumeric(request.form("beginid")) then
	body="<tr><td colspan=2 class=forumrow>错误的开始参数!</td></tr>"
	exit sub
end if
if not isnumeric(request.form("endid")) then
	body="<tr><td colspan=2 class=forumrow>错误的结束参数!</td></tr>"
	exit sub
end if
if clng(request.form("beginid"))>clng(request.form("endid")) then
	body="<tr><td colspan=2 class=forumrow>开始ID应该比结束ID小!</td></tr>"
	exit sub
end if

Dim oldMinArticle,Rss
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=forumrow>已经到记录的最尾端,请结束更新!</td></tr>"
	exit sub
end if
Rss.close

SQL = "Select usergroupid From Dv_UserGroups where ParentGID=4"
SET Rss = Conn.Execute(SQL)
	SQL = Rss.GetString(,, "", ",", "")
Rss.close
Set Rss = Nothing
SQL = SQL&"4"

set rs=Dvbbs.Execute("select * from Dv_UserGroups where ParentGID=4 order by MinArticle desc")
do while not rs.eof
	Dvbbs.Execute("update [Dv_user] set userclass='"&rs("usertitle")&"',titlepic='"&rs("grouppic")&"' where 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 align=left colspan=2 height=23>继续更新用户数据</th>
</tr>
<tr>
<td width="20%" class="forumrow" valign=top>更新用户等级</td>
<td width="80%" class="forumrow">执行本操作将按照<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>&nbsp;用户ID,可以填写您想从哪一个ID号开始进行修复</td>
</tr>
<tr>
<td width="20%" class="forumrow">结束用户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>&nbsp;将更新开始到结束ID之间的用户数据,之间的数值最好不要选择过大</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

'用户所有主题数
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
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
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
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=forumrow>错误的开始参数!</td></tr>"
	Exit Sub
End If
If Not IsNumeric(request.form("endid")) Then
	body="<tr><td colspan=2 class=forumrow>错误的结束参数!</td></tr>"
	Exit Sub
End If
If CLng(request.form("beginid"))>clng(request.form("endid")) Then
	body="<tr><td colspan=2 class=forumrow>开始ID应该比结束ID小!</td></tr>"
	Exit Sub
End If
Dim C1
C1=clng(request.form("endid"))-clng(request.form("beginid"))
%>
</table>
&nbsp;<BR>
<table cellpadding="0" cellspacing="0" border="0" width="95%" class="tableBorder" align=center>
<tr><td colspan=2 class=forumrow>
下面开始更新论坛帖子资料,预计本次共有<%=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="95%" class="tableBorder" align=center>
<%
Response.Flush
Dim TotalUseTable,Ers,SQL1
Dim vBody,isagree,re
Dim Maxid
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=forumrow>已经到记录的最尾端,请结束更新!</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"))
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=i+1
	'If (i mod 100) = 0 Then
		Response.Write "<script>img2.width=" & Fix((i/C1) * 100) & ";" & VbCrLf
		Response.Write "txt2.innerHTML=""更新完编号为"&Rs(0)&"的数据,正在更新下一个帖子数据," & FormatNumber(i/C1*25,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="admin_update.asp?action=fix" method=post>
<tr> 
<th align=left colspan=2 height=23>继续修复帖子(修复指定范围贴子UBB标签)</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>&nbsp;帖子主题ID,可以填写您想从哪一个ID号开始进行修复</td>
</tr>
<tr>
<td width="20%" class="forumrow">结束的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>&nbsp;将更新开始到结束ID之间的帖子数据,之间的数值最好不要选择过大</td>
</tr>
<tr>
<td width="20%" class="forumrow">新老贴的标识日期</td>
<td width="80%" class="forumrow"><input type="text" name="updatedate" value="<%=updatedate%>">(格式:YYYY-M-D) 就是论坛升级到v7.0的日期,如果不填写,一律按老贴处理</td>
</tr>
<tr>
<td width="20%" class="forumrow">去掉贴子中的HTML标记</td>
<td width="80%" class="forumrow"><input type="radio" name="killhtml" value="1" 
 <%
  If killhtml="1" Then 
  %>
  checked 
  <%
  End If 
  %>
> 是
  <input type="radio" name="killhtml" value="0" 
  <%
  If killhtml="0" Then 
  %>
  checked 
  <%
  End If 
  %>
  > 否 &nbsp;<br>选是的话,贴子中的HTML标记将会自动被清除,有利于减少数据库的大小,但是会失去原来的HTML效果。</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
%>

⌨️ 快捷键说明

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