diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-05-18 15:02:20 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-05-18 15:02:20 -0400 |
commit | 025b1c744cedcc6b9402094df3003fb5a895e5d4 (patch) | |
tree | 7d85b6a91e2d4a084fe713bb0a7add3c4146266a /actions | |
parent | 3ea856c69e4ec78c830b39f00e1a92ff29c3905f (diff) |
better handling of zero values in stats
darcs-hash:20080518190220-84dde-e1e3005a72a6913dd86fc9384e1083fb39203a73.gz
Diffstat (limited to 'actions')
-rw-r--r-- | actions/showstream.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/actions/showstream.php b/actions/showstream.php index 861f58c29..82a55518d 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -190,15 +190,27 @@ class ShowstreamAction extends StreamAction { // XXX: WORM cache this $subs = DB_DataObject::factory('subscription'); $subs->subscriber = $profile->id; - $subs_count = $subs->count() || 0; + $subs_count = $subs->count(); + if (!$subs_count) { + $subs_count = 0; + } + $subbed = DB_DataObject::factory('subscription'); $subbed->subscribed = $profile->id; - $subbed_count = $subbed->count() || 0; + $subbed_count = $subbed->count(); + if (!$subbed_count) { + $subbed_count = 0; + } + $notices = DB_DataObject::factory('notice'); $notices->profile_id = $profile->id; - $notice_count = $notices->count() || 0; + $notice_count = $notices->count(); + + if (!$notice_count) { + $notice_count = 0; + } # Other stats...? common_element_start('dl', 'statistics'); |