select count(id) as totalentries, min(posted) as firstentry, max(posted) as lastentry from tblblogentries where tblblogentries.blog = and year(posted) = select count(email) as totalsubscribers from tblblogsubscribers where tblblogsubscribers.blog = and verified = 1 select sum(views) as total from tblblogentries where tblblogentries.blog = and year(posted) = select top 10 id, title, views from tblblogentries where tblblogentries.blog = and year(posted) = order by views desc limit 10 select count(tblblogcomments.id) as totalcomments from tblblogcomments, tblblogentries where tblblogcomments.entryidfk = tblblogentries.id and tblblogentries.blog = and tblblogcomments.moderated = 1 and year(tblblogcomments.posted) = select count(tblblogtrackbacks.id) as totaltrackbacks from tblblogtrackbacks, tblblogentries where tblblogtrackbacks.entryid = tblblogentries.id and tblblogentries.blog = select categoryid, categoryname, count(categoryidfk) as total from tblblogcategories, tblblogentriescategories, tblblogentries where tblblogentriescategories.categoryidfk = tblblogcategories.categoryid and tblblogcategories.blog = and tblblogentriescategories.entryidfk = tblblogentries.id and year(tblblogentries.posted) = group by tblblogcategories.categoryid, tblblogcategories.categoryname order by total desc order by count(categoryidfk) desc select top 10 tblblogentries.id, tblblogentries.title, count(tblblogcomments.id) as commentcount from tblblogentries, tblblogcomments where tblblogcomments.entryidfk = tblblogentries.id and tblblogentries.blog = and tblblogcomments.moderated = 1 and year(tblblogcomments.posted) = group by tblblogentries.id, tblblogentries.title order by commentcount desc order by count(tblblogcomments.id) desc limit 10 select top 10 tblblogcategories.categoryid, tblblogcategories.categoryname, count(tblblogcomments.id) as commentcount from tblblogcategories, tblblogcomments, tblblogentriescategories where tblblogcomments.entryidfk = tblblogentriescategories.entryidfk and tblblogentriescategories.categoryidfk = tblblogcategories.categoryid and tblblogcategories.blog = and year(tblblogcomments.posted) = and tblblogcomments.moderated = 1 group by tblblogcategories.categoryid, tblblogcategories.categoryname order by commentcount desc order by count(tblblogcomments.id) desc limit 10 select top 10 tblblogentries.id, tblblogentries.title, count(tblblogtrackbacks.id) as trackbackcount from tblblogentries, tblblogtrackbacks where tblblogtrackbacks.entryid = tblblogentries.id and tblblogentries.blog = and year(tblblogtrackbacks.created) = group by tblblogentries.id, tblblogentries.title order by trackbackcount desc order by count(tblblogtrackbacks.id) desc limit 10 select top 10 searchterm, count(searchterm) as total from tblblogsearchstats where blog = and year(searched) = group by searchterm order by total desc order by count(searchterm) desc limit 10
Stats for #statsYear#

#rb("generalstats")#
#rb("totalnumentries")#: #getTotalEntries.totalEntries#
#rb("firstentry")#: #dateFormat(getTotalEntries.firstEntry,"mm/dd/yy")# 
#rb("lastentry")#: #dateFormat(getTotalEntries.lastEntry,"mm/dd/yy")# 
#rb("totalcomments")#: #getTotalComments.totalComments#
#rb("avgcommentsperentry")#: #numberFormat(averageCommentsPerEntry,"999.99")#
#rb("totaltrackbacks")#: #getTotalTrackbacks.totalTrackbacks#
#rb("totalviews")#: #getTotalViews.total#
Average Views: #numberFormat(gettotalviews.total/gettotalentries.totalentries,"999.99")# 0
#rb("totalsubscribers")#: #getTotalSubscribers.totalsubscribers#

#rb("topviews")#
#title# #views#

#rb("categorystats")#
#categoryname# #total#

#rb("topentriesbycomments")#
#title# #commentCount#

#rb("topcategoriesbycomments")#
select total from getCategoryCount where categoryid = '#categoryid#'
#categoryname# #commentCount# (#rb("avgcommentperentry")#: #avg#)

#rb("topentriesbytrackbacks")#
#title# #trackbackCount#

#rb("topsearchterms")#
#searchterm# #total#