2020-08-16 05:25:54 -05:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<?php include $_SERVER['DOCUMENT_ROOT'].'/src/common-meta.php';?>
|
2020-09-27 17:19:17 -05:00
|
|
|
<link href="/styles/buttons.css" type="text/css" rel="stylesheet" />
|
2021-02-08 19:23:47 -06:00
|
|
|
<link href="/minecraft/styles/styles.css" type="text/css" rel="stylesheet" />
|
2020-08-16 05:25:54 -05:00
|
|
|
<link rel="shortcut icon" href="/favicon.ico" />
|
2021-02-09 05:24:58 -06:00
|
|
|
<title>9iron - Modded Minecraft</title>
|
2020-08-16 05:25:54 -05:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php include $_SERVER['DOCUMENT_ROOT'].'/src/common-header.php';?>
|
|
|
|
<div class="content">
|
|
|
|
<div class="section">
|
2021-02-09 05:24:58 -06:00
|
|
|
<a href="/minecraft/setup" class="startbutton">
|
2021-02-09 05:34:06 -06:00
|
|
|
<i class="fa fa-arrow-right"></i>
|
2021-02-09 05:24:58 -06:00
|
|
|
<p>Confused? Click here to get started</p>
|
|
|
|
</a>
|
2020-08-16 05:25:54 -05:00
|
|
|
</div>
|
2021-02-08 19:23:47 -06:00
|
|
|
<?php
|
|
|
|
# Define a pack card generator function
|
|
|
|
function echo_pack($pack) {
|
|
|
|
# Add basic coloration to the element, if it exists
|
|
|
|
if (file_exists("packs/$pack/color")) {
|
|
|
|
$color = file_get_contents("packs/$pack/color");
|
|
|
|
echo "<div class=\"modpack\" style=\"background: $color; color: var(--background);\">";
|
|
|
|
} else {
|
|
|
|
echo '<div class="modpack">';
|
|
|
|
}
|
|
|
|
|
|
|
|
# Push an image if we've got one of those
|
|
|
|
if (file_exists("packs/$pack/icon.png")) {
|
|
|
|
echo "<img src=\"/minecraft/packs/$pack/icon.png\" class=\"packicon\"/>";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Get the pack description
|
|
|
|
$desc = "<h2>$pack</h2><p>A modpack.</p>";
|
|
|
|
$descfile = "packs/$pack/desc.html";
|
|
|
|
if (file_exists($descfile)) {
|
|
|
|
$desc = file_get_contents($descfile);
|
|
|
|
}
|
|
|
|
echo "$desc";
|
|
|
|
|
|
|
|
# A small button to browse previous world downloads
|
2021-02-08 19:33:35 -06:00
|
|
|
if (file_exists("../files/packs/$pack/worlds")) {
|
2021-02-08 19:23:47 -06:00
|
|
|
echo "<p><a href=\"/files/packs/$pack/worlds\" class=\"worldsbutton\">Browse world backups</a></p>";
|
|
|
|
}
|
|
|
|
|
|
|
|
# And a bright big download button
|
|
|
|
echo "<a href=\"/files/packs/$pack/latest.zip\" class=\"downloadbutton\">Download</a>";
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
# Get list of modpacks
|
|
|
|
$dir = new DirectoryIterator("packs");
|
|
|
|
$packs = array();
|
|
|
|
foreach ($dir as $fileinfo) {
|
|
|
|
if (!$fileinfo->isDot() && $fileinfo->isDir()) {
|
|
|
|
array_push($packs, $fileinfo->getFilename());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Parse through and provide their information
|
|
|
|
if (!empty($packs)) {
|
|
|
|
echo '<div class="section">';
|
|
|
|
# If we have a current pack, print that upfront
|
|
|
|
if (file_exists("packs/current") && readlink("packs/current")) {
|
|
|
|
# We have a valid current pack, remove it from the list and print it upfront
|
|
|
|
$currentpack = readlink("packs/current");
|
|
|
|
$packs = array_diff($packs, ["$currentpack", "current"]);
|
2021-02-09 05:24:58 -06:00
|
|
|
echo '<div class="currentcontainer"><h1>Current Modpack</h1>';
|
2021-02-08 19:23:47 -06:00
|
|
|
echo_pack($currentpack);
|
|
|
|
# If there's a server IP name along with that, print that out too
|
|
|
|
if (file_exists("packs/currentip")) {
|
|
|
|
$ip = file_get_contents("packs/currentip");
|
|
|
|
echo "<p><code class=\"bigcode\">$ip</code></p>";
|
|
|
|
}
|
2021-02-09 05:24:58 -06:00
|
|
|
echo '</div></div><div class="section">';
|
2021-02-08 19:23:47 -06:00
|
|
|
}
|
|
|
|
# Sort the list of remaining packs
|
|
|
|
sort($packs);
|
|
|
|
# Print the rest of them
|
|
|
|
echo '<h1>Modpacks</h1><div class="packcontainer">';
|
|
|
|
foreach ($packs as $pack) {
|
|
|
|
echo_pack($pack);
|
|
|
|
}
|
|
|
|
echo '</div></div>';
|
|
|
|
}
|
|
|
|
?>
|
2020-08-16 05:25:54 -05:00
|
|
|
</div>
|
|
|
|
<?php include $_SERVER['DOCUMENT_ROOT'].'/src/common-footer.php';?>
|
|
|
|
</body>
|
|
|
|
</html>
|