summaryrefslogtreecommitdiff
path: root/instances.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2023-11-07 08:04:56 -0500
committerlolcat <will@lolcat.ca>2023-11-07 08:04:56 -0500
commit785452873f0ee0a27fc157b482b7551560f0282d (patch)
tree4c70e240031ed3868425ca683c83ebfd378a9159 /instances.php
parent64b090ee058953aed2246967332c7f0b6623cd8f (diff)
fix typo
Diffstat (limited to 'instances.php')
-rw-r--r--instances.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/instances.php b/instances.php
new file mode 100644
index 0000000..b9db771
--- /dev/null
+++ b/instances.php
@@ -0,0 +1,55 @@
+<?php
+
+include "lib/frontend.php";
+$frontend = new frontend();
+
+include "data/config.php";
+
+$params = "";
+$first = true;
+foreach($_GET as $key => $value){
+
+ if(
+ !is_string($value) ||
+ $key == "target"
+ ){
+
+ continue;
+ }
+
+ if($first === true){
+
+ $first = false;
+ $params = "?";
+ }else{
+
+ $params .= "&";
+ }
+
+ $params .= urlencode($key) . "=" . urlencode($value);
+}
+
+if(
+ !isset($_GET["target"]) ||
+ !is_string($_GET["target"])
+){
+
+ $target = "";
+}else{
+
+ $target = "/" . urlencode($_GET["target"]);
+}
+
+$instances = "";
+foreach(config::INSTANCES as $instance){
+
+ $instances .= '<tr><td class="expand"><a href="' . htmlspecialchars($instance) . $target . $params . '" target="_BLANK" rel="noreferer">' . htmlspecialchars($instance) . '</a></td></tr>';
+}
+
+echo
+ $frontend->load(
+ "instances.html",
+ [
+ "instances_html" => $instances
+ ]
+ );