<!--#include file="config.asp" -->
<%
Response.ContentType="text/html"
Response.Expires = -9999
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-ctrol", "no-cache"
Dim ArticleID,Rs,SQL
Dim AllHits,DayHits,WeekHits,MonthHits,HitsTime,hits,stype
NewAsp.ChkPostAgent()
ArticleID=NewAsp.ChkNumeric(Request("id"))
If ArticleID=0 Then ArticleID=NewAsp.ChkNumeric(Request("ArticleID"))
stype = NewAsp.ChkNumeric(Request("type"))
If Not IsObject(Conn) Then ConnectionDatabase
Set Rs = NewAsp.CreateAXObject("ADODB.Recordset")
SQL = "SELECT AllHits,DayHits,WeekHits,MonthHits,HitsTime FROM NC_Article WHERE ArticleID="& ArticleID
Rs.Open SQL,Conn,1,3
If Not(Rs.BOF And Rs.EOF) Then
	hits = CLng(Rs("AllHits"))+1
	Rs("AllHits").Value = hits
	If DateDiff("Ww", Rs("HitsTime"), Now) <= 0 Then
		Rs("WeekHits").Value = Rs("WeekHits").Value + 1
	Else
		Rs("WeekHits").Value = 1
	End If
	If DateDiff("M", Rs("HitsTime"), Now) <= 0 Then
		Rs("MonthHits").Value = Rs("MonthHits").Value + 1
	Else
		Rs("MonthHits").Value = 1
	End If
	If DateDiff("D", Rs("HitsTime"), Now) <= 0 Then
		Rs("DayHits").Value = Rs("DayHits").Value + 1
	Else
		Rs("DayHits").Value = 1
		Rs("HitsTime").Value = Now
	End If
	Rs.Update
	AllHits = Rs("AllHits")
	DayHits = Rs("DayHits")
	WeekHits = Rs("WeekHits")
	MonthHits = Rs("MonthHits")
End If
Rs.close
Set Rs=nothing
NewAsp.PageEnd()
If stype = 1 Then
	Response.Write "var oHits=document.getElementById(""NewAsp_Hits"");" & vbNewLine
	Response.Write "if (oHits!=null) {" & vbNewLine
	Response.Write "oHits.style.display='';" & vbNewLine
	Response.Write "oHits.innerHTML="& Chr(34) &"本日："& DayHits &" 本周："& WeekHits &" 本月："& MonthHits &" 总数："& AllHits &" "& Chr(34) &";" & vbNewLine
	Response.Write "}" & vbNewLine
ElseIf stype = 2 Then
	Response.Write "本日："& DayHits &" 本周："& WeekHits &" 本月："& MonthHits &" 总数："& AllHits
ElseIf stype = 3 Then
	Response.Write ""
ElseIf stype = 4 Then
	Response.Write "document.write (' ');"
Else
	Response.Write "document.write ("& Chr(34) &"本日："& DayHits &" 本周："& WeekHits &" 本月："& MonthHits &" 总数："& AllHits &" "& Chr(34) &");"
End If
%>