1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
global $toplevel; global $lang; global $pages;
header("Content-Type: text/plain");
$members = scoreOrderGlobal();
$list = [
"rd" => "/raindrops",
"cb" => "/cloudburst",
"minty" => "/cloudydreams",
"twilight" => "/twi",
"luna" => "/princessluna",
"cloudy" => "/cloudydreams",
"zipp" => "/zippstorm",
"babs" => "/babsseed",
"frost" => "/frostcrystals",
"violet" => "/violetdawn"
];
foreach ($members as $member) {
for ($i = 1; $i < strlen($member["name"]); $i++) {
$part = substr($member["name"], 0, $i);
if (in_array($part, array_keys($list))) {
$list[$part] = false;
} else {
$list[$part] = "/" . $member["name"];
}
}
foreach ($member["proxy_tags"] as $proxy) {
$system = $member["_system"] === "gdapd" ? "rd" : "cb";
$list[$system . preg_replace("/[^a-z]/m", "", $proxy["prefix"])] = "/" . $member["name"];
}
$list[$member["id"]] = "/" . $member["name"];
$list[$member["uuid"]] = "/" . $member["name"];
}
$list["minty"] = "/cloudydreams";
$list["twilight"] = "/twi";
if (in_array($toplevel, array_keys($list)) && $list[$toplevel]) {
if ($toplevel !== "unknown") {
header("Location: " . $list[$toplevel]);
} else {
peh_error("Page not found: " . strip_tags($toplevel), 404);
}
} else {
peh_error("Page not found: " . strip_tags($toplevel), 404);
}
|