function parseXml($filename, $structure) { $projectName = str_replace(".xml", "", $filename); newProject($projectName); if ($structure->page) { foreach ($structure->page as $page) { newPage($page->name, $page->extension, $page->location); } } if ($structure->component) { foreach ($structure->component as $component) { newComponent($component->name, $component->extension, $component->location); } } }
<?php $title = "GWC Projects"; $projects = array(); $projects["vector"] = newProject("Vector Math", null, "Vector math calculator", "https://www.microsoft.com/en-us/store/p/vector-math/9nblgggzl4hm"); $projects["chemistry"] = newProject("Chemistry Tools", "https://github.com/CaptainGlac1er/ChemistryTools", "Chemistry App that I built for chemistry class.", "https://www.microsoft.com/en-us/store/p/chemistry-tools/9nblggh0g5zw"); $projects["Discordtest"] = newProject("Discord Bot", "https://github.com/CaptainGlac1er/DiscordTest", "Fun project that I wanted to do to have fun with the Discord API. Pulls images from imgur and openweathermap.", null); $projects['WebServer'] = newProject('Web Server', "https://github.com/CaptainGlac1er/resume", "Built this web server to host this website.", "index.php"); $projects['LaserProject'] = newProject('Laser Project', null, "Fun laser project", "https://youtu.be/nAnuzva5i8w"); if (!empty($_GET) & isset($_GET["type"])) { switch ($_GET['type']) { case "get": if (isset($_GET['app']) && isset($projects[$_GET['app']])) { $item = $projects[$_GET['app']]; $content = $item["NAME"] . " " . $item['LINK']; } else { $content = "empty app"; } break; case "redirect": if (isset($_GET['app']) && isset($projects[$_GET['app']])) { $item = $projects[$_GET['app']]; $content = $item["NAME"] . " " . $item['LINK']; echo '<html><head><meta HTTP-EQUIV="REFRESH" content="0; url=' . $item['LINK'] . '"></head></html>'; return; } else { $content = "empty app"; } break; default: $content = "empty";