www.gusucode.com > 艺术签名文章资讯网源代码 > 艺术签名文章资讯网源代码/624/flash/hits.asp

    <!--#include file="config.asp" -->
<%
Dim flashid,Rs,SQL
Dim AllHits,DayHits,WeekHits,MonthHits,HitsTime,hits,stype
Newasp.ChkPostAgent()
If Not IsNumeric(Request("flashid")) And Request("flashid") <> "" then
	Response.Write"错误的系统参数!ID必须是数字"
	Response.End
Else
	flashid = CLng(Request.querystring("flashid"))
End If
stype = CLng(Request.querystring("type"))
If Not IsObject(Conn) Then ConnectionDatabase
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT AllHits,DayHits,WeekHits,MonthHits,HitsTime FROM NC_FlashList where flashid = "& flashid  
Rs.Open SQL,Conn,1,3
	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")
Rs.close
set Rs=nothing

CloseConn
If stype = 1 Then
	Response.Write "var oHits=document.getElementById(""ArticleHits"");" & vbNewLine
	Response.Write "if (oHits!=null) {" & vbNewLine
	Response.Write "oHits.innerHTML="& Chr(34) &"本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总计:"& AllHits &" "& Chr(34) &";" & vbNewLine
	Response.Write "}" & vbNewLine
Else
	Response.Write "document.write ("& Chr(34) &"本日:"& DayHits &" 本周:"& WeekHits &" 本月:"& MonthHits &" 总计:"& AllHits &" "& Chr(34) &");"
End If
%>