TTT_Role_Overview/index.php
2022-03-28 20:29:20 +02:00

140 lines
4.9 KiB
PHP

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TTT2 Role Overview</title>
<meta name="description" content="All TTT2 Roles halfheartedly documented">
<meta name="author" content="James">
<meta property="og:title" content="TTT2 Role Overview">
<meta property="og:type" content="website">
<meta property="og:url" content="https://ttt.james-things.com">
<meta property="og:description" content="All TTT2 Roles documented halfheartedly">
<meta property="og:image" content="https://e7.pngegg.com/pngimages/710/403/png-clipart-the-embodiment-of-scarlet-devil-team-shanghai-alice-video-game-banjo-tooie-mario-luigi-partners-in-time-marisa-logo-computer-wallpaper.png">
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<!--MATERIALIZE-->
<!--Import jQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--My Custom Stylesheet-->
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="container">
<?php
$defaultlanguage = "en";
# Get language from URL
if(isset($_GET["lang"])) {
$language = $_GET["lang"];
} else {
$language = $defaultlanguage;
}
#Check if Language folder exists
if(file_exists("roles/".$language."/")) {
$files = glob("roles/".$language."/*.php");
} else {
$language = $defaultlanguage;
$files = glob("roles/".$language."/*.php");
}
#Get all files from the language folder
sort($files);
$count = 1;
foreach ($files as $filename) {
include $filename;
$shortname = substr($filename, 9);
$shortname = substr($shortname, 0, -4);
/*
if ($count%2 == 1)
{
echo "<div class='row'>";
}
*/
echo '
<div class="col s12">
<div class="blurry">
<div class="card '.$color.' '.$tcolor.'-text">
<div class="card-content">
<span class="card-title">'.$name.'</span>
<p>'.$description.'</p>
</div>
<div class="card-tabs">
<ul class="tabs tabs-fixed-width">
<li class="tab col s3">
<a class="active" href="#'.$shortname.'h2p"><i class="material-icons">help_outline</i></a>
</li>
<li class="tab col s3">
<a href="#'.$shortname.'pbw"><i class="material-icons">check</i></a>
</li>
<li class="tab col s3 hide-on-small-only">
<a href="#'.$shortname.'convars"><i class="material-icons">code</i></a>
</li>
<li class="tab col s3">
<a href="#'.$shortname.'credits"><i class="material-icons">copyright</i></a>
</li>
</ul>
</div>
<div class="card-content grey lighten-4 black-text">
<div id="'.$shortname.'h2p"><h5>How to play:</h5><pre>'.$howtoplay.'</pre></div>
<div id="'.$shortname.'pbw"><h5>Plays best with:</h5>'.$playsbestwith.'</div>
<div id="'.$shortname.'convars"><h5>Convars:</h5>
<pre>'.$convars.'</pre>
</div>
<div id="'.$shortname.'credits"><h5>Credits:</h5>Main Creator: <a href="'.$authorurl.'">'.$author.'</a><br><pre>'.$ctext.'</pre></div>
<div class="card-action '.$color.' ">
<a class="'.$tcolor.'-text" href="'.$steam.' ">Steam</a>
<a class="'.$tcolor.'-text" href="'.$source.'">Source</a>
</div>
</div
</div>
</div>
</div>
';
/*
if ($count%2 == 0)
{
echo "</div>";
}
$count++;
*/
}
// if ($count%2 != 1) echo "</div>";
?>
</div>
<!-- Start Tab init -->
<script>
$(document).ready(function(){
$('.tabs').tabs();
});
</script>
<!-- End Tab init -->
<!--JavaScript at end of body for optimized loading-->
<script type="text/javascript" src="js/materialize.min.js"></script>
</body>
</html>