- // Other stats...?
- $this->elementStart('dl', 'entity_user-id');
- $this->element('dt', null, _('User ID'));
- $this->element('dd', null, $this->profile->id);
- $this->elementEnd('dl');
-
- $this->elementStart('dl', 'entity_member-since');
- $this->element('dt', null, _('Member since'));
- $this->element('dd', null, date('j M Y',
- strtotime($this->profile->created)));
- $this->elementEnd('dl');
-
- $this->elementStart('dl', 'entity_subscriptions');
- $this->elementStart('dt');
- $this->element('a', array('href' => common_local_url('subscriptions',
- array('nickname' => $this->profile->nickname))),
- _('Subscriptions'));
- $this->elementEnd('dt');
- $this->element('dd', null, $subs_count);
- $this->elementEnd('dl');
+ $profile = $this->profile;
+ $actionParams = array('nickname' => $profile->nickname);
+ $stats = array(
+ array(
+ 'id' => 'user-id',
+ // TRANS: Label for user statistics.
+ 'label' => _('User ID'),
+ 'value' => $profile->id,
+ ),
+ array(
+ 'id' => 'member-since',
+ // TRANS: Label for user statistics.
+ 'label' => _('Member since'),
+ 'value' => date('j M Y', strtotime($profile->created))
+ ),
+ array(
+ 'id' => 'subscriptions',
+ // TRANS: Label for user statistics.
+ 'label' => _('Subscriptions'),
+ 'link' => common_local_url('subscriptions', $actionParams),
+ 'value' => $profile->subscriptionCount(),
+ ),
+ array(
+ 'id' => 'subscribers',
+ // TRANS: Label for user statistics.
+ 'label' => _('Subscribers'),
+ 'link' => common_local_url('subscribers', $actionParams),
+ 'value' => $profile->subscriberCount(),
+ ),
+ array(
+ 'id' => 'groups',
+ // TRANS: Label for user statistics.
+ 'label' => _('Groups'),
+ 'link' => common_local_url('usergroups', $actionParams),
+ 'value' => $profile->getGroups()->N,
+ ),
+ array(
+ 'id' => 'notices',
+ // TRANS: Label for user statistics.
+ 'label' => _('Notices'),
+ 'value' => $notice_count,
+ ),
+ array(
+ 'id' => 'daily_notices',
+ // TRANS: Label for user statistics.
+ // TRANS: Average count of posts made per day since account registration.
+ 'label' => _('Daily average'),
+ 'value' => $daily_count
+ )
+ );
+
+ // Give plugins a chance to add stats entries
+ Event::handle('ProfileStats', array($profile, &$stats));
+
+ foreach ($stats as $row) {
+ $this->showStatsRow($row);
+ }
+ $this->elementEnd('div');
+ }