76 lines
1.9 KiB
PHP
76 lines
1.9 KiB
PHP
<?php
|
|
$pages = [
|
|
"proclib",
|
|
"TODO",
|
|
"kettext",
|
|
"front",
|
|
"plans",
|
|
"news",
|
|
"netwine",
|
|
"dox",
|
|
"cirquit",
|
|
"petite_juliet",
|
|
"VAD",
|
|
"newsboy",
|
|
"about",
|
|
"utilities",
|
|
"ARK",
|
|
"noirchat"
|
|
];
|
|
$current_page = "news";
|
|
foreach ($pages as $page) {
|
|
foreach ($_GET as $get=>$value) {
|
|
if ($get == $page) {
|
|
$current_page = $page;
|
|
}
|
|
}
|
|
}
|
|
|
|
if ($current_page == "plans") {
|
|
if ($_GET["plans"] == '') {
|
|
$plans = scandir('plans/');
|
|
for ($i = 2; $i < count($plans); $i++) {
|
|
$post .= "<a href=?plans=".$plans[$i].">".$plans[$i]."</a><br />\n";
|
|
}
|
|
} else {
|
|
$plans = scandir('plans/');
|
|
for ($i = 2; $i < count($plans); $i++) {
|
|
if ($plans[$i] == $_GET['plans']) break;
|
|
}
|
|
|
|
$post .= "<h3>".$_GET['plans']."</h3>";
|
|
$post .= "<center>";
|
|
if ($i-1 >= 2) {
|
|
$post .= '<a href="?plans='.$plans[$i-1].'" class="surf"><< '.$plans[$i-1].'</a>';
|
|
}
|
|
$post .= ' <a href="?plans" class="surf">index</a> ';
|
|
if ($i+1 < count($plans)) {
|
|
$post .= '<a href="?plans='.$plans[$i+1].'" class="surf">'.$plans[$i+1].' >></a>';
|
|
}
|
|
$post .= "</center>";
|
|
$post .= "<pre>".htmlentities(file_get_contents("plans/".$_GET['plans']))."</pre>";
|
|
}
|
|
} else if ($current_page == "dox") {
|
|
if ($_GET["dox"] == '') {
|
|
$dox = scandir('dox/');
|
|
for ($i = 2; $i < count($dox); $i++) {
|
|
$post .= "<a href=?dox=".$dox[$i].">".$dox[$i]."</a><br />\n";
|
|
}
|
|
} else {
|
|
$post .= '<a href="?dox" class="surf">Back to index</a><br />';
|
|
$post .= (file_get_contents("dox/".$_GET['dox']));
|
|
}
|
|
} else if ($current_page == "news") {
|
|
$news = scandir('news/');
|
|
array_shift($news);
|
|
array_shift($news);
|
|
rsort($news);
|
|
for ($i = 0; $i < count($news); $i++) {
|
|
$post .= (file_get_contents("news/".$news[$i]));
|
|
}
|
|
}
|
|
(file_exists('pages/'.$current_page.'.html') ? include 'pages/'.$current_page.'.html' : '');
|
|
echo ($post ? $post : '');
|
|
|
|
?>
|