db->query($s); $r = $q->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->name = HTML::e($r["name"]); $this->description = HTML::e($r["description"]); } $s = "SELECT id " . "FROM k_guild_skill " . "WHERE skill_group = $this->id; "; $q = $this->db->query($s); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ array_push($this->skills, new K_Guild_Skill($db, $r["id"])); } } /** * Gets the pathto the monster image. The image must be in the * img/skill_guild/ directory, and its name must be the monster id, * padded with '0' to 1 digits, and the extension must be '.png'. * * @return string Image URL, or a fixed unknown image. */ public function get_image(){ if (file_exists(PATH::BASE . "img/skill_guild/" . str_pad($this->id, 1, '0', STR_PAD_LEFT) . ".png")){ return URL::IMG["SKILL_GUILD"] . str_pad($this->id, 1, '0', STR_PAD_LEFT) . ".png"; } else{ return URL::IMG["UNKNOWN"]; } } } ?>