public function onPostListBuilding(PostListBuildingEvent $event) { global $config, $database; $cc = $config->get_int("comment_count"); if ($cc > 0) { $recent = $database->cache->get("recent_comments"); if (empty($recent)) { $recent = $this->get_recent_comments($cc); $database->cache->set("recent_comments", $recent, 60); } if (count($recent) > 0) { $this->theme->display_recent_comments($recent); } } }