Single-page version, reads URL quesries
This commit is contained in:
parent
1d49872154
commit
8abf09a2f9
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-AU">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>BB Web-log Example/Demo.</title>
|
||||
<meta name="author" content="">
|
||||
<meta name="description" content="">
|
||||
<meta name="keywords" content="">
|
||||
<link rel="stylesheet" type="text/css" href="../basic.css" >
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="../feed-rss2.xml">
|
||||
</head>
|
||||
<body>
|
||||
<header id="top">
|
||||
<section>
|
||||
<h1>BB Web-log Example/Demo.</h1>
|
||||
<p><a href="../feed-rss2.xml" target="_blank">Read via <abbr title="Rich Site Summary">RSS</abbr> feed</a>.</p>
|
||||
</section>
|
||||
<nav>
|
||||
<p>Year:</p>
|
||||
<ol>
|
||||
<li><a href="../">2020</a></li>
|
||||
<li>2019☜</li>
|
||||
<li>et cetera</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<?php
|
||||
foreach (array_reverse(glob("*.html")) as $filename) {
|
||||
include $filename;
|
||||
}
|
||||
?>
|
||||
</main>
|
||||
<footer>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="../">Web-log Home</a></li>
|
||||
<li><a href="#top">Page Top</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
18
index.php
18
index.php
|
@ -18,17 +18,25 @@
|
|||
<nav>
|
||||
<p>Year:</p>
|
||||
<ol>
|
||||
<li>2020☜</li>
|
||||
<li><a href="2019/">2019</a></li>
|
||||
<li><a href="?year=2020">2020</a></li>
|
||||
<li><a href="?year=2019">2019</a></li>
|
||||
<li>et cetera</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<?php
|
||||
foreach (array_reverse(glob("2020/*.html")) as $filename) {
|
||||
include $filename;
|
||||
}
|
||||
if($_SERVER['QUERY_STRING']) {
|
||||
// If year is requested give posts from that year--
|
||||
foreach (array_reverse(glob("posts/{$_GET['year']}*.html")) as $filename) {
|
||||
include $filename;
|
||||
}
|
||||
} else {
|
||||
// --otherwise give posts from latest year.
|
||||
foreach (array_reverse(glob("posts/2020*.html")) as $filename) {
|
||||
include $filename;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</main>
|
||||
<footer>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
2019-06-09_00:11_Example
|
Loading…
Reference in New Issue