ShowID = $id; $this->CommentForm = render('comments/commentform'); $this->getData(); $this->GetEpisodeList(); } private function getData() { $get = Database::select('projects', '*', 'WHERE showid = :id', data: [':id' => $this->ShowID]); $data = $get->fetch(); $this->ID = $data["id"]; $this->Title = $data["title"]; $this->Thumbnail = $this->ThumbPath . $data["thumbnail"]; $this->Description = $data["desc"]; } public function __get($what) { return property_exists($this, $what) ? $this->{$what} : null; } public function GetEpisodeList() { $get = Database::select('episodes', '*', 'WHERE `show` = :s', 'id DESC', data: [':s' => $this->ShowID]); $episodes = $get->fetchAll(); $this->EpisodeArray = $episodes; } public function GetEpisodeComments($id) { $get = Database::select('episodecomments', '*', 'WHERE showID = :id', data: [':id' => $id]); $data = $get->fetchAll(); $list = []; foreach ($data as $ID) { $comment = new EpisodeComment($ID['id']); $poster = new User($comment->Author); $list[] = render('comments/commentbox', [ 'a' => $poster->Avatar, 'u' => $poster->Username, 'c' => BBCode(magicClean($comment->Content)), 'd' => $comment->PostDate ]); } return $list; } }