diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-23 11:25:36 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-23 11:25:36 -0700 |
commit | 16fa03212bc6cabe2f47e93d06c0def10d46b353 (patch) | |
tree | d728300f2cdb94a9c7f03d6d7366336f775a8ade /lib/profileaction.php | |
parent | 533a3bf6a3180237cfffb8baf29ea3a3f7ec34f8 (diff) |
Ticket 2188: add a daily average post count to profile statistics sidebar.
When we have more detailed history stats, this'd be a good place to link to details/graphs.
Diffstat (limited to 'lib/profileaction.php')
-rw-r--r-- | lib/profileaction.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/profileaction.php b/lib/profileaction.php index 029c21845..072c024c7 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -169,6 +169,12 @@ class ProfileAction extends OwnerDesignAction $subbed_count = $this->profile->subscriberCount(); $notice_count = $this->profile->noticeCount(); $group_count = $this->user->getGroups()->N; + $age_days = (time() - strtotime($this->profile->created)) / 86400; + if ($age_days < 1) { + // Rather than extrapolating out to a bajillion... + $age_days = 1; + } + $daily_count = round($notice_count / $age_days); $this->elementStart('div', array('id' => 'entity_statistics', 'class' => 'section')); @@ -219,6 +225,12 @@ class ProfileAction extends OwnerDesignAction $this->element('dd', null, $notice_count); $this->elementEnd('dl'); + $this->elementStart('dl', 'entity_daily_notices'); + // TRANS: Average count of posts made per day since account registration + $this->element('dt', null, _('Daily average')); + $this->element('dd', null, $daily_count); + $this->elementEnd('dl'); + $this->elementEnd('div'); } |