wiki/wiki.php

86 lines
1.4 KiB
PHP
Raw Permalink Normal View History

<?php
2019-07-04 16:34:33 +00:00
/*
This code is Copyright(c) 2019 by ubergeek under the GPL 3 or later.
Parsedown is licensed under the MIT license.
*/
2019-07-01 00:32:30 +00:00
include('config.php');
2019-07-04 16:34:33 +00:00
include('parsedown-1.7.3/Parsedown.php');
2019-07-01 00:32:30 +00:00
2019-06-28 15:51:05 +00:00
$page = $_GET['page'];
2019-07-03 01:15:44 +00:00
$style = $_GET['style'];
2019-07-04 16:34:33 +00:00
$Parsedown = new Parsedown();
$Parsedown->setSafeMode(true);
2019-06-28 15:51:05 +00:00
if ( $page == "") {
$page = "main";
}
2019-07-03 01:15:44 +00:00
if ( $style == "") {
if ( $site_style == "") {
$site_style="site";
}
}
else {
$site_style=$style;
}
2019-07-04 16:34:33 +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-03 01:15:44 +00:00
2019-06-29 02:49:58 +00:00
print "<!DOCTYPE html>
2019-06-30 17:11:12 +00:00
<html lang='en'>
2019-06-28 15:51:05 +00:00
<head>
2019-07-01 01:01:55 +00:00
<title>$site_name - $page</title>
2019-07-03 01:15:44 +00:00
<link rel='stylesheet' type='text/css' href='$site_root/includes/$site_style.css'>
2019-07-01 01:05:38 +00:00
</head>
<body>
<!-- Begin Header -->
<div id='header'>";
2019-07-04 16:34:33 +00:00
print $Parsedown->text($header);
print "
</div>
<!-- End Header -->
";
2019-07-01 00:35:39 +00:00
print "<hr>
<div id='body'>
<!-- Begin Sidebar -->
<div id='sidebar'>
";
2019-07-04 16:34:33 +00:00
echo $Parsedown->text($sidebar);
print " </div>
<!-- End Sidebar -->
<!-- Begin Body -->
<div id='content'>";
2019-07-04 16:34:33 +00:00
echo $Parsedown->text($content);
print " </div>
<!-- End Body -->
2019-07-01 00:32:30 +00:00
</div>
<!-- Begin Footer -->
<div id='footer'>
2019-07-02 01:11:01 +00:00
<hr>
";
2019-07-04 16:34:33 +00:00
echo $Parsedown->text($footer);
2019-06-28 15:51:05 +00:00
print " </div>
<!-- End Footer -->
</body>
2019-06-28 15:51:05 +00:00
</html>";
?>