yaml = $this->getList(); $mods = []; foreach($this->yaml['mods'] as $modname => $mod) { if($mod['mod_count'] > 0) $mods[$modname] = $mod; } $this->mods = $mods; $this->validmods = array_keys($mods); } public function getList() { $yaml = file_get_contents($this->url); if (function_exists('yaml_parse')) { return yaml_parse($yaml); } else { require_once "./Spyc.php"; return Spyc::YAMLLoadString($yaml); } } public function render($mod = null) { if ($mod === null) { return $this->modList(); } if($mod === 'create') { return $this->create(); } if(!in_array($mod, $this->validmods)) { // return 'Invalid mod selected'; return $this->create(); } return $this->displayMod($mod); } public function create() { echo 'Back to list'; echo '
Submitting a PR for a Mod to be added to the official LinuxServer.io repo
'; } public function modList() { echo 'Add a mod'; foreach($this->mods as $modname => $mod) { echo '
'.$mod['mod_count'].'Mods

'.$modname.'

'; } } public function displayMod($displaymod) { echo 'Back to list'; echo '
'.$displaymod.'
'; foreach($this->mods[$displaymod]['container_mods'] as $mod) { echo '

'.key($mod).'

'; } echo 'Add a mod'; } } $lsmods = new LsMods; ?> Linuxserver Container Mods

LinuxServer.io

render($_GET['mod'] ?? null); ?>