Here's an all-in-one (Reply & View activity), with toggle period:
<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; if not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
'##
'## Based on Kyodai's CountXViews
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If mLev > 1 Then
Response.Write "<table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Topic Activity<br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table><br>" & vbNewLine
intPeriod = 30
If Request.Form("Duration")<>"30" Then
intPeriod = 7
end if
datActivityDays = DateAdd("d", -intPeriod, Date())
myActivityDate = DateToStr(datActivityDays)
Response.Write "<table align=""center"" width=""100%"" bgColor=""" & strTableBorderColor & """ style=""border-collapse:collapse"" cellpadding=""4"" cellspacing=""1"" border=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td colspan=""4"" align=""center"" width=""100%"" bgColor=""" & strPopupTableColor & """>" & vbNewLine & _
" <form action=""Counts.asp"" method=""post"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strCategoryFontColor & """ size=""" & strHeaderFontSize+2 & """>Activity Monitor<br><small>(Most Viewed Topics in Past " & _
" <input type=""radio"" class=""radio"" name=""Duration"" value=""30""" & chkRadio(intPeriod,30,true) & ">30" & _
" <input type=""radio"" class=""radio"" name=""Duration"" value=""7""" & chkRadio(intPeriod,7,true) & ">7 Days)</small>" & _
" <input type=""submit"" name=""Submit"" value=""Submit"">" & _
" </font>" & _
" </form>" & _
" </td>" & _
" </tr></table><br>" & _
"<table align=""center"" width=""100%"" bgColor=""" & strTableBorderColor & """ style=""border-collapse:collapse"" cellpadding=""4"" cellspacing=""1"" border=""1"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""10%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>VIEWS</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""15%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>AUTHOR</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""5%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>TOPIC</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""70%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>SUBJECT</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
Set rsTopic = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT TOP 5 T_VIEW_COUNT, T_SUBJECT, T_AUTHOR, TOPIC_ID FROM " & strTablePrefix & "TOPICS WHERE T_DATE > '" & myActivityDate & "' ORDER BY T_VIEW_COUNT DESC"
rsTopic.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
If rsTopic.EOF Then
Response.Write "<tr><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """>None Viewed</td></tr>"
Else
il=0
im=0
rsTopic.MoveFirst
Do while NOT rsTopic.EOF
CColor = strForumCellColor
if il<>0 then CColor = strForumFirstCellColor
Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""10%"" bgColor=" & CColor & ">" & vbNewLine & _
rsTopic("T_VIEW_COUNT") & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""15%"" bgColor=" & CColor & ">"
If strUseExtEndedProfile Then
Response.Write "<a href=""pop_profile.asp?mode=display&id="& rsTopic("T_AUTHOR") & """>"
Else
Response.Write "<a href=""JavaScript:openWindow2('pop_profile.asp?mode=display&id=" & rsTopic("T_AUTHOR") & "')"">"
End If
Response.Write GetMemberName(rsTopic("T_AUTHOR")) & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""5%"" bgColor=" & CColor & ">" & vbNewLine & _
" <a href=""topic.asp?TOPIC_ID=" & rsTopic("TOPIC_ID") &""">" & rsTopic("TOPIC_ID") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""left"" width=""70%"" bgColor=" & CColor & ">" & vbNewLine & _
rsTopic("T_SUBJECT") & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </font>" & vbNewLine
il=1-il
im=im+1
if im=5 then exit do
rsTopic.MoveNext
Loop
rsTopic.Close
End If
Set rsTopic = Nothing
Response.Write " </table><br><table align=""center"" width=""100%"" bgColor=""" & strTableBorderColor & """ style=""border-collapse:collapse"" cellpadding=""4"" cellspacing=""1"" border=""1"">" & vbNewLine & _
" <td align=""center"" width=""10%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>REPLIES</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""15%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>AUTHOR</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""5%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>TOPIC</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""70%"" bgColor=""" & strHeadCellColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize+1 & """><b>SUBJECT</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
Set rsTopic = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT TOP 5 T_REPLIES, T_SUBJECT, T_AUTHOR, TOPIC_ID FROM " & strTablePrefix & "TOPICS WHERE T_DATE > '" & myActivityDate & "' ORDER BY T_REPLIES DESC"
rsTopic.Open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
If rsTopic.EOF Then
Response.Write "<tr><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """> </td><td bgColor=""" & strForumCellColor & """>No Replies</td></tr>"
Else
il=0
im=0
rsTopic.MoveFirst
Do while NOT rsTopic.EOF
CColor = strForumCellColor
if il<>0 then CColor = strForumFirstCellColor
Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""10%"" bgColor=" & CColor & ">" & vbNewLine & _
rsTopic("T_REPLIES") & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""15%"" bgColor=" & CColor & ">"
If strUseExtEndedProfile Then
Response.Write "<a href=""pop_profile.asp?mode=display&id="& rsTopic("T_AUTHOR") & """>"
Else
Response.Write "<a href=""JavaScript:openWindow2('pop_profile.asp?mode=display&id=" & rsTopic("T_AUTHOR") & "')"">"
End If
Response.Write GetMemberName(rsTopic("T_AUTHOR")) & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""center"" width=""5%"" bgColor=" & CColor & ">" & vbNewLine & _
" <a href=""topic.asp?TOPIC_ID=" & rsTopic("TOPIC_ID") &""">" & rsTopic("TOPIC_ID") & "</a>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td align=""left"" width=""70%"" bgColor=" & CColor & ">" & vbNewLine & _
rsTopic("T_SUBJECT") & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </font>" & vbNewLine
il=1-il
im=im+1
if im=5 then exit do
rsTopic.MoveNext
Loop
rsTopic.Close
End If
Set rsTopic = Nothing
Response.Write "</table>"
Else
Response.Write "<center>Unauthorized access.<br><br></center>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""2; URL=default.asp"">" & vbNewLine
End If
WriteFooter
%>