<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Conn.asp"-->
<!--#include file="Ex_Cls/Ex_SkinCls.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css"> 
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<div style="text-align:center">更新进度</center>
<div style="color:red;padding-left:50px;">
<%
Dim ExComm,refresh,ExI,ExSkin
Set ExComm=new Ex_CommonCls
ExComm.IsAdLogin 
ExComm.IsIpAllow
Sub RefreshCache
	Refresh=ExComm.GetCacheList(sn)
	Refresh=Split(Refresh,",")
	For ExI=0 To UBound(Refresh)
		response.write("缓存&nbsp;"&Refresh(ExI)&"&nbsp;已清除<br>")
	Next
	ExComm.ClearCaches(sn)
	Set ExSkin=new Ex_SkinCls
	ExSkin.RefreshSkinCache
	ExComm.ShowMsg "清除了"&UBound(Refresh)&"个缓存",""
End Sub 
Sub RefreshCount
	Dim StrSql,Rs
	'日志数量
	Response.Write("正在更新日志数量<br>")
	StrSql="select count(*) from Ex_Log"
	Set Rs=Conn.Execute(StrSql)
	StrSql="update Ex_Config set LogCount="&Rs(0)
	Conn.Execute StrSql
	Rs.close
	'评论数量
	Response.Write("正在更新评论数量<br>")
	StrSql="select count(*) from Ex_Comment"
	Set Rs=Conn.Execute(StrSql)
	StrSql="update Ex_Config set CmtCount="&Rs(0)
	Conn.Execute StrSql
	Rs.Close
	'留言数量
	Response.Write("正在更新留言数量<br>")
	StrSql="select count(*) from Ex_Message"
	Set Rs=Conn.Execute(StrSql)
	StrSql="update Ex_Config set MsgCount="&Rs(0)
	Conn.Execute StrSql
	Rs.Close
	'更新日志回复数量
	Response.Write("正在更新日志回复数量<br>")
	StrSql="select id from Ex_log"
	Set Rs=Conn.Execute(StrSql)
	If Not Rs.eof And Not Rs.bof Then 
		Dim R,Id
		Do While Not Rs.eof 
			Id=Rs("id")
			StrSql="select count(*) from Ex_Comment where isshow='是' and parentid="&Id
			Set R=Conn.Execute(StrSql)
			StrSql="update Ex_Log set cmt="&R(0)&" where id="&Id
			Conn.Execute StrSql
			R.Close
			Rs.movenext
		Loop 
	End If 
	ExComm.ShowMsg "全部更新完毕",""
End Sub 
If Request.querystring("t")="" Then 
	RefreshCache
Else 
	RefreshCount
End If 
%>
</div>
</body>
</html>