hitcount.asp
来自「本源代码为终点小说连载系统 v1.15 Build 0430 SQL清风修改版,」· ASP 代码 · 共 115 行
ASP
115 行
<!-- #include file="conn.asp" -->
<%
Function bookcount(id)
if session("book_ID")<>"" then
if session("book_ID")<>cstr(id) then
dim yearhitstime,monthhitstime,weekdayhitstime,dayhitstime
set rshit=server.CreateObject("ADODB.recordset")
sqlhit="select yearhitstime,monthhitstime,weekdayhitstime,dayhitstime,list_hit,list_yhit,list_mhit,list_zhit,list_dhit from [list_book] where id="&cstr(id)
rshit.open sqlhit,conn,1,3
if not rshit.eof then
yearhitstime=rshit("yearhitstime")
monthhitstime=rshit("monthhitstime")
weekdayhitstime=rshit("weekdayhitstime")
dayhitstime=rshit("dayhitstime")
end if
rshit("list_hit")=rshit("list_hit")+1
rshit.update
if cstr(year(formatdatetime(now(),1)))=cstr(year(formatdatetime(yearhitstime,1))) then
rshit("list_yhit")=rshit("list_yhit")+1
rshit.update
else
rshit("list_yhit")=1
rshit("yearhitstime")=now()
rshit.update
end if
if cstr(month(formatdatetime(now(),1)))=cstr(month(formatdatetime(monthhitstime,1))) then
rshit("list_mhit")=rshit("list_mhit")+1
rshit.update
else
rshit("list_mhit")=1
rshit("monthhitstime")=now()
rshit.update
end if
if cstr(weekday(formatdatetime(now(),1)))=cstr(weekday(formatdatetime(weekdayhitstime,1))) then
rshit("list_zhit")=rshit("list_zhit")+1
rshit.update
else
rshit("list_zhit")=1
rshit("weekdayhitstime")=now()
rshit.update
end if
if cstr(day(formatdatetime(now(),1)))=cstr(day(formatdatetime(dayhitstime,1))) then
rshit("list_dhit")=rshit("list_dhit")+1
rshit.update
else
rshit("list_dhit")=1
rshit("dayhitstime")=now()
rshit.update
end if
rshit.close
set rshit=nothing
else
end if
else
set rshit=server.CreateObject("ADODB.recordset")
sqlhit="select yearhitstime,monthhitstime,weekdayhitstime,dayhitstime,list_hit,list_yhit,list_mhit,list_zhit,list_dhit from [list_book] where id="&cstr(id)
rshit.open sqlhit,conn,1,3
if not rshit.eof then
yearhitstime=rshit("yearhitstime")
monthhitstime=rshit("monthhitstime")
weekdayhitstime=rshit("weekdayhitstime")
dayhitstime=rshit("dayhitstime")
end if
rshit("list_hit")=rshit("list_hit")+1
rshit.update
if cstr(year(formatdatetime(now(),1)))=cstr(year(formatdatetime(yearhitstime,1))) then
rshit("list_yhit")=rshit("list_yhit")+1
rshit.update
else
rshit("list_yhit")=1
rshit("yearhitstime")=now()
rshit.update
end if
if cstr(month(formatdatetime(now(),1)))=cstr(month(formatdatetime(monthhitstime,1))) then
rshit("list_mhit")=rshit("list_mhit")+1
rshit.update
else
rshit("list_mhit")=1
rshit("monthhitstime")=now()
rshit.update
end if
if cstr(weekday(formatdatetime(now(),1)))=cstr(weekday(formatdatetime(weekdayhitstime,1))) then
rshit("list_zhit")=rshit("list_zhit")+1
rshit.update
else
rshit("list_zhit")=1
rshit("weekdayhitstime")=now()
rshit.update
end if
if cstr(day(formatdatetime(now(),1)))=cstr(day(formatdatetime(dayhitstime,1))) then
rshit("list_dhit")=rshit("list_dhit")+1
rshit.update
else
rshit("list_dhit")=1
rshit("dayhitstime")=now()
rshit.update
end if
rshit.close
set rshit=nothing
session("book_ID")=cstr(id)
end if
End Function
%>
<%
id=replace(trim(request("id")),"'","")
bookcount(id)
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?