OK, fiddled around a bit with it, and here's a simple Show Posts for Last 30 Days code with average at the bottom.
I'm sure I could do the date routines a bit better, but on my forum at least it works
Enjoy....
<%
'#################################################################################
'## Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## 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 the 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 the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'########### Post Stats Code by Ben Griffiths (ben@bengriffiths.co.uk) ###########
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
function FormatDate
If Year(Date)<2000 then
FormatDate = "20" & Year(strForumTimeAdjust) & "/" & Month(strForumTimeAdjust) & "/" & Day(strForumTimeAdjust)
else
FormatDate = Year(strForumTimeAdjust) & "/" & Month(strForumTimeAdjust) & "/" & Day(strForumTimeAdjust)
End If
end function
Response.Write "<table border=""0"" width=""100%"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br>" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconStats,"","align=""absmiddle""") & " <a href=""stats.asp"">Statistics for last 30 Days</a></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
response.write "<center>" & VBNewLine & _
"<table bgcolor=""" & strTableBorderColor & """ border=""0"" cellpadding=""2"" border=""0"" cellspacing=""1"" width=""300"">" & VBNewLine & _
"<tr bgcolor=""" & strHeadCellColor & """><td align=center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Date</b></font></td><td align=center><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Amount Posts</b></font></td></tr>" & VBNewLine
DaysBack=0
BgColor=1
TotalPosts=0
Set Conntemp=Server.CreateObject("ADODB.Connection")
Conntemp.Open my_Conn
For t=1 to 30
If BGColor=1 then
BGColor=0
BGString=strAltForumCellColor
else
BGColor=1
BGString=strForumCellColor
end if
HiDate = DateToStr(DateAdd("d",DaysBack+1, FormatDate() & " 00:00:00"))
LoDate = DateToStr(DateAdd("d",DaysBack, FormatDate() & " 00:00:00"))
strSql = "SELECT SUM(PostCount) AS FullCount FROM (" & "SELECT COUNT (*) As PostCount FROM " & strTablePrefix & "TOPICS WHERE (T_DATE >= '" & LoDate & "' AND T_DATE < '" & HiDate & "')" & " UNION " & "SELECT COUNT (*) As PostCount FROM " & strTablePrefix & "REPLY WHERE (R_DATE >= '" & LoDate & "' AND R_DATE < '" & HiDate & "')" & ") As MyView;"
Set db_TOTAL=Conntemp.Execute(strSql)
Response.write "<tr><td align=center bgcolor=" & BGString & "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & FormatDateTime(DateAdd("d",DaysBack,FormatDate() & " 00:00:00"),2) & "</font></td><td align=center bgcolor=" & BGString & "><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & db_TOTAL("FullCount") & "</font></td></tr>"
DaysBack=DaysBack-1
TotalPosts=TotalPosts+(db_TOTAL("FullCount"))
Next
response.write "</table>" & vbNewLine &_
"<br>" & vbNewLine &_
"<center><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Average Posts Per Day: </b>" & int(TotalPosts / 30) & "</font></center>"
Conntemp.close
set Conntemp = nothing
set db_TOTAL = nothing
WriteFooter
Response.End
%>