You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

92 lines
3.0 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modpack | KNKS</title>
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/modpack.css">
</head>
<body>
<?php
include "./components/navbar.php";
function getNewestFile($directory) {
// Check if the provided path is a directory
if (!is_dir($directory)) {
return "Provided path is not a directory.";
}
// Get all .zip and .mrpack files in the directory
$files = glob($directory . '/*.{zip,mrpack}', GLOB_BRACE);
// Check if there are no files found
if (empty($files)) {
return null;
}
// Sort files by modification time, newest first
usort($files, function($a, $b) {
return filemtime($b) - filemtime($a);
});
// Return the newest file
return $files[0];
}
?>
<div class="title-container">
<h1><span>M</span>odpack</h1>
</div>
<section class="content-container">
<h1>Vyber si pack pro svůj launcher</h1>
<div class="modpack-container">
<div class="modpack">
<h1>prism launcher</h1>
<div>
<img src="./images/modpacks/prism.png" alt="">
<p></p>
<div>
<a class="button" href=<?php echo '"' . getNewestFile('./modpack/resources/Prism') .'"' ?>>stáhnout</a>
<a class="button" href="/modpack/archive.php?category=Prism">archiv verzí</a>
<a class="button">návod</a>
</div>
</div>
</div>
<div class="modpack">
<h1>curseforge launcher</h1>
<div>
<img src="./images/modpacks/curseforge.png" alt="">
<p></p>
<div>
<a class="button" href=<?php echo '"' . getNewestFile('./modpack/resources/CurseForge') .'"' ?>>stáhnout</a>
<a class="button" href="/modpack/archive.php?category=CurseForge">archiv verzí</a>
<a class="button">návod</a>
</div>
</div>
</div>
<div class="modpack">
<h1>modrinth app</h1>
<div>
<img src="./images/modpacks/modrinth.png" alt="">
<p></p>
<div>
<a class="button" href=<?php echo '"' . getNewestFile('./modpack/resources/Modrinth') .'"' ?>>stáhnout</a>
<a class="button" href="/modpack/archive.php?category=Modrinth">archiv verzí</a>
<a class="button">návod</a>
</div>
</div>
</div>
</div>
</section>
<?php
require "./components/footer.php"
?>
</body>
</html>