<% '------------------------------------------------------------- 'StatCounteX 3.1 'http://www.2enetworx.com/dev/projects/statcountex.asp 'File: config.asp 'Description: Graphical Report Generator 'Initiated by Kevin Yochum on Feb 5, 2001 '------------------------------------------------------------- 'You may use the code for any purpose 'But re-publishing is discouraged. 'See License.txt for additional information '------------------------------------------------------------- 'Change Log: '------------------------------------------------------------- '# Feb 12, 2001 by Hakan Eskici 'Added missing tags '------------------------------------------------------------- ' Sub ListIps ' ' Usage: ' lYear - the numerical year (optional) ' lMonth - the numerical month (optional) ' lDay - the numerical day (optional) ' lHour - the numerical hour (optional) ' Sub ListIps( lYear, lMonth, lDay, lHour ) sDataSource = "" If Len(lHour) > 0 Then sDataSource = "GroupIpsByHourAndDate" Else sDataSource = "GroupIpsByDate" End If sSQL = "SELECT * From " & sDataSource & " Where 1=1 " If Len( lYear ) > 0 Then sSQL = sSQL & "and DatePart(""yyyy"",[Date])=" & lYear & " " End If If Len( lMonth ) > 0 Then sSQL = sSQL & "and DatePart( ""m"", [Date])= " & lMonth & " " End If If Len( lDay ) > 0 Then sSQL = sSQL & "and DatePart( ""d"", [Date])= " & lDay & " " End If If Len( lHour ) > 0 Then sSQL = sSQL & "and Hour= " & lHour & " " End If ' Connect to the database OpenDB sConnStats rs.Open sSQL,,,adCmdTable %> <% do while not rs.eof sLink = " 0 Then sLink = sLink & "&year=" & lYear End If If Len( lMonth ) > 0 Then sLink = sLink & "&month=" & lMonth End If If Len( lDay ) > 0 Then sLink = sLink & "&day=" & lDay End If If Len( lHour ) > 0 Then sLink = sLink & "&hour=" & lHour End If sLink = sLink & """>" & rs("IP") & "" %> <% rs.movenext loop %>
Stats: Visitors on <%=GetDate%>
<%=sLink%>
<%=rs.RecordCount%> visitors
<% conn.close 'set rs=nothing 'set conn=nothing End Sub ' ' Sub ShowClickPath ' ' Usage: ' sIP - The IP to show the click path for. ' lYear - the numerical year (optional) ' lMonth - the numerical month (optional) ' lDay - the numerical day (optional) ' lHour - the numerical hour (optional) ' Sub ShowClickPath( sIp, lYear, lMonth, lDay, lHour ) If Len( sIP ) = 0 Then Response.Write( "Error: IP Address not provided for displaying a Click Path." ) Exit Sub End If ' sSQL = "SELECT Stats.*, Refs.RefName, Paths.PathName FROM Paths RIGHT JOIN (Refs RIGHT JOIN Stats ON Refs.RefID = Stats.RefID) ON Paths.PathID = Stats.PathID WHERE (((Stats.IP)='"&sIp&"') AND ((Stats.Date)="&sDate&"))" sSQL = "SELECT Stats.Date, Stats.Time, Stats.IP, Paths.PathName, Refs.RefName FROM Paths RIGHT JOIN (Refs RIGHT JOIN Stats ON Refs.RefID = Stats.RefID) ON Paths.PathID = Stats.PathID Where Stats.IP='" & sIp & "'" If Len( lYear ) > 0 Then sSQL = sSQL & " and DatePart(""yyyy"", [Stats].[Date]) = " & lYear End If If Len( lMonth ) > 0 Then sSQL = sSQL & " and DatePart(""m"", [Stats].[Date]) = " & lMonth End If If Len( lDay ) > 0 Then sSQL = sSQL & " and DatePart(""d"", [Stats].[Date]) = " & lDay End If If Len( lHour ) > 0 Then sSQL = sSQL & " and DatePart(""h"", [Stats].[Time]) = " & lHour End If ' Connect to the database OpenDB sConnStats rs.Open sSQL,,,adCmdTable sFieldName = "" If bShowLinks And InStr( rs("RefName"), "http://" ) > 0 Then sFieldName = "" & rs("RefName") & "" Else sFieldName = rs("RefName") end if %> <% ' Calculate totals do while not rs.eof sFieldName = "" If bShowLinks And InStr( rs("PathName"), "http://" ) > 0 Then sFieldName = "" & rs("PathName") & "" Else sFieldName = rs("RefName") end if %> <% rs.movenext loop %>
Stats: Click path for <%=sIp%> on <%=rs("Date")%>
<%=rs("Date")%> <%=rs("Time")%> <%=sFieldName%>
<%=rs("Date")%> <%=rs("Time")%> <%=sFieldName%>
<% conn.close 'set rs=nothing 'set conn=nothing End Sub Function GetDate If Len(Request.QueryString("Month")) > 0 Then GetDate = MonthName(Request.QueryString("Month")) If Len(Request.QueryString("Day")) > 0 Then GetDate = GetDate & " " & Request.QueryString("Day") End If GetDate = GetDate & ", " End If If Len(Request.QueryString("Year")) > 0 Then GetDate = GetDate & Request.QueryString("Year") End If If Len(GetDate) = 0 Then GetDate = "All Data" End If End Function sIp = Request.QueryString( "IP" ) sYear = Request.QueryString( "Year" ) sMonth = Request.QueryString( "Month" ) sDay = Request.QueryString( "Day" ) sHour = Request.QueryString( "Hour" ) %> StatCounteX 3.1
Truly Scrumptious Fabrics Stats

Reports Yearly Report Monthly Report Daily Report <% If Len( sIp ) > 0 Then %> Visitors Report Click Path <% Else %> Visitors Report <% End If %>

<% Response.Write( "Displaying Data For " & GetDate & "

" ) If Len( sIp ) > 0 Then ShowClickPath sIp, sYear, sMonth, sDay, sHour Else ListIps sYear, sMonth, sDay, sHour End If %> ">Back to Previous Page