Permalink
Browse files

New stat, total_subscribers.

  • Loading branch information...
1 parent 1d48521 commit 835ae0b8ad73458ee7294c3863414cac81346565 @jamiemccarthy jamiemccarthy committed Dec 20, 2002
Showing with 19 additions and 0 deletions.
  1. +17 −0 plugins/Stats/Stats.pm
  2. +2 −0 plugins/Stats/adminmail.pl
View
@@ -735,6 +735,23 @@ sub countDaily {
return \%returnable;
}
+########################################################
+sub countDailySubscriber {
+ my($self) = @_;
+ my $constants = getCurrentStatic();
+ return 0 unless $constants->{subscribe};
+ my $subscribers = $self->sqlSelectColArrayref(
+ "uid",
+ "users_hits",
+ "hits_paidfor > hits_bought
+ AND lastclick >= DATE_SUB(NOW(), INTERVAL 48 HOUR)",
+ );
+ return 0 unless $subscribers && @$subscribers;
+ my $uid_list = join(", ", @$subscribers);
+ my $count = $self->sqlCount("accesslog_temp", "uid IN ($uid_list)");
+ return $count;
+}
+
########################################################
sub getDurationByStaticOpHour {
my($self, $options) = @_;
@@ -169,6 +169,7 @@
no_op => $constants->{op_exclude_from_countdaily}
} );
$data{total_static} = $grand_total_static;
+ my $total_subscriber = $stats->countDailySubscriber();
for (qw|index article search comments palm journal rss|) {
my $uniq = $stats->countDailyByPageDistinctIPID($_);
my $pages = $stats->countDailyByPage($_);
@@ -273,6 +274,7 @@
$statsSave->createStatDaily("total", $count->{total});
$statsSave->createStatDaily("total_static", $total_static);
+ $statsSave->createStatDaily("total_subscriber", $total_subscriber);
$statsSave->createStatDaily("grand_total", $grand_total);
$statsSave->createStatDaily("grand_total_static", $grand_total_static);
$statsSave->createStatDaily("total_bytes", $total_bytes);

0 comments on commit 835ae0b

Please sign in to comment.