]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better handling of zero values in stats
authorEvan Prodromou <evan@prodromou.name>
Sun, 18 May 2008 19:02:20 +0000 (15:02 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sun, 18 May 2008 19:02:20 +0000 (15:02 -0400)
darcs-hash:20080518190220-84dde-e1e3005a72a6913dd86fc9384e1083fb39203a73.gz

actions/showstream.php

index 861f58c29b0d22548a7c3add6982c78babf5ef08..82a55518da60fdfafca3b770d25847d853a45757 100644 (file)
@@ -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');