From aa1a8f13c59e78662709bb659e7516e3432c18c8 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Tue, 17 Dec 2002 22:58:06 +0000 Subject: [PATCH] Static additions to stats email --- plugins/Stats/Stats.pm | 3 +++ plugins/Stats/adminmail.pl | 11 ++++++++++- plugins/Stats/templates/display;adminmail;default | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/Stats/Stats.pm b/plugins/Stats/Stats.pm index 0e30fca32..45ceb364e 100644 --- a/plugins/Stats/Stats.pm +++ b/plugins/Stats/Stats.pm @@ -636,12 +636,15 @@ sub countUsersByPage { ######################################################## sub countDailyByPage { my($self, $op, $options) = @_; + $options ||= {}; my $where = "1=1 "; $where .= " AND op='$op'" if $op; $where .= " AND section='$options->{section}'" if $options->{section}; + $where .= " AND static='$options->{static}'" + if $options->{static}; # The "no_op" option can take either a scalar for one op to exclude, # or an arrayref of multiple ops to exclude. diff --git a/plugins/Stats/adminmail.pl b/plugins/Stats/adminmail.pl index d624e8b4a..86ced1db7 100644 --- a/plugins/Stats/adminmail.pl +++ b/plugins/Stats/adminmail.pl @@ -160,8 +160,15 @@ oldest => $oldest_to_show }); - my $grand_total = $stats->countDailyByPage('', ); + my $grand_total = $stats->countDailyByPage(''); $data{grand_total} = $grand_total; + my $grand_total_static = $stats->countDailyByPage('',{ static => 'yes' } ); + $data{grand_total_static} = $grand_total_static; + my $total_static = $stats->countDailyByPage('', { + static => 'yes', + no_op => $constants->{op_exclude_from_countdaily} + } ); + $data{total_static} = $grand_total_static; for (qw|index article search comments palm journal rss|) { my $uniq = $stats->countDailyByPageDistinctIPID($_); my $pages = $stats->countDailyByPage($_); @@ -250,7 +257,9 @@ }); $statsSave->createStatDaily("total", $count->{total}); + $statsSave->createStatDaily("total_static", $total_static); $statsSave->createStatDaily("grand_total", $grand_total); + $statsSave->createStatDaily("grand_total_static", $grand_total_static); $statsSave->createStatDaily("total_bytes", $total_bytes); $statsSave->createStatDaily("unique", $count->{unique}); $statsSave->createStatDaily("unique_users", $count->{unique_users}); diff --git a/plugins/Stats/templates/display;adminmail;default b/plugins/Stats/templates/display;adminmail;default index d0504f74c..275de2328 100644 --- a/plugins/Stats/templates/display;adminmail;default +++ b/plugins/Stats/templates/display;adminmail;default @@ -13,8 +13,9 @@ display __template__ [% constants.sitename %] Stats for [% day %] - UIDs IPIDs Pages + UIDs IPIDs Pages total: [% users %] [% unique %] [% total %] + static total: [% total_static %] grand total: - - [% grand_total %] ([% total_bytes %]) posts: [% distinct_comment_posters_uids %] [% IPIDS %] comments: [% comments_uids %] [% comments_ipids %] [% comments_page %] ([% comments_bytes %])