<!--#include file="conn.asp" -->
<%
Dim ID,Rs,SQL
Dim Hits,DayHits,WeekHits,MonthHits,HitsTime
If Not IsNumeric(Request("ID")) And Request("ID") <> "" then
	Response.write"错误的系统参数!ID必须是数字"
	Response.end
Else
	ID = CLng(Request.querystring("ID"))
End If
Set Rs=server.createobject("adodb.recordset")
SQL = "select Hits,DayHits,WeekHits,MonthHits,HitsTime from NC_Article where ID = "& ID   
Rs.open SQL,conn,1,3
	Rs("Hits") = Rs("Hits") + 1
	If DateDiff("Ww", Rs("HitsTime"), Now) <= 0 Then
		Rs("WeekHits") = Rs("WeekHits") + 1
	Else
		Rs("WeekHits") = 1
	End If
	If DateDiff("M", Rs("HitsTime"), Now) <= 0 Then
		Rs("MonthHits") = Rs("MonthHits") + 1
	Else
		Rs("MonthHits") = 1
	End If
	If DateDiff("D", Rs("HitsTime"), Now) <= 0 Then
		Rs("DayHits") = Rs("DayHits") + 1
	Else
		Rs("DayHits") = 1
		Rs("HitsTime") = Now
	End If
	Rs.Update
	Hits = Rs("Hits")
	DayHits = Rs("DayHits")
	WeekHits = Rs("WeekHits")
	MonthHits = Rs("MonthHits")
Rs.close
set Rs=nothing
CloseConn
response.write "document.write ("& Chr(34) &"本日："& DayHits &" 本周："& WeekHits &" 本月："& MonthHits &" 总浏览数："& Hits &" "& Chr(34) &");"
%>