instances.php 860 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. include "lib/frontend.php";
  3. $frontend = new frontend();
  4. include "data/config.php";
  5. $params = "";
  6. $first = true;
  7. foreach($_GET as $key => $value){
  8. if(
  9. !is_string($value) ||
  10. $key == "target"
  11. ){
  12. continue;
  13. }
  14. if($first === true){
  15. $first = false;
  16. $params = "?";
  17. }else{
  18. $params .= "&";
  19. }
  20. $params .= urlencode($key) . "=" . urlencode($value);
  21. }
  22. if(
  23. !isset($_GET["target"]) ||
  24. !is_string($_GET["target"])
  25. ){
  26. $target = "";
  27. }else{
  28. $target = "/" . urlencode($_GET["target"]);
  29. }
  30. $instances = "";
  31. foreach(config::INSTANCES as $instance){
  32. $instances .= '<tr><td class="expand"><a href="' . htmlspecialchars($instance) . $target . $params . '" target="_BLANK" rel="noreferer">' . htmlspecialchars($instance) . '</a></td></tr>';
  33. }
  34. echo
  35. $frontend->load(
  36. "instances.html",
  37. [
  38. "instances_html" => $instances
  39. ]
  40. );