You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
require_once __DIR__ . "/include/header.php";
|
|
|
|
require_once __DIR__ . "/lib/parsedown/parsedown.php";
|
|
|
|
|
|
|
|
$parsedown = new Parsedown();
|
|
|
|
|
|
|
|
$path = __DIR__ . "/config/rules.md";
|
|
|
|
|
|
|
|
if(!file_exists($path)) {
|
|
|
|
echo '<div class="alert alert-danger"><p class="text-center">Wystąpił błąd: plik z regulaminem nie został odnaleziony</div>';
|
|
|
|
} else {
|
|
|
|
$file = readFileContent($path);
|
|
|
|
|
|
|
|
if(!$file) {
|
|
|
|
echo '<div class="alert alert-danger"><p class="text-center">Wystąpił błąd: nie można odczytać pliku z regulaminem</div>';
|
|
|
|
} else {
|
|
|
|
?>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title"><i class="fa fa-book" aria-hidden="true"></i> Regulamin serwera</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<?php echo $parsedown->text($file); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}}
|
|
|
|
|
|
|
|
// *******
|
|
|
|
// METHODS
|
|
|
|
// *******
|
|
|
|
|
|
|
|
function readFileContent($file) {
|
|
|
|
$fopen = @fopen($file, "r");
|
|
|
|
if(!$fopen) return false;
|
|
|
|
$text = fread($fopen,filesize($file));
|
|
|
|
fclose($fopen);
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ . "/include/footer.php";
|
|
|
|
?>
|