📄 admin_counter.asp
字号:
Percent = FormatNumber(rsCounter("Num")/TotalNum*100, 2, -1) &"%"
%>
<tr>
<td class="item_25"><%=rsCounter("BrowserName")%></td>
<td class="item_25"><%=rsCounter("Num")%></td>
<td class="item_25"><%=Percent%></td>
<td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
</tr>
<%
If i<RowCount Then rsCounter.MoveNext
Next
rsCounter.Close()
End If
%>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
</tr>
</table>
<%
Set rsCounter = Nothing
Set CounterCmd = Nothing
EL_Common.ShowScriptError()
End Sub
Sub Counter_3()
On Error Resume Next
Dim CounterCmd, rsCounter, i, StrFields, StrCondition
Dim PageCounts, RowCount, TotalRowCount, Percent, TotalNum
StrFields = "*"
StrCondition = "1=1"
TotalNum = Conn.Execute("SELECT SUM(Num) FROM EL_CounterRefer")(0)
Call EL_Common.InitCommand(CounterCmd, "EL_SP_SplitPage")
With CounterCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_CounterRefer")
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "ReferURL")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "Num DESC")
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsCounter = .Execute()
End With
rsCounter.Close()
RowCount = CounterCmd(0)
TotalRowCount = CounterCmd(9)
PageCounts = CounterCmd(10)
CurrentPath = CurrentPath &">> 链接地址分析"
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><%=CurrentPath%></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="40%" class="top_25"><strong>链接地址</strong></td>
<td width="9%" class="top_25"><strong>访问次数</strong></td>
<td width="11%" class="top_25"><strong>百分比</strong></td>
<td width="40%" class="top_25"><strong>图示</strong></td>
</tr>
<%
If RowCount = 0 Then
Response.Write "<tr><td colspan=4 class=td_50 align=center>没有链接地址数据</td></tr>"
Else
rsCounter.Open()
For i = 1 To RowCount
Percent = FormatNumber(rsCounter("Num")/TotalNum*100, 2, -1) &"%"
%>
<tr>
<td class="item_25" title="<%=rsCounter("ReferURL")%>"><%=Left(rsCounter("ReferURL"), 50)%></td>
<td class="item_25"><%=rsCounter("Num")%></td>
<td class="item_25"><%=Percent%></td>
<td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
</tr>
<%
If i<RowCount Then rsCounter.MoveNext
Next
rsCounter.Close()
End If
%>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
</tr>
</table>
<%
Set rsCounter = Nothing
Set CounterCmd = Nothing
EL_Common.ShowScriptError()
End Sub
Sub Counter_2()
On Error Resume Next
Dim CounterCmd, rsCounter, i, StrFields, StrCondition
Dim PageCounts, RowCount, TotalRowCount, Percent, TotalNum
StrFields = "*"
StrCondition = "1=1"
TotalNum = Conn.Execute("SELECT SUM(Num) FROM EL_CounterAddress")(0)
Call EL_Common.InitCommand(CounterCmd, "EL_SP_SplitPage")
With CounterCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_CounterAddress")
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "Address")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "Num DESC")
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsCounter = .Execute()
End With
rsCounter.Close()
RowCount = CounterCmd(0)
TotalRowCount = CounterCmd(9)
PageCounts = CounterCmd(10)
CurrentPath = CurrentPath &">> 详细地址分析"
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><%=CurrentPath%></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="30%" class="top_25"><strong>详细地址</strong></td>
<td width="11%" class="top_25"><strong>访问次数</strong></td>
<td width="19%" class="top_25"><strong>百分比</strong></td>
<td width="40%" class="top_25"><strong>图示</strong></td>
</tr>
<%
If RowCount = 0 Then
Response.Write "<tr><td colspan=4 class=td_50 align=center>没有详细地址数据</td></tr>"
Else
rsCounter.Open()
For i = 1 To RowCount
Percent = FormatNumber(rsCounter("Num")/TotalNum*100, 2, -1) &"%"
%>
<tr>
<td class="item_25"><%=rsCounter("Address")%></td>
<td class="item_25"><%=rsCounter("Num")%></td>
<td class="item_25"><%=Percent%></td>
<td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
</tr>
<%
If i<RowCount Then rsCounter.MoveNext
Next
rsCounter.Close()
End If
%>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
</tr>
</table>
<%
Set rsCounter = Nothing
Set CounterCmd = Nothing
EL_Common.ShowScriptError()
End Sub
Sub Counter_1()
On Error Resume Next
Dim CounterCmd, rsCounter, i, StrFields, StrCondition
Dim PageCounts, RowCount, TotalRowCount, Percent, TotalNum
StrFields = "*"
StrCondition = "1=1"
TotalNum = Conn.Execute("SELECT SUM(Num) FROM EL_CounterIp")(0)
Call EL_Common.InitCommand(CounterCmd, "EL_SP_SplitPage")
With CounterCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_CounterIp")
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "Ip")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "Num DESC")
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsCounter = .Execute()
End With
rsCounter.Close()
RowCount = CounterCmd(0)
TotalRowCount = CounterCmd(9)
PageCounts = CounterCmd(10)
CurrentPath = CurrentPath &">> Ip地址分析"
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><%=CurrentPath%></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="30%" class="top_25"><strong>IP地址</strong></td>
<td width="11%" class="top_25"><strong>访问次数</strong></td>
<td width="19%" class="top_25"><strong>百分比</strong></td>
<td width="40%" class="top_25"><strong>图示</strong></td>
</tr>
<%
If RowCount = 0 Then
Response.Write "<tr><td colspan=4 class=td_50 align=center>没有IP数据</td></tr>"
Else
rsCounter.Open()
For i = 1 To RowCount
Percent = FormatNumber(rsCounter("Num")/TotalNum*100, 2, -1) &"%"
%>
<tr>
<td class="item_25"><%=rsCounter("Ip")%></td>
<td class="item_25"><%=rsCounter("Num")%></td>
<td class="item_25"><%=Percent%></td>
<td class="item_25"><div style="width:<%=Percent%>; background:blue; font-size:xx-small; color:blue; height:8px;"><img src="Images/blank.gif"></div></td>
</tr>
<%
If i<RowCount Then rsCounter.MoveNext
Next
rsCounter.Close()
End If
%>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "记录", "条")%></td>
</tr>
</table>
<%
Set rsCounter = Nothing
Set CounterCmd = Nothing
EL_Common.ShowScriptError()
End Sub
Sub ShowOnline()
On Error Resume Next
Dim OnlineCmd, rsOnline, i, StrFields, StrCondition, UserCount
Dim PageCounts, RowCount, TotalRowCount, OnlineTimer, UserOnlineTimer
OnlineTimer = Conn.Execute("SELECT TOP 1 OnlineTimer FROM EL_CounterConfig")(0)
Conn.Execute("UPDATE [EL_User] SET [Online]=0 WHERE [UserID] IN (SELECT [UserID] FROM [EL_CounterOnline] WHERE [UserID]>0 AND [LastActiveTime]<(DATEADD(second, 0-(SELECT TOP 1 LoginOverTime*60 FROM EL_Config), GETDATE())))")
Conn.Execute("DELETE FROM [EL_CounterOnline] WHERE [UserID]>0 AND [LastActiveTime]<(DATEADD(second, 0-(SELECT TOP 1 LoginOverTime*60 FROM EL_Config), GETDATE()))")
StrFields = "*"
StrCondition = "LastActiveTime>=DATEADD(second, 0-"& OnlineTimer &", GETDATE()) OR [UserID]>0"
Call EL_Common.InitCommand(OnlineCmd, "EL_SP_SplitPage")
With OnlineCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_CounterOnline")
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "OnlineID")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "ComeInTime DESC")
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsOnline = .Execute()
End With
rsOnline.Close()
RowCount = OnlineCmd(0)
TotalRowCount = OnlineCmd(9)
PageCounts = OnlineCmd(10)
CurrentPath = CurrentPath &">> 当前在线用户"
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="62%"><%=CurrentPath%></td>
<td width="38%" align="right" nowrap>共 <span class="redText"><%=RowCount%></span> 个用户在线,其中会员:<span class="BlueText" id="un">统计中…</span>个, 游客:<span class="GreenText" id="on">统计中…</span>个</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="9%" align="center" nowrap class="top_item"><strong>客户端</strong></td>
<td width="11%" align="center" nowrap class="top_item"><strong>IP地址</strong></td>
<td width="16%" align="center" nowrap class="top_item"><strong>详细地址</strong></td>
<td width="10%" align="center" nowrap class="top_item"><strong>来访时间</strong></td>
<td width="9%" align="center" nowrap class="top_item"><strong>活动时间</strong></td>
<td width="7%" align="center" nowrap class="top_item"><strong>停留</strong></td>
<td width="38%" align="center" nowrap class="top_item"><strong>当前所在页面</strong></td>
</tr>
<%
If RowCount = 0 Then
Response.Write "<tr><td colspan=7 class=td_50 align=center>没有在线用户</td></tr>"
UserCount = 0
Else
rsOnline.Open()
Dim TempUserName
UserCount = 0
For i = 1 To RowCount
%>
<tr class="td_25" onMouseOut="this.className='td_25'" onMouseOver="this.className='MouseOver_25'">
<td align="center">
<%
TempUserName = ""
If rsOnline("UserID") > 0 Then
UserCount = UserCount + 1
TempUserName = EL_Common.GetFieldValue("UserName", "EL_User", "UserID="& rsOnline("UserID"))
Response.Write "<a href='"& InstallDir &"User/ShowUser.asp?UserName="& TempUserName &"' target='_blank'><span class=bluetext>"& TempUserName &"</span></a>"
Else
Response.Write "<span class='graytext'>[游客]</span>"
End If
%>
</td>
<td align="center"><%=rsOnline("ClientIp")%></td>
<td align="center"><%=EL_Common.ServerHTMLEncode(rsOnline("Address"))%></td>
<td align="center" nowrap title="<%=FormatDateTime(rsOnline("ComeInTime"), 2)%>"><%=FormatDateTime(rsOnline("ComeInTime"), 3)%></td>
<td align="center" nowrap title="<%=FormatDateTime(rsOnline("LastActiveTime"), 2)%>"><%=FormatDateTime(rsOnline("LastActiveTime"), 3)%></td>
<td align="center"><%=ShowOnlineTime(rsOnline("ComeInTime"))%></td>
<td style="padding-left:5px;"><a href="<%=rsOnline("CurrentPosition")%>" target="_blank" title="<%=rsOnline("CurrentPosition")%>"><%=EL_Common.GetTopic(rsOnline("CurrentPosition"), 45)%></a></td>
</tr>
<%
If i < RowCount Then rsOnline.MoveNext
Next
rsOnline.Close()
End If
%>
<script language="javascript">
getObject("un").innerText = <%=UserCount%>;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -