base.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. $navData = [
  3. "home" => ["name" => "Home", "show" => true, "dropdown" => ""],
  4. "news" => ["name" => "Gameplay", "show" => true, "dropdown" => "gameplayData"],
  5. "survival" => ["name" => "Survival", "show" => false, "dropdown" => ""],
  6. "games" => ["name" => "Minigames", "show" => false, "dropdown" => ""],
  7. "creative" => ["name" => "Creative", "show" => false, "dropdown" => ""],
  8. "ranks" => ["name" => "Ranks", "show" => true, "dropdown" => ""],
  9. "team" => ["name" => "Team", "show" => true, "dropdown" => ""],
  10. "snuvi" => ["name" => "SnuviScript", "show" => true, "dropdown" => "snuviData"],
  11. "jokes" => ["name" => "Jokes", "show" => true, "dropdown" => ""],
  12. "dynmap" => ["name" => "Dynmap", "show" => true, "dropdown" => ""],
  13. ];
  14. $gameplayData = [
  15. "survival" => ["name" => "Survival", "icon" => ""],
  16. "games" => ["name" => "Minigames", "icon" => ""],
  17. "creative" => ["name" => "Creative", "icon" => ""],
  18. ];
  19. $snuviData = [
  20. "snuvi_core" => ["name" => "Core", "icon" => ""],
  21. "snuvi_minecraft" => ["name" => "Minecraft", "icon" => ""],
  22. ];
  23. $includePath = "error.php";
  24. if(isset($_GET["site"])) {
  25. $name = $_GET["site"];
  26. if(array_key_exists($name, $navData)) {
  27. $includePath = "$name.php";
  28. $navData[$name]["class"] = "active";
  29. }
  30. } else {
  31. $includePath = "home.php";
  32. $navData["home"]["class"] = "active";
  33. }
  34. include "views/base.view.php";