2016-07-01 02:35:15 +00:00
|
|
|
<?php
|
|
|
|
require_once __DIR__ . "/include/header.php";
|
|
|
|
require_once __DIR__ . "/lib/parsedown/parsedown.php";
|
|
|
|
|
|
|
|
$parsedown = new Parsedown();
|
|
|
|
|
|
|
|
$path = __DIR__ . "/config/rules.md";
|
|
|
|
|
2016-10-31 02:18:46 +00:00
|
|
|
if (!file_exists($path)) {
|
2016-07-25 14:14:04 +00:00
|
|
|
echo '<div class="alert alert-danger"><p class="text-center">' . translate($lang["rules"]["filenotfound"]) . '</div>';
|
2016-07-01 02:35:15 +00:00
|
|
|
} else {
|
|
|
|
$file = readFileContent($path);
|
2016-07-01 20:34:55 +00:00
|
|
|
|
2016-10-31 02:18:46 +00:00
|
|
|
if (!$file) {
|
2016-07-25 14:14:04 +00:00
|
|
|
echo '<div class="alert alert-danger"><p class="text-center">' . translate($lang["rules"]["readerror"]) . '</div>';
|
2016-07-01 02:35:15 +00:00
|
|
|
} else {
|
|
|
|
?>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2016-07-25 14:14:04 +00:00
|
|
|
<h3 class="panel-title"><i class="fa fa-book" aria-hidden="true"></i> <?php tl($lang["rules"]["title"]); ?></h3>
|
2016-07-01 02:35:15 +00:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<?php echo $parsedown->text($file); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}}
|
|
|
|
|
|
|
|
// *******
|
|
|
|
// METHODS
|
|
|
|
// *******
|
|
|
|
|
|
|
|
function readFileContent($file) {
|
|
|
|
$fopen = @fopen($file, "r");
|
2016-10-31 02:18:46 +00:00
|
|
|
if (!$fopen) return false;
|
|
|
|
$text = fread($fopen, filesize($file));
|
2016-07-01 02:35:15 +00:00
|
|
|
fclose($fopen);
|
|
|
|
return $text;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ . "/include/footer.php";
|
|
|
|
?>
|