2019-07-01 01:18:23 +00:00
|
|
|
<?php
|
2019-07-04 16:27:10 +00:00
|
|
|
/*
|
2019-07-09 11:17:46 +00:00
|
|
|
This code is Copyright(c) 2019 by ubergeek under the AGPL 3 or later.
|
2019-07-04 16:27:10 +00:00
|
|
|
Parsedown is licensed under the MIT license.
|
2019-07-09 11:17:46 +00:00
|
|
|
ParsedownExtra is licensed under the MIT license.
|
2019-07-04 16:27:10 +00:00
|
|
|
*/
|
2019-07-01 01:18:23 +00:00
|
|
|
|
|
|
|
include('config.php');
|
2019-07-09 11:17:46 +00:00
|
|
|
include('parsedown/Parsedown.php');
|
|
|
|
include('parsedownextra/ParsedownExtra.phgp');
|
2019-07-01 01:18:23 +00:00
|
|
|
|
|
|
|
$page = $_GET['page'];
|
2019-07-02 12:46:57 +00:00
|
|
|
$style = $_GET['style'];
|
2019-07-04 16:27:10 +00:00
|
|
|
$Parsedown = new Parsedown();
|
2019-07-04 16:31:20 +00:00
|
|
|
$Parsedown->setSafeMode(true);
|
2019-07-01 01:18:23 +00:00
|
|
|
|
|
|
|
if ( $page == "") {
|
|
|
|
$page = "main";
|
|
|
|
}
|
|
|
|
|
2019-07-02 12:46:57 +00:00
|
|
|
if ( $style == "") {
|
|
|
|
if ( $site_style == "") {
|
|
|
|
$site_style="site";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$site_style=$style;
|
|
|
|
}
|
2019-07-04 16:27:10 +00:00
|
|
|
|
|
|
|
$header = file_get_contents("$doc_root/includes/header.md");
|
|
|
|
$sidebar = file_get_contents("$doc_root/includes/sidebar.md");
|
|
|
|
$content = file_get_contents("$doc_root/articles/$page.md");
|
|
|
|
$footer = file_get_contents("$doc_root/includes/footer.md");
|
2019-07-02 12:46:57 +00:00
|
|
|
|
2019-07-01 01:18:23 +00:00
|
|
|
print "<!DOCTYPE html>
|
|
|
|
<html lang='en'>
|
|
|
|
<head>
|
|
|
|
<title>$site_name - $page</title>
|
2019-07-02 12:46:57 +00:00
|
|
|
<link rel='stylesheet' type='text/css' href='$site_root/includes/$site_style.css'>
|
2019-07-01 01:18:23 +00:00
|
|
|
</head>
|
2019-07-01 15:05:01 +00:00
|
|
|
<body>
|
|
|
|
<!-- Begin Header -->
|
2019-07-01 16:33:19 +00:00
|
|
|
|
|
|
|
<div id='header'>";
|
2019-07-01 15:05:01 +00:00
|
|
|
|
2019-07-04 16:27:10 +00:00
|
|
|
print $Parsedown->text($header);
|
|
|
|
|
2019-07-01 16:33:19 +00:00
|
|
|
print "
|
|
|
|
</div>
|
|
|
|
<!-- End Header -->
|
2019-07-01 15:05:01 +00:00
|
|
|
";
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-01 15:05:01 +00:00
|
|
|
print "<hr>
|
2019-07-01 15:20:08 +00:00
|
|
|
<div id='body'>
|
2019-07-01 15:05:01 +00:00
|
|
|
|
|
|
|
<!-- Begin Sidebar -->
|
2019-07-01 15:20:08 +00:00
|
|
|
<div id='sidebar'>
|
2019-07-01 15:05:01 +00:00
|
|
|
";
|
2019-07-04 16:27:10 +00:00
|
|
|
|
|
|
|
echo $Parsedown->text($sidebar);
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-01 15:05:01 +00:00
|
|
|
print " </div>
|
|
|
|
<!-- End Sidebar -->
|
|
|
|
|
|
|
|
<!-- Begin Body -->
|
2019-07-01 15:20:08 +00:00
|
|
|
<div id='content'>";
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-04 16:27:10 +00:00
|
|
|
echo $Parsedown->text($content);
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-01 15:05:01 +00:00
|
|
|
print " </div>
|
|
|
|
<!-- End Body -->
|
|
|
|
|
2019-07-01 01:18:23 +00:00
|
|
|
</div>
|
2019-07-01 15:05:01 +00:00
|
|
|
|
|
|
|
<!-- Begin Footer -->
|
2019-07-01 15:20:08 +00:00
|
|
|
<div id='footer'>
|
2019-07-01 15:05:01 +00:00
|
|
|
<hr>
|
|
|
|
";
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-04 16:27:10 +00:00
|
|
|
echo $Parsedown->text($footer);
|
2019-07-01 01:18:23 +00:00
|
|
|
|
2019-07-01 15:05:01 +00:00
|
|
|
print " </div>
|
|
|
|
<!-- End Footer -->
|
|
|
|
|
2019-07-01 01:18:23 +00:00
|
|
|
</body>
|
|
|
|
</html>";
|
|
|
|
?>
|