OWE/archiv.php

41 lines
996 B
PHP

<!DOCTYPE html>
<?php
$raw_json_config = file_get_contents("data/config.json");
$config_data = json_decode($raw_json_config, false);
?>
<html>
<head>
<title><?php print("Archiv ".($config_data->title ?? "One Word Each")); ?></title>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="<?php print($config_data->logo->icon_path ?? "favicon.ico"); ?>" type="image/x-icon">
</head>
<body>
<?php
if (isset($config_data->style)) {
print("<style>\n");
print($config_data->style);
print("\n</style>");
}
?>
<h1><?php print($config_data->headline ?? "One Word Each"); ?> - Archiv</h1>
<p><a href="./">Startseite</a></p>
<?php
$filename = $_REQUEST["file"];
if (strcmp(pathinfo($filename)["dirname"], ".") != 0) {
die("nur das echte Archiv ist hier erreichbar");
}
$content = file_get_contents("./data/".$filename) or die("ungültiger Dateiname");
?>
<p class="sentences">
<?php
print($content);
?>
</p>
</body>
</html>