Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Shared :: "linedancerMain.php"
- include_once("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/php/Generators 2/iconGenerator.php");
- if( isset($_GET["summary"])){
- include_once("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/php/Classes/linedancerOverviewClass.php");
- }else{
- include_once("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/php/Classes/linedancerClass.php");
- }
- // Get the specified release and game from the query parameters
- $release = isset($_GET['release']) ? $_GET['release'] : '';
- $game = isset($_GET['game']) ? $_GET['game'] : '';
- $linedancer = new linedancerClass($release,$game);
- include_once("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/php/Generators 2/gameListGenerator.php");
- $gamesByRelease = $gameList->listGames();
- $pagedata = loader("");
- function loader($pagedata){
- include_once("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/php/Generators 2/gameListGenerator.php");
- $gameList = new gameListClass();
- $release = isset($_GET['release']) ? $_GET['release'] : '';
- $game = isset($_GET['game']) ? $_GET['game'] : '';
- $gamesByRelease = $gameList->listGames();
- if(isset($gamesByRelease[$release][$game])){
- return file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/scripts/html/main.html");
- }
- }
- if ($game !== "") {
- $fancyTitle = "{$game}";
- } elseif ($release !== "") {
- $fancyTitle = "{$release}";
- } else {
- $fancyTitle = "Door Games";
- }
- $fancyTitle = ucwords($fancyTitle);
- $fancyHost = str_replace(" ",".",ucwords(str_replace("."," ","{$_SERVER['HTTP_HOST']}")));
- $fancyTitle = "Keal's {$fancyTitle} @ {$fancyHost}";
- /*if(is_file("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/icon/{$game}.png")){
- $favIcon = "data:image/png;base64," . str_replace("="," ",base64_encode(file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/icon/{$game}.png")));
- }else*/if(is_file("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/{$release} {$game}.png")){
- $favIcon = "data:image/png;base64," . str_replace("="," ",base64_encode(file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/{$release} {$game}.png")));
- } elseif(is_file("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/{$release}.png")) {
- $favIcon = "data:image/png;base64," . str_replace("="," ",base64_encode(file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/{$release}.png")));
- } elseif(is_file("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/Main.png")) {
- $favIcon = "data:image/png;base64," . str_replace("="," ",base64_encode(file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/generated/Main.png")));
- } elseif(is_file("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/icon/crescent-onion-dome.png")) {
- $favIcon = "data:image/png;base64," . str_replace("="," ",base64_encode(file_get_contents("{$_SERVER['DOCUMENT_ROOT']}/Shared/assets/Sprites/icon/crescent-onion-dome.png")));
- }
- $swaps = [
- "{{ release name }}" => "{$release}" !== "" ? "{$release}" : "Main",
- "{{ project name }}" => "{$game}" !== "" ? "{$game}" : "",
- "{{ release root }}" => "{$release}" !== "" ? "/{$release}" : "/Main",
- "{{ project root }}" => "{$game}" !== "" ? "/{$game}" : "",
- "{{ fav icon }}" => $favIcon,
- "{{ title }}" => $fancyTitle
- ];
- foreach($swaps as $swapOut => $swapIn){
- $pagedata = str_replace($swapOut, $swapIn, $pagedata);
- }
- $pagedata = $linedancer->loader($pagedata);
- // Output the final page data
- header("Content-Type: text/html");
- echo $pagedata;
Add Comment
Please, Sign In to add comment