📄 admincount.asp
字号:
<!--#include file="Connections.asp" -->
<!--#include file="adminaccess.asp" -->
<body <%=background%> >
<table border=1 borderColor=<%=tdc2%> cellPadding=4 cellSpacing=1 width=<%=tdc3%> style="border-collapse: collapse" align=center>
<tr>
<td height="21" width="100%" align="center" <%=hColor%> class=tdc1 colspan="5" >
论坛数据更新</td>
</tr>
<tr>
<td align="right" width="20%" bgcolor=<%=tColor2%> class=tdc>说明:</td>
<td bgcolor=<%=tColor2%> class=tdc>
如果论坛数据出现不一致或其它问题,可以通过更新数据解决,由于数据的量不同,有些更新时间较长,请耐心等待
</td>
</tr>
</talbe>
<%dim h_postmoney,h_topbeauty,top_fen,h_topmoney,h_loginmoney,h_loginfen,h_loginbeauty,h_delfen,h_delmoney,h_delbeauty,h_postbeauty,t_fen,r_fen,h_replybeauty,h_replymoney,h_regmoney,h_regfen,h_regbeauty
sql="select h_topbeauty,top_fen,h_topmoney,h_postmoney,h_loginmoney,h_loginfen,h_loginbeauty,h_delfen,h_delmoney,h_delbeauty,h_postbeauty,t_fen,r_fen,h_replybeauty,h_replymoney,h_regmoney,h_regfen,h_regbeauty from home"
set rsconn1=conn.execute(sql)
if not rsconn1.eof then
h_postmoney=rsconn1("h_postmoney")
h_postbeauty=rsconn1("h_postbeauty")
t_fen=rsconn1("t_fen")
r_fen=rsconn1("r_fen")
h_replybeauty=rsconn1("h_replybeauty")
h_replymoney=rsconn1("h_replymoney")
h_delfen=rsconn1("h_delfen")'删除减分
h_delmoney=rsconn1("h_delmoney")
h_delbeauty=rsconn1("h_delbeauty")
h_loginfen=rsconn1("h_loginfen")
h_loginmoney=rsconn1("h_loginmoney")
h_loginbeauty=rsconn1("h_loginbeauty")
h_regfen=rsconn1("h_regfen")
h_regmoney=rsconn1("h_regmoney")
h_regbeauty=rsconn1("h_regbeauty")
h_topmoney=rsconn1("h_topmoney")
top_fen=rsconn1("top_fen")
h_topbeauty=rsconn1("h_topbeauty")
end if
set rsconn1=nothing
server.ScriptTimeout = 99999
if Request.QueryString("action")="topic" then
i=0
a=0
sql="select count(t_id) as tid from topic"
set rs=conn.execute(sql)
if not rs.eof then i=rs("tid")
sql="select count(t_id) as tid from reply"
set rs=conn.execute(sql)
if not rs.eof then a=rs("tid")
set rs=nothing
sql="update total set t_num="&i&" , r_num="&a&""
conn.execute(sql)
succmsg="<li>帖子总数更新完毕,当前共有主题"&i&"篇,回复帖"&a&"篇</li>"
call succ(succmsg)
response.end
elseif Request.QueryString("action")="lanmu_topic" then
sql="select l_id from lanmu"
set rs=conn.execute(sql)
do while not rs.eof
sql1="select count(t_id) as tid from topic where l_id="&rs("l_id")&""
set rs1=conn.execute(sql1)
i=0
if not rs1.eof then i=rs1("tid")
set rs1=nothing
sql2="update lanmu set l_topiccount="&i&" where l_id="&rs("l_id")&""
conn.execute(sql2)
rs.MoveNext
loop
set rs=nothing
succmsg="<li>论坛版块主题计数更新完毕</li>"
call succ(succmsg)
response.end
elseif Request.QueryString("action")="lanmu_reply" then
sql="select l_id from lanmu"
set rs=conn.execute(sql)
do while not rs.eof
sql1="select count(r_id) as tid from reply where l_id="&rs("l_id")&""
set rs1=conn.execute(sql1)
i=0
if not rs1.eof then i=rs1("tid")
set rs1=nothing
sql2="update lanmu set l_count="&i&" where l_id="&rs("l_id")&""
conn.execute(sql2)
rs.MoveNext
loop
set rs=nothing
succmsg="<li>论坛版块回复计数更新完毕</li>"
call succ(succmsg)
response.end
elseif Request.QueryString("action")="total" then
sql="select count(u_id) as uid from user"
set rs=conn.execute(sql)
i=rs("uid")
sql="update total set n_num="&i&""
conn.execute(sql)
succmsg="<li>会员总数更新完毕,当前共有会员"&i&"人</li>"
call succ(succmsg)
response.end
'更新统计数据
elseif Request.QueryString("action")="tongji" then
sql="update total set o_num=0,tongji=0,tongji1=0,h_tjnowday=0,h_tjpreday=0,h_tjnowmonth=0,h_tjpremonth=0"
conn.execute(sql)
sql="delete from online"
conn.execute(sql)
succmsg="<li>统计数据已经全部归零</li>"
call succ(succmsg)
response.end
'更新在线统计数据
elseif Request.QueryString("action")="online" then
sql="delete from online"
conn.execute(sql)
succmsg="<li>在线统计数据已经归零</li>"
call succ(succmsg)
response.end
'更新投票数据
elseif Request.QueryString("action")="vote" then
sql="delete from vote"
conn.execute(sql)
sql="update topic set t_vote=0"
conn.execute(sql)
succmsg="<li>投票数据已经删除</li>"
call succ(succmsg)
response.end
'更新等级
elseif Request.QueryString("action")="grade" then
u_startid=chktopic(request("u_startid"))
u_endid=chktopic(request("u_endid"))
if (not IsNumeric(u_startid)) or (not IsNumeric(u_endid)) then
errormsg="<Li>开始id或者结束id必须为数字</li>"
call error(errormsg)
response.end
end if
if int(u_startid)>int(u_endid) then
errormsg="<Li>开始id必须小于结束id</li>"
call error(errormsg)
response.end
end if
sql5="select grade,fen,username from user where u_id>="&u_startid&" and u_id<="&u_endid&""
set rs5=conn.execute(sql5)
if not(rs5.eof or rs5.bof) then
do while not rs5.eof
if rs5("grade")>=4 then
sqlg="select top 1 g_num from grade where g_fen<="&rs5("fen")&" and g_num<>1 and g_num<>2 and g_num<>3"
set rsg=conn.execute(sqlg)
if not rsg.eof then
sqlgrade2="update user set grade='"&rsg("g_num")&"' where username='"&rs5("username")&"'"
conn.Execute (sqlgrade2)
end if
end if
rs5.movenext
loop
end if
set rs5=nothing
succmsg="<li>会员等级更新完毕</li>"
call succ(succmsg)
response.end
'更新会员统计数据
elseif Request.QueryString("action")="userfen" then
u_startid=chktopic(request("u_startid"))
u_endid=chktopic(request("u_endid"))
if (not IsNumeric(u_startid)) or (not IsNumeric(u_endid)) then
errormsg="<Li>开始id或者结束id必须为数字</li>"
call error(errormsg)
response.end
end if
if int(u_startid)>int(u_endid) then
errormsg="<Li>开始id必须小于结束id</li>"
call error(errormsg)
response.end
end if
sql5="select username,u_logintimes from user where u_id>="&u_startid&" and u_id<="&u_endid&""
set rs5=conn.execute(sql5)
if not(rs5.eof or rs5.bof) then
do while not rs5.eof
sql = "select count(t_username) as at from topic where t_username='"&rs5("username")&"'"
set rs=conn.execute(sql)
a=rs("at")'计算出主题数
fen=a*t_fen
u_money=a*h_postmoney
u_beauty=a*h_postbeauty
sql = "select count(r_username) as ar from reply where r_username='"&rs5("username")&"'"
set rs=conn.execute(sql)
b=rs("ar")'计算出回复数
fen1=b*r_fen
fen=fen+fen1
u_money1=b*h_replymoney
u_money=u_money+u_money1
u_beauty1=b*h_replybeauty
u_beauty=u_beauty+u_beauty1
sql = "select count(t_username) as ast from topic where t_username='"&rs5("username")&"'and t_jinhua=1"
set rs=conn.execute(sql)
c=rs("ast")'计算出精华数
fen2=c*top_fen
fen=fen+fen2
u_money2=c*h_topmoney
u_money=u_money+u_money2
u_beauty2=c*h_topbeauty
u_beauty=u_beauty+u_beauty2
set rs=nothing
loginfen=rs5("u_logintimes")*h_loginfen
loginmoney=rs5("u_logintimes")*h_loginmoney
loginbeauty=rs5("u_logintimes")*h_loginbeauty
sql8="update user set send=u_deltopic+"&a&"+"&b&",u_toptopic="&c&",fen="&fen&"+"&loginfen&"+"&h_regfen&",u_money="&u_money&"+"&loginmoney&"+"&h_regmoney&",u_beauty="&u_beauty&"+"&loginbeauty&"+"&h_regbeauty&" where username='"&rs5("username")&"'"
conn.execute(sql8)
rs5.movenext
loop
end if
set rs5=nothing
succmsg="<li>会员发帖量,经验值,财产,魅力统计更新完毕</li>"
call succ(succmsg)
response.end
elseif Request.QueryString("action")="topic_reply" then
u_startid=chktopic(request("u_startid"))
u_endid=chktopic(request("u_endid"))
if (not IsNumeric(u_startid)) or (not IsNumeric(u_endid)) then
errormsg="<Li>开始id或者结束id必须为数字</li>"
call error(errormsg)
response.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -