<%@language=vbscript codepage=936 %>
<%
Option Explicit
'强制浏览器重新访问服务器下载页面，而不是从缓存读取页面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<!--#include file="Conn.asp"-->
<!--#include file="Inc/Cl_ClsSysTem.asp"-->
<%
Dim ChannelID,ModuleID,InfoID,sType,IsAdd
Dim sql,rs,TempJs
Dim Hits,DayHits,WeekHits,MonthHits
ChannelID	= Cl.ChkClng(Request("ChannelID"))
InfoID		= Cl.ChkClng(request("InfoID"))
sType		= ","&Trim(request("Type"))&","
IsAdd		= Lcase(Trim(request("Add")))
if ChannelID=0 or InfoID=0 then
	Response.Write "document.write('0');"
	Response.end
end if
Cl.GetChannelSetting(ChannelID)
ModuleID=Cint(Cl.Channel_Setting(20))
OpenConn
Set rs = server.CreateObject("ADODB.recordset")
Select Case ModuleID
	Case 1 : GetHits_1
	Case 2 : GetHits_2
	Case 3 : GetHits_3
	Case 4 : GetHits_4
	Case 5 : GetHits_5
	Case Else : GetHits_1
End Select
Set rs=Nothing
CloseAllObj
Response.Write "document.write('" & TempJs & "');"

Sub GetHits_1()
	sql = "select Hits from Cl_Article where ArticleID=" & InfoID
	rs.open sql, conn, 1, 3
	If rs.bof And rs.eof Then
		Hits = 0
	Else
		Hits = rs(0)
		'if Trim(Request.Cookies("View_"&ChannelID&"_"&InfoID))<>"OK" then
			Hits = Hits + 1
			rs(0) = Hits
			rs.Update
		'	Response.Cookies("View_"&ChannelID&"_"&InfoID)="OK"
		'end if
	end if
	rs.close
	TempJs=Hits
End Sub

Sub GetHits_2()
	sql = "select Hits,DayHits,WeekHits,MonthHits from Cl_Soft where SoftID=" & InfoID
	rs.open sql, conn, 1, 3
	If rs.bof And rs.eof Then
		Hits = 0
		DayHits = 0
		WeekHits = 0
		MonthHits = 0
	Else
		Hits = rs(0)
		DayHits = rs(1)
		WeekHits = rs(2)
		MonthHits = rs(3)
		if IsAdd="a" then
			Hits = Hits + 1
			DayHits = DayHits + 1
			WeekHits = WeekHits + 1
			MonthHits = MonthHits + 1
			rs(0) = Hits
			rs(1) = DayHits
			rs(2) = WeekHits
			rs(3) = MonthHits
			rs.Update
			'Response.Cookies("View_"&ChannelID&"_"&InfoID)="OK"
		end if
	end if
	rs.close
	if Instr(sType,",0,")=0 And Instr(sType,",1,")=0 And Instr(sType,",2,")=0 And Instr(sType,",3,")=0 then
		TempJs="本日：" & DayHits & "&nbsp;&nbsp;本周：" & WeekHits & "&nbsp;&nbsp;本月：" & MonthHits & "&nbsp;&nbsp;总计：" & Hits
	else
		TempJs=""
		if Instr(sType,",0,")>0 then
			TempJs=TempJs & "本日：" & DayHits & "　&nbsp;"
		end if
		if Instr(sType,",1,")>0 then
			TempJs=TempJs & "本周：" & WeekHits & "　&nbsp;"
		end if
		if Instr(sType,",2,")>0 then
			TempJs=TempJs & "本月：" & MonthHits & "　&nbsp;"
		end if
		if Instr(sType,",3,")>0 then
			TempJs=TempJs & "总计：" & Hits
		end if
	end if
End Sub

Sub GetHits_3()
	sql = "select Hits,DayHits,WeekHits,MonthHits from Cl_Photo where PhotoID=" & InfoID
	rs.open sql, conn, 1, 3
	If rs.bof And rs.eof Then
		Hits = 0
		DayHits = 0
		WeekHits = 0
		MonthHits = 0
	Else
		Hits = rs(0)
		DayHits = rs(1)
		WeekHits = rs(2)
		MonthHits = rs(3)
		if IsAdd="a" then
			Hits = Hits + 1
			DayHits = DayHits + 1
			WeekHits = WeekHits + 1
			MonthHits = MonthHits + 1
			rs(0) = Hits
			rs(1) = DayHits
			rs(2) = WeekHits
			rs(3) = MonthHits
			rs.Update
			'Response.Cookies("View_"&ChannelID&"_"&InfoID)="OK"
		end if
	end if
	rs.close
	if Instr(sType,",0,")=0 And Instr(sType,",1,")=0 And Instr(sType,",2,")=0 And Instr(sType,",3,")=0 then
		TempJs="本日：" & DayHits & "&nbsp;&nbsp;本周：" & WeekHits & "&nbsp;&nbsp;本月：" & MonthHits & "&nbsp;&nbsp;总计：" & Hits
	else
		TempJs=""
		if Instr(sType,",0,")>0 then
			TempJs=TempJs & "本日：" & DayHits & "　&nbsp;"
		end if
		if Instr(sType,",1,")>0 then
			TempJs=TempJs & "本周：" & WeekHits & "　&nbsp;"
		end if
		if Instr(sType,",2,")>0 then
			TempJs=TempJs & "本月：" & MonthHits & "　&nbsp;"
		end if
		if Instr(sType,",3,")>0 then
			TempJs=TempJs & "总计：" & Hits
		end if
	end if
End Sub

Sub GetHits_4()
	sql = "select Hits,DayHits,WeekHits,MonthHits from Cl_Movie where MovieID=" & InfoID
	rs.open sql, conn, 1, 3
	If rs.bof And rs.eof Then
		Hits = 0
		DayHits = 0
		WeekHits = 0
		MonthHits = 0
	Else
		Hits = rs(0)
		DayHits = rs(1)
		WeekHits = rs(2)
		MonthHits = rs(3)
		if IsAdd="a" then
			Hits = Hits + 1
			DayHits = DayHits + 1
			WeekHits = WeekHits + 1
			MonthHits = MonthHits + 1
			rs(0) = Hits
			rs(1) = DayHits
			rs(2) = WeekHits
			rs(3) = MonthHits
			rs.Update
			'Response.Cookies("View_"&ChannelID&"_"&InfoID)="OK"
		end if
	end if
	rs.close
	if Instr(sType,",0,")=0 And Instr(sType,",1,")=0 And Instr(sType,",2,")=0 And Instr(sType,",3,")=0 then
		TempJs="本日：" & DayHits & "&nbsp;&nbsp;本周：" & WeekHits & "&nbsp;&nbsp;本月：" & MonthHits & "&nbsp;&nbsp;总计：" & Hits
	else
		TempJs=""
		if Instr(sType,",0,")>0 then
			TempJs=TempJs & "本日：" & DayHits & "　&nbsp;"
		end if
		if Instr(sType,",1,")>0 then
			TempJs=TempJs & "本周：" & WeekHits & "　&nbsp;"
		end if
		if Instr(sType,",2,")>0 then
			TempJs=TempJs & "本月：" & MonthHits & "　&nbsp;"
		end if
		if Instr(sType,",3,")>0 then
			TempJs=TempJs & "总计：" & Hits
		end if
	end if
End Sub

Sub GetHits_5()
	sql = "select Hits,DayHits,WeekHits,MonthHits from Cl_Product where ProductID=" & InfoID
	rs.open sql, conn, 1, 3
	If rs.bof And rs.eof Then
		Hits = 0
		DayHits = 0
		WeekHits = 0
		MonthHits = 0
	Else
		Hits = rs(0)
		DayHits = rs(1)
		WeekHits = rs(2)
		MonthHits = rs(3)
		if IsAdd="a" then
			Hits = Hits + 1
			DayHits = DayHits + 1
			WeekHits = WeekHits + 1
			MonthHits = MonthHits + 1
			rs(0) = Hits
			rs(1) = DayHits
			rs(2) = WeekHits
			rs(3) = MonthHits
			rs.Update
			'Response.Cookies("View_"&ChannelID&"_"&InfoID)="OK"
		end if
	end if
	rs.close
	if Instr(sType,",0,")=0 And Instr(sType,",1,")=0 And Instr(sType,",2,")=0 And Instr(sType,",3,")=0 then
		TempJs="本日：" & DayHits & "&nbsp;&nbsp;本周：" & WeekHits & "&nbsp;&nbsp;本月：" & MonthHits & "&nbsp;&nbsp;总计：" & Hits
	else
		TempJs=""
		if Instr(sType,",0,")>0 then
			TempJs=TempJs & "本日：" & DayHits & "　&nbsp;"
		end if
		if Instr(sType,",1,")>0 then
			TempJs=TempJs & "本周：" & WeekHits & "　&nbsp;"
		end if
		if Instr(sType,",2,")>0 then
			TempJs=TempJs & "本月：" & MonthHits & "　&nbsp;"
		end if
		if Instr(sType,",3,")>0 then
			TempJs=TempJs & "总计：" & Hits
		end if
	end if
End Sub

'==================================================
'CreateLive CMS Version 3.1
'							Powered by Aspoo.Net
'
'邮箱: aspoo@126.com		Info@aspoo.cn
'ＱＱ: 3315263				596197794
'网站: www.aspoo.cn			www.aspoo.com
'论坛: bbs.aspoo.cn			bbs.aspoo.com
'
'Copyright (C) 2005 Aspoo.Net All Rights Reserved.
'==================================================
%>