db->query($s); $r = $q->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->name = $r["name"]; $this->is_buff = $r["is_buff"]; $this->description = $r["description"]; } } public function get_image(){ global $base_dir; global $path; if (file_exists($base_dir . "img/content/effect/" . str_pad($this->id, 4, '0', STR_PAD_LEFT) . ".png")){ return $path["img"]["content"] . "effect/" . str_pad($this->id, 4, '0', STR_PAD_LEFT) . ".png"; } else{ return $path["img"]["layout"] . "unknown.png"; } } } ?>