Skyrim Helper Source Code Viewer

See up my source code skirt! D=

..sadly, it does not do syntax highlighting for the htmls, javascripts, or csss D=
eh. oh well.


Welp! You're viewing THIS file!!! (source.php)

<?php

require_once __DIR__ DIRECTORY_SEPARATOR 'valid_file_map.php';

$source null;
$file_name $_GET['view'] ?? 'source.php';

if ( 
in_array($file_namearray_keys($valid_file_map)) ) {
    
$source file_get_contents(realpath(__DIR__ DIRECTORY_SEPARATOR $file_name));
}

?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Skyrim Helper Source Code Viewer</title>
    <meta name="description" content="See into the source code of my Skyrim Helper Series!">
    <style type="text/css">
        html { width:100%; height:100%; font-size: 100%; }
        body { box-sizing: border-box; margin: 1em 2em; }
        #source-code { font-family: Courier New, monospace; }
    </style>
</head>
<body>
    <h1>Skyrim Helper Source Code Viewer</h1>
    <p>See up my source code skirt! D=</p>
    <p style="font-style: italic;font-size:.8em">..sadly, it does not do syntax highlighting for the htmls, javascripts, or csss D=<br>eh. oh well.</p>
    <hr>
    <div id="source-code">
        <? if ( $file_name === 'source.php' ) {
            echo 
"<p>Welp! You're viewing <b>THIS</b> file!!! (source.php)</p>";
        }
        if ( 
$source ) {
            
highlight_string($source);
        } else {
            echo 
"<h3 style='color:red'>Invalid or no file name provided</h3>";
        }
        
?>
    </div>
    <hr>
    <p>Didn't get enough? Go back to that fancy <a href="./index.php">index page</a>!</p>
    <p>Hey! If you thought this was handy or feel like there could be some fun improvements, <a href="mailto:ryan@rohjay.one">email me</a>!</p>
</body>
</html>

Didn't get enough? Go back to that fancy index page!

Hey! If you thought this was handy or feel like there could be some fun improvements, email me!