Skip to content

Commit

Permalink
Static additions to stats email
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianAker committed Dec 17, 2002
1 parent 43bc6a9 commit aa1a8f1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions plugins/Stats/Stats.pm
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion plugins/Stats/adminmail.pl
Expand Up @@ -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($_);
Expand Down Expand Up @@ -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});
Expand Down
3 changes: 2 additions & 1 deletion plugins/Stats/templates/display;adminmail;default
Expand Up @@ -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 %])
Expand Down

0 comments on commit aa1a8f1

Please sign in to comment.