diff options
Diffstat (limited to 'pages/front.inc')
-rw-r--r-- | pages/front.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pages/front.inc b/pages/front.inc new file mode 100644 index 0000000..a60be1d --- /dev/null +++ b/pages/front.inc @@ -0,0 +1,30 @@ +<?php + +$parts = explode("/", $_GET["_"]); + +var_dump($parts); + +if (isset($parts[2])) { + if ($parts[2] === "cloudburst") { + $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true); + } elseif ($parts[2] === "raindrops") { + $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); + } else { + header("Location: /"); + die(); + } + + if (count($fronters["members"]) > 0) { + header("Location: /" . $fronters["members"][0]["name"]); + die(); + } else { + if ($parts[2] === "cloudburst") { + header("Location: /cloudburst"); + } else { + header("Location: /raindrops"); + } + } +} else { + header("Location: /"); + die(); +}
\ No newline at end of file |