moderators) { global $database; $query = "SELECT memberid,username FROM " . DB_PREFIX . "forum_moderators RIGHT JOIN " . DB_PREFIX . "members on id=memberid WHERE forumid=" . (int) $this->id; $this->moderators = $database->getrows($query); } return $this->moderators; } public function getLastTopic() { if(!$this->lastTopic) { global $database; $query = "SELECT a.*, b.date as lastpostdate, c.username, c.id as userid FROM " . DB_PREFIX . "forum_topics a LEFT JOIN " . DB_PREFIX . "posts b on a.id = b.relationId and b.relationType='topic' LEFT JOIN " . DB_PREFIX . "members c on b.posterid = c.id WHERE forumid=" . (int) $this->id . " ORDER by b.id DESC LIMIT 1"; if($topic = $database->getrow($query)) { $this->lastTopic = new ForumTopic; setvaluesbyarray($this->lastTopic,$topic); } } return $this->lastTopic; } }