function generateStatistics($story) { if (is_object($story)) { $storyid = $story->id; } if (is_numeric($story)) { $storyid = $story; } // get the count: $count = discussion::getCount($storyid); if ($count) { $lastPostData = discussion::getLastPostData($storyid); } else { return "No posts yet."; } $posts = $count == 1 ? "post" : "posts"; $str = ''; $str .= "{$count} {$posts}, last post on "; $str .= timestamp2usdate($lastPostData['timestamp']); //$str .= ' by '; //$str .= $lastPostData['fullname']; return $str; }